From 23618ba964a59f0849626116c6196f569927fbe2 Mon Sep 17 00:00:00 2001 From: Subash Pradhan Date: Thu, 24 Oct 2024 14:03:30 +0200 Subject: [PATCH] Adding configurations, availability, sessions, bookings endpoint under Scheduler to match with other SDKs architecture --- lib/nylas/client.rb | 32 ++++-------------------- lib/nylas/resources/scheduling.rb | 41 +++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 27 deletions(-) create mode 100644 lib/nylas/resources/scheduling.rb diff --git a/lib/nylas/client.rb b/lib/nylas/client.rb index 05c2bfb5..c122cba2 100644 --- a/lib/nylas/client.rb +++ b/lib/nylas/client.rb @@ -8,6 +8,7 @@ require_relative "resources/webhooks" require_relative "resources/applications" require_relative "resources/folders" +require_relative "resources/scheduling" require_relative "resources/configurations" require_relative "resources/sessions" require_relative "resources/availability" @@ -122,33 +123,10 @@ def webhooks Webhooks.new(self) end - # The configuration resources for your Nylas application. - # - # @return [Nylas::Scheduling::Confiugrations] Scheduling configuration resources - # for your Nylas application. - def configurations - Configurations.new(self) - end - - # The Booking resources for your Nylas application. - # - # @return [Nylas::Scheduling::Bookings] Scheduling booking resources for your Nylas application. - def bookings - Bookings.new(self) - end - - # The Session resources for your Nylas application. - # - # @return [Nylas::Scheduling::Sessions] Scheduling session resources for your Nylas application. - def sessions - Sessions.new(self) - end - - # The availability resources for your Nylas application. - # - # @return [Nylas::Scheduling::Availability] Scheduling availability resources for your Nylas application. - def availability - Availability.new(self) + # The Scheduler resources for your Nylas application. + # @return [Nylas::Scheduler] Scheduler resources for your Nylas application. + def scheduler + Scheduler.new(self) end end end diff --git a/lib/nylas/resources/scheduling.rb b/lib/nylas/resources/scheduling.rb new file mode 100644 index 00000000..553fb013 --- /dev/null +++ b/lib/nylas/resources/scheduling.rb @@ -0,0 +1,41 @@ +require_relative './configurations' +require_relative './sessions' +require_relative './bookings' +require_relative './availability' + +module Nylas + class Scheduler + def initialize(api_client) + @api_client = api_client + @configurations = Configurations.new(@api_client) + @bookings = Bookings.new(@api_client) + @sessions = Sessions.new(@api_client) + @availability = Availability.new(@api_client) + end + + # The configuration resources for your Nylas application. + # @return [Nylas::Scheduler::Confiugrations] Scheduler configuration resources + # for your Nylas application. + def configurations + @configurations + end + + # The Session resources for your Nylas application. + # @return [Nylas::Scheduler::Sessions] Scheduler session resources for your Nylas application. + def sessions + @sessions + end + + # The Booking resources for your Nylas application. + # @return [Nylas::Scheduler::Bookings] Scheduler booking resources for your Nylas application. + def bookings + @bookings + end + + # The availability resources for your Nylas application. + # @return [Nylas::Scheduler::Availability] Scheduling availability resources for your Nylas application. + def availability + @availability + end + end +end