aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/google_docs/GooglePhotosClientUtils.ts
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-09-03 12:51:59 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-09-03 12:51:59 -0400
commit38176e5ba949b84dc410d29197180121d81e085c (patch)
treefc16f9dadd97d76c8431640bab27cfa8bb75421f /src/client/apis/google_docs/GooglePhotosClientUtils.ts
parent8b992ef2c152e86299fd3460112124d476393a60 (diff)
implemented refresh tokens and create, get, list
Diffstat (limited to 'src/client/apis/google_docs/GooglePhotosClientUtils.ts')
-rw-r--r--src/client/apis/google_docs/GooglePhotosClientUtils.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/client/apis/google_docs/GooglePhotosClientUtils.ts b/src/client/apis/google_docs/GooglePhotosClientUtils.ts
new file mode 100644
index 000000000..67a282f48
--- /dev/null
+++ b/src/client/apis/google_docs/GooglePhotosClientUtils.ts
@@ -0,0 +1,35 @@
+import { Album } from "../../../server/apis/google/typings/albums";
+import { PostToServer } from "../../../Utils";
+import { RouteStore } from "../../../server/RouteStore";
+
+export namespace GooglePhotosClientUtils {
+
+ export const Create = async (title: string) => {
+ let parameters = {
+ action: Album.Action.Create,
+ body: { album: { title } }
+ } as Album.Create;
+ return PostToServer(RouteStore.googlePhotos, parameters);
+ };
+
+ export const List = async (options?: Partial<Album.ListOptions>) => {
+ let parameters = {
+ action: Album.Action.List,
+ parameters: {
+ pageSize: (options ? options.pageSize : 20) || 20,
+ pageToken: (options ? options.pageToken : undefined) || undefined,
+ excludeNonAppCreatedData: (options ? options.excludeNonAppCreatedData : false) || false,
+ } as Album.ListOptions
+ } as Album.List;
+ return PostToServer(RouteStore.googlePhotos, parameters);
+ };
+
+ export const Get = async (albumId: string) => {
+ let parameters = {
+ action: Album.Action.Get,
+ albumId
+ } as Album.Get;
+ return PostToServer(RouteStore.googlePhotos, parameters);
+ };
+
+} \ No newline at end of file