From da00e278491c8fab362a5ddd73d786a8278e9a15 Mon Sep 17 00:00:00 2001 From: Sean Moss Date: Tue, 23 Jun 2026 20:34:13 -0400 Subject: [PATCH 1/3] Generate RescueGroups.org API client with openapi-generator-cli This is the foundation for fixing #115 (multi-species support) and addressing the failure of #124, which broke in production because the hand-rolled rescue_groups.py code emitted a request shape that the live API rejected, returning zero results. Instead of continuing to hand-roll HTTP calls, this commit introduces: - scripts/generate_rescuegroups_client.sh: regenerates the client from the api-evangelist OpenAPI spec, pinned to a specific commit SHA via gh api for reproducibility. The spec is fetched to /tmp and never written into the repo. Generator image: openapi-generator-cli:v7.23.0. - vendor/rescuegroups_client/: the generated Python client. Only the package (rescuegroups_client/) and the generated docs/ are vendored; the script also deletes CI configs, tests, build outputs, and generator metadata. The .gitignore has belt-and-suspenders rules for the same. - .gitignore: ignore rules for the generated build artefacts and the unrelated generator cruft that the tidy step may miss on a future generator version. Follow-up work needed before this can replace rescue_groups.py: - Wrap the generated client behind a PetSource adapter so main.py keeps working unchanged. - Add a live-API integration test (gated on CUTEPETSBOSTON_RESCUEGROUPS_API_KEY) so future request-shape changes are validated against the real API. - Re-introduce multi-species search using the typed SearchRequest, with the canonical body shape (species.singular, geodistance) that matches the documented example. The new client typed the search call against the spec; the search body now uses species.singular + geodistance, which matches the canonical example in the upstream spec and was the likely cause of #124 returning zero results. --- .gitignore | 24 + scripts/generate_rescuegroups_client.sh | 88 ++ vendor/rescuegroups_client/.gitignore | 66 ++ vendor/rescuegroups_client/docs/Animal.md | 32 + .../docs/AnimalAttributes.md | 45 + .../docs/AnimalListResponse.md | 31 + .../docs/AnimalRelationships.md | 34 + .../docs/AnimalSingleResponse.md | 30 + vendor/rescuegroups_client/docs/AnimalsApi.md | 275 +++++ .../docs/AuthenticationApi.md | 80 ++ vendor/rescuegroups_client/docs/BreedsApi.md | 91 ++ vendor/rescuegroups_client/docs/ColorsApi.md | 85 ++ .../rescuegroups_client/docs/ErrorResponse.md | 29 + .../docs/ErrorResponseErrorsInner.md | 31 + .../rescuegroups_client/docs/GeoDistance.md | 33 + .../rescuegroups_client/docs/OrgAttributes.md | 42 + .../docs/OrgListResponse.md | 30 + .../docs/OrgSingleResponse.md | 29 + .../rescuegroups_client/docs/Organization.md | 31 + .../docs/OrganizationsApi.md | 179 +++ .../rescuegroups_client/docs/PatternsApi.md | 85 ++ .../docs/PetListResponse.md | 29 + .../docs/PetListResponseData.md | 31 + .../docs/PetListResponseDataAttributes.md | 30 + .../docs/PetListUpdateRequest.md | 29 + .../docs/PetListUpdateRequestData.md | 31 + .../rescuegroups_client/docs/PetListsApi.md | 173 +++ .../rescuegroups_client/docs/ReferenceItem.md | 31 + .../docs/ReferenceItemAttributes.md | 29 + .../docs/ReferenceListResponse.md | 30 + .../docs/RelationshipData.md | 29 + .../docs/RelationshipDataData.md | 30 + .../docs/RelationshipDataDataOneOf.md | 30 + .../rescuegroups_client/docs/ResponseMeta.md | 31 + .../rescuegroups_client/docs/SearchFilter.md | 31 + .../rescuegroups_client/docs/SearchRequest.md | 29 + .../docs/SearchRequestData.md | 31 + vendor/rescuegroups_client/docs/SpeciesApi.md | 85 ++ .../rescuegroups_client/docs/SpeciesItem.md | 31 + .../docs/SpeciesItemAttributes.md | 32 + .../docs/SpeciesListResponse.md | 29 + .../rescuegroups_client/docs/TokenRequest.md | 30 + .../rescuegroups_client/docs/TokenResponse.md | 29 + .../docs/TokenResponseData.md | 30 + .../docs/TokenResponseDataAttributes.md | 30 + .../rescuegroups_client/__init__.py | 130 +++ .../rescuegroups_client/api/__init__.py | 12 + .../rescuegroups_client/api/animals_api.py | 1028 +++++++++++++++++ .../api/authentication_api.py | 316 +++++ .../rescuegroups_client/api/breeds_api.py | 321 +++++ .../rescuegroups_client/api/colors_api.py | 284 +++++ .../api/organizations_api.py | 642 ++++++++++ .../rescuegroups_client/api/patterns_api.py | 284 +++++ .../rescuegroups_client/api/pet_lists_api.py | 598 ++++++++++ .../rescuegroups_client/api/species_api.py | 284 +++++ .../rescuegroups_client/api_client.py | 804 +++++++++++++ .../rescuegroups_client/api_response.py | 21 + .../rescuegroups_client/configuration.py | 638 ++++++++++ .../rescuegroups_client/exceptions.py | 218 ++++ .../rescuegroups_client/models/__init__.py | 50 + .../rescuegroups_client/models/animal.py | 112 ++ .../models/animal_attributes.py | 151 +++ .../models/animal_list_response.py | 104 ++ .../models/animal_relationships.py | 117 ++ .../models/animal_single_response.py | 94 ++ .../models/error_response.py | 96 ++ .../models/error_response_errors_inner.py | 92 ++ .../models/geo_distance.py | 96 ++ .../models/org_attributes.py | 114 ++ .../models/org_list_response.py | 102 ++ .../models/org_single_response.py | 92 ++ .../models/organization.py | 106 ++ .../models/pet_list_response.py | 92 ++ .../models/pet_list_response_data.py | 96 ++ .../pet_list_response_data_attributes.py | 90 ++ .../models/pet_list_update_request.py | 92 ++ .../models/pet_list_update_request_data.py | 102 ++ .../models/reference_item.py | 96 ++ .../models/reference_item_attributes.py | 88 ++ .../models/reference_list_response.py | 102 ++ .../models/relationship_data.py | 92 ++ .../models/relationship_data_data.py | 140 +++ .../models/relationship_data_data_one_of.py | 90 ++ .../models/response_meta.py | 92 ++ .../models/search_filter.py | 99 ++ .../models/search_request.py | 92 ++ .../models/search_request_data.py | 104 ++ .../models/species_item.py | 96 ++ .../models/species_item_attributes.py | 94 ++ .../models/species_list_response.py | 96 ++ .../models/token_request.py | 90 ++ .../models/token_response.py | 92 ++ .../models/token_response_data.py | 94 ++ .../models/token_response_data_attributes.py | 91 ++ .../rescuegroups_client/py.typed | 0 .../rescuegroups_client/rest.py | 263 +++++ 96 files changed, 11579 insertions(+) create mode 100755 scripts/generate_rescuegroups_client.sh create mode 100644 vendor/rescuegroups_client/.gitignore create mode 100644 vendor/rescuegroups_client/docs/Animal.md create mode 100644 vendor/rescuegroups_client/docs/AnimalAttributes.md create mode 100644 vendor/rescuegroups_client/docs/AnimalListResponse.md create mode 100644 vendor/rescuegroups_client/docs/AnimalRelationships.md create mode 100644 vendor/rescuegroups_client/docs/AnimalSingleResponse.md create mode 100644 vendor/rescuegroups_client/docs/AnimalsApi.md create mode 100644 vendor/rescuegroups_client/docs/AuthenticationApi.md create mode 100644 vendor/rescuegroups_client/docs/BreedsApi.md create mode 100644 vendor/rescuegroups_client/docs/ColorsApi.md create mode 100644 vendor/rescuegroups_client/docs/ErrorResponse.md create mode 100644 vendor/rescuegroups_client/docs/ErrorResponseErrorsInner.md create mode 100644 vendor/rescuegroups_client/docs/GeoDistance.md create mode 100644 vendor/rescuegroups_client/docs/OrgAttributes.md create mode 100644 vendor/rescuegroups_client/docs/OrgListResponse.md create mode 100644 vendor/rescuegroups_client/docs/OrgSingleResponse.md create mode 100644 vendor/rescuegroups_client/docs/Organization.md create mode 100644 vendor/rescuegroups_client/docs/OrganizationsApi.md create mode 100644 vendor/rescuegroups_client/docs/PatternsApi.md create mode 100644 vendor/rescuegroups_client/docs/PetListResponse.md create mode 100644 vendor/rescuegroups_client/docs/PetListResponseData.md create mode 100644 vendor/rescuegroups_client/docs/PetListResponseDataAttributes.md create mode 100644 vendor/rescuegroups_client/docs/PetListUpdateRequest.md create mode 100644 vendor/rescuegroups_client/docs/PetListUpdateRequestData.md create mode 100644 vendor/rescuegroups_client/docs/PetListsApi.md create mode 100644 vendor/rescuegroups_client/docs/ReferenceItem.md create mode 100644 vendor/rescuegroups_client/docs/ReferenceItemAttributes.md create mode 100644 vendor/rescuegroups_client/docs/ReferenceListResponse.md create mode 100644 vendor/rescuegroups_client/docs/RelationshipData.md create mode 100644 vendor/rescuegroups_client/docs/RelationshipDataData.md create mode 100644 vendor/rescuegroups_client/docs/RelationshipDataDataOneOf.md create mode 100644 vendor/rescuegroups_client/docs/ResponseMeta.md create mode 100644 vendor/rescuegroups_client/docs/SearchFilter.md create mode 100644 vendor/rescuegroups_client/docs/SearchRequest.md create mode 100644 vendor/rescuegroups_client/docs/SearchRequestData.md create mode 100644 vendor/rescuegroups_client/docs/SpeciesApi.md create mode 100644 vendor/rescuegroups_client/docs/SpeciesItem.md create mode 100644 vendor/rescuegroups_client/docs/SpeciesItemAttributes.md create mode 100644 vendor/rescuegroups_client/docs/SpeciesListResponse.md create mode 100644 vendor/rescuegroups_client/docs/TokenRequest.md create mode 100644 vendor/rescuegroups_client/docs/TokenResponse.md create mode 100644 vendor/rescuegroups_client/docs/TokenResponseData.md create mode 100644 vendor/rescuegroups_client/docs/TokenResponseDataAttributes.md create mode 100644 vendor/rescuegroups_client/rescuegroups_client/__init__.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/__init__.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/animals_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/authentication_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/breeds_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/colors_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/organizations_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/patterns_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/pet_lists_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api/species_api.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api_client.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/api_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/configuration.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/exceptions.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/__init__.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/animal.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/animal_attributes.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/animal_list_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/animal_relationships.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/animal_single_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/error_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/error_response_errors_inner.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/geo_distance.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/org_attributes.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/org_list_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/org_single_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/organization.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data_attributes.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request_data.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/reference_item.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/reference_item_attributes.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/reference_list_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/relationship_data.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data_one_of.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/response_meta.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/search_filter.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/search_request.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/search_request_data.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/species_item.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/species_item_attributes.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/species_list_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/token_request.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/token_response.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/token_response_data.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/models/token_response_data_attributes.py create mode 100644 vendor/rescuegroups_client/rescuegroups_client/py.typed create mode 100644 vendor/rescuegroups_client/rescuegroups_client/rest.py diff --git a/.gitignore b/.gitignore index c66e250..d109490 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,27 @@ image.png # Ignore because this is used by github artifacts database.json + +# Vendored third-party packages — commit source, ignore build outputs +# (Generated by openapi-generator; not source.) +vendor/rescuegroups_client/build +vendor/rescuegroups_client/dist +vendor/rescuegroups_client/*.egg-info +vendor/rescuegroups_client/.pytest_cache +vendor/rescuegroups_client/.tox +vendor/rescuegroups_client/.github +vendor/rescuegroups_client/.gitlab-ci.yml +vendor/rescuegroups_client/.openapi-generator +vendor/rescuegroups_client/.openapi-generator-ignore +vendor/rescuegroups_client/.travis.yml +vendor/rescuegroups_client/git_push.sh +vendor/rescuegroups_client/pyproject.toml +vendor/rescuegroups_client/requirements.txt +vendor/rescuegroups_client/setup.cfg +vendor/rescuegroups_client/setup.py +vendor/rescuegroups_client/test +vendor/rescuegroups_client/test-requirements.txt +vendor/rescuegroups_client/tox.ini +vendor/rescuegroups_client/README.md +!vendor/rescuegroups_client/rescuegroups_client/ +!vendor/rescuegroups_client/docs/ diff --git a/scripts/generate_rescuegroups_client.sh b/scripts/generate_rescuegroups_client.sh new file mode 100755 index 0000000..0c837e2 --- /dev/null +++ b/scripts/generate_rescuegroups_client.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash +# Regenerate vendor/rescuegroups_client/ from the upstream RescueGroups.org +# OpenAPI spec using openapi-generator-cli via Docker. +# +# Usage: +# ./scripts/generate_rescuegroups_client.sh +# +# Requires: docker, curl, gh (only for the SHA pin) + +set -euo pipefail + +GENERATOR_IMAGE="openapitools/openapi-generator-cli:v7.23.0" +SPEC_OWNER="api-evangelist" +SPEC_REPO="rescuegroups-org" +SPEC_PATH="openapi/rescuegroups-org-openapi.yml" + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +OUT_DIR="${REPO_ROOT}/vendor/rescuegroups_client" +SPEC_FILE="$(mktemp -t openapi-XXXXXX.yml)" +trap 'rm -f "${SPEC_FILE}"' EXIT + +# Pin to a specific commit SHA so the build is reproducible. +SHA="$(gh api "repos/${SPEC_OWNER}/${SPEC_REPO}/commits/main" --jq '.sha')" +echo "Pinned spec SHA: ${SHA}" + +curl -fsSL \ + "https://raw.githubusercontent.com/${SPEC_OWNER}/${SPEC_REPO}/${SHA}/${SPEC_PATH}" \ + -o "${SPEC_FILE}" + +echo "Validating spec..." +docker run --rm \ + -v "${SPEC_FILE}:/spec/openapi.yml:ro" \ + "${GENERATOR_IMAGE}" \ + validate -i /spec/openapi.yml + +echo "Generating Python client to ${OUT_DIR}..." +mkdir -p "${REPO_ROOT}/vendor" +rm -rf "${OUT_DIR}" +docker run --rm \ + -v "${REPO_ROOT}/vendor:/local/out" \ + -v "${SPEC_FILE}:/spec/openapi.yml:ro" \ + "${GENERATOR_IMAGE}" generate \ + -i /spec/openapi.yml \ + -g python \ + -o /local/out/rescuegroups_client \ + --additional-properties=packageName=rescuegroups_client,projectName=rescuegroups-client,pythonVersion=3.12 \ + --git-host=github.com --git-user-id=codeforboston --git-repo-id=CutePetsBoston + +echo "Tidying non-source artefacts..." +# Keep only the package and the generated docs. Delete everything else +# (CI configs, tests, build outputs, generator metadata, etc.) — they're +# not source and we don't want them in the repo. +rm -rf \ + "${OUT_DIR}/.github" \ + "${OUT_DIR}/.gitlab-ci.yml" \ + "${OUT_DIR}/.openapi-generator" \ + "${OUT_DIR}/.openapi-generator-ignore" \ + "${OUT_DIR}/.pytest_cache" \ + "${OUT_DIR}/.tox" \ + "${OUT_DIR}/.travis.yml" \ + "${OUT_DIR}/build" \ + "${OUT_DIR}/dist" \ + "${OUT_DIR}/git_push.sh" \ + "${OUT_DIR}/pyproject.toml" \ + "${OUT_DIR}/requirements.txt" \ + "${OUT_DIR}/setup.cfg" \ + "${OUT_DIR}/setup.py" \ + "${OUT_DIR}/test" \ + "${OUT_DIR}/test-requirements.txt" \ + "${OUT_DIR}/tox.ini" +find "${OUT_DIR}" -name "*.egg-info" -type d -exec rm -rf {} + +rm -f "${OUT_DIR}/test.egg-info" + +cat > "${OUT_DIR}/README.md" < AnimalSingleResponse get_public_animal(animal_id, include=include) + +Get Public Animal + +Retrieve a single public adoptable animal by ID. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.animal_single_response import AnimalSingleResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.AnimalsApi(api_client) + animal_id = 'animal_id_example' # str | The unique animal identifier. + include = ['include_example'] # List[str] | Related entities to include in the response. (optional) + + try: + # Get Public Animal + api_response = api_instance.get_public_animal(animal_id, include=include) + print("The response of AnimalsApi->get_public_animal:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnimalsApi->get_public_animal: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **animal_id** | **str**| The unique animal identifier. | + **include** | [**List[str]**](str.md)| Related entities to include in the response. | [optional] + +### Return type + +[**AnimalSingleResponse**](AnimalSingleResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A single animal record. | - | +**401** | Missing or invalid authorization. | - | +**404** | Resource not found. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_public_animals** +> AnimalListResponse list_public_animals(page=page, limit=limit, sort=sort, fields=fields, include=include) + +List Public Animals + +Retrieve a paginated list of public adoptable animals. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.animal_list_response import AnimalListResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.AnimalsApi(api_client) + page = 1 # int | Page number for paginated results. (optional) (default to 1) + limit = 25 # int | Number of records per page (max 250). (optional) (default to 25) + sort = 'sort_example' # str | Sort field with optional +/- prefix for direction. (optional) + fields = ['fields_example'] # List[str] | Specific fields to return. (optional) + include = ['include_example'] # List[str] | Related entities to include in the response. (optional) + + try: + # List Public Animals + api_response = api_instance.list_public_animals(page=page, limit=limit, sort=sort, fields=fields, include=include) + print("The response of AnimalsApi->list_public_animals:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnimalsApi->list_public_animals: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number for paginated results. | [optional] [default to 1] + **limit** | **int**| Number of records per page (max 250). | [optional] [default to 25] + **sort** | **str**| Sort field with optional +/- prefix for direction. | [optional] + **fields** | [**List[str]**](str.md)| Specific fields to return. | [optional] + **include** | [**List[str]**](str.md)| Related entities to include in the response. | [optional] + +### Return type + +[**AnimalListResponse**](AnimalListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A paginated list of animals. | - | +**401** | Missing or invalid authorization. | - | +**429** | Rate limit exceeded. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **search_public_animals** +> AnimalListResponse search_public_animals(view_name, page=page, limit=limit, sort=sort, include=include, search_request=search_request) + +Search Public Animals + +Search public adoptable animals using filters, views, and geodistance. Predefined view names include: available, adopted, haspic, cats, dogs, rabbits, and species-specific variants. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.animal_list_response import AnimalListResponse +from rescuegroups_client.models.search_request import SearchRequest +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.AnimalsApi(api_client) + view_name = 'view_name_example' # str | Predefined view name (e.g., available, adopted, haspic, cats, dogs). + page = 1 # int | Page number for paginated results. (optional) (default to 1) + limit = 25 # int | Number of records per page (max 250). (optional) (default to 25) + sort = 'sort_example' # str | Sort field with optional +/- prefix for direction. (optional) + include = ['include_example'] # List[str] | Related entities to include in the response. (optional) + search_request = rescuegroups_client.SearchRequest() # SearchRequest | (optional) + + try: + # Search Public Animals + api_response = api_instance.search_public_animals(view_name, page=page, limit=limit, sort=sort, include=include, search_request=search_request) + print("The response of AnimalsApi->search_public_animals:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AnimalsApi->search_public_animals: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **view_name** | **str**| Predefined view name (e.g., available, adopted, haspic, cats, dogs). | + **page** | **int**| Page number for paginated results. | [optional] [default to 1] + **limit** | **int**| Number of records per page (max 250). | [optional] [default to 25] + **sort** | **str**| Sort field with optional +/- prefix for direction. | [optional] + **include** | [**List[str]**](str.md)| Related entities to include in the response. | [optional] + **search_request** | [**SearchRequest**](SearchRequest.md)| | [optional] + +### Return type + +[**AnimalListResponse**](AnimalListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Matching animals. | - | +**400** | Invalid request parameters. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/AuthenticationApi.md b/vendor/rescuegroups_client/docs/AuthenticationApi.md new file mode 100644 index 0000000..6315c4c --- /dev/null +++ b/vendor/rescuegroups_client/docs/AuthenticationApi.md @@ -0,0 +1,80 @@ +# rescuegroups_client.AuthenticationApi + +All URIs are relative to *https://api.rescuegroups.org/v5* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_token**](AuthenticationApi.md#create_token) | **POST** /tokens | Create Authentication Token + + +# **create_token** +> TokenResponse create_token(token_request=token_request) + +Create Authentication Token + +Obtain a bearer token for authenticated (private data) access. + +### Example + + +```python +import rescuegroups_client +from rescuegroups_client.models.token_request import TokenRequest +from rescuegroups_client.models.token_response import TokenResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.AuthenticationApi(api_client) + token_request = rescuegroups_client.TokenRequest() # TokenRequest | (optional) + + try: + # Create Authentication Token + api_response = api_instance.create_token(token_request=token_request) + print("The response of AuthenticationApi->create_token:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AuthenticationApi->create_token: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **token_request** | [**TokenRequest**](TokenRequest.md)| | [optional] + +### Return type + +[**TokenResponse**](TokenResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Token created successfully. | - | +**400** | Invalid request parameters. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/BreedsApi.md b/vendor/rescuegroups_client/docs/BreedsApi.md new file mode 100644 index 0000000..1ab8218 --- /dev/null +++ b/vendor/rescuegroups_client/docs/BreedsApi.md @@ -0,0 +1,91 @@ +# rescuegroups_client.BreedsApi + +All URIs are relative to *https://api.rescuegroups.org/v5* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_animal_breeds**](BreedsApi.md#list_animal_breeds) | **GET** /public/animals/breeds | List Animal Breeds + + +# **list_animal_breeds** +> ReferenceListResponse list_animal_breeds(page=page, limit=limit) + +List Animal Breeds + +Retrieve all animal breed reference values. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.reference_list_response import ReferenceListResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.BreedsApi(api_client) + page = 1 # int | Page number for paginated results. (optional) (default to 1) + limit = 25 # int | Number of records per page (max 250). (optional) (default to 25) + + try: + # List Animal Breeds + api_response = api_instance.list_animal_breeds(page=page, limit=limit) + print("The response of BreedsApi->list_animal_breeds:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling BreedsApi->list_animal_breeds: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number for paginated results. | [optional] [default to 1] + **limit** | **int**| Number of records per page (max 250). | [optional] [default to 25] + +### Return type + +[**ReferenceListResponse**](ReferenceListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of animal breeds. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/ColorsApi.md b/vendor/rescuegroups_client/docs/ColorsApi.md new file mode 100644 index 0000000..a462b28 --- /dev/null +++ b/vendor/rescuegroups_client/docs/ColorsApi.md @@ -0,0 +1,85 @@ +# rescuegroups_client.ColorsApi + +All URIs are relative to *https://api.rescuegroups.org/v5* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_animal_colors**](ColorsApi.md#list_animal_colors) | **GET** /public/animals/colors | List Animal Colors + + +# **list_animal_colors** +> ReferenceListResponse list_animal_colors() + +List Animal Colors + +Retrieve all animal color reference values. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.reference_list_response import ReferenceListResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.ColorsApi(api_client) + + try: + # List Animal Colors + api_response = api_instance.list_animal_colors() + print("The response of ColorsApi->list_animal_colors:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ColorsApi->list_animal_colors: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ReferenceListResponse**](ReferenceListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of animal colors. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/ErrorResponse.md b/vendor/rescuegroups_client/docs/ErrorResponse.md new file mode 100644 index 0000000..048d48e --- /dev/null +++ b/vendor/rescuegroups_client/docs/ErrorResponse.md @@ -0,0 +1,29 @@ +# ErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**List[ErrorResponseErrorsInner]**](ErrorResponseErrorsInner.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.error_response import ErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorResponse from a JSON string +error_response_instance = ErrorResponse.from_json(json) +# print the JSON string representation of the object +print(ErrorResponse.to_json()) + +# convert the object into a dict +error_response_dict = error_response_instance.to_dict() +# create an instance of ErrorResponse from a dict +error_response_from_dict = ErrorResponse.from_dict(error_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/ErrorResponseErrorsInner.md b/vendor/rescuegroups_client/docs/ErrorResponseErrorsInner.md new file mode 100644 index 0000000..38b7af1 --- /dev/null +++ b/vendor/rescuegroups_client/docs/ErrorResponseErrorsInner.md @@ -0,0 +1,31 @@ +# ErrorResponseErrorsInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | [optional] +**title** | **str** | | [optional] +**detail** | **str** | | [optional] + +## Example + +```python +from rescuegroups_client.models.error_response_errors_inner import ErrorResponseErrorsInner + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorResponseErrorsInner from a JSON string +error_response_errors_inner_instance = ErrorResponseErrorsInner.from_json(json) +# print the JSON string representation of the object +print(ErrorResponseErrorsInner.to_json()) + +# convert the object into a dict +error_response_errors_inner_dict = error_response_errors_inner_instance.to_dict() +# create an instance of ErrorResponseErrorsInner from a dict +error_response_errors_inner_from_dict = ErrorResponseErrorsInner.from_dict(error_response_errors_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/GeoDistance.md b/vendor/rescuegroups_client/docs/GeoDistance.md new file mode 100644 index 0000000..c0b3d03 --- /dev/null +++ b/vendor/rescuegroups_client/docs/GeoDistance.md @@ -0,0 +1,33 @@ +# GeoDistance + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**postalcode** | **str** | Postal code for distance search. | [optional] +**lat** | **float** | Latitude for coordinate-based search. | [optional] +**lon** | **float** | Longitude for coordinate-based search. | [optional] +**miles** | **int** | Search radius in miles. | [optional] +**kilometers** | **int** | Search radius in kilometers. | [optional] + +## Example + +```python +from rescuegroups_client.models.geo_distance import GeoDistance + +# TODO update the JSON string below +json = "{}" +# create an instance of GeoDistance from a JSON string +geo_distance_instance = GeoDistance.from_json(json) +# print the JSON string representation of the object +print(GeoDistance.to_json()) + +# convert the object into a dict +geo_distance_dict = geo_distance_instance.to_dict() +# create an instance of GeoDistance from a dict +geo_distance_from_dict = GeoDistance.from_dict(geo_distance_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/OrgAttributes.md b/vendor/rescuegroups_client/docs/OrgAttributes.md new file mode 100644 index 0000000..ebff6df --- /dev/null +++ b/vendor/rescuegroups_client/docs/OrgAttributes.md @@ -0,0 +1,42 @@ +# OrgAttributes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Organization name. | [optional] +**type** | **str** | Organization type (rescue, shelter, etc.). | [optional] +**email** | **str** | Contact email address. | [optional] +**phone** | **str** | Contact phone number. | [optional] +**street** | **str** | Street address. | [optional] +**city** | **str** | City. | [optional] +**state** | **str** | State or province. | [optional] +**country** | **str** | Country. | [optional] +**postalcode** | **str** | Postal code. | [optional] +**url** | **str** | Organization website URL. | [optional] +**adoption_url** | **str** | Adoption application URL. | [optional] +**about** | **str** | Organization description. | [optional] +**serve_areas** | **str** | Geographic areas the organization serves. | [optional] +**facebook_url** | **str** | Facebook page URL. | [optional] + +## Example + +```python +from rescuegroups_client.models.org_attributes import OrgAttributes + +# TODO update the JSON string below +json = "{}" +# create an instance of OrgAttributes from a JSON string +org_attributes_instance = OrgAttributes.from_json(json) +# print the JSON string representation of the object +print(OrgAttributes.to_json()) + +# convert the object into a dict +org_attributes_dict = org_attributes_instance.to_dict() +# create an instance of OrgAttributes from a dict +org_attributes_from_dict = OrgAttributes.from_dict(org_attributes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/OrgListResponse.md b/vendor/rescuegroups_client/docs/OrgListResponse.md new file mode 100644 index 0000000..20a7686 --- /dev/null +++ b/vendor/rescuegroups_client/docs/OrgListResponse.md @@ -0,0 +1,30 @@ +# OrgListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**meta** | [**ResponseMeta**](ResponseMeta.md) | | [optional] +**data** | [**List[Organization]**](Organization.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.org_list_response import OrgListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of OrgListResponse from a JSON string +org_list_response_instance = OrgListResponse.from_json(json) +# print the JSON string representation of the object +print(OrgListResponse.to_json()) + +# convert the object into a dict +org_list_response_dict = org_list_response_instance.to_dict() +# create an instance of OrgListResponse from a dict +org_list_response_from_dict = OrgListResponse.from_dict(org_list_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/OrgSingleResponse.md b/vendor/rescuegroups_client/docs/OrgSingleResponse.md new file mode 100644 index 0000000..d15012b --- /dev/null +++ b/vendor/rescuegroups_client/docs/OrgSingleResponse.md @@ -0,0 +1,29 @@ +# OrgSingleResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Organization**](Organization.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.org_single_response import OrgSingleResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of OrgSingleResponse from a JSON string +org_single_response_instance = OrgSingleResponse.from_json(json) +# print the JSON string representation of the object +print(OrgSingleResponse.to_json()) + +# convert the object into a dict +org_single_response_dict = org_single_response_instance.to_dict() +# create an instance of OrgSingleResponse from a dict +org_single_response_from_dict = OrgSingleResponse.from_dict(org_single_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/Organization.md b/vendor/rescuegroups_client/docs/Organization.md new file mode 100644 index 0000000..30a5442 --- /dev/null +++ b/vendor/rescuegroups_client/docs/Organization.md @@ -0,0 +1,31 @@ +# Organization + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique organization identifier. | [optional] +**type** | **str** | | [optional] +**attributes** | [**OrgAttributes**](OrgAttributes.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.organization import Organization + +# TODO update the JSON string below +json = "{}" +# create an instance of Organization from a JSON string +organization_instance = Organization.from_json(json) +# print the JSON string representation of the object +print(Organization.to_json()) + +# convert the object into a dict +organization_dict = organization_instance.to_dict() +# create an instance of Organization from a dict +organization_from_dict = Organization.from_dict(organization_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/OrganizationsApi.md b/vendor/rescuegroups_client/docs/OrganizationsApi.md new file mode 100644 index 0000000..2972962 --- /dev/null +++ b/vendor/rescuegroups_client/docs/OrganizationsApi.md @@ -0,0 +1,179 @@ +# rescuegroups_client.OrganizationsApi + +All URIs are relative to *https://api.rescuegroups.org/v5* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_public_org**](OrganizationsApi.md#get_public_org) | **GET** /public/orgs/{org_id} | Get Public Organization +[**list_public_orgs**](OrganizationsApi.md#list_public_orgs) | **GET** /public/orgs | List Public Organizations + + +# **get_public_org** +> OrgSingleResponse get_public_org(org_id) + +Get Public Organization + +Retrieve a single public rescue organization by ID. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.org_single_response import OrgSingleResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.OrganizationsApi(api_client) + org_id = 'org_id_example' # str | The unique organization identifier. + + try: + # Get Public Organization + api_response = api_instance.get_public_org(org_id) + print("The response of OrganizationsApi->get_public_org:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->get_public_org: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org_id** | **str**| The unique organization identifier. | + +### Return type + +[**OrgSingleResponse**](OrgSingleResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A single organization record. | - | +**401** | Missing or invalid authorization. | - | +**404** | Resource not found. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_public_orgs** +> OrgListResponse list_public_orgs(page=page, limit=limit, sort=sort, fields=fields, include=include) + +List Public Organizations + +Retrieve a paginated list of public rescue organizations. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.org_list_response import OrgListResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.OrganizationsApi(api_client) + page = 1 # int | Page number for paginated results. (optional) (default to 1) + limit = 25 # int | Number of records per page (max 250). (optional) (default to 25) + sort = 'sort_example' # str | Sort field with optional +/- prefix for direction. (optional) + fields = ['fields_example'] # List[str] | Specific fields to return. (optional) + include = ['include_example'] # List[str] | Related entities to include in the response. (optional) + + try: + # List Public Organizations + api_response = api_instance.list_public_orgs(page=page, limit=limit, sort=sort, fields=fields, include=include) + print("The response of OrganizationsApi->list_public_orgs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationsApi->list_public_orgs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Page number for paginated results. | [optional] [default to 1] + **limit** | **int**| Number of records per page (max 250). | [optional] [default to 25] + **sort** | **str**| Sort field with optional +/- prefix for direction. | [optional] + **fields** | [**List[str]**](str.md)| Specific fields to return. | [optional] + **include** | [**List[str]**](str.md)| Related entities to include in the response. | [optional] + +### Return type + +[**OrgListResponse**](OrgListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A paginated list of organizations. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/PatternsApi.md b/vendor/rescuegroups_client/docs/PatternsApi.md new file mode 100644 index 0000000..7c435c5 --- /dev/null +++ b/vendor/rescuegroups_client/docs/PatternsApi.md @@ -0,0 +1,85 @@ +# rescuegroups_client.PatternsApi + +All URIs are relative to *https://api.rescuegroups.org/v5* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_animal_patterns**](PatternsApi.md#list_animal_patterns) | **GET** /public/animals/patterns | List Animal Patterns + + +# **list_animal_patterns** +> ReferenceListResponse list_animal_patterns() + +List Animal Patterns + +Retrieve all animal pattern reference values. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.reference_list_response import ReferenceListResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.PatternsApi(api_client) + + try: + # List Animal Patterns + api_response = api_instance.list_animal_patterns() + print("The response of PatternsApi->list_animal_patterns:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PatternsApi->list_animal_patterns: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**ReferenceListResponse**](ReferenceListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of animal patterns. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/PetListResponse.md b/vendor/rescuegroups_client/docs/PetListResponse.md new file mode 100644 index 0000000..5abc106 --- /dev/null +++ b/vendor/rescuegroups_client/docs/PetListResponse.md @@ -0,0 +1,29 @@ +# PetListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PetListResponseData**](PetListResponseData.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.pet_list_response import PetListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of PetListResponse from a JSON string +pet_list_response_instance = PetListResponse.from_json(json) +# print the JSON string representation of the object +print(PetListResponse.to_json()) + +# convert the object into a dict +pet_list_response_dict = pet_list_response_instance.to_dict() +# create an instance of PetListResponse from a dict +pet_list_response_from_dict = PetListResponse.from_dict(pet_list_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/PetListResponseData.md b/vendor/rescuegroups_client/docs/PetListResponseData.md new file mode 100644 index 0000000..a6171d4 --- /dev/null +++ b/vendor/rescuegroups_client/docs/PetListResponseData.md @@ -0,0 +1,31 @@ +# PetListResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**type** | **str** | | [optional] +**attributes** | [**PetListResponseDataAttributes**](PetListResponseDataAttributes.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.pet_list_response_data import PetListResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of PetListResponseData from a JSON string +pet_list_response_data_instance = PetListResponseData.from_json(json) +# print the JSON string representation of the object +print(PetListResponseData.to_json()) + +# convert the object into a dict +pet_list_response_data_dict = pet_list_response_data_instance.to_dict() +# create an instance of PetListResponseData from a dict +pet_list_response_data_from_dict = PetListResponseData.from_dict(pet_list_response_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/PetListResponseDataAttributes.md b/vendor/rescuegroups_client/docs/PetListResponseDataAttributes.md new file mode 100644 index 0000000..e37489b --- /dev/null +++ b/vendor/rescuegroups_client/docs/PetListResponseDataAttributes.md @@ -0,0 +1,30 @@ +# PetListResponseDataAttributes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**keystring** | **str** | | [optional] +**name** | **str** | | [optional] + +## Example + +```python +from rescuegroups_client.models.pet_list_response_data_attributes import PetListResponseDataAttributes + +# TODO update the JSON string below +json = "{}" +# create an instance of PetListResponseDataAttributes from a JSON string +pet_list_response_data_attributes_instance = PetListResponseDataAttributes.from_json(json) +# print the JSON string representation of the object +print(PetListResponseDataAttributes.to_json()) + +# convert the object into a dict +pet_list_response_data_attributes_dict = pet_list_response_data_attributes_instance.to_dict() +# create an instance of PetListResponseDataAttributes from a dict +pet_list_response_data_attributes_from_dict = PetListResponseDataAttributes.from_dict(pet_list_response_data_attributes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/PetListUpdateRequest.md b/vendor/rescuegroups_client/docs/PetListUpdateRequest.md new file mode 100644 index 0000000..3b5e5c8 --- /dev/null +++ b/vendor/rescuegroups_client/docs/PetListUpdateRequest.md @@ -0,0 +1,29 @@ +# PetListUpdateRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**PetListUpdateRequestData**](PetListUpdateRequestData.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.pet_list_update_request import PetListUpdateRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of PetListUpdateRequest from a JSON string +pet_list_update_request_instance = PetListUpdateRequest.from_json(json) +# print the JSON string representation of the object +print(PetListUpdateRequest.to_json()) + +# convert the object into a dict +pet_list_update_request_dict = pet_list_update_request_instance.to_dict() +# create an instance of PetListUpdateRequest from a dict +pet_list_update_request_from_dict = PetListUpdateRequest.from_dict(pet_list_update_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/PetListUpdateRequestData.md b/vendor/rescuegroups_client/docs/PetListUpdateRequestData.md new file mode 100644 index 0000000..af85fe6 --- /dev/null +++ b/vendor/rescuegroups_client/docs/PetListUpdateRequestData.md @@ -0,0 +1,31 @@ +# PetListUpdateRequestData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**id** | **str** | | [optional] +**attributes** | **Dict[str, object]** | | [optional] + +## Example + +```python +from rescuegroups_client.models.pet_list_update_request_data import PetListUpdateRequestData + +# TODO update the JSON string below +json = "{}" +# create an instance of PetListUpdateRequestData from a JSON string +pet_list_update_request_data_instance = PetListUpdateRequestData.from_json(json) +# print the JSON string representation of the object +print(PetListUpdateRequestData.to_json()) + +# convert the object into a dict +pet_list_update_request_data_dict = pet_list_update_request_data_instance.to_dict() +# create an instance of PetListUpdateRequestData from a dict +pet_list_update_request_data_from_dict = PetListUpdateRequestData.from_dict(pet_list_update_request_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/PetListsApi.md b/vendor/rescuegroups_client/docs/PetListsApi.md new file mode 100644 index 0000000..7382ea3 --- /dev/null +++ b/vendor/rescuegroups_client/docs/PetListsApi.md @@ -0,0 +1,173 @@ +# rescuegroups_client.PetListsApi + +All URIs are relative to *https://api.rescuegroups.org/v5* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_pet_list**](PetListsApi.md#get_pet_list) | **GET** /public/petlists/{keystring} | Get Pet List +[**update_pet_list**](PetListsApi.md#update_pet_list) | **PUT** /public/petlists/{keystring} | Update Pet List + + +# **get_pet_list** +> PetListResponse get_pet_list(keystring) + +Get Pet List + +Retrieve a pet list by its keystring. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.pet_list_response import PetListResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.PetListsApi(api_client) + keystring = 'keystring_example' # str | The pet list keystring identifier. + + try: + # Get Pet List + api_response = api_instance.get_pet_list(keystring) + print("The response of PetListsApi->get_pet_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PetListsApi->get_pet_list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **keystring** | **str**| The pet list keystring identifier. | + +### Return type + +[**PetListResponse**](PetListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A pet list. | - | +**401** | Missing or invalid authorization. | - | +**404** | Resource not found. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_pet_list** +> PetListResponse update_pet_list(keystring, pet_list_update_request=pet_list_update_request) + +Update Pet List + +Update a pet list by its keystring. + +### Example + +* Bearer Authentication (bearerAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.pet_list_response import PetListResponse +from rescuegroups_client.models.pet_list_update_request import PetListUpdateRequest +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization: bearerAuth +configuration = rescuegroups_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.PetListsApi(api_client) + keystring = 'keystring_example' # str | The pet list keystring identifier. + pet_list_update_request = rescuegroups_client.PetListUpdateRequest() # PetListUpdateRequest | (optional) + + try: + # Update Pet List + api_response = api_instance.update_pet_list(keystring, pet_list_update_request=pet_list_update_request) + print("The response of PetListsApi->update_pet_list:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PetListsApi->update_pet_list: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **keystring** | **str**| The pet list keystring identifier. | + **pet_list_update_request** | [**PetListUpdateRequest**](PetListUpdateRequest.md)| | [optional] + +### Return type + +[**PetListResponse**](PetListResponse.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: application/vnd.api+json + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Updated pet list. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/ReferenceItem.md b/vendor/rescuegroups_client/docs/ReferenceItem.md new file mode 100644 index 0000000..27016df --- /dev/null +++ b/vendor/rescuegroups_client/docs/ReferenceItem.md @@ -0,0 +1,31 @@ +# ReferenceItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**type** | **str** | | [optional] +**attributes** | [**ReferenceItemAttributes**](ReferenceItemAttributes.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.reference_item import ReferenceItem + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferenceItem from a JSON string +reference_item_instance = ReferenceItem.from_json(json) +# print the JSON string representation of the object +print(ReferenceItem.to_json()) + +# convert the object into a dict +reference_item_dict = reference_item_instance.to_dict() +# create an instance of ReferenceItem from a dict +reference_item_from_dict = ReferenceItem.from_dict(reference_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/ReferenceItemAttributes.md b/vendor/rescuegroups_client/docs/ReferenceItemAttributes.md new file mode 100644 index 0000000..1a715ea --- /dev/null +++ b/vendor/rescuegroups_client/docs/ReferenceItemAttributes.md @@ -0,0 +1,29 @@ +# ReferenceItemAttributes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] + +## Example + +```python +from rescuegroups_client.models.reference_item_attributes import ReferenceItemAttributes + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferenceItemAttributes from a JSON string +reference_item_attributes_instance = ReferenceItemAttributes.from_json(json) +# print the JSON string representation of the object +print(ReferenceItemAttributes.to_json()) + +# convert the object into a dict +reference_item_attributes_dict = reference_item_attributes_instance.to_dict() +# create an instance of ReferenceItemAttributes from a dict +reference_item_attributes_from_dict = ReferenceItemAttributes.from_dict(reference_item_attributes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/ReferenceListResponse.md b/vendor/rescuegroups_client/docs/ReferenceListResponse.md new file mode 100644 index 0000000..4201b03 --- /dev/null +++ b/vendor/rescuegroups_client/docs/ReferenceListResponse.md @@ -0,0 +1,30 @@ +# ReferenceListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**meta** | [**ResponseMeta**](ResponseMeta.md) | | [optional] +**data** | [**List[ReferenceItem]**](ReferenceItem.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.reference_list_response import ReferenceListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ReferenceListResponse from a JSON string +reference_list_response_instance = ReferenceListResponse.from_json(json) +# print the JSON string representation of the object +print(ReferenceListResponse.to_json()) + +# convert the object into a dict +reference_list_response_dict = reference_list_response_instance.to_dict() +# create an instance of ReferenceListResponse from a dict +reference_list_response_from_dict = ReferenceListResponse.from_dict(reference_list_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/RelationshipData.md b/vendor/rescuegroups_client/docs/RelationshipData.md new file mode 100644 index 0000000..7fec3ea --- /dev/null +++ b/vendor/rescuegroups_client/docs/RelationshipData.md @@ -0,0 +1,29 @@ +# RelationshipData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RelationshipDataData**](RelationshipDataData.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.relationship_data import RelationshipData + +# TODO update the JSON string below +json = "{}" +# create an instance of RelationshipData from a JSON string +relationship_data_instance = RelationshipData.from_json(json) +# print the JSON string representation of the object +print(RelationshipData.to_json()) + +# convert the object into a dict +relationship_data_dict = relationship_data_instance.to_dict() +# create an instance of RelationshipData from a dict +relationship_data_from_dict = RelationshipData.from_dict(relationship_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/RelationshipDataData.md b/vendor/rescuegroups_client/docs/RelationshipDataData.md new file mode 100644 index 0000000..609fc28 --- /dev/null +++ b/vendor/rescuegroups_client/docs/RelationshipDataData.md @@ -0,0 +1,30 @@ +# RelationshipDataData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**id** | **str** | | [optional] + +## Example + +```python +from rescuegroups_client.models.relationship_data_data import RelationshipDataData + +# TODO update the JSON string below +json = "{}" +# create an instance of RelationshipDataData from a JSON string +relationship_data_data_instance = RelationshipDataData.from_json(json) +# print the JSON string representation of the object +print(RelationshipDataData.to_json()) + +# convert the object into a dict +relationship_data_data_dict = relationship_data_data_instance.to_dict() +# create an instance of RelationshipDataData from a dict +relationship_data_data_from_dict = RelationshipDataData.from_dict(relationship_data_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/RelationshipDataDataOneOf.md b/vendor/rescuegroups_client/docs/RelationshipDataDataOneOf.md new file mode 100644 index 0000000..56b1196 --- /dev/null +++ b/vendor/rescuegroups_client/docs/RelationshipDataDataOneOf.md @@ -0,0 +1,30 @@ +# RelationshipDataDataOneOf + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**id** | **str** | | [optional] + +## Example + +```python +from rescuegroups_client.models.relationship_data_data_one_of import RelationshipDataDataOneOf + +# TODO update the JSON string below +json = "{}" +# create an instance of RelationshipDataDataOneOf from a JSON string +relationship_data_data_one_of_instance = RelationshipDataDataOneOf.from_json(json) +# print the JSON string representation of the object +print(RelationshipDataDataOneOf.to_json()) + +# convert the object into a dict +relationship_data_data_one_of_dict = relationship_data_data_one_of_instance.to_dict() +# create an instance of RelationshipDataDataOneOf from a dict +relationship_data_data_one_of_from_dict = RelationshipDataDataOneOf.from_dict(relationship_data_data_one_of_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/ResponseMeta.md b/vendor/rescuegroups_client/docs/ResponseMeta.md new file mode 100644 index 0000000..14fb384 --- /dev/null +++ b/vendor/rescuegroups_client/docs/ResponseMeta.md @@ -0,0 +1,31 @@ +# ResponseMeta + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**count** | **int** | Total number of matching records. | [optional] +**page_count** | **int** | Total number of pages. | [optional] +**transaction_id** | **str** | Unique transaction identifier for support requests. | [optional] + +## Example + +```python +from rescuegroups_client.models.response_meta import ResponseMeta + +# TODO update the JSON string below +json = "{}" +# create an instance of ResponseMeta from a JSON string +response_meta_instance = ResponseMeta.from_json(json) +# print the JSON string representation of the object +print(ResponseMeta.to_json()) + +# convert the object into a dict +response_meta_dict = response_meta_instance.to_dict() +# create an instance of ResponseMeta from a dict +response_meta_from_dict = ResponseMeta.from_dict(response_meta_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/SearchFilter.md b/vendor/rescuegroups_client/docs/SearchFilter.md new file mode 100644 index 0000000..703fd76 --- /dev/null +++ b/vendor/rescuegroups_client/docs/SearchFilter.md @@ -0,0 +1,31 @@ +# SearchFilter + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_name** | **str** | Field name to filter on. | +**operation** | **str** | Filter operation. | +**criteria** | **str** | Filter value or special criteria (e.g., rg:contactID, rg:today). | [optional] + +## Example + +```python +from rescuegroups_client.models.search_filter import SearchFilter + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchFilter from a JSON string +search_filter_instance = SearchFilter.from_json(json) +# print the JSON string representation of the object +print(SearchFilter.to_json()) + +# convert the object into a dict +search_filter_dict = search_filter_instance.to_dict() +# create an instance of SearchFilter from a dict +search_filter_from_dict = SearchFilter.from_dict(search_filter_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/SearchRequest.md b/vendor/rescuegroups_client/docs/SearchRequest.md new file mode 100644 index 0000000..9977031 --- /dev/null +++ b/vendor/rescuegroups_client/docs/SearchRequest.md @@ -0,0 +1,29 @@ +# SearchRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**SearchRequestData**](SearchRequestData.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.search_request import SearchRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchRequest from a JSON string +search_request_instance = SearchRequest.from_json(json) +# print the JSON string representation of the object +print(SearchRequest.to_json()) + +# convert the object into a dict +search_request_dict = search_request_instance.to_dict() +# create an instance of SearchRequest from a dict +search_request_from_dict = SearchRequest.from_dict(search_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/SearchRequestData.md b/vendor/rescuegroups_client/docs/SearchRequestData.md new file mode 100644 index 0000000..403e937 --- /dev/null +++ b/vendor/rescuegroups_client/docs/SearchRequestData.md @@ -0,0 +1,31 @@ +# SearchRequestData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filters** | [**List[SearchFilter]**](SearchFilter.md) | | [optional] +**filter_processing** | **str** | Boolean expression for filter combination. | [optional] +**geodistance** | [**GeoDistance**](GeoDistance.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.search_request_data import SearchRequestData + +# TODO update the JSON string below +json = "{}" +# create an instance of SearchRequestData from a JSON string +search_request_data_instance = SearchRequestData.from_json(json) +# print the JSON string representation of the object +print(SearchRequestData.to_json()) + +# convert the object into a dict +search_request_data_dict = search_request_data_instance.to_dict() +# create an instance of SearchRequestData from a dict +search_request_data_from_dict = SearchRequestData.from_dict(search_request_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/SpeciesApi.md b/vendor/rescuegroups_client/docs/SpeciesApi.md new file mode 100644 index 0000000..fd79241 --- /dev/null +++ b/vendor/rescuegroups_client/docs/SpeciesApi.md @@ -0,0 +1,85 @@ +# rescuegroups_client.SpeciesApi + +All URIs are relative to *https://api.rescuegroups.org/v5* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_animal_species**](SpeciesApi.md#list_animal_species) | **GET** /public/animals/species | List Animal Species + + +# **list_animal_species** +> SpeciesListResponse list_animal_species() + +List Animal Species + +Retrieve all animal species reference values. + +### Example + +* Api Key Authentication (apiKeyAuth): + +```python +import rescuegroups_client +from rescuegroups_client.models.species_list_response import SpeciesListResponse +from rescuegroups_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.rescuegroups.org/v5 +# See configuration.py for a list of all supported configuration parameters. +configuration = rescuegroups_client.Configuration( + host = "https://api.rescuegroups.org/v5" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: apiKeyAuth +configuration.api_key['apiKeyAuth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['apiKeyAuth'] = 'Bearer' + +# Enter a context with an instance of the API client +with rescuegroups_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = rescuegroups_client.SpeciesApi(api_client) + + try: + # List Animal Species + api_response = api_instance.list_animal_species() + print("The response of SpeciesApi->list_animal_species:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling SpeciesApi->list_animal_species: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**SpeciesListResponse**](SpeciesListResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/vnd.api+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A list of animal species. | - | +**401** | Missing or invalid authorization. | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/vendor/rescuegroups_client/docs/SpeciesItem.md b/vendor/rescuegroups_client/docs/SpeciesItem.md new file mode 100644 index 0000000..52bebcb --- /dev/null +++ b/vendor/rescuegroups_client/docs/SpeciesItem.md @@ -0,0 +1,31 @@ +# SpeciesItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**type** | **str** | | [optional] +**attributes** | [**SpeciesItemAttributes**](SpeciesItemAttributes.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.species_item import SpeciesItem + +# TODO update the JSON string below +json = "{}" +# create an instance of SpeciesItem from a JSON string +species_item_instance = SpeciesItem.from_json(json) +# print the JSON string representation of the object +print(SpeciesItem.to_json()) + +# convert the object into a dict +species_item_dict = species_item_instance.to_dict() +# create an instance of SpeciesItem from a dict +species_item_from_dict = SpeciesItem.from_dict(species_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/SpeciesItemAttributes.md b/vendor/rescuegroups_client/docs/SpeciesItemAttributes.md new file mode 100644 index 0000000..3db2691 --- /dev/null +++ b/vendor/rescuegroups_client/docs/SpeciesItemAttributes.md @@ -0,0 +1,32 @@ +# SpeciesItemAttributes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**singular** | **str** | Singular species name. | [optional] +**plural** | **str** | Plural species name. | [optional] +**young_singular** | **str** | Singular name for young of the species. | [optional] +**young_plural** | **str** | Plural name for young of the species. | [optional] + +## Example + +```python +from rescuegroups_client.models.species_item_attributes import SpeciesItemAttributes + +# TODO update the JSON string below +json = "{}" +# create an instance of SpeciesItemAttributes from a JSON string +species_item_attributes_instance = SpeciesItemAttributes.from_json(json) +# print the JSON string representation of the object +print(SpeciesItemAttributes.to_json()) + +# convert the object into a dict +species_item_attributes_dict = species_item_attributes_instance.to_dict() +# create an instance of SpeciesItemAttributes from a dict +species_item_attributes_from_dict = SpeciesItemAttributes.from_dict(species_item_attributes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/SpeciesListResponse.md b/vendor/rescuegroups_client/docs/SpeciesListResponse.md new file mode 100644 index 0000000..4f8c53e --- /dev/null +++ b/vendor/rescuegroups_client/docs/SpeciesListResponse.md @@ -0,0 +1,29 @@ +# SpeciesListResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[SpeciesItem]**](SpeciesItem.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.species_list_response import SpeciesListResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SpeciesListResponse from a JSON string +species_list_response_instance = SpeciesListResponse.from_json(json) +# print the JSON string representation of the object +print(SpeciesListResponse.to_json()) + +# convert the object into a dict +species_list_response_dict = species_list_response_instance.to_dict() +# create an instance of SpeciesListResponse from a dict +species_list_response_from_dict = SpeciesListResponse.from_dict(species_list_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/TokenRequest.md b/vendor/rescuegroups_client/docs/TokenRequest.md new file mode 100644 index 0000000..51da24f --- /dev/null +++ b/vendor/rescuegroups_client/docs/TokenRequest.md @@ -0,0 +1,30 @@ +# TokenRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **str** | RescueGroups.org account username. | +**password** | **str** | RescueGroups.org account password. | + +## Example + +```python +from rescuegroups_client.models.token_request import TokenRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenRequest from a JSON string +token_request_instance = TokenRequest.from_json(json) +# print the JSON string representation of the object +print(TokenRequest.to_json()) + +# convert the object into a dict +token_request_dict = token_request_instance.to_dict() +# create an instance of TokenRequest from a dict +token_request_from_dict = TokenRequest.from_dict(token_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/TokenResponse.md b/vendor/rescuegroups_client/docs/TokenResponse.md new file mode 100644 index 0000000..97d73fd --- /dev/null +++ b/vendor/rescuegroups_client/docs/TokenResponse.md @@ -0,0 +1,29 @@ +# TokenResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**TokenResponseData**](TokenResponseData.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.token_response import TokenResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenResponse from a JSON string +token_response_instance = TokenResponse.from_json(json) +# print the JSON string representation of the object +print(TokenResponse.to_json()) + +# convert the object into a dict +token_response_dict = token_response_instance.to_dict() +# create an instance of TokenResponse from a dict +token_response_from_dict = TokenResponse.from_dict(token_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/TokenResponseData.md b/vendor/rescuegroups_client/docs/TokenResponseData.md new file mode 100644 index 0000000..05d089f --- /dev/null +++ b/vendor/rescuegroups_client/docs/TokenResponseData.md @@ -0,0 +1,30 @@ +# TokenResponseData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Token ID. | [optional] +**attributes** | [**TokenResponseDataAttributes**](TokenResponseDataAttributes.md) | | [optional] + +## Example + +```python +from rescuegroups_client.models.token_response_data import TokenResponseData + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenResponseData from a JSON string +token_response_data_instance = TokenResponseData.from_json(json) +# print the JSON string representation of the object +print(TokenResponseData.to_json()) + +# convert the object into a dict +token_response_data_dict = token_response_data_instance.to_dict() +# create an instance of TokenResponseData from a dict +token_response_data_from_dict = TokenResponseData.from_dict(token_response_data_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/docs/TokenResponseDataAttributes.md b/vendor/rescuegroups_client/docs/TokenResponseDataAttributes.md new file mode 100644 index 0000000..66098a5 --- /dev/null +++ b/vendor/rescuegroups_client/docs/TokenResponseDataAttributes.md @@ -0,0 +1,30 @@ +# TokenResponseDataAttributes + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**token** | **str** | Bearer authentication token. | [optional] +**expiration** | **datetime** | Token expiration timestamp. | [optional] + +## Example + +```python +from rescuegroups_client.models.token_response_data_attributes import TokenResponseDataAttributes + +# TODO update the JSON string below +json = "{}" +# create an instance of TokenResponseDataAttributes from a JSON string +token_response_data_attributes_instance = TokenResponseDataAttributes.from_json(json) +# print the JSON string representation of the object +print(TokenResponseDataAttributes.to_json()) + +# convert the object into a dict +token_response_data_attributes_dict = token_response_data_attributes_instance.to_dict() +# create an instance of TokenResponseDataAttributes from a dict +token_response_data_attributes_from_dict = TokenResponseDataAttributes.from_dict(token_response_data_attributes_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/__init__.py b/vendor/rescuegroups_client/rescuegroups_client/__init__.py new file mode 100644 index 0000000..4164526 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/__init__.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +# flake8: noqa + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# Define package exports +__all__ = [ + "AnimalsApi", + "AuthenticationApi", + "BreedsApi", + "ColorsApi", + "OrganizationsApi", + "PatternsApi", + "PetListsApi", + "SpeciesApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "Animal", + "AnimalAttributes", + "AnimalListResponse", + "AnimalRelationships", + "AnimalSingleResponse", + "ErrorResponse", + "ErrorResponseErrorsInner", + "GeoDistance", + "OrgAttributes", + "OrgListResponse", + "OrgSingleResponse", + "Organization", + "PetListResponse", + "PetListResponseData", + "PetListResponseDataAttributes", + "PetListUpdateRequest", + "PetListUpdateRequestData", + "ReferenceItem", + "ReferenceItemAttributes", + "ReferenceListResponse", + "RelationshipData", + "RelationshipDataData", + "RelationshipDataDataOneOf", + "ResponseMeta", + "SearchFilter", + "SearchRequest", + "SearchRequestData", + "SpeciesItem", + "SpeciesItemAttributes", + "SpeciesListResponse", + "TokenRequest", + "TokenResponse", + "TokenResponseData", + "TokenResponseDataAttributes", +] + +# import apis into sdk package +from rescuegroups_client.api.animals_api import AnimalsApi as AnimalsApi +from rescuegroups_client.api.authentication_api import AuthenticationApi as AuthenticationApi +from rescuegroups_client.api.breeds_api import BreedsApi as BreedsApi +from rescuegroups_client.api.colors_api import ColorsApi as ColorsApi +from rescuegroups_client.api.organizations_api import OrganizationsApi as OrganizationsApi +from rescuegroups_client.api.patterns_api import PatternsApi as PatternsApi +from rescuegroups_client.api.pet_lists_api import PetListsApi as PetListsApi +from rescuegroups_client.api.species_api import SpeciesApi as SpeciesApi + +# import ApiClient +from rescuegroups_client.api_response import ApiResponse as ApiResponse +from rescuegroups_client.api_client import ApiClient as ApiClient +from rescuegroups_client.configuration import Configuration as Configuration +from rescuegroups_client.exceptions import OpenApiException as OpenApiException +from rescuegroups_client.exceptions import ApiTypeError as ApiTypeError +from rescuegroups_client.exceptions import ApiValueError as ApiValueError +from rescuegroups_client.exceptions import ApiKeyError as ApiKeyError +from rescuegroups_client.exceptions import ApiAttributeError as ApiAttributeError +from rescuegroups_client.exceptions import ApiException as ApiException + +# import models into sdk package +from rescuegroups_client.models.animal import Animal as Animal +from rescuegroups_client.models.animal_attributes import AnimalAttributes as AnimalAttributes +from rescuegroups_client.models.animal_list_response import AnimalListResponse as AnimalListResponse +from rescuegroups_client.models.animal_relationships import AnimalRelationships as AnimalRelationships +from rescuegroups_client.models.animal_single_response import AnimalSingleResponse as AnimalSingleResponse +from rescuegroups_client.models.error_response import ErrorResponse as ErrorResponse +from rescuegroups_client.models.error_response_errors_inner import ErrorResponseErrorsInner as ErrorResponseErrorsInner +from rescuegroups_client.models.geo_distance import GeoDistance as GeoDistance +from rescuegroups_client.models.org_attributes import OrgAttributes as OrgAttributes +from rescuegroups_client.models.org_list_response import OrgListResponse as OrgListResponse +from rescuegroups_client.models.org_single_response import OrgSingleResponse as OrgSingleResponse +from rescuegroups_client.models.organization import Organization as Organization +from rescuegroups_client.models.pet_list_response import PetListResponse as PetListResponse +from rescuegroups_client.models.pet_list_response_data import PetListResponseData as PetListResponseData +from rescuegroups_client.models.pet_list_response_data_attributes import PetListResponseDataAttributes as PetListResponseDataAttributes +from rescuegroups_client.models.pet_list_update_request import PetListUpdateRequest as PetListUpdateRequest +from rescuegroups_client.models.pet_list_update_request_data import PetListUpdateRequestData as PetListUpdateRequestData +from rescuegroups_client.models.reference_item import ReferenceItem as ReferenceItem +from rescuegroups_client.models.reference_item_attributes import ReferenceItemAttributes as ReferenceItemAttributes +from rescuegroups_client.models.reference_list_response import ReferenceListResponse as ReferenceListResponse +from rescuegroups_client.models.relationship_data import RelationshipData as RelationshipData +from rescuegroups_client.models.relationship_data_data import RelationshipDataData as RelationshipDataData +from rescuegroups_client.models.relationship_data_data_one_of import RelationshipDataDataOneOf as RelationshipDataDataOneOf +from rescuegroups_client.models.response_meta import ResponseMeta as ResponseMeta +from rescuegroups_client.models.search_filter import SearchFilter as SearchFilter +from rescuegroups_client.models.search_request import SearchRequest as SearchRequest +from rescuegroups_client.models.search_request_data import SearchRequestData as SearchRequestData +from rescuegroups_client.models.species_item import SpeciesItem as SpeciesItem +from rescuegroups_client.models.species_item_attributes import SpeciesItemAttributes as SpeciesItemAttributes +from rescuegroups_client.models.species_list_response import SpeciesListResponse as SpeciesListResponse +from rescuegroups_client.models.token_request import TokenRequest as TokenRequest +from rescuegroups_client.models.token_response import TokenResponse as TokenResponse +from rescuegroups_client.models.token_response_data import TokenResponseData as TokenResponseData +from rescuegroups_client.models.token_response_data_attributes import TokenResponseDataAttributes as TokenResponseDataAttributes + diff --git a/vendor/rescuegroups_client/rescuegroups_client/api/__init__.py b/vendor/rescuegroups_client/rescuegroups_client/api/__init__.py new file mode 100644 index 0000000..837d41c --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/__init__.py @@ -0,0 +1,12 @@ +# flake8: noqa + +# import apis into api package +from rescuegroups_client.api.animals_api import AnimalsApi +from rescuegroups_client.api.authentication_api import AuthenticationApi +from rescuegroups_client.api.breeds_api import BreedsApi +from rescuegroups_client.api.colors_api import ColorsApi +from rescuegroups_client.api.organizations_api import OrganizationsApi +from rescuegroups_client.api.patterns_api import PatternsApi +from rescuegroups_client.api.pet_lists_api import PetListsApi +from rescuegroups_client.api.species_api import SpeciesApi + diff --git a/vendor/rescuegroups_client/rescuegroups_client/api/animals_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/animals_api.py new file mode 100644 index 0000000..e112cd5 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/animals_api.py @@ -0,0 +1,1028 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from rescuegroups_client.models.animal_list_response import AnimalListResponse +from rescuegroups_client.models.animal_single_response import AnimalSingleResponse +from rescuegroups_client.models.search_request import SearchRequest + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +class AnimalsApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_public_animal( + self, + animal_id: Annotated[StrictStr, Field(description="The unique animal identifier.")], + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnimalSingleResponse: + """Get Public Animal + + Retrieve a single public adoptable animal by ID. + + :param animal_id: The unique animal identifier. (required) + :type animal_id: str + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_public_animal_serialize( + animal_id=animal_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalSingleResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_animal_with_http_info( + self, + animal_id: Annotated[StrictStr, Field(description="The unique animal identifier.")], + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnimalSingleResponse]: + """Get Public Animal + + Retrieve a single public adoptable animal by ID. + + :param animal_id: The unique animal identifier. (required) + :type animal_id: str + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_public_animal_serialize( + animal_id=animal_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalSingleResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_animal_without_preload_content( + self, + animal_id: Annotated[StrictStr, Field(description="The unique animal identifier.")], + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Public Animal + + Retrieve a single public adoptable animal by ID. + + :param animal_id: The unique animal identifier. (required) + :type animal_id: str + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_public_animal_serialize( + animal_id=animal_id, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalSingleResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_public_animal_serialize( + self, + animal_id, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include[]': '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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if animal_id is not None: + _path_params['animal_id'] = animal_id + # process the query parameters + if include is not None: + + _query_params.append(('include[]', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/animals/{animal_id}', + 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_public_animals( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + fields: Annotated[Optional[List[StrictStr]], Field(description="Specific fields to return.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnimalListResponse: + """List Public Animals + + Retrieve a paginated list of public adoptable animals. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param fields: Specific fields to return. + :type fields: List[str] + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_animals_serialize( + page=page, + limit=limit, + sort=sort, + fields=fields, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalListResponse", + '401': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_animals_with_http_info( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + fields: Annotated[Optional[List[StrictStr]], Field(description="Specific fields to return.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnimalListResponse]: + """List Public Animals + + Retrieve a paginated list of public adoptable animals. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param fields: Specific fields to return. + :type fields: List[str] + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_animals_serialize( + page=page, + limit=limit, + sort=sort, + fields=fields, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalListResponse", + '401': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_animals_without_preload_content( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + fields: Annotated[Optional[List[StrictStr]], Field(description="Specific fields to return.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """List Public Animals + + Retrieve a paginated list of public adoptable animals. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param fields: Specific fields to return. + :type fields: List[str] + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_animals_serialize( + page=page, + limit=limit, + sort=sort, + fields=fields, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalListResponse", + '401': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_public_animals_serialize( + self, + page, + limit, + sort, + fields, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'fields[]': 'multi', + 'include[]': '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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if fields is not None: + + _query_params.append(('fields[]', fields)) + + if include is not None: + + _query_params.append(('include[]', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/animals', + 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_public_animals( + self, + view_name: Annotated[StrictStr, Field(description="Predefined view name (e.g., available, adopted, haspic, cats, dogs).")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + search_request: Optional[SearchRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AnimalListResponse: + """Search Public Animals + + Search public adoptable animals using filters, views, and geodistance. Predefined view names include: available, adopted, haspic, cats, dogs, rabbits, and species-specific variants. + + :param view_name: Predefined view name (e.g., available, adopted, haspic, cats, dogs). (required) + :type view_name: str + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param include: Related entities to include in the response. + :type include: List[str] + :param search_request: + :type search_request: SearchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_animals_serialize( + view_name=view_name, + page=page, + limit=limit, + sort=sort, + include=include, + search_request=search_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_animals_with_http_info( + self, + view_name: Annotated[StrictStr, Field(description="Predefined view name (e.g., available, adopted, haspic, cats, dogs).")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + search_request: Optional[SearchRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AnimalListResponse]: + """Search Public Animals + + Search public adoptable animals using filters, views, and geodistance. Predefined view names include: available, adopted, haspic, cats, dogs, rabbits, and species-specific variants. + + :param view_name: Predefined view name (e.g., available, adopted, haspic, cats, dogs). (required) + :type view_name: str + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param include: Related entities to include in the response. + :type include: List[str] + :param search_request: + :type search_request: SearchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_animals_serialize( + view_name=view_name, + page=page, + limit=limit, + sort=sort, + include=include, + search_request=search_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_animals_without_preload_content( + self, + view_name: Annotated[StrictStr, Field(description="Predefined view name (e.g., available, adopted, haspic, cats, dogs).")], + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + search_request: Optional[SearchRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Search Public Animals + + Search public adoptable animals using filters, views, and geodistance. Predefined view names include: available, adopted, haspic, cats, dogs, rabbits, and species-specific variants. + + :param view_name: Predefined view name (e.g., available, adopted, haspic, cats, dogs). (required) + :type view_name: str + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param include: Related entities to include in the response. + :type include: List[str] + :param search_request: + :type search_request: SearchRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_animals_serialize( + view_name=view_name, + page=page, + limit=limit, + sort=sort, + include=include, + search_request=search_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AnimalListResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_public_animals_serialize( + self, + view_name, + page, + limit, + sort, + include, + search_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'include[]': '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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if view_name is not None: + _path_params['view_name'] = view_name + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if include is not None: + + _query_params.append(('include[]', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + if search_request is not None: + _body_params = search_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+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/vnd.api+json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/public/animals/search/{view_name}', + 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/vendor/rescuegroups_client/rescuegroups_client/api/authentication_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/authentication_api.py new file mode 100644 index 0000000..ac3e07f --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/authentication_api.py @@ -0,0 +1,316 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from typing import Optional +from rescuegroups_client.models.token_request import TokenRequest +from rescuegroups_client.models.token_response import TokenResponse + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def create_token( + self, + token_request: Optional[TokenRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TokenResponse: + """Create Authentication Token + + Obtain a bearer token for authenticated (private data) access. + + :param token_request: + :type token_request: TokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_token_serialize( + token_request=token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TokenResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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 create_token_with_http_info( + self, + token_request: Optional[TokenRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TokenResponse]: + """Create Authentication Token + + Obtain a bearer token for authenticated (private data) access. + + :param token_request: + :type token_request: TokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_token_serialize( + token_request=token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TokenResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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 create_token_without_preload_content( + self, + token_request: Optional[TokenRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Create Authentication Token + + Obtain a bearer token for authenticated (private data) access. + + :param token_request: + :type token_request: TokenRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_token_serialize( + token_request=token_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TokenResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_token_serialize( + self, + 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, List[str], List[bytes], List[Tuple[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 token_request is not None: + _body_params = token_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+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/vnd.api+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='/tokens', + 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/vendor/rescuegroups_client/rescuegroups_client/api/breeds_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/breeds_api.py new file mode 100644 index 0000000..b2afae2 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/breeds_api.py @@ -0,0 +1,321 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from pydantic import Field +from typing import Optional +from typing_extensions import Annotated +from rescuegroups_client.models.reference_list_response import ReferenceListResponse + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +class BreedsApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def list_animal_breeds( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ReferenceListResponse: + """List Animal Breeds + + Retrieve all animal breed reference values. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_breeds_serialize( + page=page, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_breeds_with_http_info( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ReferenceListResponse]: + """List Animal Breeds + + Retrieve all animal breed reference values. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_breeds_serialize( + page=page, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_breeds_without_preload_content( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """List Animal Breeds + + Retrieve all animal breed reference values. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_breeds_serialize( + page=page, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_animal_breeds_serialize( + self, + page, + limit, + _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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/animals/breeds', + 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/vendor/rescuegroups_client/rescuegroups_client/api/colors_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/colors_api.py new file mode 100644 index 0000000..38cff25 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/colors_api.py @@ -0,0 +1,284 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from rescuegroups_client.models.reference_list_response import ReferenceListResponse + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +class ColorsApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def list_animal_colors( + 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, + ) -> ReferenceListResponse: + """List Animal Colors + + Retrieve all animal color reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_colors_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_colors_with_http_info( + 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, + ) -> ApiResponse[ReferenceListResponse]: + """List Animal Colors + + Retrieve all animal color reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_colors_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_colors_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: + """List Animal Colors + + Retrieve all animal color reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_colors_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_animal_colors_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, List[str], List[bytes], List[Tuple[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` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/animals/colors', + 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/vendor/rescuegroups_client/rescuegroups_client/api/organizations_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/organizations_api.py new file mode 100644 index 0000000..2dc988f --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/organizations_api.py @@ -0,0 +1,642 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from pydantic import Field, StrictStr +from typing import List, Optional +from typing_extensions import Annotated +from rescuegroups_client.models.org_list_response import OrgListResponse +from rescuegroups_client.models.org_single_response import OrgSingleResponse + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +class OrganizationsApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_public_org( + self, + org_id: Annotated[StrictStr, Field(description="The unique organization identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OrgSingleResponse: + """Get Public Organization + + Retrieve a single public rescue organization by ID. + + :param org_id: The unique organization identifier. (required) + :type org_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_public_org_serialize( + org_id=org_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrgSingleResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_org_with_http_info( + self, + org_id: Annotated[StrictStr, Field(description="The unique organization identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OrgSingleResponse]: + """Get Public Organization + + Retrieve a single public rescue organization by ID. + + :param org_id: The unique organization identifier. (required) + :type org_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_public_org_serialize( + org_id=org_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrgSingleResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_org_without_preload_content( + self, + org_id: Annotated[StrictStr, Field(description="The unique organization identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Public Organization + + Retrieve a single public rescue organization by ID. + + :param org_id: The unique organization identifier. (required) + :type org_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_public_org_serialize( + org_id=org_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrgSingleResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_public_org_serialize( + self, + org_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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if org_id is not None: + _path_params['org_id'] = org_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/orgs/{org_id}', + 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_public_orgs( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + fields: Annotated[Optional[List[StrictStr]], Field(description="Specific fields to return.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OrgListResponse: + """List Public Organizations + + Retrieve a paginated list of public rescue organizations. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param fields: Specific fields to return. + :type fields: List[str] + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_orgs_serialize( + page=page, + limit=limit, + sort=sort, + fields=fields, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrgListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_orgs_with_http_info( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + fields: Annotated[Optional[List[StrictStr]], Field(description="Specific fields to return.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OrgListResponse]: + """List Public Organizations + + Retrieve a paginated list of public rescue organizations. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param fields: Specific fields to return. + :type fields: List[str] + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_orgs_serialize( + page=page, + limit=limit, + sort=sort, + fields=fields, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrgListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_public_orgs_without_preload_content( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for paginated results.")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=250, strict=True, ge=1)]], Field(description="Number of records per page (max 250).")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort field with optional +/- prefix for direction.")] = None, + fields: Annotated[Optional[List[StrictStr]], Field(description="Specific fields to return.")] = None, + include: Annotated[Optional[List[StrictStr]], Field(description="Related entities to include in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """List Public Organizations + + Retrieve a paginated list of public rescue organizations. + + :param page: Page number for paginated results. + :type page: int + :param limit: Number of records per page (max 250). + :type limit: int + :param sort: Sort field with optional +/- prefix for direction. + :type sort: str + :param fields: Specific fields to return. + :type fields: List[str] + :param include: Related entities to include in the response. + :type include: List[str] + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_public_orgs_serialize( + page=page, + limit=limit, + sort=sort, + fields=fields, + include=include, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrgListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_public_orgs_serialize( + self, + page, + limit, + sort, + fields, + include, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'fields[]': 'multi', + 'include[]': '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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if fields is not None: + + _query_params.append(('fields[]', fields)) + + if include is not None: + + _query_params.append(('include[]', include)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/orgs', + 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/vendor/rescuegroups_client/rescuegroups_client/api/patterns_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/patterns_api.py new file mode 100644 index 0000000..ff9f2ee --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/patterns_api.py @@ -0,0 +1,284 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from rescuegroups_client.models.reference_list_response import ReferenceListResponse + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +class PatternsApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def list_animal_patterns( + 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, + ) -> ReferenceListResponse: + """List Animal Patterns + + Retrieve all animal pattern reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_patterns_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_patterns_with_http_info( + 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, + ) -> ApiResponse[ReferenceListResponse]: + """List Animal Patterns + + Retrieve all animal pattern reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_patterns_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_patterns_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: + """List Animal Patterns + + Retrieve all animal pattern reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_patterns_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ReferenceListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_animal_patterns_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, List[str], List[bytes], List[Tuple[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` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/animals/patterns', + 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/vendor/rescuegroups_client/rescuegroups_client/api/pet_lists_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/pet_lists_api.py new file mode 100644 index 0000000..e638d1b --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/pet_lists_api.py @@ -0,0 +1,598 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from pydantic import Field, StrictStr +from typing import Optional +from typing_extensions import Annotated +from rescuegroups_client.models.pet_list_response import PetListResponse +from rescuegroups_client.models.pet_list_update_request import PetListUpdateRequest + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +class PetListsApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def get_pet_list( + self, + keystring: Annotated[StrictStr, Field(description="The pet list keystring identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PetListResponse: + """Get Pet List + + Retrieve a pet list by its keystring. + + :param keystring: The pet list keystring identifier. (required) + :type keystring: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pet_list_serialize( + keystring=keystring, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PetListResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_pet_list_with_http_info( + self, + keystring: Annotated[StrictStr, Field(description="The pet list keystring identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PetListResponse]: + """Get Pet List + + Retrieve a pet list by its keystring. + + :param keystring: The pet list keystring identifier. (required) + :type keystring: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pet_list_serialize( + keystring=keystring, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PetListResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_pet_list_without_preload_content( + self, + keystring: Annotated[StrictStr, Field(description="The pet list keystring identifier.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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 Pet List + + Retrieve a pet list by its keystring. + + :param keystring: The pet list keystring identifier. (required) + :type keystring: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_pet_list_serialize( + keystring=keystring, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PetListResponse", + '401': "ErrorResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_pet_list_serialize( + self, + keystring, + _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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if keystring is not None: + _path_params['keystring'] = keystring + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/petlists/{keystring}', + 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 update_pet_list( + self, + keystring: Annotated[StrictStr, Field(description="The pet list keystring identifier.")], + pet_list_update_request: Optional[PetListUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PetListResponse: + """Update Pet List + + Update a pet list by its keystring. + + :param keystring: The pet list keystring identifier. (required) + :type keystring: str + :param pet_list_update_request: + :type pet_list_update_request: PetListUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_pet_list_serialize( + keystring=keystring, + pet_list_update_request=pet_list_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PetListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_pet_list_with_http_info( + self, + keystring: Annotated[StrictStr, Field(description="The pet list keystring identifier.")], + pet_list_update_request: Optional[PetListUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PetListResponse]: + """Update Pet List + + Update a pet list by its keystring. + + :param keystring: The pet list keystring identifier. (required) + :type keystring: str + :param pet_list_update_request: + :type pet_list_update_request: PetListUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_pet_list_serialize( + keystring=keystring, + pet_list_update_request=pet_list_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PetListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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 update_pet_list_without_preload_content( + self, + keystring: Annotated[StrictStr, Field(description="The pet list keystring identifier.")], + pet_list_update_request: Optional[PetListUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[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: + """Update Pet List + + Update a pet list by its keystring. + + :param keystring: The pet list keystring identifier. (required) + :type keystring: str + :param pet_list_update_request: + :type pet_list_update_request: PetListUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_pet_list_serialize( + keystring=keystring, + pet_list_update_request=pet_list_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "PetListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_pet_list_serialize( + self, + keystring, + pet_list_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, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if keystring is not None: + _path_params['keystring'] = keystring + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if pet_list_update_request is not None: + _body_params = pet_list_update_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+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/vnd.api+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='/public/petlists/{keystring}', + 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/vendor/rescuegroups_client/rescuegroups_client/api/species_api.py b/vendor/rescuegroups_client/rescuegroups_client/api/species_api.py new file mode 100644 index 0000000..cbb3d80 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api/species_api.py @@ -0,0 +1,284 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 + +from rescuegroups_client.models.species_list_response import SpeciesListResponse + +from rescuegroups_client.api_client import ApiClient, RequestSerialized +from rescuegroups_client.api_response import ApiResponse +from rescuegroups_client.rest import RESTResponseType + + +class SpeciesApi: + """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) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def list_animal_species( + 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, + ) -> SpeciesListResponse: + """List Animal Species + + Retrieve all animal species reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_species_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpeciesListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_species_with_http_info( + 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, + ) -> ApiResponse[SpeciesListResponse]: + """List Animal Species + + Retrieve all animal species reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_species_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpeciesListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_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_animal_species_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: + """List Animal Species + + Retrieve all animal species reference values. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores 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_animal_species_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SpeciesListResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_animal_species_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, List[str], List[bytes], List[Tuple[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` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.api+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'apiKeyAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/public/animals/species', + 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/vendor/rescuegroups_client/rescuegroups_client/api_client.py b/vendor/rescuegroups_client/rescuegroups_client/api_client.py new file mode 100644 index 0000000..e384e51 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/api_client.py @@ -0,0 +1,804 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 decimal +import json +import mimetypes +import os +import re +import tempfile +import uuid + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from rescuegroups_client.configuration import Configuration +from rescuegroups_client.api_response import ApiResponse, T as ApiResponseT +import rescuegroups_client.models +from rescuegroups_client import rest +from rescuegroups_client.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :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 + """ + + 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, + 'decimal': decimal.Decimal, + 'UUID': uuid.UUID, + 'object': object, + } + _pool = None + + 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() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/1.0.0/python' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _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, + 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 + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + 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) + 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( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + 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) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # 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.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return 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 + """ + + 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 + response_text = None + return_data = None + try: + if response_type in ("bytearray", "bytes"): + 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.headers.get('content-type') + if content_type is not None: + 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) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.headers, + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + 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 decimal.Decimal return string representation. + 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. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + 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, uuid.UUID): + return str(obj) + 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, decimal.Decimal): + return str(obj) + elif isinstance(obj, dict): + return { + key: self.sanitize_for_serialization(val) + for key, val in obj.items() + } + + # 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 self.sanitize_for_serialization(obj_dict) + + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + 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 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(rescuegroups_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + 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 k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, 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(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :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) + """ + 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) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(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)) + ) + 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, List[str], List[bytes], Tuple[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 + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + 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: 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 None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + 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. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + 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. + :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_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 + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single 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['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :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.headers.get("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + 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 __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + 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.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/vendor/rescuegroups_client/rescuegroups_client/api_response.py b/vendor/rescuegroups_client/rescuegroups_client/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/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/vendor/rescuegroups_client/rescuegroups_client/configuration.py b/vendor/rescuegroups_client/rescuegroups_client/configuration.py new file mode 100644 index 0000000..4d0313f --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/configuration.py @@ -0,0 +1,638 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import copy +import http.client as httplib +import logging +from logging import FileHandler +import multiprocessing +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self + +import urllib3 + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "apiKeyAuth": APIKeyAuthSetting, + "bearerAuth": BearerAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :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). + 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 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 + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + 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. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: int | urllib3.util.retry.Retry - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. + + :Example: + + API Key Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + cookieAuth: # name for the security scheme + type: apiKey + in: cookie + name: JSESSIONID # cookie name + + You can programmatically set the cookie: + +conf = rescuegroups_client.Configuration( + api_key={'cookieAuth': 'abc123'} + api_key_prefix={'cookieAuth': 'JSESSIONID'} +) + + The following cookie will be added to the HTTP request: + Cookie: JSESSIONID abc123 + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, urllib3.util.retry.Retry]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "https://api.rescuegroups.org/v5" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("rescuegroups_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = verify_ssl + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = cert_file + """client certificate file + """ + self.key_file = key_file + """client key file + """ + self.assert_hostname = assert_hostname + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = tls_server_name + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. None in the constructor is coerced to cpu_count * 5. + """ + + self.proxy = proxy + """Proxy URL + """ + self.proxy_headers = proxy_headers + """Proxy headers + """ + self.safe_chars_for_path_param = safe_chars_for_path_param + """Safe chars for path_param + """ + self.retries = retries + """Retry configuration + """ + # Enable client side validation + self.client_side_validation = client_side_validation + + self.socket_options = socket_options + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = datetime_format + """datetime format + """ + + self.date_format = date_format + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """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) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # 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 httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + + return urllib3.util.make_headers( + basic_auth=username + ':' + password + ).get('authorization') + + def auth_settings(self)-> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + if 'apiKeyAuth' in self.api_key: + auth['apiKeyAuth'] = { + 'type': 'api_key', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_api_key_with_prefix( + 'apiKeyAuth', + ), + } + if self.access_token is not None: + auth['bearerAuth'] = { + 'type': 'bearer', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 5.0.0\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.rescuegroups.org/v5", + 'description': "Production API", + }, + { + 'url': "https://dev1-api.rescuegroups.org/v5", + 'description': "Development/Test API", + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and variable['enum_values'] \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/vendor/rescuegroups_client/rescuegroups_client/exceptions.py b/vendor/rescuegroups_client/rescuegroups_client/exceptions.py new file mode 100644 index 0000000..538cbd7 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/exceptions.py @@ -0,0 +1,218 @@ +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + 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 + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + 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: + 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.headers + + @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) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(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 = "({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: + error_message += "HTTP response data: {0}\n".format(self.data) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/__init__.py b/vendor/rescuegroups_client/rescuegroups_client/models/__init__.py new file mode 100644 index 0000000..68dbf4a --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/__init__.py @@ -0,0 +1,50 @@ +# coding: utf-8 + +# flake8: noqa +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from rescuegroups_client.models.animal import Animal +from rescuegroups_client.models.animal_attributes import AnimalAttributes +from rescuegroups_client.models.animal_list_response import AnimalListResponse +from rescuegroups_client.models.animal_relationships import AnimalRelationships +from rescuegroups_client.models.animal_single_response import AnimalSingleResponse +from rescuegroups_client.models.error_response import ErrorResponse +from rescuegroups_client.models.error_response_errors_inner import ErrorResponseErrorsInner +from rescuegroups_client.models.geo_distance import GeoDistance +from rescuegroups_client.models.org_attributes import OrgAttributes +from rescuegroups_client.models.org_list_response import OrgListResponse +from rescuegroups_client.models.org_single_response import OrgSingleResponse +from rescuegroups_client.models.organization import Organization +from rescuegroups_client.models.pet_list_response import PetListResponse +from rescuegroups_client.models.pet_list_response_data import PetListResponseData +from rescuegroups_client.models.pet_list_response_data_attributes import PetListResponseDataAttributes +from rescuegroups_client.models.pet_list_update_request import PetListUpdateRequest +from rescuegroups_client.models.pet_list_update_request_data import PetListUpdateRequestData +from rescuegroups_client.models.reference_item import ReferenceItem +from rescuegroups_client.models.reference_item_attributes import ReferenceItemAttributes +from rescuegroups_client.models.reference_list_response import ReferenceListResponse +from rescuegroups_client.models.relationship_data import RelationshipData +from rescuegroups_client.models.relationship_data_data import RelationshipDataData +from rescuegroups_client.models.relationship_data_data_one_of import RelationshipDataDataOneOf +from rescuegroups_client.models.response_meta import ResponseMeta +from rescuegroups_client.models.search_filter import SearchFilter +from rescuegroups_client.models.search_request import SearchRequest +from rescuegroups_client.models.search_request_data import SearchRequestData +from rescuegroups_client.models.species_item import SpeciesItem +from rescuegroups_client.models.species_item_attributes import SpeciesItemAttributes +from rescuegroups_client.models.species_list_response import SpeciesListResponse +from rescuegroups_client.models.token_request import TokenRequest +from rescuegroups_client.models.token_response import TokenResponse +from rescuegroups_client.models.token_response_data import TokenResponseData +from rescuegroups_client.models.token_response_data_attributes import TokenResponseDataAttributes + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/animal.py b/vendor/rescuegroups_client/rescuegroups_client/models/animal.py new file mode 100644 index 0000000..c5e9745 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/animal.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.animal_attributes import AnimalAttributes +from rescuegroups_client.models.animal_relationships import AnimalRelationships +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Animal(BaseModel): + """ + Animal + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique animal identifier.") + type: Optional[StrictStr] = None + attributes: Optional[AnimalAttributes] = None + relationships: Optional[AnimalRelationships] = None + __properties: ClassVar[List[str]] = ["id", "type", "attributes", "relationships"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['animals']): + raise ValueError("must be one of enum values ('animals')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Animal from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + # override the default output from pydantic by calling `to_dict()` of relationships + if self.relationships: + _dict['relationships'] = self.relationships.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Animal from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "attributes": AnimalAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None, + "relationships": AnimalRelationships.from_dict(obj["relationships"]) if obj.get("relationships") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/animal_attributes.py b/vendor/rescuegroups_client/rescuegroups_client/models/animal_attributes.py new file mode 100644 index 0000000..7df11ba --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/animal_attributes.py @@ -0,0 +1,151 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from datetime import date +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnimalAttributes(BaseModel): + """ + AnimalAttributes + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Animal name.") + birth_date: Optional[date] = Field(default=None, description="Animal birth date.", alias="birthDate") + sex: Optional[StrictStr] = Field(default=None, description="Animal sex.") + age_group: Optional[StrictStr] = Field(default=None, description="Age group category.", alias="ageGroup") + size_group: Optional[StrictStr] = Field(default=None, description="Size group category.", alias="sizeGroup") + is_adoption_pending: Optional[StrictBool] = Field(default=None, description="Whether adoption is pending.", alias="isAdoptionPending") + is_altered: Optional[StrictBool] = Field(default=None, description="Whether the animal is spayed/neutered.", alias="isAltered") + picture_count: Optional[StrictInt] = Field(default=None, description="Number of pictures available.", alias="pictureCount") + video_count: Optional[StrictInt] = Field(default=None, description="Number of videos available.", alias="videoCount") + adopted_date: Optional[date] = Field(default=None, description="Date the animal was adopted.", alias="adoptedDate") + special_needs_details: Optional[StrictStr] = Field(default=None, description="Description of any special needs.", alias="specialNeedsDetails") + description_text: Optional[StrictStr] = Field(default=None, description="Plain text description of the animal.", alias="descriptionText") + location_citystate: Optional[StrictStr] = Field(default=None, description="City and state where the animal is located.", alias="locationCitystate") + location_state: Optional[StrictStr] = Field(default=None, description="State where the animal is located.", alias="locationState") + location_distance: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Distance from search location.", alias="locationDistance") + rescue_id: Optional[StrictStr] = Field(default=None, description="External rescue ID.", alias="rescueId") + url: Optional[StrictStr] = Field(default=None, description="URL of the animal profile page.") + __properties: ClassVar[List[str]] = ["name", "birthDate", "sex", "ageGroup", "sizeGroup", "isAdoptionPending", "isAltered", "pictureCount", "videoCount", "adoptedDate", "specialNeedsDetails", "descriptionText", "locationCitystate", "locationState", "locationDistance", "rescueId", "url"] + + @field_validator('sex') + def sex_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Male', 'Female', 'Unknown']): + raise ValueError("must be one of enum values ('Male', 'Female', 'Unknown')") + return value + + @field_validator('age_group') + def age_group_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Baby', 'Young', 'Adult', 'Senior']): + raise ValueError("must be one of enum values ('Baby', 'Young', 'Adult', 'Senior')") + return value + + @field_validator('size_group') + def size_group_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['Small', 'Medium', 'Large', 'Extra Large']): + raise ValueError("must be one of enum values ('Small', 'Medium', 'Large', 'Extra Large')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnimalAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnimalAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "birthDate": obj.get("birthDate"), + "sex": obj.get("sex"), + "ageGroup": obj.get("ageGroup"), + "sizeGroup": obj.get("sizeGroup"), + "isAdoptionPending": obj.get("isAdoptionPending"), + "isAltered": obj.get("isAltered"), + "pictureCount": obj.get("pictureCount"), + "videoCount": obj.get("videoCount"), + "adoptedDate": obj.get("adoptedDate"), + "specialNeedsDetails": obj.get("specialNeedsDetails"), + "descriptionText": obj.get("descriptionText"), + "locationCitystate": obj.get("locationCitystate"), + "locationState": obj.get("locationState"), + "locationDistance": obj.get("locationDistance"), + "rescueId": obj.get("rescueId"), + "url": obj.get("url") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/animal_list_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/animal_list_response.py new file mode 100644 index 0000000..2ade2fc --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/animal_list_response.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.animal import Animal +from rescuegroups_client.models.response_meta import ResponseMeta +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnimalListResponse(BaseModel): + """ + AnimalListResponse + """ # noqa: E501 + meta: Optional[ResponseMeta] = None + data: Optional[List[Animal]] = None + included: Optional[List[Dict[str, Any]]] = None + __properties: ClassVar[List[str]] = ["meta", "data", "included"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnimalListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnimalListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "meta": ResponseMeta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": [Animal.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "included": obj.get("included") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/animal_relationships.py b/vendor/rescuegroups_client/rescuegroups_client/models/animal_relationships.py new file mode 100644 index 0000000..0bed961 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/animal_relationships.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.relationship_data import RelationshipData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnimalRelationships(BaseModel): + """ + AnimalRelationships + """ # noqa: E501 + breeds: Optional[RelationshipData] = None + colors: Optional[RelationshipData] = None + patterns: Optional[RelationshipData] = None + species: Optional[RelationshipData] = None + orgs: Optional[RelationshipData] = None + pictures: Optional[RelationshipData] = None + __properties: ClassVar[List[str]] = ["breeds", "colors", "patterns", "species", "orgs", "pictures"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnimalRelationships from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 breeds + if self.breeds: + _dict['breeds'] = self.breeds.to_dict() + # override the default output from pydantic by calling `to_dict()` of colors + if self.colors: + _dict['colors'] = self.colors.to_dict() + # override the default output from pydantic by calling `to_dict()` of patterns + if self.patterns: + _dict['patterns'] = self.patterns.to_dict() + # override the default output from pydantic by calling `to_dict()` of species + if self.species: + _dict['species'] = self.species.to_dict() + # override the default output from pydantic by calling `to_dict()` of orgs + if self.orgs: + _dict['orgs'] = self.orgs.to_dict() + # override the default output from pydantic by calling `to_dict()` of pictures + if self.pictures: + _dict['pictures'] = self.pictures.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnimalRelationships from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "breeds": RelationshipData.from_dict(obj["breeds"]) if obj.get("breeds") is not None else None, + "colors": RelationshipData.from_dict(obj["colors"]) if obj.get("colors") is not None else None, + "patterns": RelationshipData.from_dict(obj["patterns"]) if obj.get("patterns") is not None else None, + "species": RelationshipData.from_dict(obj["species"]) if obj.get("species") is not None else None, + "orgs": RelationshipData.from_dict(obj["orgs"]) if obj.get("orgs") is not None else None, + "pictures": RelationshipData.from_dict(obj["pictures"]) if obj.get("pictures") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/animal_single_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/animal_single_response.py new file mode 100644 index 0000000..7dd55db --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/animal_single_response.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.animal import Animal +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AnimalSingleResponse(BaseModel): + """ + AnimalSingleResponse + """ # noqa: E501 + data: Optional[Animal] = None + included: Optional[List[Dict[str, Any]]] = None + __properties: ClassVar[List[str]] = ["data", "included"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AnimalSingleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AnimalSingleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": Animal.from_dict(obj["data"]) if obj.get("data") is not None else None, + "included": obj.get("included") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/error_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/error_response.py new file mode 100644 index 0000000..9b7ee55 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/error_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.error_response_errors_inner import ErrorResponseErrorsInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ErrorResponse(BaseModel): + """ + ErrorResponse + """ # noqa: E501 + errors: Optional[List[ErrorResponseErrorsInner]] = None + __properties: ClassVar[List[str]] = ["errors"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 errors (list) + _items = [] + if self.errors: + for _item_errors in self.errors: + if _item_errors: + _items.append(_item_errors.to_dict()) + _dict['errors'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "errors": [ErrorResponseErrorsInner.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/error_response_errors_inner.py b/vendor/rescuegroups_client/rescuegroups_client/models/error_response_errors_inner.py new file mode 100644 index 0000000..a4f057f --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/error_response_errors_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ErrorResponseErrorsInner(BaseModel): + """ + ErrorResponseErrorsInner + """ # noqa: E501 + status: Optional[StrictStr] = None + title: Optional[StrictStr] = None + detail: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["status", "title", "detail"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponseErrorsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponseErrorsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "title": obj.get("title"), + "detail": obj.get("detail") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/geo_distance.py b/vendor/rescuegroups_client/rescuegroups_client/models/geo_distance.py new file mode 100644 index 0000000..9da8599 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/geo_distance.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GeoDistance(BaseModel): + """ + GeoDistance + """ # noqa: E501 + postalcode: Optional[StrictStr] = Field(default=None, description="Postal code for distance search.") + lat: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Latitude for coordinate-based search.") + lon: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Longitude for coordinate-based search.") + miles: Optional[StrictInt] = Field(default=None, description="Search radius in miles.") + kilometers: Optional[StrictInt] = Field(default=None, description="Search radius in kilometers.") + __properties: ClassVar[List[str]] = ["postalcode", "lat", "lon", "miles", "kilometers"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GeoDistance from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GeoDistance from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "postalcode": obj.get("postalcode"), + "lat": obj.get("lat"), + "lon": obj.get("lon"), + "miles": obj.get("miles"), + "kilometers": obj.get("kilometers") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/org_attributes.py b/vendor/rescuegroups_client/rescuegroups_client/models/org_attributes.py new file mode 100644 index 0000000..3cdf8db --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/org_attributes.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +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 +from pydantic_core import to_jsonable_python + +class OrgAttributes(BaseModel): + """ + OrgAttributes + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Organization name.") + type: Optional[StrictStr] = Field(default=None, description="Organization type (rescue, shelter, etc.).") + email: Optional[StrictStr] = Field(default=None, description="Contact email address.") + phone: Optional[StrictStr] = Field(default=None, description="Contact phone number.") + street: Optional[StrictStr] = Field(default=None, description="Street address.") + city: Optional[StrictStr] = Field(default=None, description="City.") + state: Optional[StrictStr] = Field(default=None, description="State or province.") + country: Optional[StrictStr] = Field(default=None, description="Country.") + postalcode: Optional[StrictStr] = Field(default=None, description="Postal code.") + url: Optional[StrictStr] = Field(default=None, description="Organization website URL.") + adoption_url: Optional[StrictStr] = Field(default=None, description="Adoption application URL.", alias="adoptionUrl") + about: Optional[StrictStr] = Field(default=None, description="Organization description.") + serve_areas: Optional[StrictStr] = Field(default=None, description="Geographic areas the organization serves.", alias="serveAreas") + facebook_url: Optional[StrictStr] = Field(default=None, description="Facebook page URL.", alias="facebookUrl") + __properties: ClassVar[List[str]] = ["name", "type", "email", "phone", "street", "city", "state", "country", "postalcode", "url", "adoptionUrl", "about", "serveAreas", "facebookUrl"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrgAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrgAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "type": obj.get("type"), + "email": obj.get("email"), + "phone": obj.get("phone"), + "street": obj.get("street"), + "city": obj.get("city"), + "state": obj.get("state"), + "country": obj.get("country"), + "postalcode": obj.get("postalcode"), + "url": obj.get("url"), + "adoptionUrl": obj.get("adoptionUrl"), + "about": obj.get("about"), + "serveAreas": obj.get("serveAreas"), + "facebookUrl": obj.get("facebookUrl") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/org_list_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/org_list_response.py new file mode 100644 index 0000000..08bc215 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/org_list_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.organization import Organization +from rescuegroups_client.models.response_meta import ResponseMeta +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OrgListResponse(BaseModel): + """ + OrgListResponse + """ # noqa: E501 + meta: Optional[ResponseMeta] = None + data: Optional[List[Organization]] = None + __properties: ClassVar[List[str]] = ["meta", "data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrgListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrgListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "meta": ResponseMeta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": [Organization.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/org_single_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/org_single_response.py new file mode 100644 index 0000000..c1bac83 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/org_single_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.organization import Organization +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OrgSingleResponse(BaseModel): + """ + OrgSingleResponse + """ # noqa: E501 + data: Optional[Organization] = None + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrgSingleResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrgSingleResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": Organization.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/organization.py b/vendor/rescuegroups_client/rescuegroups_client/models/organization.py new file mode 100644 index 0000000..e946dd8 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/organization.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.org_attributes import OrgAttributes +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Organization(BaseModel): + """ + Organization + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique organization identifier.") + type: Optional[StrictStr] = None + attributes: Optional[OrgAttributes] = None + __properties: ClassVar[List[str]] = ["id", "type", "attributes"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['orgs']): + raise ValueError("must be one of enum values ('orgs')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Organization from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Organization from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "attributes": OrgAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response.py new file mode 100644 index 0000000..deb5e3b --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.pet_list_response_data import PetListResponseData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PetListResponse(BaseModel): + """ + PetListResponse + """ # noqa: E501 + data: Optional[PetListResponseData] = None + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PetListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PetListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": PetListResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data.py b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data.py new file mode 100644 index 0000000..07ebea9 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.pet_list_response_data_attributes import PetListResponseDataAttributes +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PetListResponseData(BaseModel): + """ + PetListResponseData + """ # noqa: E501 + id: Optional[StrictStr] = None + type: Optional[StrictStr] = None + attributes: Optional[PetListResponseDataAttributes] = None + __properties: ClassVar[List[str]] = ["id", "type", "attributes"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PetListResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PetListResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "attributes": PetListResponseDataAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data_attributes.py b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data_attributes.py new file mode 100644 index 0000000..94b230e --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_response_data_attributes.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PetListResponseDataAttributes(BaseModel): + """ + PetListResponseDataAttributes + """ # noqa: E501 + keystring: Optional[StrictStr] = None + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["keystring", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PetListResponseDataAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PetListResponseDataAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "keystring": obj.get("keystring"), + "name": obj.get("name") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request.py b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request.py new file mode 100644 index 0000000..4adcb56 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.pet_list_update_request_data import PetListUpdateRequestData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PetListUpdateRequest(BaseModel): + """ + PetListUpdateRequest + """ # noqa: E501 + data: Optional[PetListUpdateRequestData] = None + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PetListUpdateRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PetListUpdateRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": PetListUpdateRequestData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request_data.py b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request_data.py new file mode 100644 index 0000000..0804fbe --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/pet_list_update_request_data.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class PetListUpdateRequestData(BaseModel): + """ + PetListUpdateRequestData + """ # noqa: E501 + type: Optional[StrictStr] = None + id: Optional[StrictStr] = None + attributes: Optional[Dict[str, Any]] = None + __properties: ClassVar[List[str]] = ["type", "id", "attributes"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['petlists']): + raise ValueError("must be one of enum values ('petlists')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PetListUpdateRequestData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PetListUpdateRequestData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "id": obj.get("id"), + "attributes": obj.get("attributes") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/reference_item.py b/vendor/rescuegroups_client/rescuegroups_client/models/reference_item.py new file mode 100644 index 0000000..4329427 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/reference_item.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.reference_item_attributes import ReferenceItemAttributes +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ReferenceItem(BaseModel): + """ + ReferenceItem + """ # noqa: E501 + id: Optional[StrictStr] = None + type: Optional[StrictStr] = None + attributes: Optional[ReferenceItemAttributes] = None + __properties: ClassVar[List[str]] = ["id", "type", "attributes"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReferenceItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReferenceItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "attributes": ReferenceItemAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/reference_item_attributes.py b/vendor/rescuegroups_client/rescuegroups_client/models/reference_item_attributes.py new file mode 100644 index 0000000..c845385 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/reference_item_attributes.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ReferenceItemAttributes(BaseModel): + """ + ReferenceItemAttributes + """ # noqa: E501 + name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReferenceItemAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReferenceItemAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/reference_list_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/reference_list_response.py new file mode 100644 index 0000000..0d0ef05 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/reference_list_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.reference_item import ReferenceItem +from rescuegroups_client.models.response_meta import ResponseMeta +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ReferenceListResponse(BaseModel): + """ + ReferenceListResponse + """ # noqa: E501 + meta: Optional[ResponseMeta] = None + data: Optional[List[ReferenceItem]] = None + __properties: ClassVar[List[str]] = ["meta", "data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ReferenceListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 meta + if self.meta: + _dict['meta'] = self.meta.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ReferenceListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "meta": ResponseMeta.from_dict(obj["meta"]) if obj.get("meta") is not None else None, + "data": [ReferenceItem.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data.py b/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data.py new file mode 100644 index 0000000..7b4ea65 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.relationship_data_data import RelationshipDataData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RelationshipData(BaseModel): + """ + RelationshipData + """ # noqa: E501 + data: Optional[RelationshipDataData] = None + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RelationshipData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RelationshipData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": RelationshipDataData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data.py b/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data.py new file mode 100644 index 0000000..6b4ee4f --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from rescuegroups_client.models.relationship_data_data_one_of import RelationshipDataDataOneOf +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +RELATIONSHIPDATADATA_ONE_OF_SCHEMAS = ["List[RelationshipDataDataOneOf]", "RelationshipDataDataOneOf"] + +class RelationshipDataData(BaseModel): + """ + RelationshipDataData + """ + # data type: RelationshipDataDataOneOf + oneof_schema_1_validator: Optional[RelationshipDataDataOneOf] = None + # data type: List[RelationshipDataDataOneOf] + oneof_schema_2_validator: Optional[List[RelationshipDataDataOneOf]] = None + actual_instance: Optional[Union[List[RelationshipDataDataOneOf], RelationshipDataDataOneOf]] = None + one_of_schemas: Set[str] = { "List[RelationshipDataDataOneOf]", "RelationshipDataDataOneOf" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = RelationshipDataData.model_construct() + error_messages = [] + match = 0 + # validate data type: RelationshipDataDataOneOf + if not isinstance(v, RelationshipDataDataOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `RelationshipDataDataOneOf`") + else: + match += 1 + # validate data type: List[RelationshipDataDataOneOf] + try: + instance.oneof_schema_2_validator = v + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in RelationshipDataData with oneOf schemas: List[RelationshipDataDataOneOf], RelationshipDataDataOneOf. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in RelationshipDataData with oneOf schemas: List[RelationshipDataDataOneOf], RelationshipDataDataOneOf. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into RelationshipDataDataOneOf + try: + instance.actual_instance = RelationshipDataDataOneOf.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into List[RelationshipDataDataOneOf] + try: + # validation + instance.oneof_schema_2_validator = json.loads(json_str) + # assign value to actual_instance + instance.actual_instance = instance.oneof_schema_2_validator + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into RelationshipDataData with oneOf schemas: List[RelationshipDataDataOneOf], RelationshipDataDataOneOf. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into RelationshipDataData with oneOf schemas: List[RelationshipDataDataOneOf], RelationshipDataDataOneOf. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], List[RelationshipDataDataOneOf], RelationshipDataDataOneOf]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data_one_of.py b/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data_one_of.py new file mode 100644 index 0000000..8f616d1 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/relationship_data_data_one_of.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RelationshipDataDataOneOf(BaseModel): + """ + RelationshipDataDataOneOf + """ # noqa: E501 + type: Optional[StrictStr] = None + id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type", "id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RelationshipDataDataOneOf from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RelationshipDataDataOneOf from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "id": obj.get("id") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/response_meta.py b/vendor/rescuegroups_client/rescuegroups_client/models/response_meta.py new file mode 100644 index 0000000..5a5bc5d --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/response_meta.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ResponseMeta(BaseModel): + """ + ResponseMeta + """ # noqa: E501 + count: Optional[StrictInt] = Field(default=None, description="Total number of matching records.") + page_count: Optional[StrictInt] = Field(default=None, description="Total number of pages.", alias="pageCount") + transaction_id: Optional[StrictStr] = Field(default=None, description="Unique transaction identifier for support requests.", alias="transactionId") + __properties: ClassVar[List[str]] = ["count", "pageCount", "transactionId"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResponseMeta from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResponseMeta from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "count": obj.get("count"), + "pageCount": obj.get("pageCount"), + "transactionId": obj.get("transactionId") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/search_filter.py b/vendor/rescuegroups_client/rescuegroups_client/models/search_filter.py new file mode 100644 index 0000000..49b24c2 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/search_filter.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchFilter(BaseModel): + """ + SearchFilter + """ # noqa: E501 + field_name: StrictStr = Field(description="Field name to filter on.", alias="fieldName") + operation: StrictStr = Field(description="Filter operation.") + criteria: Optional[StrictStr] = Field(default=None, description="Filter value or special criteria (e.g., rg:contactID, rg:today).") + __properties: ClassVar[List[str]] = ["fieldName", "operation", "criteria"] + + @field_validator('operation') + def operation_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['equal', 'notequal', 'lessthan', 'greaterthan', 'contains', 'notcontains', 'blank', 'notblank', 'startswith', 'endswith']): + raise ValueError("must be one of enum values ('equal', 'notequal', 'lessthan', 'greaterthan', 'contains', 'notcontains', 'blank', 'notblank', 'startswith', 'endswith')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchFilter from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchFilter from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fieldName": obj.get("fieldName"), + "operation": obj.get("operation"), + "criteria": obj.get("criteria") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/search_request.py b/vendor/rescuegroups_client/rescuegroups_client/models/search_request.py new file mode 100644 index 0000000..75e25cf --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/search_request.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.search_request_data import SearchRequestData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchRequest(BaseModel): + """ + SearchRequest + """ # noqa: E501 + data: Optional[SearchRequestData] = None + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": SearchRequestData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/search_request_data.py b/vendor/rescuegroups_client/rescuegroups_client/models/search_request_data.py new file mode 100644 index 0000000..f483f53 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/search_request_data.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.geo_distance import GeoDistance +from rescuegroups_client.models.search_filter import SearchFilter +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SearchRequestData(BaseModel): + """ + SearchRequestData + """ # noqa: E501 + filters: Optional[List[SearchFilter]] = None + filter_processing: Optional[StrictStr] = Field(default=None, description="Boolean expression for filter combination.", alias="filterProcessing") + geodistance: Optional[GeoDistance] = None + __properties: ClassVar[List[str]] = ["filters", "filterProcessing", "geodistance"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SearchRequestData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 filters (list) + _items = [] + if self.filters: + for _item_filters in self.filters: + if _item_filters: + _items.append(_item_filters.to_dict()) + _dict['filters'] = _items + # override the default output from pydantic by calling `to_dict()` of geodistance + if self.geodistance: + _dict['geodistance'] = self.geodistance.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SearchRequestData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "filters": [SearchFilter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None, + "filterProcessing": obj.get("filterProcessing"), + "geodistance": GeoDistance.from_dict(obj["geodistance"]) if obj.get("geodistance") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/species_item.py b/vendor/rescuegroups_client/rescuegroups_client/models/species_item.py new file mode 100644 index 0000000..76b9205 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/species_item.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.species_item_attributes import SpeciesItemAttributes +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SpeciesItem(BaseModel): + """ + SpeciesItem + """ # noqa: E501 + id: Optional[StrictStr] = None + type: Optional[StrictStr] = None + attributes: Optional[SpeciesItemAttributes] = None + __properties: ClassVar[List[str]] = ["id", "type", "attributes"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpeciesItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpeciesItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "attributes": SpeciesItemAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/species_item_attributes.py b/vendor/rescuegroups_client/rescuegroups_client/models/species_item_attributes.py new file mode 100644 index 0000000..fd45a26 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/species_item_attributes.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +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 +from pydantic_core import to_jsonable_python + +class SpeciesItemAttributes(BaseModel): + """ + SpeciesItemAttributes + """ # noqa: E501 + singular: Optional[StrictStr] = Field(default=None, description="Singular species name.") + plural: Optional[StrictStr] = Field(default=None, description="Plural species name.") + young_singular: Optional[StrictStr] = Field(default=None, description="Singular name for young of the species.", alias="youngSingular") + young_plural: Optional[StrictStr] = Field(default=None, description="Plural name for young of the species.", alias="youngPlural") + __properties: ClassVar[List[str]] = ["singular", "plural", "youngSingular", "youngPlural"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpeciesItemAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpeciesItemAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "singular": obj.get("singular"), + "plural": obj.get("plural"), + "youngSingular": obj.get("youngSingular"), + "youngPlural": obj.get("youngPlural") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/species_list_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/species_list_response.py new file mode 100644 index 0000000..60116ff --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/species_list_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.species_item import SpeciesItem +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class SpeciesListResponse(BaseModel): + """ + SpeciesListResponse + """ # noqa: E501 + data: Optional[List[SpeciesItem]] = None + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpeciesListResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpeciesListResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [SpeciesItem.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/token_request.py b/vendor/rescuegroups_client/rescuegroups_client/models/token_request.py new file mode 100644 index 0000000..3073d38 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/token_request.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TokenRequest(BaseModel): + """ + TokenRequest + """ # noqa: E501 + username: StrictStr = Field(description="RescueGroups.org account username.") + password: StrictStr = Field(description="RescueGroups.org account password.") + __properties: ClassVar[List[str]] = ["username", "password"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TokenRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TokenRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "username": obj.get("username"), + "password": obj.get("password") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/token_response.py b/vendor/rescuegroups_client/rescuegroups_client/models/token_response.py new file mode 100644 index 0000000..7403882 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/token_response.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.token_response_data import TokenResponseData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TokenResponse(BaseModel): + """ + TokenResponse + """ # noqa: E501 + data: Optional[TokenResponseData] = None + __properties: ClassVar[List[str]] = ["data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TokenResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TokenResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": TokenResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/token_response_data.py b/vendor/rescuegroups_client/rescuegroups_client/models/token_response_data.py new file mode 100644 index 0000000..c2a075d --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/token_response_data.py @@ -0,0 +1,94 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from rescuegroups_client.models.token_response_data_attributes import TokenResponseDataAttributes +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TokenResponseData(BaseModel): + """ + TokenResponseData + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Token ID.") + attributes: Optional[TokenResponseDataAttributes] = None + __properties: ClassVar[List[str]] = ["id", "attributes"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TokenResponseData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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 attributes + if self.attributes: + _dict['attributes'] = self.attributes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TokenResponseData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "attributes": TokenResponseDataAttributes.from_dict(obj["attributes"]) if obj.get("attributes") is not None else None + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/models/token_response_data_attributes.py b/vendor/rescuegroups_client/rescuegroups_client/models/token_response_data_attributes.py new file mode 100644 index 0000000..9526412 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/models/token_response_data_attributes.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + 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 json + +from datetime import datetime +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 +from pydantic_core import to_jsonable_python + +class TokenResponseDataAttributes(BaseModel): + """ + TokenResponseDataAttributes + """ # noqa: E501 + token: Optional[StrictStr] = Field(default=None, description="Bearer authentication token.") + expiration: Optional[datetime] = Field(default=None, description="Token expiration timestamp.") + __properties: ClassVar[List[str]] = ["token", "expiration"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=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""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TokenResponseDataAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `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, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TokenResponseDataAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "token": obj.get("token"), + "expiration": obj.get("expiration") + }) + return _obj + + diff --git a/vendor/rescuegroups_client/rescuegroups_client/py.typed b/vendor/rescuegroups_client/rescuegroups_client/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/vendor/rescuegroups_client/rescuegroups_client/rest.py b/vendor/rescuegroups_client/rescuegroups_client/rest.py new file mode 100644 index 0000000..0fa0ae3 --- /dev/null +++ b/vendor/rescuegroups_client/rescuegroups_client/rest.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +""" + RescueGroups.org API + + The RescueGroups.org REST API v5 provides access to adoptable pet data including animals, organizations, breeds, species, colors, and patterns. It supports advanced search with geodistance filtering, pagination, and relationship inclusion. API key authorization is used for public data access; bearer token authorization is used for private/write operations. + + The version of the OpenAPI document: 5.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl + +import urllib3 + +from rescuegroups_client.exceptions import ApiException, ApiValueError + +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse + + +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) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + @property + def headers(self): + """Returns a dictionary of response headers.""" + return self.response.headers + + def getheaders(self): + """Returns a dictionary of the response headers; use ``headers`` instead.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header; use ``headers.get()`` instead.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + 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 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } + if configuration.assert_hostname is not None: + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) + + if configuration.retries is not None: + 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: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize + + # https pool manager + 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(**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 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 _request_timeout: timeout setting 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' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, float)): + timeout = urllib3.Timeout(total=_request_timeout) + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): + timeout = urllib3.Timeout( + connect=_request_timeout[0], + read=_request_timeout[1] + ) + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + + # 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, + body=request_body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': + r = self.pool_manager.request( + method, + url, + fields=post_params, + encode_multipart=False, + timeout=timeout, + 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, + fields=post_params, + encode_multipart=True, + timeout=timeout, + 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. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, + body=request_body, + preload_content=False, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) + except urllib3.exceptions.SSLError as e: + msg = "\n".join([type(e).__name__, str(e)]) + raise ApiException(status=0, reason=msg) + + return RESTResponse(r) From bfa132a7655c9c832e4642be5a5cb0f828e5e772 Mon Sep 17 00:00:00 2001 From: Sean Moss Date: Tue, 23 Jun 2026 20:48:20 -0400 Subject: [PATCH 2/3] Add initial vendor files for RescueGroups.org API client This commit introduces two new files: - `vendor/__init__.py`: Initializes the vendor package. - `vendor/rescuegroups_client/__init__.py`: Initializes the generated RescueGroups.org API client package. These files lay the groundwork for integrating the new API client into the project. --- vendor/__init__.py | 0 vendor/rescuegroups_client/__init__.py | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 vendor/__init__.py create mode 100644 vendor/rescuegroups_client/__init__.py diff --git a/vendor/__init__.py b/vendor/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vendor/rescuegroups_client/__init__.py b/vendor/rescuegroups_client/__init__.py new file mode 100644 index 0000000..e69de29 From e810189f7444bcb433f53f40909443c6364fd9da Mon Sep 17 00:00:00 2001 From: Sean Moss Date: Tue, 23 Jun 2026 20:56:59 -0400 Subject: [PATCH 3/3] Add pydantic --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 25519fc..41f9751 100644 --- a/requirements.txt +++ b/requirements.txt @@ -31,6 +31,7 @@ pip-tools==7.5.3 pluggy==1.6.0 plyer==2.1.0 protobuf==3.20.3 +pydantic==2.13.4 Pygments==2.20.0 pyproject_hooks==1.2.0 PySocks==1.7.1