Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passenger API | Ticketing #379

Merged
merged 4 commits into from May 8, 2024
Merged

Passenger API | Ticketing #379

merged 4 commits into from May 8, 2024

Conversation

phylor
Copy link
Collaborator

@phylor phylor commented May 8, 2024

This adds all model and endpoints related to ticketing to the passenger API.

There are also two additional changes:

  • Add support for namespaced models to the passenger API. Currently all model classes of the passenger API are located in Ioki::Model::Passenger. For Ticketing it makes sense to namespace all ticketing models in Ioki::Model::Passenger::Ticketing. Such subfolders were not yet loaded though (in lib/ioki/model.rb).
  • Allow POST requests with an empty body. You still have to pass nil to the method though: passenger_client.create_my_model('my_id', nil)

Copy link
Contributor

@tom-ioki tom-ioki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍 Just a small question.

lib/ioki/apis/endpoints/create.rb Outdated Show resolved Hide resolved
lib/ioki/apis/passenger_api.rb Outdated Show resolved Hide resolved
The `nil` approach changes the behavior when supplying a model you might
not know that it's `nil`. Before it raised, the new behavior is that it no
longer raises, but sends an empty body to the API.

`outgoing_model_class` is an optional argument which defaults to `nil`.
We therefore cannot use `nil` to specify that the body should be empty. We
use `:empty` instead to denote that the request should send an empty body.
@phylor phylor merged commit af550a3 into main May 8, 2024
2 checks passed
@phylor phylor deleted the passenger-api-ticketing branch May 8, 2024 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants