Skip to content

Commit b8d447e

Browse files
authored
Merge pull request #13 from Equal-IQ/upload-profile-picture
Fixing uploadProfilePicture to use presignedURLs
2 parents c811603 + 6bd0559 commit b8d447e

File tree

4 files changed

+6
-29
lines changed

4 files changed

+6
-29
lines changed

model/profiles.smithy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,11 @@ operation UploadProfilePicture {
7676
}
7777

7878
structure UploadProfilePictureInput {
79-
image: String
80-
userId: UserId
8179
}
8280

8381
structure UploadProfilePictureOutput {
84-
message: String
85-
pictureId: String
82+
@required
83+
url_info: PresignedPostData
8684
}
8785

8886
structure UserProfile {

python/api_model/types/models.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,8 @@ class UpdateProfileResponseContent(BaseModel):
280280
updatedFields: list[str] | None
281281

282282

283-
class UploadProfilePictureRequestContent(BaseModel):
284-
image: str | None
285-
userId: str | None = Field(None, pattern='^[A-Za-z0-9-]+$')
286-
287-
288283
class UploadProfilePictureResponseContent(BaseModel):
289-
message: str | None
290-
pictureId: str | None
284+
url_info: PresignedPostData
291285

292286

293287
class UserProfile(BaseModel):

typescript/src/index.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,14 +431,8 @@ export type UpdateProfileResponseContent = {
431431
updatedFields?: string[];
432432
};
433433

434-
export type UploadProfilePictureRequestContent = {
435-
image?: string;
436-
userId?: string;
437-
};
438-
439434
export type UploadProfilePictureResponseContent = {
440-
message?: string;
441-
pictureId?: string;
435+
url_info: PresignedPostData;
442436
};
443437

444438
export type UserProfile = {

typescript/src/models.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -587,13 +587,8 @@ export interface components {
587587
userId: string;
588588
updatedFields?: string[];
589589
};
590-
UploadProfilePictureRequestContent: {
591-
image?: string;
592-
userId?: string;
593-
};
594590
UploadProfilePictureResponseContent: {
595-
message?: string;
596-
pictureId?: string;
591+
url_info: components["schemas"]["PresignedPostData"];
597592
};
598593
UserProfile: {
599594
userId?: string;
@@ -1117,11 +1112,7 @@ export interface operations {
11171112
path?: never;
11181113
cookie?: never;
11191114
};
1120-
requestBody?: {
1121-
content: {
1122-
"application/json": components["schemas"]["UploadProfilePictureRequestContent"];
1123-
};
1124-
};
1115+
requestBody?: never;
11251116
responses: {
11261117
/** @description UploadProfilePicture 200 response */
11271118
200: {

0 commit comments

Comments
 (0)