Releases: gadventures/gapipy
Releases · gadventures/gapipy
Build Release 2.42.0 (2026-02-19)
What's Changed
- Add
date_last_modifiedfield toBookingCompanyresource by @sarahnightingale in #149
New Contributors
- @sarahnightingale made their first contribution in #149
Full Changelog: 2.41.0...2.42.0
Build Release 2.41.0 (2025-12-02)
What's Changed
- Add optional
timeoutparameter to requests by @openbracketret in #146
New Contributors
- @openbracketret made their first contribution in #146
Full Changelog: 2.40.0...2.41.0
Build Release 2.40.0 (2025-11-06)
What's Changed
- Field updates to the AcommodationDossier and ActivityDossier resources by @ammaar-gadv in #145
- Breaking changes to dossier resources
- Removed the
costsandhas_costsfields from bothAccommodationDossierandActivityDossierresources. - Moved the
featuresfield inAccommodationDossierfrom an as-is field to a model-collection-field, now referencing theDossierFeatureresource. - Exposed the
primary_countryfield on theActivityDossierresource, referencing theCountryresource.
- Removed the
- Breaking changes to dossier resources
- [FIX: 110799b] revert the removal of
deepcopy(data)in_fill_fieldsby @ammaar-gadv in #147
New Contributors
- @ammaar-gadv made their first contribution in #145
Full Changelog: 2.38.0...2.40.0
Release 2.38.0 (2025-05-29)
What's Changed
- Adds "global_http_headers" config to "Client" ... by @jonprindiville in #126
- Relationships fields for Tour Dossiers & Departures by @marz619 in #128
- DjangoCache Implementation by @mverteuil in #129
- Add pre-configured settings protection by @mverteuil in #130
- restore old fetch() behaviour by @abrahamvarricatt in #131
- introduce new constants.py file by @abrahamvarricatt in #132
- Add default timeout support to DjangoCache by @mverteuil in #133
- Make future requirement flexible by @mverteuil in #134
- Add Departure.travel_ready_policy model field by @marz619 in #135
- Detect an empty payload during a partial update... by @marz619 in #137
- Run unit tests GH Actions with tox by @jonprindiville in #139
- Add "contact_us" model field to the AgencyChain resource by @marz619 in #141
- Remove unsupported Python versions from testing matrix by @rafik-gadventures in #144
- Add new resources for "room upgrade" and "regional connector" products by @rafik-gadventures in #143
New Contributors
- @mverteuil made their first contribution in #129
- @rafik-gadventures made their first contribution in #144
Full Changelog: 2.26.2...2.38.0
Release 2.26.2 (2020-04-20)
Fixes 2.26.1
-
#125 - Fix for Issue #113 & #123 release in
2.26.1from gapipy import Client g = Client(application_key="MY_API_KEY") g.tour_dossiers.get(24309).departures.count() # AttributeError: 'tuple' object has no attribute 'uri'
Removes the _set_resource_collection_field override from the TourDossier resource. This behaviour has been deprecated.
Release 2.26.1 (2020-04-20)
Fixes + Additions to 2.26.0
- #123 - Fix for Issue #113
- Calls to
APIRequestor.list_rawwill use its initialised parameters, unless the URI provides its own.
- Calls to
- #124 - Add the ability to define the
max_retriesvalues on the requestor.- New
envvalueGAPI_CLIENT_MAX_RETRIES. - The default value will be
0, and if provided will override theretryvalue on therequests.Session. - This change will also always initialize a
requests.Sessionvalue on initialisation of thegapipy.Client.
- New
- edc8d9b - Add
variation_idfield to theImageresource. - bd35531 - Update the
ActivityDossierandAccommodationDossierresources.- Remove the
is_prepaidfield. - Adds the
has_costsfield.
- Remove the
Release 2.26.0 (2020-04-14)
BREAKING CHANGES
- The
Query.filtermethod will return a clone/copy of itself. This will
preserve the state offilterson the original Query object. - The
Query.allmethod will not clear the filters after returning. - The
Query.allmethod will return aTypeErrorif a type other than
anintis passed to thelimitargument. - The
Query.countmethod will not clear the filters after returning. - see: #121
- The
AgencyChain.agenciesfield will be returned as a list of Resource objects - see: f34afd5
Release 2.24.0 (2019-11-05)
- Add missing/new fields to resources
- Accommodation Dossier: categories, suggested_dossiers, visited_countries, and visited_cities
- Activity Dossier: suggested_dossiers, visited_countries, and visited_cities
- Departure: local_payments
- Itinerary: publish_state
- See #117
- Add
continentandplacereferences to theCountriesresource- See #115
- Accept
additional_headersoptional kwarg oncreate- See #114
Release 2.20.1 (2019-02-20) :: HISTORY.rst fixes
See Release 2.20.0 for details
Release 2.20.0 (2019-02-20)
commits & PRs
changes
-
Defines two new private resources:
-
RequirementSet: returned as a list viabooking/{id}/requirementsor queryable as individual objects- encapsulates a series of
Requirements - listable via
api.bookings.get(123456).requirements
- encapsulates a series of
-
Requirement: found as individual components within aRequirementSet- not listable ... but can be found via a
RequirementSet::requirementslist
- not listable ... but can be found via a
-
-
Moves the
Checkinresource into thebookingpackage -
Modifies
Query.allbehaviour:- It will attempt to use an
hrefvalue when available - This is done as
bookings/{id}/requirementsactually points
to a list ofRequirementSets
- It will attempt to use an
Requirements power G Adventures' Good-To-Go platform
Usage:
from gapipy import Client
api = Client(application_key='your_application_key')
# get a booking
booking = api.bookings.get(123456) # <Booking: 123456>
# get the booking requirement sets
booking_requirements = list(booking.requirements) # [<RequirementSet: AaBbCcDd (stub)>, ...]
# get the set of requirements for one of those sets, if any
some_requirements = booking_requirements[0].requirements # [<Requirement: AbcDe12345XyZ (stub)>, ...]
# look at a single requirement
requirement = booking_requirements[0].requirements[0] # <Requirement: AbcDe12345XyZ (stub)>
# get some requirement set directly
requirement_set = api.requirement_sets.get('AaBbCcDd')
# get some requirement directly
requirement = api.requirements.get('AbcDe12345XyZ')
# print out the id, code, name for all requirements for all requirement_sets for some booking
for rs in booking.requirements:
print(rs.id, rs.code, rs.name)
for r in rs.requirements:
print('\t', r.id, r.code, r.name)