Skip to content
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

[Do not merge] Manual rename test #69

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions gen.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
configVersion: 2.0.0
generation:
sdkClassName: airbyte
sdkClassName: airbyte_api
usageSnippets:
optionalPropertyRendering: withExample
useClassNamesForArrayFields: true
Expand All @@ -11,7 +11,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: false
python:
version: 0.47.3
version: 0.48.0
author: Airbyte
clientServerStatusCodesAsErrors: true
description: Python Client SDK for Airbyte API
Expand Down
File renamed without changes.
68 changes: 28 additions & 40 deletions src/airbyte/connections.py → src/airbyte_api/connections.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from .sdkconfiguration import SDKConfiguration
from airbyte import utils
from airbyte.models import errors, operations, shared
from airbyte_api import utils
from airbyte_api.models import errors, operations, shared
from typing import Optional

class Connections:
sdk_configuration: SDKConfiguration

def __init__(self, sdk_config: SDKConfiguration) -> None:
self.sdk_configuration = sdk_config




def create_connection(self, request: shared.ConnectionCreateRequest) -> operations.CreateConnectionResponse:
r"""Create a connection"""
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = base_url + '/connections'
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, shared.ConnectionCreateRequest, "request", False, False, 'json')
Expand All @@ -26,17 +24,17 @@ def create_connection(self, request: shared.ConnectionCreateRequest) -> operatio
raise Exception('request body is required')
headers['Accept'] = 'application/json'
headers['user-agent'] = self.sdk_configuration.user_agent

if callable(self.sdk_configuration.security):
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security())
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)

http_res = client.request('POST', url, data=data, files=form, headers=headers)
content_type = http_res.headers.get('Content-Type')

res = operations.CreateConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)

if http_res.status_code == 200:
if utils.match_content_type(content_type, 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.ConnectionResponse])
Expand All @@ -48,55 +46,51 @@ def create_connection(self, request: shared.ConnectionCreateRequest) -> operatio

return res



def delete_connection(self, request: operations.DeleteConnectionRequest) -> operations.DeleteConnectionResponse:
r"""Delete a Connection"""
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = utils.generate_url(operations.DeleteConnectionRequest, base_url, '/connections/{connectionId}', request)
headers = {}
headers['Accept'] = '*/*'
headers['user-agent'] = self.sdk_configuration.user_agent

if callable(self.sdk_configuration.security):
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security())
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)

http_res = client.request('DELETE', url, headers=headers)
content_type = http_res.headers.get('Content-Type')

res = operations.DeleteConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)

if http_res.status_code == 204:
pass
elif http_res.status_code == 403 or http_res.status_code == 404 or http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)

return res



def get_connection(self, request: operations.GetConnectionRequest) -> operations.GetConnectionResponse:
r"""Get Connection details"""
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = utils.generate_url(operations.GetConnectionRequest, base_url, '/connections/{connectionId}', request)
headers = {}
headers['Accept'] = 'application/json'
headers['user-agent'] = self.sdk_configuration.user_agent

if callable(self.sdk_configuration.security):
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security())
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)

http_res = client.request('GET', url, headers=headers)
content_type = http_res.headers.get('Content-Type')

res = operations.GetConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)

if http_res.status_code == 200:
if utils.match_content_type(content_type, 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.ConnectionResponse])
Expand All @@ -108,28 +102,26 @@ def get_connection(self, request: operations.GetConnectionRequest) -> operations

return res



def list_connections(self, request: operations.ListConnectionsRequest) -> operations.ListConnectionsResponse:
r"""List connections"""
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = base_url + '/connections'
headers = {}
query_params = utils.get_query_params(operations.ListConnectionsRequest, request)
headers['Accept'] = 'application/json'
headers['user-agent'] = self.sdk_configuration.user_agent

if callable(self.sdk_configuration.security):
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security())
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)

http_res = client.request('GET', url, params=query_params, headers=headers)
content_type = http_res.headers.get('Content-Type')

res = operations.ListConnectionsResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)

if http_res.status_code == 200:
if utils.match_content_type(content_type, 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.ConnectionsResponse])
Expand All @@ -141,12 +133,10 @@ def list_connections(self, request: operations.ListConnectionsRequest) -> operat

return res



def patch_connection(self, request: operations.PatchConnectionRequest) -> operations.PatchConnectionResponse:
r"""Update Connection details"""
base_url = utils.template_url(*self.sdk_configuration.get_server_details())

url = utils.generate_url(operations.PatchConnectionRequest, base_url, '/connections/{connectionId}', request)
headers = {}
req_content_type, data, form = utils.serialize_request_body(request, operations.PatchConnectionRequest, "connection_patch_request", False, False, 'json')
Expand All @@ -156,17 +146,17 @@ def patch_connection(self, request: operations.PatchConnectionRequest) -> operat
raise Exception('request body is required')
headers['Accept'] = 'application/json'
headers['user-agent'] = self.sdk_configuration.user_agent

if callable(self.sdk_configuration.security):
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security())
else:
client = utils.configure_security_client(self.sdk_configuration.client, self.sdk_configuration.security)

http_res = client.request('PATCH', url, data=data, files=form, headers=headers)
content_type = http_res.headers.get('Content-Type')

res = operations.PatchConnectionResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res)

if http_res.status_code == 200:
if utils.match_content_type(content_type, 'application/json'):
out = utils.unmarshal_json(http_res.text, Optional[shared.ConnectionResponse])
Expand All @@ -177,5 +167,3 @@ def patch_connection(self, request: operations.PatchConnectionRequest) -> operat
raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)

return res


Loading