-
Notifications
You must be signed in to change notification settings - Fork 15
fix: [PromptRegistry] Export templates as byte[] over File
#667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,15 +10,13 @@ | |
| import com.sap.cloud.sdk.services.openapi.apiclient.ApiClient; | ||
| import com.sap.cloud.sdk.services.openapi.core.AbstractOpenApiService; | ||
| import com.sap.cloud.sdk.services.openapi.core.OpenApiRequestException; | ||
| import java.io.File; | ||
| import java.util.HashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.UUID; | ||
| import javax.annotation.Nonnull; | ||
| import javax.annotation.Nullable; | ||
| import org.springframework.core.ParameterizedTypeReference; | ||
| import org.springframework.core.io.FileSystemResource; | ||
| import org.springframework.http.HttpHeaders; | ||
| import org.springframework.http.HttpMethod; | ||
| import org.springframework.http.MediaType; | ||
|
|
@@ -238,11 +236,11 @@ public OrchestrationConfigDeleteResponse deleteOrchestrationConfig( | |
| * | ||
| * @param orchestrationConfigId (required) The value for the parameter orchestrationConfigId | ||
| * @param aiResourceGroup (optional) Specify a resource group id to use | ||
| * @return File | ||
| * @return byte[] | ||
| * @throws OpenApiRequestException if an error occurs while attempting to invoke the API | ||
| */ | ||
| @Nonnull | ||
| public File exportOrchestrationConfig( | ||
| public byte[] exportOrchestrationConfig( | ||
| @Nonnull final UUID orchestrationConfigId, @Nullable final String aiResourceGroup) | ||
| throws OpenApiRequestException { | ||
| final Object localVarPostBody = null; | ||
|
|
@@ -278,8 +276,8 @@ public File exportOrchestrationConfig( | |
|
|
||
| final String[] localVarAuthNames = new String[] {}; | ||
|
|
||
| final ParameterizedTypeReference<File> localVarReturnType = | ||
| new ParameterizedTypeReference<File>() {}; | ||
| final ParameterizedTypeReference<byte[]> localVarReturnType = | ||
| new ParameterizedTypeReference<byte[]>() {}; | ||
| return apiClient.invokeAPI( | ||
| localVarPath, | ||
| HttpMethod.GET, | ||
|
|
@@ -303,11 +301,11 @@ public File exportOrchestrationConfig( | |
| * <p><b>0</b> - Common Error | ||
| * | ||
| * @param orchestrationConfigId The value for the parameter orchestrationConfigId | ||
| * @return File | ||
| * @return byte[] | ||
| * @throws OpenApiRequestException if an error occurs while attempting to invoke the API | ||
| */ | ||
| @Nonnull | ||
| public File exportOrchestrationConfig(@Nonnull final UUID orchestrationConfigId) | ||
| public byte[] exportOrchestrationConfig(@Nonnull final UUID orchestrationConfigId) | ||
| throws OpenApiRequestException { | ||
| return exportOrchestrationConfig(orchestrationConfigId, null); | ||
| } | ||
|
|
@@ -423,7 +421,8 @@ public OrchestrationConfigGetResponse getOrchestrationConfigByUuid( | |
| */ | ||
| @Nonnull | ||
| public OrchestrationConfigPostResponse importOrchestrationConfig( | ||
| @Nullable final String aiResourceGroup, @Nullable final File _file) | ||
| @Nullable final String aiResourceGroup, | ||
| @Nullable final org.springframework.core.io.Resource _file) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Comment) Usage of |
||
| throws OpenApiRequestException { | ||
| final Object localVarPostBody = null; | ||
|
|
||
|
|
@@ -441,7 +440,7 @@ public OrchestrationConfigPostResponse importOrchestrationConfig( | |
| if (aiResourceGroup != null) | ||
| localVarHeaderParams.add("AI-Resource-Group", apiClient.parameterToString(aiResourceGroup)); | ||
|
|
||
| if (_file != null) localVarFormParams.add("file", new FileSystemResource(_file)); | ||
| if (_file != null) localVarFormParams.add("file", _file); | ||
|
|
||
| final String[] localVarAccepts = {"application/json"}; | ||
| final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Comment)
After discussion we aligned on
byte[]to be used overFile.Because the latter would require life-cycle handling, i.e. deletion after usage.