Permalink
Browse files

Update generated modules (Drive V2)

  • Loading branch information...
1 parent 661f9fa commit 591447670fa9f762f1400c236c117c444a4db7dc @astrada committed Sep 24, 2013
Showing with 429 additions and 149 deletions.
  1. +221 −98 src/gapi/gapiDriveV2Model.ml
  2. +87 −47 src/gapi/gapiDriveV2Model.mli
  3. +91 −3 src/gapi/gapiDriveV2Service.ml
  4. +30 −1 src/gapi/gapiDriveV2Service.mli
View
319 src/gapi/gapiDriveV2Model.ml
@@ -1576,6 +1576,60 @@ struct
end
+module PermissionId =
+struct
+ type t = {
+ id : string;
+ kind : string;
+
+ }
+
+ let id = {
+ GapiLens.get = (fun x -> x.id);
+ GapiLens.set = (fun v x -> { x with id = v });
+ }
+ let kind = {
+ GapiLens.get = (fun x -> x.kind);
+ GapiLens.set = (fun v x -> { x with kind = v });
+ }
+
+ let empty = {
+ id = "";
+ kind = "";
+
+ }
+
+ let rec render_content x =
+ [
+ GapiJson.render_string_value "id" x.id;
+ GapiJson.render_string_value "kind" x.kind;
+
+ ]
+ and render x =
+ GapiJson.render_object "" (render_content x)
+
+ let rec parse x = function
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "id"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with id = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "kind"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with kind = v }
+ | GapiCore.AnnotatedTree.Node
+ ({ GapiJson.name = ""; data_type = GapiJson.Object },
+ cs) ->
+ GapiJson.parse_children parse empty (fun x -> x) cs
+ | e ->
+ GapiJson.unexpected "GapiDriveV2Model.PermissionId.parse" e x
+
+ let to_data_model = GapiJson.render_root render
+
+ let of_data_model = GapiJson.parse_root parse empty
+
+end
+
module Revision =
struct
type t = {
@@ -2195,6 +2249,8 @@ struct
type t = {
additionalRoles : string list;
authKey : string;
+ domain : string;
+ emailAddress : string;
etag : string;
id : string;
kind : string;
@@ -2216,6 +2272,14 @@ struct
GapiLens.get = (fun x -> x.authKey);
GapiLens.set = (fun v x -> { x with authKey = v });
}
+ let domain = {
+ GapiLens.get = (fun x -> x.domain);
+ GapiLens.set = (fun v x -> { x with domain = v });
+ }
+ let emailAddress = {
+ GapiLens.get = (fun x -> x.emailAddress);
+ GapiLens.set = (fun v x -> { x with emailAddress = v });
+ }
let etag = {
GapiLens.get = (fun x -> x.etag);
GapiLens.set = (fun v x -> { x with etag = v });
@@ -2260,6 +2324,8 @@ struct
let empty = {
additionalRoles = [];
authKey = "";
+ domain = "";
+ emailAddress = "";
etag = "";
id = "";
kind = "";
@@ -2277,6 +2343,8 @@ struct
[
GapiJson.render_array "additionalRoles" (GapiJson.render_string_value "") x.additionalRoles;
GapiJson.render_string_value "authKey" x.authKey;
+ GapiJson.render_string_value "domain" x.domain;
+ GapiJson.render_string_value "emailAddress" x.emailAddress;
GapiJson.render_string_value "etag" x.etag;
GapiJson.render_string_value "id" x.id;
GapiJson.render_string_value "kind" x.kind;
@@ -2312,6 +2380,14 @@ struct
`String v) ->
{ x with authKey = v }
| GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "domain"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with domain = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "emailAddress"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with emailAddress = v }
+ | GapiCore.AnnotatedTree.Leaf
({ GapiJson.name = "etag"; data_type = GapiJson.Scalar },
`String v) ->
{ x with etag = v }
@@ -2364,6 +2440,104 @@ struct
end
+module Property =
+struct
+ type t = {
+ etag : string;
+ key : string;
+ kind : string;
+ selfLink : string;
+ value : string;
+ visibility : string;
+
+ }
+
+ let etag = {
+ GapiLens.get = (fun x -> x.etag);
+ GapiLens.set = (fun v x -> { x with etag = v });
+ }
+ let key = {
+ GapiLens.get = (fun x -> x.key);
+ GapiLens.set = (fun v x -> { x with key = v });
+ }
+ let kind = {
+ GapiLens.get = (fun x -> x.kind);
+ GapiLens.set = (fun v x -> { x with kind = v });
+ }
+ let selfLink = {
+ GapiLens.get = (fun x -> x.selfLink);
+ GapiLens.set = (fun v x -> { x with selfLink = v });
+ }
+ let value = {
+ GapiLens.get = (fun x -> x.value);
+ GapiLens.set = (fun v x -> { x with value = v });
+ }
+ let visibility = {
+ GapiLens.get = (fun x -> x.visibility);
+ GapiLens.set = (fun v x -> { x with visibility = v });
+ }
+
+ let empty = {
+ etag = "";
+ key = "";
+ kind = "";
+ selfLink = "";
+ value = "";
+ visibility = "";
+
+ }
+
+ let rec render_content x =
+ [
+ GapiJson.render_string_value "etag" x.etag;
+ GapiJson.render_string_value "key" x.key;
+ GapiJson.render_string_value "kind" x.kind;
+ GapiJson.render_string_value "selfLink" x.selfLink;
+ GapiJson.render_string_value "value" x.value;
+ GapiJson.render_string_value "visibility" x.visibility;
+
+ ]
+ and render x =
+ GapiJson.render_object "" (render_content x)
+
+ let rec parse x = function
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "etag"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with etag = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "key"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with key = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "kind"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with kind = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "selfLink"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with selfLink = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "value"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with value = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "visibility"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with visibility = v }
+ | GapiCore.AnnotatedTree.Node
+ ({ GapiJson.name = ""; data_type = GapiJson.Object },
+ cs) ->
+ GapiJson.parse_children parse empty (fun x -> x) cs
+ | e ->
+ GapiJson.unexpected "GapiDriveV2Model.Property.parse" e x
+
+ let to_data_model = GapiJson.render_root render
+
+ let of_data_model = GapiJson.parse_root parse empty
+
+end
+
module ParentReference =
struct
type t = {
@@ -2984,6 +3158,7 @@ struct
type t = {
alternateLink : string;
appDataContents : bool;
+ copyable : bool;
createdDate : GapiDate.t;
defaultOpenWithLink : string;
description : string;
@@ -3014,6 +3189,7 @@ struct
ownerNames : string list;
owners : User.t list;
parents : ParentReference.t list;
+ properties : Property.t list;
quotaBytesUsed : int64;
selfLink : string;
shared : bool;
@@ -3036,6 +3212,10 @@ struct
GapiLens.get = (fun x -> x.appDataContents);
GapiLens.set = (fun v x -> { x with appDataContents = v });
}
+ let copyable = {
+ GapiLens.get = (fun x -> x.copyable);
+ GapiLens.set = (fun v x -> { x with copyable = v });
+ }
let createdDate = {
GapiLens.get = (fun x -> x.createdDate);
GapiLens.set = (fun v x -> { x with createdDate = v });
@@ -3156,6 +3336,10 @@ struct
GapiLens.get = (fun x -> x.parents);
GapiLens.set = (fun v x -> { x with parents = v });
}
+ let properties = {
+ GapiLens.get = (fun x -> x.properties);
+ GapiLens.set = (fun v x -> { x with properties = v });
+ }
let quotaBytesUsed = {
GapiLens.get = (fun x -> x.quotaBytesUsed);
GapiLens.set = (fun v x -> { x with quotaBytesUsed = v });
@@ -3204,6 +3388,7 @@ struct
let empty = {
alternateLink = "";
appDataContents = false;
+ copyable = false;
createdDate = GapiDate.epoch;
defaultOpenWithLink = "";
description = "";
@@ -3234,6 +3419,7 @@ struct
ownerNames = [];
owners = [];
parents = [];
+ properties = [];
quotaBytesUsed = 0L;
selfLink = "";
shared = false;
@@ -3252,6 +3438,7 @@ struct
[
GapiJson.render_string_value "alternateLink" x.alternateLink;
GapiJson.render_bool_value "appDataContents" x.appDataContents;
+ GapiJson.render_bool_value "copyable" x.copyable;
GapiJson.render_date_value "createdDate" x.createdDate;
GapiJson.render_string_value "defaultOpenWithLink" x.defaultOpenWithLink;
GapiJson.render_string_value "description" x.description;
@@ -3282,6 +3469,7 @@ struct
GapiJson.render_array "ownerNames" (GapiJson.render_string_value "") x.ownerNames;
GapiJson.render_array "owners" User.render x.owners;
GapiJson.render_array "parents" ParentReference.render x.parents;
+ GapiJson.render_array "properties" Property.render x.properties;
GapiJson.render_int64_value "quotaBytesUsed" x.quotaBytesUsed;
GapiJson.render_string_value "selfLink" x.selfLink;
GapiJson.render_bool_value "shared" x.shared;
@@ -3308,6 +3496,10 @@ struct
`Bool v) ->
{ x with appDataContents = v }
| GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "copyable"; data_type = GapiJson.Scalar },
+ `Bool v) ->
+ { x with copyable = v }
+ | GapiCore.AnnotatedTree.Leaf
({ GapiJson.name = "createdDate"; data_type = GapiJson.Scalar },
`String v) ->
{ x with createdDate = GapiDate.of_string v }
@@ -3497,6 +3689,24 @@ struct
ParentReference.empty
(fun v -> { x with parents = v })
cs
+ | GapiCore.AnnotatedTree.Node
+ ({ GapiJson.name = "properties"; data_type = GapiJson.Array },
+ cs) ->
+ GapiJson.parse_collection
+ (fun x' -> function
+ | GapiCore.AnnotatedTree.Node
+ ({ GapiJson.name = ""; data_type = GapiJson.Object },
+ cs) ->
+ GapiJson.parse_children
+ Property.parse
+ Property.empty
+ (fun v -> v)
+ cs
+ | e ->
+ GapiJson.unexpected "GapiDriveV2Model.File.parse.parse_collection" e x')
+ Property.empty
+ (fun v -> { x with properties = v })
+ cs
| GapiCore.AnnotatedTree.Leaf
({ GapiJson.name = "quotaBytesUsed"; data_type = GapiJson.Scalar },
`String v) ->
@@ -3866,104 +4076,6 @@ struct
end
-module Property =
-struct
- type t = {
- etag : string;
- key : string;
- kind : string;
- selfLink : string;
- value : string;
- visibility : string;
-
- }
-
- let etag = {
- GapiLens.get = (fun x -> x.etag);
- GapiLens.set = (fun v x -> { x with etag = v });
- }
- let key = {
- GapiLens.get = (fun x -> x.key);
- GapiLens.set = (fun v x -> { x with key = v });
- }
- let kind = {
- GapiLens.get = (fun x -> x.kind);
- GapiLens.set = (fun v x -> { x with kind = v });
- }
- let selfLink = {
- GapiLens.get = (fun x -> x.selfLink);
- GapiLens.set = (fun v x -> { x with selfLink = v });
- }
- let value = {
- GapiLens.get = (fun x -> x.value);
- GapiLens.set = (fun v x -> { x with value = v });
- }
- let visibility = {
- GapiLens.get = (fun x -> x.visibility);
- GapiLens.set = (fun v x -> { x with visibility = v });
- }
-
- let empty = {
- etag = "";
- key = "";
- kind = "";
- selfLink = "";
- value = "";
- visibility = "";
-
- }
-
- let rec render_content x =
- [
- GapiJson.render_string_value "etag" x.etag;
- GapiJson.render_string_value "key" x.key;
- GapiJson.render_string_value "kind" x.kind;
- GapiJson.render_string_value "selfLink" x.selfLink;
- GapiJson.render_string_value "value" x.value;
- GapiJson.render_string_value "visibility" x.visibility;
-
- ]
- and render x =
- GapiJson.render_object "" (render_content x)
-
- let rec parse x = function
- | GapiCore.AnnotatedTree.Leaf
- ({ GapiJson.name = "etag"; data_type = GapiJson.Scalar },
- `String v) ->
- { x with etag = v }
- | GapiCore.AnnotatedTree.Leaf
- ({ GapiJson.name = "key"; data_type = GapiJson.Scalar },
- `String v) ->
- { x with key = v }
- | GapiCore.AnnotatedTree.Leaf
- ({ GapiJson.name = "kind"; data_type = GapiJson.Scalar },
- `String v) ->
- { x with kind = v }
- | GapiCore.AnnotatedTree.Leaf
- ({ GapiJson.name = "selfLink"; data_type = GapiJson.Scalar },
- `String v) ->
- { x with selfLink = v }
- | GapiCore.AnnotatedTree.Leaf
- ({ GapiJson.name = "value"; data_type = GapiJson.Scalar },
- `String v) ->
- { x with value = v }
- | GapiCore.AnnotatedTree.Leaf
- ({ GapiJson.name = "visibility"; data_type = GapiJson.Scalar },
- `String v) ->
- { x with visibility = v }
- | GapiCore.AnnotatedTree.Node
- ({ GapiJson.name = ""; data_type = GapiJson.Object },
- cs) ->
- GapiJson.parse_children parse empty (fun x -> x) cs
- | e ->
- GapiJson.unexpected "GapiDriveV2Model.Property.parse" e x
-
- let to_data_model = GapiJson.render_root render
-
- let of_data_model = GapiJson.parse_root parse empty
-
-end
-
module PropertyList =
struct
type t = {
@@ -4271,6 +4383,7 @@ struct
id : string;
kind : string;
params : (string * string) list;
+ payload : bool;
resourceId : string;
resourceUri : string;
token : string;
@@ -4298,6 +4411,10 @@ struct
GapiLens.get = (fun x -> x.params);
GapiLens.set = (fun v x -> { x with params = v });
}
+ let payload = {
+ GapiLens.get = (fun x -> x.payload);
+ GapiLens.set = (fun v x -> { x with payload = v });
+ }
let resourceId = {
GapiLens.get = (fun x -> x.resourceId);
GapiLens.set = (fun v x -> { x with resourceId = v });
@@ -4321,6 +4438,7 @@ struct
id = "";
kind = "";
params = [];
+ payload = false;
resourceId = "";
resourceUri = "";
token = "";
@@ -4335,6 +4453,7 @@ struct
GapiJson.render_string_value "id" x.id;
GapiJson.render_string_value "kind" x.kind;
GapiJson.render_collection "params" GapiJson.Object (fun (id, v) -> GapiJson.render_string_value id v) x.params;
+ GapiJson.render_bool_value "payload" x.payload;
GapiJson.render_string_value "resourceId" x.resourceId;
GapiJson.render_string_value "resourceUri" x.resourceUri;
GapiJson.render_string_value "token" x.token;
@@ -4376,6 +4495,10 @@ struct
(fun v -> { x with params = v })
cs
| GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "payload"; data_type = GapiJson.Scalar },
+ `Bool v) ->
+ { x with payload = v }
+ | GapiCore.AnnotatedTree.Leaf
({ GapiJson.name = "resourceId"; data_type = GapiJson.Scalar },
`String v) ->
{ x with resourceId = v }
View
134 src/gapi/gapiDriveV2Model.mli
@@ -516,6 +516,31 @@ sig
end
+module PermissionId :
+sig
+ type t = {
+ id : string;
+ (** The permission ID. *)
+ kind : string;
+ (** This is always drive#permissionId. *)
+
+ }
+
+ val id : (t, string) GapiLens.t
+ val kind : (t, string) GapiLens.t
+
+ val empty : t
+
+ val render : t -> GapiJson.json_data_model list
+
+ val parse : t -> GapiJson.json_data_model -> t
+
+ val to_data_model : t -> GapiJson.json_data_model
+
+ val of_data_model : GapiJson.json_data_model -> t
+
+end
+
module Revision :
sig
type t = {
@@ -717,6 +742,10 @@ sig
(** Additional roles for this user. Only commenter is currently allowed. *)
authKey : string;
(** The authkey parameter required for this permission. *)
+ domain : string;
+ (** The domain name of the entity this permission refers to. This is an output-only field which is populated when the permission type is "user", "group" or "domain". *)
+ emailAddress : string;
+ (** The email address of the user this permission refers to. This is an output-only field which is populated when the permission type is "user" and the given user's Google+ profile privacy settings allow exposing their email address. *)
etag : string;
(** The ETag of the permission. *)
id : string;
@@ -749,6 +778,8 @@ sig
val additionalRoles : (t, string list) GapiLens.t
val authKey : (t, string) GapiLens.t
+ val domain : (t, string) GapiLens.t
+ val emailAddress : (t, string) GapiLens.t
val etag : (t, string) GapiLens.t
val id : (t, string) GapiLens.t
val kind : (t, string) GapiLens.t
@@ -772,6 +803,43 @@ sig
end
+module Property :
+sig
+ type t = {
+ etag : string;
+ (** ETag of the property. *)
+ key : string;
+ (** The key of this property. *)
+ kind : string;
+ (** This is always drive#property. *)
+ selfLink : string;
+ (** The link back to this property. *)
+ value : string;
+ (** The value of this property. *)
+ visibility : string;
+ (** The visibility of this property. *)
+
+ }
+
+ val etag : (t, string) GapiLens.t
+ val key : (t, string) GapiLens.t
+ val kind : (t, string) GapiLens.t
+ val selfLink : (t, string) GapiLens.t
+ val value : (t, string) GapiLens.t
+ val visibility : (t, string) GapiLens.t
+
+ val empty : t
+
+ val render : t -> GapiJson.json_data_model list
+
+ val parse : t -> GapiJson.json_data_model -> t
+
+ val to_data_model : t -> GapiJson.json_data_model
+
+ val of_data_model : GapiJson.json_data_model -> t
+
+end
+
module ParentReference :
sig
type t = {
@@ -833,7 +901,7 @@ sig
sig
type t = {
hidden : bool;
- (** Whether this file is hidden from the user. *)
+ (** Deprecated. *)
restricted : bool;
(** Whether viewers are prevented from downloading this file. *)
starred : bool;
@@ -984,6 +1052,8 @@ sig
(** A link for opening the file in using a relevant Google editor or viewer. *)
appDataContents : bool;
(** Whether this file is in the appdata folder. *)
+ copyable : bool;
+ (** Whether the file can be copied by the current user. *)
createdDate : GapiDate.t;
(** Create time for this file (formatted ISO8601 timestamp). *)
defaultOpenWithLink : string;
@@ -1045,6 +1115,8 @@ sig
parents : ParentReference.t list;
(** Collection of parent folders which contain this file.
Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder. *)
+ properties : Property.t list;
+ (** The list of properties. *)
quotaBytesUsed : int64;
(** The number of quota bytes used by this file. *)
selfLink : string;
@@ -1072,6 +1144,7 @@ Setting this field will put the file in all of the provided folders. On insert,
val alternateLink : (t, string) GapiLens.t
val appDataContents : (t, bool) GapiLens.t
+ val copyable : (t, bool) GapiLens.t
val createdDate : (t, GapiDate.t) GapiLens.t
val defaultOpenWithLink : (t, string) GapiLens.t
val description : (t, string) GapiLens.t
@@ -1102,6 +1175,7 @@ Setting this field will put the file in all of the provided folders. On insert,
val ownerNames : (t, string list) GapiLens.t
val owners : (t, User.t list) GapiLens.t
val parents : (t, ParentReference.t list) GapiLens.t
+ val properties : (t, Property.t list) GapiLens.t
val quotaBytesUsed : (t, int64) GapiLens.t
val selfLink : (t, string) GapiLens.t
val shared : (t, bool) GapiLens.t
@@ -1231,43 +1305,6 @@ sig
end
-module Property :
-sig
- type t = {
- etag : string;
- (** ETag of the property. *)
- key : string;
- (** The key of this property. *)
- kind : string;
- (** This is always drive#property. *)
- selfLink : string;
- (** The link back to this property. *)
- value : string;
- (** The value of this property. *)
- visibility : string;
- (** The visibility of this property. *)
-
- }
-
- val etag : (t, string) GapiLens.t
- val key : (t, string) GapiLens.t
- val kind : (t, string) GapiLens.t
- val selfLink : (t, string) GapiLens.t
- val value : (t, string) GapiLens.t
- val visibility : (t, string) GapiLens.t
-
- val empty : t
-
- val render : t -> GapiJson.json_data_model list
-
- val parse : t -> GapiJson.json_data_model -> t
-
- val to_data_model : t -> GapiJson.json_data_model
-
- val of_data_model : GapiJson.json_data_model -> t
-
-end
-
module PropertyList :
sig
type t = {
@@ -1374,23 +1411,25 @@ module Channel :
sig
type t = {
address : string;
- (** The address of the receiving entity where events are delivered. Specific to the channel type. *)
+ (** The address where notifications are delivered for this channel. *)
expiration : int64;
- (** The expiration instant for this channel if it is defined. *)
+ (** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. *)
id : string;
- (** A UUID for the channel *)
+ (** A UUID or similar unique string that identifies this channel. *)
kind : string;
- (** A channel watching an API resource *)
+ (** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". *)
params : (string * string) list;
- (** Additional parameters controlling delivery channel behavior *)
+ (** Additional parameters controlling delivery channel behavior. Optional. *)
+ payload : bool;
+ (** A Boolean value to indicate whether payload is wanted. Optional. *)
resourceId : string;
- (** An opaque id that identifies the resource that is being watched. Stable across different API versions *)
+ (** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. *)
resourceUri : string;
- (** The canonicalized ID of the watched resource. *)
+ (** A version-specific identifier for the watched resource. *)
token : string;
- (** An arbitrary string associated with the channel that is delivered to the target address with each event delivered over this channel. *)
+ (** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. *)
_type : string;
- (** The type of delivery mechanism used by this channel *)
+ (** The type of delivery mechanism used for this channel. *)
}
@@ -1399,6 +1438,7 @@ sig
val id : (t, string) GapiLens.t
val kind : (t, string) GapiLens.t
val params : (t, (string * string) list) GapiLens.t
+ val payload : (t, bool) GapiLens.t
val resourceId : (t, string) GapiLens.t
val resourceUri : (t, string) GapiLens.t
val token : (t, string) GapiLens.t
View
94 src/gapi/gapiDriveV2Service.ml
@@ -1160,6 +1160,20 @@ struct
GapiService.get ?query_parameters ?etag full_url
(GapiJson.parse_json_response Permission.of_data_model) session
+ let getIdForEmail
+ ?(base_url = "https://www.googleapis.com/drive/v2/")
+ ?std_params
+ ~email
+ session =
+ let full_url = GapiUtils.add_path_to_url ["permissionIds";
+ ((fun x -> x) email)] base_url in
+ let params = PermissionsParameters.merge_parameters
+ ?standard_parameters:std_params () in
+ let query_parameters = Option.map PermissionsParameters.to_key_value_list
+ params in
+ GapiService.get ?query_parameters full_url
+ (GapiJson.parse_json_response PermissionId.of_data_model) session
+
let insert
?(base_url = "https://www.googleapis.com/drive/v2/")
?std_params
@@ -1403,6 +1417,59 @@ end
module RealtimeResource =
struct
+ module RealtimeParameters =
+ struct
+ type t = {
+ (* Standard query parameters *)
+ fields : string;
+ prettyPrint : bool;
+ quotaUser : string;
+ userIp : string;
+ key : string;
+ (* realtime-specific query parameters *)
+ baseRevision : string;
+
+ }
+
+ let default = {
+ fields = "";
+ prettyPrint = true;
+ quotaUser = "";
+ userIp = "";
+ key = "";
+ baseRevision = "";
+
+ }
+
+ let to_key_value_list qp =
+ let param get_value to_string name =
+ GapiService.build_param default qp get_value to_string name in [
+ param (fun p -> p.fields) (fun x -> x) "fields";
+ param (fun p -> p.prettyPrint) string_of_bool "prettyPrint";
+ param (fun p -> p.quotaUser) (fun x -> x) "quotaUser";
+ param (fun p -> p.userIp) (fun x -> x) "userIp";
+ param (fun p -> p.key) (fun x -> x) "key";
+ param (fun p -> p.baseRevision) (fun x -> x) "baseRevision";
+
+ ] |> List.concat
+
+ let merge_parameters
+ ?(standard_parameters = GapiService.StandardParameters.default)
+ ?(baseRevision = default.baseRevision)
+ () =
+ let parameters = {
+ fields = standard_parameters.GapiService.StandardParameters.fields;
+ prettyPrint = standard_parameters.GapiService.StandardParameters.prettyPrint;
+ quotaUser = standard_parameters.GapiService.StandardParameters.quotaUser;
+ userIp = standard_parameters.GapiService.StandardParameters.userIp;
+ key = standard_parameters.GapiService.StandardParameters.key;
+ baseRevision;
+
+ } in
+ if parameters = default then None else Some parameters
+
+ end
+
let get
?(base_url = "https://www.googleapis.com/drive/v2/")
?etag
@@ -1411,13 +1478,34 @@ struct
session =
let full_url = GapiUtils.add_path_to_url ["files"; ((fun x -> x) fileId);
"realtime"] base_url in
- let params = GapiService.StandardParameters.merge_parameters
+ let params = RealtimeParameters.merge_parameters
?standard_parameters:std_params () in
- let query_parameters = Option.map
- GapiService.StandardParameters.to_key_value_list params in
+ let query_parameters = Option.map RealtimeParameters.to_key_value_list
+ params in
GapiService.get ?query_parameters ?etag full_url
GapiRequest.parse_empty_response session
+ let update
+ ?(base_url = "https://www.googleapis.com/drive/v2/")
+ ?std_params
+ ?media_source
+ ?baseRevision
+ ~fileId
+ session =
+ let base_path = ["files"; ((fun x -> x) fileId); "realtime"] in
+ let media_path = [""; "resumable"; "upload"; "drive"; "v2"; "files";
+ ((fun x -> x) fileId); "realtime"] in
+ let path_to_add = if Option.is_some media_source then media_path
+ else base_path in
+ let full_url = GapiUtils.add_path_to_url path_to_add base_url in
+ let params = RealtimeParameters.merge_parameters
+ ?standard_parameters:std_params ?baseRevision () in
+ let query_parameters = Option.map RealtimeParameters.to_key_value_list
+ params in
+ GapiService.put ?query_parameters ?media_source
+ ~data_to_post:(fun _ -> GapiCore.PostData.empty) ~data:() full_url
+ GapiRequest.parse_empty_response session
+
end
View
31 src/gapi/gapiDriveV2Service.mli
@@ -159,7 +159,7 @@ end
module ChannelsResource :
sig
- (**
+ (** Stop watching resources through this channel
@param base_url Service endpoint base URL (defaults to ["https://www.googleapis.com/drive/v2/"]).
@param std_params Optional standard parameters.
@@ -718,6 +718,19 @@ sig
GapiConversation.Session.t ->
GapiDriveV2Model.Permission.t * GapiConversation.Session.t
+ (** Returns the permission ID for an email address.
+
+ @param base_url Service endpoint base URL (defaults to ["https://www.googleapis.com/drive/v2/"]).
+ @param std_params Optional standard parameters.
+ @param email The email address for which to return a permission ID
+ *)
+ val getIdForEmail :
+ ?base_url:string ->
+ ?std_params:GapiService.StandardParameters.t ->
+ email:string ->
+ GapiConversation.Session.t ->
+ GapiDriveV2Model.PermissionId.t * GapiConversation.Session.t
+
(** Inserts a permission for a file.
@param base_url Service endpoint base URL (defaults to ["https://www.googleapis.com/drive/v2/"]).
@@ -911,6 +924,22 @@ sig
GapiConversation.Session.t ->
unit * GapiConversation.Session.t
+ (** Overwrites the Realtime API data model associated with this file with the provided JSON data model.
+
+ @param base_url Service endpoint base URL (defaults to ["https://www.googleapis.com/drive/v2/"]).
+ @param std_params Optional standard parameters.
+ @param baseRevision The revision of the model to diff the uploaded model against. If set, the uploaded model is diffed against the provided revision and those differences are merged with any changes made to the model after the provided revision. If not set, the uploaded model replaces the current model on the server.
+ @param fileId The ID of the file that the Realtime API data model is associated with.
+ *)
+ val update :
+ ?base_url:string ->
+ ?std_params:GapiService.StandardParameters.t ->
+ ?media_source:GapiMediaResource.t ->
+ ?baseRevision:string ->
+ fileId:string ->
+ GapiConversation.Session.t ->
+ unit * GapiConversation.Session.t
+
end

0 comments on commit 5914476

Please sign in to comment.