Permalink
Browse files

Update Drive API

  • Loading branch information...
1 parent 681d2d6 commit 86a5adc7a2d0692e0064a3199683105386c669a0 @astrada committed Jul 13, 2013
Showing with 407 additions and 3 deletions.
  1. +152 −0 src/gapi/gapiDriveV2Model.ml
  2. +50 −1 src/gapi/gapiDriveV2Model.mli
  3. +109 −2 src/gapi/gapiDriveV2Service.ml
  4. +96 −0 src/gapi/gapiDriveV2Service.mli
@@ -1033,6 +1033,7 @@ struct
exportLinks : (string * string) list;
fileExtension : string;
fileSize : int64;
+ headRevisionId : string;
iconLink : string;
id : string;
imageMediaMetadata : ImageMediaMetadata.t;
@@ -1117,6 +1118,10 @@ struct
GapiLens.get = (fun x -> x.fileSize);
GapiLens.set = (fun v x -> { x with fileSize = v });
}
+ let headRevisionId = {
+ GapiLens.get = (fun x -> x.headRevisionId);
+ GapiLens.set = (fun v x -> { x with headRevisionId = v });
+ }
let iconLink = {
GapiLens.get = (fun x -> x.iconLink);
GapiLens.set = (fun v x -> { x with iconLink = v });
@@ -1248,6 +1253,7 @@ struct
exportLinks = [];
fileExtension = "";
fileSize = 0L;
+ headRevisionId = "";
iconLink = "";
id = "";
imageMediaMetadata = ImageMediaMetadata.empty;
@@ -1295,6 +1301,7 @@ struct
GapiJson.render_collection "exportLinks" GapiJson.Object (fun (id, v) -> GapiJson.render_string_value id v) x.exportLinks;
GapiJson.render_string_value "fileExtension" x.fileExtension;
GapiJson.render_int64_value "fileSize" x.fileSize;
+ GapiJson.render_string_value "headRevisionId" x.headRevisionId;
GapiJson.render_string_value "iconLink" x.iconLink;
GapiJson.render_string_value "id" x.id;
(fun v -> GapiJson.render_object "imageMediaMetadata" (ImageMediaMetadata.render_content v)) x.imageMediaMetadata;
@@ -1393,6 +1400,10 @@ struct
`String v) ->
{ x with fileSize = Int64.of_string v }
| GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "headRevisionId"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with headRevisionId = v }
+ | GapiCore.AnnotatedTree.Leaf
({ GapiJson.name = "iconLink"; data_type = GapiJson.Scalar },
`String v) ->
{ x with iconLink = v }
@@ -3743,6 +3754,147 @@ struct
end
+module Channel =
+struct
+ type t = {
+ address : string;
+ expiration : int64;
+ id : string;
+ kind : string;
+ params : (string * string) list;
+ resourceId : string;
+ resourceUri : string;
+ token : string;
+ _type : string;
+
+ }
+
+ let address = {
+ GapiLens.get = (fun x -> x.address);
+ GapiLens.set = (fun v x -> { x with address = v });
+ }
+ let expiration = {
+ GapiLens.get = (fun x -> x.expiration);
+ GapiLens.set = (fun v x -> { x with expiration = v });
+ }
+ 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 params = {
+ GapiLens.get = (fun x -> x.params);
+ GapiLens.set = (fun v x -> { x with params = v });
+ }
+ let resourceId = {
+ GapiLens.get = (fun x -> x.resourceId);
+ GapiLens.set = (fun v x -> { x with resourceId = v });
+ }
+ let resourceUri = {
+ GapiLens.get = (fun x -> x.resourceUri);
+ GapiLens.set = (fun v x -> { x with resourceUri = v });
+ }
+ let token = {
+ GapiLens.get = (fun x -> x.token);
+ GapiLens.set = (fun v x -> { x with token = v });
+ }
+ let _type = {
+ GapiLens.get = (fun x -> x._type);
+ GapiLens.set = (fun v x -> { x with _type = v });
+ }
+
+ let empty = {
+ address = "";
+ expiration = 0L;
+ id = "";
+ kind = "";
+ params = [];
+ resourceId = "";
+ resourceUri = "";
+ token = "";
+ _type = "";
+
+ }
+
+ let rec render_content x =
+ [
+ GapiJson.render_string_value "address" x.address;
+ GapiJson.render_int64_value "expiration" x.expiration;
+ 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_string_value "resourceId" x.resourceId;
+ GapiJson.render_string_value "resourceUri" x.resourceUri;
+ GapiJson.render_string_value "token" x.token;
+ GapiJson.render_string_value "type" x._type;
+
+ ]
+ and render x =
+ GapiJson.render_object "" (render_content x)
+
+ let rec parse x = function
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "address"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with address = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "expiration"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with expiration = Int64.of_string v }
+ | 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 = "params"; data_type = GapiJson.Object },
+ cs) ->
+ GapiJson.parse_collection
+ (fun x' -> function
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = n; data_type = GapiJson.Scalar },
+ `String v) ->
+ (n, v)
+ | e ->
+ GapiJson.unexpected "GapiDriveV2Model.Channel.parse.parse_dictionary" e x')
+ ("", "")
+ (fun v -> { x with params = v })
+ cs
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "resourceId"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with resourceId = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "resourceUri"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with resourceUri = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "token"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with token = v }
+ | GapiCore.AnnotatedTree.Leaf
+ ({ GapiJson.name = "type"; data_type = GapiJson.Scalar },
+ `String v) ->
+ { x with _type = v }
+ | GapiCore.AnnotatedTree.Node
+ ({ GapiJson.name = ""; data_type = GapiJson.Object },
+ cs) ->
+ GapiJson.parse_children parse empty (fun x -> x) cs
+ | e ->
+ GapiJson.unexpected "GapiDriveV2Model.Channel.parse" e x
+
+ let to_data_model = GapiJson.render_root render
+
+ let of_data_model = GapiJson.parse_root parse empty
+
+end
+
module Change =
struct
type t = {
@@ -74,7 +74,7 @@ sig
- domain
- anyone *)
value : string;
- (** The email address or domain name for the entity. This is not populated in responses. *)
+ (** The email address or domain name for the entity. This is used during inserts and is not populated in responses. *)
withLink : bool;
(** Whether the link is required for this permission. *)
@@ -391,6 +391,8 @@ sig
(** The file extension used when downloading this file. This field is read only. To set the extension, include it in the title when creating the file. This is only populated for files with content stored in Drive. *)
fileSize : int64;
(** The size of the file in bytes. This is only populated for files with content stored in Drive. *)
+ headRevisionId : string;
+ (** The ID of the file's head revision. This will only be populated for files with content stored in Drive. *)
iconLink : string;
(** A link to the file's icon. *)
id : string;
@@ -466,6 +468,7 @@ Setting this field will put the file in all of the provided folders. On insert,
val exportLinks : (t, (string * string) list) GapiLens.t
val fileExtension : (t, string) GapiLens.t
val fileSize : (t, int64) GapiLens.t
+ val headRevisionId : (t, string) GapiLens.t
val iconLink : (t, string) GapiLens.t
val id : (t, string) GapiLens.t
val imageMediaMetadata : (t, ImageMediaMetadata.t) GapiLens.t
@@ -1191,6 +1194,52 @@ sig
end
+module Channel :
+sig
+ type t = {
+ address : string;
+ (** The address of the receiving entity where events are delivered. Specific to the channel type. *)
+ expiration : int64;
+ (** The expiration instant for this channel if it is defined. *)
+ id : string;
+ (** A UUID for the channel *)
+ kind : string;
+ (** A channel watching an API resource *)
+ params : (string * string) list;
+ (** Additional parameters controlling delivery channel behavior *)
+ resourceId : string;
+ (** An opaque id that identifies the resource that is being watched. Stable across different API versions *)
+ resourceUri : string;
+ (** The canonicalized ID of 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. *)
+ _type : string;
+ (** The type of delivery mechanism used by this channel *)
+
+ }
+
+ val address : (t, string) GapiLens.t
+ val expiration : (t, int64) GapiLens.t
+ val id : (t, string) GapiLens.t
+ val kind : (t, string) GapiLens.t
+ val params : (t, (string * string) list) GapiLens.t
+ val resourceId : (t, string) GapiLens.t
+ val resourceUri : (t, string) GapiLens.t
+ val token : (t, string) GapiLens.t
+ val _type : (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 Change :
sig
type t = {
Oops, something went wrong.

0 comments on commit 86a5adc

Please sign in to comment.