api/cloud: remove magic constants
UploadTypes_* constants are auto-generated from the openapi spec. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
4b031a4692
commit
61e97372df
1 changed files with 2 additions and 2 deletions
|
|
@ -171,7 +171,7 @@ func (server *Server) Compose(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
uploadRequest := (ir.UploadRequests)[0]
|
uploadRequest := (ir.UploadRequests)[0]
|
||||||
/* oneOf is not supported by the openapi generator so marshal and unmarshal the uploadrequest based on the type */
|
/* oneOf is not supported by the openapi generator so marshal and unmarshal the uploadrequest based on the type */
|
||||||
if uploadRequest.Type == "aws" {
|
if uploadRequest.Type == UploadTypes_aws {
|
||||||
var awsUploadOptions AWSUploadRequestOptions
|
var awsUploadOptions AWSUploadRequestOptions
|
||||||
jsonUploadOptions, err := json.Marshal(uploadRequest.Options)
|
jsonUploadOptions, err := json.Marshal(uploadRequest.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -205,7 +205,7 @@ func (server *Server) Compose(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
targets = append(targets, t)
|
targets = append(targets, t)
|
||||||
} else if uploadRequest.Type == "gcp" {
|
} else if uploadRequest.Type == UploadTypes_gcp {
|
||||||
var gcpUploadOptions GCPUploadRequestOptions
|
var gcpUploadOptions GCPUploadRequestOptions
|
||||||
jsonUploadOptions, err := json.Marshal(uploadRequest.Options)
|
jsonUploadOptions, err := json.Marshal(uploadRequest.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue