Skip to content

Commit

Permalink
Client credentials SDK gen (#12416)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonsSpaghetti committed May 10, 2024
1 parent 3786cfc commit d67a6fc
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
39 changes: 35 additions & 4 deletions airbyte-api/src/main/openapi/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4827,6 +4827,7 @@ paths:
text/html: {}
description: Redirects to documentation
operationId: getDocumentation
x-sdk-alias: getDocumentation
summary: "Root path, currently returns a redirect to the documentation"
# This redirect route is unsecured since it points to our documentation.
security: []
Expand All @@ -4842,6 +4843,7 @@ paths:
summary: Health Check
# This route is unsecured for external monitoring.
security: []
x-sdk-alias: getHealthCheck
/public/v1/jobs:
get:
tags:
Expand Down Expand Up @@ -4953,6 +4955,7 @@ paths:
description: Not allowed
operationId: listJobs
summary: List Jobs by sync type
x-sdk-alias: listJobs
post:
requestBody:
content:
Expand Down Expand Up @@ -4988,6 +4991,7 @@ paths:
description: Not allowed
operationId: publicCreateJob
summary: Trigger a sync or reset job of a connection
x-sdk-alias: createJob
/public/v1/jobs/{jobId}:
get:
tags:
Expand All @@ -5012,6 +5016,7 @@ paths:
"404":
description: Not found
operationId: getJob
x-sdk-alias: getJob
summary: Get Job status and details
delete:
tags:
Expand All @@ -5030,6 +5035,7 @@ paths:
"404":
description: Not found
operationId: publicCancelJob
x-sdk-alias: cancelJob
summary: Cancel a running Job
parameters:
- name: jobId
Expand All @@ -5056,6 +5062,7 @@ paths:
"404":
description: Not found
operationId: listSources
x-sdk-alias: listSources
summary: List sources
parameters:
- name: workspaceIds
Expand Down Expand Up @@ -5129,6 +5136,7 @@ paths:
"403":
description: Not allowed
operationId: publicCreateSource
x-sdk-alias: createSource
summary: Create a source
description: "Creates a source given a name, workspace id, and a json blob containing the configuration for the source."
/public/v1/sources/{sourceId}:
Expand Down Expand Up @@ -5156,6 +5164,7 @@ paths:
"404":
description: Not found
operationId: publicGetSource
x-sdk-alias: getSource
summary: Get Source details
patch:
tags:
Expand Down Expand Up @@ -5197,6 +5206,7 @@ paths:
"404":
description: Not found
operationId: patchSource
x-sdk-alias: patchSource
summary: Update a Source
put:
tags:
Expand Down Expand Up @@ -5238,6 +5248,7 @@ paths:
"404":
description: Not found
operationId: putSource
x-sdk-alias: putSource
summary: Update a Source and fully overwrite it
x-sdk-entity-operation: Source#update
delete:
Expand All @@ -5253,6 +5264,7 @@ paths:
"404":
description: Not found
operationId: publicDeleteSource
x-sdk-alias: deleteSource
summary: Delete a Source
parameters:
- name: sourceId
Expand All @@ -5279,6 +5291,7 @@ paths:
"404":
description: Not found
operationId: listDestinations
x-sdk-alias: listDestinations
summary: List destinations
parameters:
- name: workspaceIds
Expand Down Expand Up @@ -5359,6 +5372,7 @@ paths:
"404":
description: Not found
operationId: publicCreateDestination
x-sdk-alias: createDestination
summary: Create a destination
description: "Creates a destination given a name, workspace id, and a json blob containing the configuration for the source."
/public/v1/destinations/{destinationId}:
Expand Down Expand Up @@ -5391,6 +5405,7 @@ paths:
"404":
description: Not found
operationId: publicGetDestination
x-sdk-alias: getDestination
summary: Get Destination details
delete:
tags:
Expand All @@ -5405,6 +5420,7 @@ paths:
"404":
description: Not found
operationId: publicDeleteDestination
x-sdk-alias: deleteDestination
summary: Delete a Destination
patch:
tags:
Expand Down Expand Up @@ -5449,6 +5465,7 @@ paths:
"404":
description: Not found
operationId: patchDestination
x-sdk-alias: patchDestination
summary: Update a Destination
put:
tags:
Expand Down Expand Up @@ -5493,6 +5510,7 @@ paths:
"404":
description: Not found
operationId: putDestination
x-sdk-alias: putDestination
summary: Update a Destination and fully overwrite it
x-sdk-entity-operation: Destination#update
parameters:
Expand Down Expand Up @@ -5521,6 +5539,7 @@ paths:
"302":
description: Redirect to the URL requested in the initiate call with the created secret ID.
operationId: oauthCallback
x-sdk-alias: oauthCallback
summary: Receive OAuth callbacks
description: Redirected to by identity providers after authentication.
# This route is unsecured because it's an OAuth callback.
Expand All @@ -5545,6 +5564,7 @@ paths:
"403":
description: API key is invalid.
operationId: initiateOAuth
x-sdk-alias: initiateOAuth
summary: Initiate OAuth for a source
description: >-
Given a source ID, workspace ID, and redirect URL, initiates OAuth for the source.
Expand Down Expand Up @@ -5591,6 +5611,7 @@ paths:
"403":
description: Not allowed
operationId: publicCreateConnection
x-sdk-alias: createConnection
summary: Create a connection
x-sdk-entity-operation: Connection#create
get:
Expand All @@ -5610,6 +5631,7 @@ paths:
"404":
description: Not found
operationId: listConnections
x-sdk-alias: listConnections
summary: List connections
x-sdk-entity-operation: Connection#list
parameters:
Expand Down Expand Up @@ -5671,6 +5693,7 @@ paths:
"404":
description: Not found
operationId: publicGetConnection
x-sdk-alias: getConnection
summary: Get Connection details
x-sdk-entity-operation: Connection#read
patch:
Expand Down Expand Up @@ -5709,6 +5732,7 @@ paths:
"404":
description: Not found
operationId: patchConnection
x-sdk-alias: patchConnection
summary: Update Connection details
x-sdk-entity-operation: Connection#update
delete:
Expand All @@ -5724,6 +5748,7 @@ paths:
"404":
description: Not found
operationId: publicDeleteConnection
x-sdk-alias: deleteConnection
summary: Delete a Connection
x-sdk-entity-operation: Connection#delete
parameters:
Expand Down Expand Up @@ -5753,6 +5778,7 @@ paths:
"404":
description: Not found
operationId: getStreamProperties
x-sdk-alias: getStreamProperties
summary: Get stream properties
parameters:
- name: "sourceId"
Expand Down Expand Up @@ -5794,6 +5820,7 @@ paths:
"404":
description: Not found
operationId: publicListWorkspaces
x-sdk-alias: listWorkspaces
summary: List workspaces
x-sdk-entity-operation: Workspace#list
parameters:
Expand Down Expand Up @@ -5861,6 +5888,7 @@ paths:
"403":
description: Not allowed
operationId: publicCreateWorkspace
x-sdk-alias: createWorkspace
summary: Create a workspace
x-sdk-entity-operation: Workspace#create
/public/v1/workspaces/{workspaceId}:
Expand Down Expand Up @@ -5894,6 +5922,7 @@ paths:
"404":
description: Not found
operationId: publicGetWorkspace
x-sdk-alias: getWorkspace
summary: Get Workspace details
x-sdk-entity-operation: Workspace#read
patch:
Expand Down Expand Up @@ -5927,6 +5956,7 @@ paths:
"403":
description: Not allowed
operationId: publicUpdateWorkspace
x-sdk-alias: updateWorkspace
summary: Update a workspace
x-sdk-entity-operation: Workspace#update
delete:
Expand All @@ -5942,6 +5972,7 @@ paths:
"404":
description: Not found
operationId: publicDeleteWorkspace
x-sdk-alias: deleteWorkspace
summary: Delete a Workspace
x-sdk-entity-operation: Workspace#delete
/public/v1/workspaces/{workspaceId}/oauthCredentials:
Expand All @@ -5964,6 +5995,7 @@ paths:
"403":
description: API key is invalid.
operationId: createOrUpdateWorkspaceOAuthCredentials
x-sdk-alias: createOrUpdateWorkspaceOAuthCredentials
summary: Create OAuth override credentials for a workspace and source type.
description: >-
Create/update a set of OAuth credentials to override the Airbyte-provided OAuth credentials used for source/destination OAuth.
Expand Down Expand Up @@ -6015,6 +6047,7 @@ paths:
"403":
description: Not allowed
operationId: publicCreatePermission
x-sdk-alias: createPermission
summary: Create a permission
x-sdk-entity-operation: Permission#create

Expand Down Expand Up @@ -10213,8 +10246,10 @@ components:
# OAuth
OAuthConfiguration:
description: The values required to configure OAuth flows. The schema for this must match the `OAuthConfigSpecification.oauthUserInputFromConnectorConfigSpecification` schema.
x-sdk-component: true
OAuthInputConfiguration:
$ref: "#/components/schemas/OAuthConfiguration"
x-sdk-component: true
AdvancedAuth:
type: object
properties:
Expand Down Expand Up @@ -12359,28 +12394,24 @@ components:
application/json:
schema:
$ref: "#/components/schemas/NotFoundKnownExceptionInfo"
x-sdk-component: true
InvalidInputResponse:
description: Input failed validation
content:
application/json:
schema:
$ref: "#/components/schemas/InvalidInputExceptionInfo"
x-sdk-component: true
ForbiddenResponse:
description: Operation forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/KnownExceptionInfo"
x-sdk-component: true
ExceptionResponse:
description: Exception occurred; see message for details.
content:
application/json:
schema:
$ref: "#/components/schemas/KnownExceptionInfo"
x-sdk-component: true
InitiateOauthResponse:
content:
application/json: {}
Expand Down
10 changes: 10 additions & 0 deletions airbyte-commons/src/main/java/io/airbyte/commons/json/Jsons.java
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,16 @@ public static Map<String, String> deserializeToStringMap(final JsonNode json) {
return OBJECT_MAPPER.convertValue(json, new TypeReference<>() {});
}

/**
* Convert a {@link JsonNode} as a string-to-string map.
*
* @param json to convert
* @return json as string-to-string map
*/
public static Map<String, Object> deserializeToMap(final JsonNode json) {
return OBJECT_MAPPER.convertValue(json, new TypeReference<>() {});
}

/**
* By the Jackson DefaultPrettyPrinter prints objects with an extra space as follows: {"name" :
* "airbyte"}. We prefer {"name": "airbyte"}.
Expand Down

0 comments on commit d67a6fc

Please sign in to comment.