-
Notifications
You must be signed in to change notification settings - Fork 25
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
[Fix] Correctly include query parameters for APIs whose request objects contain the body as a field #401
Conversation
} | ||
|
||
public <I, O> O DELETE(String path, I in, Class<O> target, Map<String, String> headers) { | ||
public <I, O> O execute( |
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.
Do we still use this one? Now all generated code uses the one which takes the Request object, correct?
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below: Trigger: Inputs:
Checks will be approved automatically on success. |
### Bug Fixes * Correctly include query parameters for APIs whose request objects contain the body as a field ([#401](#401)). ### Internal Changes * Add CICD environment to User Agent ([#404](#404)). ### API Changes: * Added `accountClient.budgetPolicy()` service. * Added `accountClient.enableIpAccessLists()` service. * Added `workspaceClient.accessControl()` service. * Added `workspaceClient.lakeviewEmbedded()` service and `workspaceClient.queryExecution()` service. * Added `workspaceClient.redashConfig()` service. * Added `httpRequest()` method for `workspaceClient.servingEndpoints()` service. * Added `gcpOauthToken` field for `com.databricks.sdk.service.catalog.TemporaryCredentials`. * Added `options` field for `com.databricks.sdk.service.catalog.UpdateCatalog`. * Added `reviewState`, `reviews` and `runnerCollaborators` fields for `com.databricks.sdk.service.cleanrooms.CleanRoomAssetNotebook`. * Added `statementId` field for `com.databricks.sdk.service.dashboards.QueryAttachment`. * Added `effectivePerformanceTarget` field for `com.databricks.sdk.service.jobs.BaseRun`. * Added `performanceTarget` field for `com.databricks.sdk.service.jobs.CreateJob`. * Added `performanceTarget` field for `com.databricks.sdk.service.jobs.JobSettings`. * Added `effectivePerformanceTarget` field for `com.databricks.sdk.service.jobs.Run`. * Added `performanceTarget` field for `com.databricks.sdk.service.jobs.RunNow`. * Added `cleanRoomsNotebookOutput` field for `com.databricks.sdk.service.jobs.RunOutput`. * Added `disabled` and `effectivePerformanceTarget` fields for `com.databricks.sdk.service.jobs.RunTask`. * Added `runAsRepl` field for `com.databricks.sdk.service.jobs.SparkJarTask`. * Added `userAuthorizedScopes` field for `com.databricks.sdk.service.oauth2.CreateCustomAppIntegration`. * Added `userAuthorizedScopes` field for `com.databricks.sdk.service.oauth2.GetCustomAppIntegrationOutput`. * Added `scopes` and `userAuthorizedScopes` fields for `com.databricks.sdk.service.oauth2.UpdateCustomAppIntegration`. * Added `contents` field for `com.databricks.sdk.service.serving.GetOpenApiResponse`. * Added `activated`, `activationUrl`, `authenticationType`, `cloud`, `comment`, `createdAt`, `createdBy`, `dataRecipientGlobalMetastoreId`, `ipAccessList`, `metastoreId`, `name`, `owner`, `propertiesKvpairs`, `region`, `sharingCode`, `tokens`, `updatedAt` and `updatedBy` fields for `com.databricks.sdk.service.sharing.RecipientInfo`. * Added `expirationTime` field for `com.databricks.sdk.service.sharing.RecipientInfo`. * Changed `update()` method for `workspaceClient.recipients()` service to return `com.databricks.sdk.service.sharing.RecipientInfo` class. * Changed `update()` method for `workspaceClient.recipients()` service to type `update()` method for `workspaceClient.recipients()` service. * Changed `update()` method for `workspaceClient.recipients()` service return type to become non-empty. * Changed `create()` method for `workspaceClient.servingEndpoints()` service with new required argument order. * Changed `getOpenApi()` method for `workspaceClient.servingEndpoints()` service return type to become non-empty. * Changed `patch()` method for `workspaceClient.servingEndpoints()` service to return `com.databricks.sdk.service.serving.EndpointTags` class. * Changed `patch()` method for `workspaceClient.servingEndpoints()` service to type `patch()` method for `workspaceClient.servingEndpoints()` service. * Changed `com.databricks.sdk.service.serving.EndpointTagList` class to. * Changed `collaboratorAlias` field for `com.databricks.sdk.service.cleanrooms.CleanRoomCollaborator` to be required. * Changed `collaboratorAlias` field for `com.databricks.sdk.service.cleanrooms.CleanRoomCollaborator` to be required. * Changed `behavior` field for `com.databricks.sdk.service.serving.AiGatewayGuardrailPiiBehavior` to no longer be required. * Changed `behavior` field for `com.databricks.sdk.service.serving.AiGatewayGuardrailPiiBehavior` to no longer be required. * Changed `config` field for `com.databricks.sdk.service.serving.CreateServingEndpoint` to no longer be required. * Changed `projectId` and `region` fields for `com.databricks.sdk.service.serving.GoogleCloudVertexAiConfig` to be required. * Changed `projectId` and `region` fields for `com.databricks.sdk.service.serving.GoogleCloudVertexAiConfig` to be required. * Changed `workloadType` field for `com.databricks.sdk.service.serving.ServedEntityInput` to type `com.databricks.sdk.service.serving.ServingModelWorkloadType` class. * Changed `workloadType` field for `com.databricks.sdk.service.serving.ServedEntityOutput` to type `com.databricks.sdk.service.serving.ServingModelWorkloadType` class. * Changed `workloadType` field for `com.databricks.sdk.service.serving.ServedModelOutput` to type `com.databricks.sdk.service.serving.ServingModelWorkloadType` class. * Removed `securableKind` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Removed `securableKind` field for `com.databricks.sdk.service.catalog.ConnectionInfo`. OpenAPI SHA: c72c58f97b950fcb924a90ef164bcb10cfcd5ece, Date: 2025-02-03
### Bug Fixes * Correctly include query parameters for APIs whose request objects contain the body as a field ([#401](#401)). ### Internal Changes * Add CICD environment to User Agent ([#404](#404)). ### API Changes: * Added `accountClient.budgetPolicy()` service. * Added `accountClient.enableIpAccessLists()` service. * Added `workspaceClient.accessControl()` service. * Added `workspaceClient.lakeviewEmbedded()` service and `workspaceClient.queryExecution()` service. * Added `workspaceClient.redashConfig()` service. * Added `httpRequest()` method for `workspaceClient.servingEndpoints()` service. * Added `gcpOauthToken` field for `com.databricks.sdk.service.catalog.TemporaryCredentials`. * Added `options` field for `com.databricks.sdk.service.catalog.UpdateCatalog`. * Added `reviewState`, `reviews` and `runnerCollaborators` fields for `com.databricks.sdk.service.cleanrooms.CleanRoomAssetNotebook`. * Added `statementId` field for `com.databricks.sdk.service.dashboards.QueryAttachment`. * Added `effectivePerformanceTarget` field for `com.databricks.sdk.service.jobs.BaseRun`. * Added `performanceTarget` field for `com.databricks.sdk.service.jobs.CreateJob`. * Added `performanceTarget` field for `com.databricks.sdk.service.jobs.JobSettings`. * Added `effectivePerformanceTarget` field for `com.databricks.sdk.service.jobs.Run`. * Added `performanceTarget` field for `com.databricks.sdk.service.jobs.RunNow`. * Added `cleanRoomsNotebookOutput` field for `com.databricks.sdk.service.jobs.RunOutput`. * Added `disabled` and `effectivePerformanceTarget` fields for `com.databricks.sdk.service.jobs.RunTask`. * Added `runAsRepl` field for `com.databricks.sdk.service.jobs.SparkJarTask`. * Added `userAuthorizedScopes` field for `com.databricks.sdk.service.oauth2.CreateCustomAppIntegration`. * Added `userAuthorizedScopes` field for `com.databricks.sdk.service.oauth2.GetCustomAppIntegrationOutput`. * Added `scopes` and `userAuthorizedScopes` fields for `com.databricks.sdk.service.oauth2.UpdateCustomAppIntegration`. * Added `contents` field for `com.databricks.sdk.service.serving.GetOpenApiResponse`. * Added `activated`, `activationUrl`, `authenticationType`, `cloud`, `comment`, `createdAt`, `createdBy`, `dataRecipientGlobalMetastoreId`, `ipAccessList`, `metastoreId`, `name`, `owner`, `propertiesKvpairs`, `region`, `sharingCode`, `tokens`, `updatedAt` and `updatedBy` fields for `com.databricks.sdk.service.sharing.RecipientInfo`. * Added `expirationTime` field for `com.databricks.sdk.service.sharing.RecipientInfo`. * Changed `update()` method for `workspaceClient.recipients()` service to return `com.databricks.sdk.service.sharing.RecipientInfo` class. * Changed `update()` method for `workspaceClient.recipients()` service to type `update()` method for `workspaceClient.recipients()` service. * Changed `update()` method for `workspaceClient.recipients()` service return type to become non-empty. * Changed `create()` method for `workspaceClient.servingEndpoints()` service with new required argument order. * Changed `getOpenApi()` method for `workspaceClient.servingEndpoints()` service return type to become non-empty. * Changed `patch()` method for `workspaceClient.servingEndpoints()` service to return `com.databricks.sdk.service.serving.EndpointTags` class. * Changed `patch()` method for `workspaceClient.servingEndpoints()` service to type `patch()` method for `workspaceClient.servingEndpoints()` service. * Changed `com.databricks.sdk.service.serving.EndpointTagList` class to. * Changed `collaboratorAlias` field for `com.databricks.sdk.service.cleanrooms.CleanRoomCollaborator` to be required. * Changed `collaboratorAlias` field for `com.databricks.sdk.service.cleanrooms.CleanRoomCollaborator` to be required. * Changed `behavior` field for `com.databricks.sdk.service.serving.AiGatewayGuardrailPiiBehavior` to no longer be required. * Changed `behavior` field for `com.databricks.sdk.service.serving.AiGatewayGuardrailPiiBehavior` to no longer be required. * Changed `config` field for `com.databricks.sdk.service.serving.CreateServingEndpoint` to no longer be required. * Changed `projectId` and `region` fields for `com.databricks.sdk.service.serving.GoogleCloudVertexAiConfig` to be required. * Changed `projectId` and `region` fields for `com.databricks.sdk.service.serving.GoogleCloudVertexAiConfig` to be required. * Changed `workloadType` field for `com.databricks.sdk.service.serving.ServedEntityInput` to type `com.databricks.sdk.service.serving.ServingModelWorkloadType` class. * Changed `workloadType` field for `com.databricks.sdk.service.serving.ServedEntityOutput` to type `com.databricks.sdk.service.serving.ServingModelWorkloadType` class. * Changed `workloadType` field for `com.databricks.sdk.service.serving.ServedModelOutput` to type `com.databricks.sdk.service.serving.ServingModelWorkloadType` class. * Removed `securableKind` field for `com.databricks.sdk.service.catalog.CatalogInfo`. * Removed `securableKind` field for `com.databricks.sdk.service.catalog.ConnectionInfo`. OpenAPI SHA: c72c58f97b950fcb924a90ef164bcb10cfcd5ece, Date: 2025-02-03
What changes are proposed in this pull request?
The Databricks API spec has two different styles of APIs, those where the request body is a field in the
Request
structure, and those where the request body is said structure (not counting the parameters passed via the URI path and query string). The former style of APIs was incorrectly implemented, preventing such APIs from using any query parameters.Generally, the approach taken here is to move the construction of the request object into the autogenerated
Impl
classes and providing a fully materializedRequest
object to theApiClient
. To do so, we expose the<T> T execute(Request in, Target Class<T>)
method as public.Separately, I've removed the per-HTTP-method methods from
ApiClient
, opting instead to use the singularexecute
, as they purely create more maintenance burden for us and decrease the surface area we need to maintain.How is this tested?
Added
AppsImplTest
to verify that the no_compute flag is included in the request passed to theApiClient
.