Commit 69a16d31 authored by Mo Firouz's avatar Mo Firouz Committed by Andrei Mihu
Browse files

Make proto uniform. Add storage proto and schema. (#166)

parent 59dff3e4
Loading
Loading
Loading
Loading
+895 −212

File changed.

Preview size limit exceeded, changes collapsed.

+293 −0
Original line number Diff line number Diff line
@@ -273,6 +273,23 @@ func request_Nakama_DeleteNotifications_0(ctx context.Context, marshaler runtime

}

var (
	filter_Nakama_DeleteStorageObjects_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)

func request_Nakama_DeleteStorageObjects_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq DeleteStorageObjectsRequest
	var metadata runtime.ServerMetadata

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Nakama_DeleteStorageObjects_0); err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.DeleteStorageObjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_Nakama_GetAccount_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq empty.Empty
	var metadata runtime.ServerMetadata
@@ -470,6 +487,102 @@ func request_Nakama_ListNotifications_0(ctx context.Context, marshaler runtime.M

}

var (
	filter_Nakama_ListStorageObjects_0 = &utilities.DoubleArray{Encoding: map[string]int{"collection": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
)

func request_Nakama_ListStorageObjects_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq ListStorageObjectsRequest
	var metadata runtime.ServerMetadata

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["collection"]
	if !ok {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collection")
	}

	protoReq.Collection, err = runtime.String(val)

	if err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "collection", err)
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Nakama_ListStorageObjects_0); err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.ListStorageObjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

var (
	filter_Nakama_ListStorageObjects_1 = &utilities.DoubleArray{Encoding: map[string]int{"collection": 0, "user_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
)

func request_Nakama_ListStorageObjects_1(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq ListStorageObjectsRequest
	var metadata runtime.ServerMetadata

	var (
		val string
		ok  bool
		err error
		_   = err
	)

	val, ok = pathParams["collection"]
	if !ok {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "collection")
	}

	protoReq.Collection, err = runtime.String(val)

	if err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "collection", err)
	}

	val, ok = pathParams["user_id"]
	if !ok {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user_id")
	}

	protoReq.UserId, err = runtime.String(val)

	if err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user_id", err)
	}

	if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Nakama_ListStorageObjects_1); err != nil {
		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
	}

	msg, err := client.ListStorageObjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

func request_Nakama_ReadStorageObjects_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq ReadStorageObjectsRequest
	var metadata runtime.ServerMetadata

	if req.ContentLength > 0 {
		if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
			return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
		}
	}

	msg, err := client.ReadStorageObjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

var (
	filter_Nakama_RpcFunc_0 = &utilities.DoubleArray{Encoding: map[string]int{"payload": 0, "id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
)
@@ -666,6 +779,21 @@ func request_Nakama_UpdateAccount_0(ctx context.Context, marshaler runtime.Marsh

}

func request_Nakama_WriteStorageObjects_0(ctx context.Context, marshaler runtime.Marshaler, client NakamaClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
	var protoReq WriteStorageObjectsRequest
	var metadata runtime.ServerMetadata

	if req.ContentLength > 0 {
		if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
			return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
		}
	}

	msg, err := client.WriteStorageObjects(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
	return msg, metadata, err

}

// RegisterNakamaHandlerFromEndpoint is same as RegisterNakamaHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNakamaHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
@@ -1052,6 +1180,35 @@ func RegisterNakamaHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli

	})

	mux.Handle("DELETE", pattern_Nakama_DeleteStorageObjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		if cn, ok := w.(http.CloseNotifier); ok {
			go func(done <-chan struct{}, closed <-chan bool) {
				select {
				case <-done:
				case <-closed:
					cancel()
				}
			}(ctx.Done(), cn.CloseNotify())
		}
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_DeleteStorageObjects_0(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_DeleteStorageObjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("GET", pattern_Nakama_GetAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -1429,6 +1586,93 @@ func RegisterNakamaHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli

	})

	mux.Handle("GET", pattern_Nakama_ListStorageObjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		if cn, ok := w.(http.CloseNotifier); ok {
			go func(done <-chan struct{}, closed <-chan bool) {
				select {
				case <-done:
				case <-closed:
					cancel()
				}
			}(ctx.Done(), cn.CloseNotify())
		}
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_ListStorageObjects_0(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_ListStorageObjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("GET", pattern_Nakama_ListStorageObjects_1, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		if cn, ok := w.(http.CloseNotifier); ok {
			go func(done <-chan struct{}, closed <-chan bool) {
				select {
				case <-done:
				case <-closed:
					cancel()
				}
			}(ctx.Done(), cn.CloseNotify())
		}
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_ListStorageObjects_1(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_ListStorageObjects_1(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_ReadStorageObjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		if cn, ok := w.(http.CloseNotifier); ok {
			go func(done <-chan struct{}, closed <-chan bool) {
				select {
				case <-done:
				case <-closed:
					cancel()
				}
			}(ctx.Done(), cn.CloseNotify())
		}
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_ReadStorageObjects_0(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_ReadStorageObjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	mux.Handle("POST", pattern_Nakama_RpcFunc_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
@@ -1719,6 +1963,35 @@ func RegisterNakamaHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli

	})

	mux.Handle("PUT", pattern_Nakama_WriteStorageObjects_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
		ctx, cancel := context.WithCancel(req.Context())
		defer cancel()
		if cn, ok := w.(http.CloseNotifier); ok {
			go func(done <-chan struct{}, closed <-chan bool) {
				select {
				case <-done:
				case <-closed:
					cancel()
				}
			}(ctx.Done(), cn.CloseNotify())
		}
		inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
		rctx, err := runtime.AnnotateContext(ctx, mux, req)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}
		resp, md, err := request_Nakama_WriteStorageObjects_0(rctx, inboundMarshaler, client, req, pathParams)
		ctx = runtime.NewServerMetadataContext(ctx, md)
		if err != nil {
			runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
			return
		}

		forward_Nakama_WriteStorageObjects_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)

	})

	return nil
}

@@ -1747,6 +2020,8 @@ var (

	pattern_Nakama_DeleteNotifications_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "notification"}, ""))

	pattern_Nakama_DeleteStorageObjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "storage"}, ""))

	pattern_Nakama_GetAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "account"}, ""))

	pattern_Nakama_GetUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "user"}, ""))
@@ -1773,6 +2048,12 @@ var (

	pattern_Nakama_ListNotifications_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "notification"}, ""))

	pattern_Nakama_ListStorageObjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v2", "storage", "collection"}, ""))

	pattern_Nakama_ListStorageObjects_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 1, 0, 4, 1, 5, 3}, []string{"v2", "storage", "collection", "user_id"}, ""))

	pattern_Nakama_ReadStorageObjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "storage"}, ""))

	pattern_Nakama_RpcFunc_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v2", "rpc", "id"}, ""))

	pattern_Nakama_RpcFunc_1 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v2", "rpc", "id"}, ""))
@@ -1792,6 +2073,8 @@ var (
	pattern_Nakama_UnlinkSteam_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v2", "account", "unlink", "steam"}, ""))

	pattern_Nakama_UpdateAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "account"}, ""))

	pattern_Nakama_WriteStorageObjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v2", "storage"}, ""))
)

var (
@@ -1819,6 +2102,8 @@ var (

	forward_Nakama_DeleteNotifications_0 = runtime.ForwardResponseMessage

	forward_Nakama_DeleteStorageObjects_0 = runtime.ForwardResponseMessage

	forward_Nakama_GetAccount_0 = runtime.ForwardResponseMessage

	forward_Nakama_GetUsers_0 = runtime.ForwardResponseMessage
@@ -1845,6 +2130,12 @@ var (

	forward_Nakama_ListNotifications_0 = runtime.ForwardResponseMessage

	forward_Nakama_ListStorageObjects_0 = runtime.ForwardResponseMessage

	forward_Nakama_ListStorageObjects_1 = runtime.ForwardResponseMessage

	forward_Nakama_ReadStorageObjects_0 = runtime.ForwardResponseMessage

	forward_Nakama_RpcFunc_0 = runtime.ForwardResponseMessage

	forward_Nakama_RpcFunc_1 = runtime.ForwardResponseMessage
@@ -1864,4 +2155,6 @@ var (
	forward_Nakama_UnlinkSteam_0 = runtime.ForwardResponseMessage

	forward_Nakama_UpdateAccount_0 = runtime.ForwardResponseMessage

	forward_Nakama_WriteStorageObjects_0 = runtime.ForwardResponseMessage
)
+186 −16
Original line number Diff line number Diff line
@@ -171,6 +171,11 @@ service Nakama {
    option (google.api.http).delete = "/v2/notification";
  }

  // Delete one or more objects by ID or username.
  rpc DeleteStorageObjects (DeleteStorageObjectsRequest) returns (google.protobuf.Empty) {
    option (google.api.http).delete = "/v2/storage";
  }

  // Fetch the current user's account.
  rpc GetAccount (google.protobuf.Empty) returns (Account) {
    option (google.api.http).get = "/v2/account";
@@ -260,6 +265,24 @@ service Nakama {
    option (google.api.http).get = "/v2/notification";
  }

  // List collections of storage objects.
  rpc ListStorageObjects (ListStorageObjectsRequest) returns (StorageObjectList) {
    option (google.api.http) = {
      get: "/v2/storage/{collection}",
      additional_bindings {
        get: "/v2/storage/{collection}/{user_id}"
      }
    };
  }

  // Get storage objects.
  rpc ReadStorageObjects (ReadStorageObjectsRequest) returns (StorageObjects) {
    option (google.api.http) = {
      post: "/v2/storage",
      body: "*"
    };
  }

  // Execute a Lua function on the server.
  rpc RpcFunc (Rpc) returns (Rpc) {
    option (google.api.http) = {
@@ -334,6 +357,14 @@ service Nakama {
      body: "*"
    };
  }

  // Write objects into the storage engine.
  rpc WriteStorageObjects (WriteStorageObjectsRequest) returns (StorageObjectAcks) {
    option (google.api.http) = {
      put: "/v2/storage",
      body: "*"
    };
  }
}

// A user with additional account details. Always the current user.
@@ -381,7 +412,6 @@ message AccountFacebook {
// Send Apple's Game Center account credentials to the server. Used with authenticate/link/unlink.
message AccountGameCenter {
  // https://developer.apple.com/documentation/gamekit/gklocalplayer/1515407-generateidentityverificationsign
  // TODO(zyro): check if all fields are still needed and improve documentation.

  // Player ID (generated by GameCenter).
  string player_id = 1;
@@ -553,6 +583,22 @@ message DeleteNotificationsRequest {
  repeated string ids = 1;
}

// Storage objects to delete.
message DeleteStorageObjectId {
  // The collection which stores the object.
  string collection = 1;
  // The key of the object within the collection.
  string key = 2;
  // The version hash of the object.
  string version = 3;
}

// Batch delete storage objects.
message DeleteStorageObjectsRequest {
  // Batch of storage objects.
  repeated DeleteStorageObjectId objectIds = 1;
}

// A friend of a user.
message Friend {
  // The friendship status.
@@ -610,13 +656,11 @@ message Group {
  // Mark a group as private where only admins can accept members.
  bool private = 8;
  // The current count of all members in the group.
  int64 count = 9;
  // The UTC offset in milliseconds.
  int64 utc_offset_ms = 10;
  int32 count = 9;
  // The UNIX time when the group was created.
  google.protobuf.Timestamp create_time = 11;
  google.protobuf.Timestamp create_time = 10;
  // The UNIX time when the group was last updated.
  google.protobuf.Timestamp update_time = 12;
  google.protobuf.Timestamp update_time = 11;
}

// A collection of zero or more groups.
@@ -641,12 +685,24 @@ message LinkFacebookRequest {
  google.protobuf.BoolValue import = 4;
}

// Fetch a list of unexpired notifications.
// Get a list of unexpired notifications.
message ListNotificationsRequest {
  // Max number of notifications to list. Between 1 and 100.
  int64 limit = 1;
  // Use this cursor to paginate notifications. Cache this to catch up to new notifications. The value of this comes from NotificationList.cacheable_cursor.
  string cacheable_cursor = 2;
  // The number of notifications to get. Between 1 and 100.
  google.protobuf.Int32Value limit = 1;
  // A cursor to page through notifications. May be cached by clients to get from point in time forwards.
  string cacheable_cursor = 2; // value from NotificationList.cacheable_cursor.
}

// List storage objects by user ID or collection or both.
message ListStorageObjectsRequest {
  // ID of the user.
  string user_id = 1;
  // The collection which stores the object.
  string collection = 2;
  // The number of storage objects to list. Between 1 and 100.
  google.protobuf.Int32Value limit = 3;
  // The cursor to page through results from.
  string cursor = 4; // value from StorageObjectList.cursor.
}

// A notification in the server.
@@ -658,7 +714,7 @@ message Notification {
  // Content of the notification in JSON.
  string content = 3;
  // Category code for this notification.
  int64 code = 4;
  int32 code = 4;
  // ID of the sender, if a user. Otherwise 'null'.
  string sender_id = 5;
  // The UNIX time when the notification was created.
@@ -675,14 +731,30 @@ message NotificationList {
  string cacheable_cursor = 2;
}

// Storage objects to get.
message ReadStorageObjectId {
  // The collection which stores the object.
  string collection = 1;
  // The key of the object within the collection.
  string key = 2;
  // The user owner of the object.
  string user_id = 3;
}

// Batch get storage objects.
message ReadStorageObjectsRequest {
  // Batch of storage objects.
  repeated ReadStorageObjectId objectIds = 1;
}

// Execute an Lua function on the server.
message Rpc {
  // The identifier of the function.
  string id = 1;
  // The payload of the function which must be a JSON object.
  google.protobuf.StringValue payload = 2;
  string payload = 2;
  // The authentication key used when executed as a non-client HTTP request.
  google.protobuf.StringValue http_key = 3;
  string http_key = 3;
}

// A user's session used to authenticate messages.
@@ -693,6 +765,80 @@ message Session {
  string udp_token = 2; // TODO(zyro): will we remove it?
}

// The read access permissions for a storage object.
enum StoragePermissionRead {
  // Default case. Assumed as OWNER_READ permission.
  STORAGE_PERMISSION_READ_UNSPECIFIED = 0;
  // The object does not have client read permissions.
  NO_READ = 1;
  // The object may be read by the user owner.
  OWNER_READ = 2;
  // The object may be read by any user.
  PUBLIC_READ = 3;
}

// The write access permission for a storage object.
enum StoragePermissionWrite {
  // Default case. Assumed as OWNER_WRITE permission.
  STORAGE_PERMISSION_WRITE_UNSPECIFIED = 0;
  // The object does not have client write permissions.
  NO_WRITE = 1;
  // The object may be written by the user owner.
  OWNER_WRITE = 2;
}

// An object within the storage engine.
message StorageObject {
  // The collection which stores the object.
  string collection = 1;
  // The key of the object within the collection.
  string key = 2;
  // The user owner of the object.
  string user_id = 3;
  // The value of the object.
  string value = 4;
  // The version hash of the object.
  string version = 5;
  // The read access permissions for the object.
  int32 permission_read = 6;
  // The write access permissions for the object.
  int32 permission_write = 7;
  // The UNIX time when the object was created.
  google.protobuf.Timestamp create_time = 8;
  // The UNIX time when the object was last updated.
  google.protobuf.Timestamp update_time = 9;
}

// A storage acknowledgement.
message StorageObjectAck {
  // The collection which stores the object.
  string collection = 1;
  // The key of the object within the collection.
  string key = 2;
  // The version hash of the object.
  string version = 3;
}

// Batch of acknowledgements for the storage object write.
message StorageObjectAcks {
  // Batch of storage write acknowledgements.
  repeated StorageObjectAck acks = 1;
}

// Batch of storage objects.
message StorageObjects {
  // The batch of storage objects.
  repeated StorageObject objects = 1;
}

// List of storage objects.
message StorageObjectList {
  // The list of storage objects.
  repeated StorageObject objects = 1;
  // The cursor associated with the query a page of results.
  string cursor = 2;
}

// Update a user's account details.
message UpdateAccountRequest {
  // The username of the user's account.
@@ -737,10 +883,12 @@ message User {
  string steam_id = 12;
  // Indicates whether the user is currently online.
  bool online = 13;
  // Number of related edges to this user.
  int32 edge_count = 14;
  // The UNIX time when the user was created.
  google.protobuf.Timestamp create_time = 14;
  google.protobuf.Timestamp create_time = 15;
  // The UNIX time when the user was last updated.
  google.protobuf.Timestamp update_time = 15;
  google.protobuf.Timestamp update_time = 16;
}

// A collection of zero or more users.
@@ -748,3 +896,25 @@ message Users {
  // The User objects.
  repeated User users = 1;
}

// The object to store.
message WriteStorageObject {
  // The collection to store the object.
  string collection = 1;
  // The key for the object within the collection.
  string key = 2;
  // The value of the object.
  string value = 3;
  // The version hash of the object to check. Possible values are: ["", "*", "#hash#"].
  string version = 4; // if-match and if-none-match
  // The read access permissions for the object.
  int32 permission_read = 5;
  // The write access permissions for the object.
  int32 permission_write = 6;
}

// Write objects to the storage engine.
message WriteStorageObjectsRequest {
  // The objects to store on the server.
  repeated WriteStorageObject objects = 1;
}
+385 −13

File changed.

Preview size limit exceeded, changes collapsed.

+7 −7
Original line number Diff line number Diff line
@@ -179,15 +179,10 @@
          "description": "Mark a group as private where only admins can accept members."
        },
        "count": {
          "type": "string",
          "format": "int64",
          "type": "integer",
          "format": "int32",
          "description": "The current count of all members in the group."
        },
        "utc_offset_ms": {
          "type": "string",
          "format": "int64",
          "description": "The UTC offset in milliseconds."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
@@ -257,6 +252,11 @@
          "format": "boolean",
          "description": "Indicates whether the user is currently online."
        },
        "edge_count": {
          "type": "integer",
          "format": "int32",
          "description": "Number of related edges to this user."
        },
        "create_time": {
          "type": "string",
          "format": "date-time",
Loading