Skip to content

Commit

Permalink
Merge pull request #57 from Student-Center/feature/WEAV-154
Browse files Browse the repository at this point in the history
[WEAV-154] 프로필 이미지 Reset 기능
  • Loading branch information
jisu15-kim authored Dec 7, 2024
2 parents 5933517 + 1c3cbac commit 7b4c4bf
Show file tree
Hide file tree
Showing 9 changed files with 463 additions and 64 deletions.
107 changes: 107 additions & 0 deletions OpenApiGenerator/Sources/OpenapiGenerated/Client.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,113 @@ public struct Client: APIProtocol {
}
)
}
/// 프로필 이미지 삭제
///
/// 특정 프로필 이미지를 삭제합니다.
///
/// - Remark: HTTP `DELETE /users/my/profile-images/{imageId}`.
/// - Remark: Generated from `#/paths//users/my/profile-images/{imageId}/delete(deleteProfileImage)`.
public func deleteProfileImage(_ input: Operations.deleteProfileImage.Input) async throws -> Operations.deleteProfileImage.Output {
try await client.send(
input: input,
forOperation: Operations.deleteProfileImage.id,
serializer: { input in
let path = try converter.renderedPath(
template: "/users/my/profile-images/{}",
parameters: [
input.path.imageId
]
)
var request: HTTPTypes.HTTPRequest = .init(
soar_path: path,
method: .delete
)
suppressMutabilityWarning(&request)
converter.setAcceptHeader(
in: &request.headerFields,
contentTypes: input.headers.accept
)
return (request, nil)
},
deserializer: { response, responseBody in
switch response.status.code {
case 204:
return .noContent(.init())
case 401:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.Unauthorized.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .unauthorized(.init(body: body))
case 404:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.NotFound.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .notFound(.init(body: body))
case 500:
let contentType = converter.extractContentTypeIfPresent(in: response.headerFields)
let body: Components.Responses.InternalServerError.Body
let chosenContentType = try converter.bestContentType(
received: contentType,
options: [
"application/json"
]
)
switch chosenContentType {
case "application/json":
body = try await converter.getResponseBodyAsJSON(
Components.Schemas.ErrorResponse.self,
from: responseBody,
transforming: { value in
.json(value)
}
)
default:
preconditionFailure("bestContentType chose an invalid content type.")
}
return .internalServerError(.init(body: body))
default:
return .undocumented(
statusCode: response.status.code,
.init()
)
}
}
)
}
/// 내 원하는 파트너 수정
///
/// 현재 로그인한 사용자의 원하는 파트너 정보를 수정합니다.
Expand Down
Loading

0 comments on commit 7b4c4bf

Please sign in to comment.