Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
88 changes: 88 additions & 0 deletions scripts/generate_rescuegroups_client.sh
Original file line number Diff line number Diff line change
@@ -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" <<EOF
# rescuegroups_client — generated

**Do not edit by hand.** Regenerate via:

\`\`\`bash
./scripts/generate_rescuegroups_client.sh
\`\`\`

Generator: openapi-generator-cli v7.23.0
Source: https://github.com/${SPEC_OWNER}/${SPEC_REPO}
Last pinned to spec commit: \`${SHA}\`
EOF

echo "Done."
Empty file added vendor/__init__.py
Empty file.
66 changes: 66 additions & 0 deletions vendor/rescuegroups_client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Ipython Notebook
.ipynb_checkpoints
Empty file.
32 changes: 32 additions & 0 deletions vendor/rescuegroups_client/docs/Animal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Animal


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | Unique animal identifier. | [optional]
**type** | **str** | | [optional]
**attributes** | [**AnimalAttributes**](AnimalAttributes.md) | | [optional]
**relationships** | [**AnimalRelationships**](AnimalRelationships.md) | | [optional]

## Example

```python
from rescuegroups_client.models.animal import Animal

# TODO update the JSON string below
json = "{}"
# create an instance of Animal from a JSON string
animal_instance = Animal.from_json(json)
# print the JSON string representation of the object
print(Animal.to_json())

# convert the object into a dict
animal_dict = animal_instance.to_dict()
# create an instance of Animal from a dict
animal_from_dict = Animal.from_dict(animal_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)


45 changes: 45 additions & 0 deletions vendor/rescuegroups_client/docs/AnimalAttributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# AnimalAttributes


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | Animal name. | [optional]
**birth_date** | **date** | Animal birth date. | [optional]
**sex** | **str** | Animal sex. | [optional]
**age_group** | **str** | Age group category. | [optional]
**size_group** | **str** | Size group category. | [optional]
**is_adoption_pending** | **bool** | Whether adoption is pending. | [optional]
**is_altered** | **bool** | Whether the animal is spayed/neutered. | [optional]
**picture_count** | **int** | Number of pictures available. | [optional]
**video_count** | **int** | Number of videos available. | [optional]
**adopted_date** | **date** | Date the animal was adopted. | [optional]
**special_needs_details** | **str** | Description of any special needs. | [optional]
**description_text** | **str** | Plain text description of the animal. | [optional]
**location_citystate** | **str** | City and state where the animal is located. | [optional]
**location_state** | **str** | State where the animal is located. | [optional]
**location_distance** | **float** | Distance from search location. | [optional]
**rescue_id** | **str** | External rescue ID. | [optional]
**url** | **str** | URL of the animal profile page. | [optional]

## Example

```python
from rescuegroups_client.models.animal_attributes import AnimalAttributes

# TODO update the JSON string below
json = "{}"
# create an instance of AnimalAttributes from a JSON string
animal_attributes_instance = AnimalAttributes.from_json(json)
# print the JSON string representation of the object
print(AnimalAttributes.to_json())

# convert the object into a dict
animal_attributes_dict = animal_attributes_instance.to_dict()
# create an instance of AnimalAttributes from a dict
animal_attributes_from_dict = AnimalAttributes.from_dict(animal_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)


31 changes: 31 additions & 0 deletions vendor/rescuegroups_client/docs/AnimalListResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# AnimalListResponse


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**meta** | [**ResponseMeta**](ResponseMeta.md) | | [optional]
**data** | [**List[Animal]**](Animal.md) | | [optional]
**included** | **List[object]** | | [optional]

## Example

```python
from rescuegroups_client.models.animal_list_response import AnimalListResponse

# TODO update the JSON string below
json = "{}"
# create an instance of AnimalListResponse from a JSON string
animal_list_response_instance = AnimalListResponse.from_json(json)
# print the JSON string representation of the object
print(AnimalListResponse.to_json())

# convert the object into a dict
animal_list_response_dict = animal_list_response_instance.to_dict()
# create an instance of AnimalListResponse from a dict
animal_list_response_from_dict = AnimalListResponse.from_dict(animal_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)


34 changes: 34 additions & 0 deletions vendor/rescuegroups_client/docs/AnimalRelationships.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# AnimalRelationships


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**breeds** | [**RelationshipData**](RelationshipData.md) | | [optional]
**colors** | [**RelationshipData**](RelationshipData.md) | | [optional]
**patterns** | [**RelationshipData**](RelationshipData.md) | | [optional]
**species** | [**RelationshipData**](RelationshipData.md) | | [optional]
**orgs** | [**RelationshipData**](RelationshipData.md) | | [optional]
**pictures** | [**RelationshipData**](RelationshipData.md) | | [optional]

## Example

```python
from rescuegroups_client.models.animal_relationships import AnimalRelationships

# TODO update the JSON string below
json = "{}"
# create an instance of AnimalRelationships from a JSON string
animal_relationships_instance = AnimalRelationships.from_json(json)
# print the JSON string representation of the object
print(AnimalRelationships.to_json())

# convert the object into a dict
animal_relationships_dict = animal_relationships_instance.to_dict()
# create an instance of AnimalRelationships from a dict
animal_relationships_from_dict = AnimalRelationships.from_dict(animal_relationships_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)


30 changes: 30 additions & 0 deletions vendor/rescuegroups_client/docs/AnimalSingleResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# AnimalSingleResponse


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [**Animal**](Animal.md) | | [optional]
**included** | **List[object]** | | [optional]

## Example

```python
from rescuegroups_client.models.animal_single_response import AnimalSingleResponse

# TODO update the JSON string below
json = "{}"
# create an instance of AnimalSingleResponse from a JSON string
animal_single_response_instance = AnimalSingleResponse.from_json(json)
# print the JSON string representation of the object
print(AnimalSingleResponse.to_json())

# convert the object into a dict
animal_single_response_dict = animal_single_response_instance.to_dict()
# create an instance of AnimalSingleResponse from a dict
animal_single_response_from_dict = AnimalSingleResponse.from_dict(animal_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)


Loading