Skip to content

Commit

Permalink
Refactor calendar settings service
Browse files Browse the repository at this point in the history
  • Loading branch information
astrada committed Dec 19, 2011
1 parent b390e06 commit 80f7c5e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
14 changes: 11 additions & 3 deletions src/gapi/gapiCalendarService.ml
Expand Up @@ -652,7 +652,15 @@ struct
end

module SettingsResource =
GapiService.Make
(SettingResourceConf)
(GapiService.StandardParameters)
struct
module Service =
GapiService.Make(SettingResourceConf)(GapiService.StandardParameters)

let list ?url ?etag ?parameters session =
Service.list ?url ?etag ?parameters session

let get ?url ?parameters ~setting session =
Service.get ?url ?parameters setting session

end

17 changes: 6 additions & 11 deletions src/gapi/gapiCalendarService.mli
Expand Up @@ -564,9 +564,8 @@ module FreebusyResource :
sig
(** Returns free/busy information for a set of calendars.
Usage: [query ?url parameters session] where [parameters] specifies the request parameters (e.g.: target calendar IDs), and [session] is the current session.
@param url Service endpoint base URL (defaults to ["https://www.googleapis.com/calendar/v3/freeBusy"]).
@param parameters Optional standard parameters..
*)
val query :
?url:string ->
Expand All @@ -582,31 +581,27 @@ module SettingsResource :
sig
(** Returns all user settings for the authenticated user.
Usage: [list ?url ?etag ?parameters session] where [session] is the current session.
@param url Service endpoint base URL (defaults to ["https://www.googleapis.com/calendar/v3/users/me/settings"]).
@param etag optional ETag.
@param parameters standard parameters.
@param etag Optional ETag.
@param parameters Optional standard parameters..
*)
val list :
?url:string ->
?etag:string ->
?parameters:GapiService.StandardParameters.t ->
?container_id:string ->
GapiConversation.Session.t ->
(GapiCalendar.Settings.t * GapiConversation.Session.t)

(** Returns a single user setting.
Usage: [get ?url setting_id session] where [setting_id] is the name of the user setting, and [session] is the current session.
@param url Service endpoint base URL (defaults to ["https://www.googleapis.com/calendar/v3/users/me/settings"]).
@param parameters Optional standard parameters..
@param setting Name of the user setting.
*)
val get :
?url:string ->
?parameters:GapiService.StandardParameters.t ->
?container_id:string ->
string ->
setting:string ->
GapiConversation.Session.t ->
(GapiCalendar.Setting.t * GapiConversation.Session.t)

Expand Down
2 changes: 1 addition & 1 deletion src/test/testCalendarServiceV3.ml
Expand Up @@ -168,7 +168,7 @@ let test_settings_get () =
(fun session ->
let (setting, _) =
GapiCalendarService.SettingsResource.get
"country"
~setting:"country"
session
in
assert_equal
Expand Down

0 comments on commit 80f7c5e

Please sign in to comment.