Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 1.0.0, Speakeasy CLI 1.198.1
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Mar 1, 2024
1 parent cb3d2a3 commit 2454337
Show file tree
Hide file tree
Showing 11 changed files with 705 additions and 61 deletions.
13 changes: 8 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ management:
docChecksum: 0dd32241bcd639c7e99747c1a7b3780d
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.258.2
releaseVersion: 5.0.1
configChecksum: ded75f9d4729d2de67bc9e77c9e4b3dc
generationVersion: 2.275.4
releaseVersion: 5.1.0
configChecksum: 4aaf3dc32922fc0f941ccd319336190c
repoURL: https://github.com/speakeasy-sdks/hightouch-python-sdk.git
repoSubDirectory: .
installationURL: https://github.com/speakeasy-sdks/hightouch-python-sdk.git
features:
python:
constsAndDefaults: 0.1.2
core: 4.4.6
globalSecurity: 2.83.2
core: 4.5.0
globalSecurity: 2.83.4
globalServerURLs: 2.82.1
unions: 2.82.5
generatedFiles:
Expand Down Expand Up @@ -210,3 +210,6 @@ generatedFiles:
- docs/sdks/hightouch/README.md
- USAGE.md
- .gitattributes
- src/hightouch/_hooks/sdkhooks.py
- src/hightouch/_hooks/types.py
- src/hightouch/_hooks/__init__.py
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,4 +758,12 @@ Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.180.1 (2.258.2) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v5.0.1] .
- [python v5.0.1] .

## 2024-03-01 00:32:47
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.198.1 (2.275.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v5.1.0] .
8 changes: 7 additions & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,14 @@ generation:
nameResolutionDec2023: false
parameterOrderingFeb2024: false
requestResponseComponentNamesFeb2024: false
auth:
oAuth2ClientCredentialsEnabled: false
python:
version: 5.0.1
version: 5.1.0
additionalDependencies:
dependencies: {}
extraDependencies:
dev: {}
author: Speakeasy
clientServerStatusCodesAsErrors: true
description: Python SDK for Hightouch API
Expand Down
1 change: 1 addition & 0 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ good-names=i,
ex,
Run,
_,
e,
id

# Good variable names regexes, separated by a comma. If names match any regex,
Expand Down
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setuptools.setup(
name="hightouch",
version="5.0.1",
version="5.1.0",
author="Speakeasy",
description="Python SDK for Hightouch API",
long_description=long_description,
Expand All @@ -19,9 +19,9 @@
install_requires=[
"certifi>=2023.7.22",
"charset-normalizer>=3.2.0",
"dataclasses-json-speakeasy>=0.5.11",
"dataclasses-json>=0.6.4",
"idna>=3.4",
"jsonpath-python>=1.0.6 ",
"jsonpath-python>=1.0.6",
"marshmallow>=3.19.0",
"mypy-extensions>=1.0.0",
"packaging>=23.1",
Expand All @@ -33,7 +33,9 @@
"urllib3>=1.26.18",
],
extras_require={
"dev":["pylint==2.16.2"]
"dev": [
"pylint==2.16.2",
],
},
package_dir={'': 'src'},
python_requires='>=3.8',
Expand Down
4 changes: 4 additions & 0 deletions src/hightouch/_hooks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from .sdkhooks import *
from .types import *
55 changes: 55 additions & 0 deletions src/hightouch/_hooks/sdkhooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

import requests
from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks
from typing import List, Optional, Tuple, Union


class SDKHooks(Hooks):
sdk_init_hooks: List[SDKInitHook] = []
before_request_hooks: List[BeforeRequestHook] = []
after_success_hooks: List[AfterSuccessHook] = []
after_error_hooks: List[AfterErrorHook] = []

def __init__(self):
pass

def register_sdk_init_hook(self, hook: SDKInitHook) -> None:
self.sdk_init_hooks.append(hook)

def register_before_request_hook(self, hook: BeforeRequestHook) -> None:
self.before_request_hooks.append(hook)

def register_after_success_hook(self, hook: AfterSuccessHook) -> None:
self.after_success_hooks.append(hook)

def register_after_error_hook(self, hook: AfterErrorHook) -> None:
self.after_error_hooks.append(hook)

def sdk_init(self, base_url: str, client: requests.Session) -> Tuple[str, requests.Session]:
for hook in self.sdk_init_hooks:
base_url, client = hook.sdk_init(base_url, client)
return base_url, client

def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> Union[requests.PreparedRequest, Exception]:
for hook in self.before_request_hooks:
request = hook.before_request(hook_ctx, request)
if isinstance(request, Exception):
raise request

return request

def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Response) -> requests.Response:
for hook in self.after_success_hooks:
response = hook.after_success(hook_ctx, response)
if isinstance(response, Exception):
raise response
return response

def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests.Response], error: Optional[Exception]) -> Tuple[Optional[requests.Response], Optional[Exception]]:
for hook in self.after_error_hooks:
result = hook.after_error(hook_ctx, response, error)
if isinstance(result, Exception):
raise result
response, error = result
return response, error
70 changes: 70 additions & 0 deletions src/hightouch/_hooks/types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

import requests as requests_http
from abc import ABC, abstractmethod
from typing import Any, Callable, List, Optional, Tuple, Union


class HookContext:
operation_id: str
oauth2_scopes: Optional[List[str]] = None
security_source: Optional[Union[Any, Callable[[], Any]]] = None

def __init__(self, operation_id: str, oauth2_scopes: Optional[List[str]], security_source: Optional[Union[Any, Callable[[], Any]]]):
self.operation_id = operation_id
self.oauth2_scopes = oauth2_scopes
self.security_source = security_source


class BeforeRequestContext(HookContext):
pass


class AfterSuccessContext(HookContext):
pass


class AfterErrorContext(HookContext):
pass


class SDKInitHook(ABC):
@abstractmethod
def sdk_init(self, base_url: str, client: requests_http.Session) -> Tuple[str, requests_http.Session]:
pass


class BeforeRequestHook(ABC):
@abstractmethod
def before_request(self, hook_ctx: BeforeRequestContext, request: requests_http.PreparedRequest) -> Union[requests_http.PreparedRequest, Exception]:
pass


class AfterSuccessHook(ABC):
@abstractmethod
def after_success(self, hook_ctx: AfterSuccessContext, response: requests_http.Response) -> Union[requests_http.PreparedRequest, Exception]:
pass


class AfterErrorHook(ABC):
@abstractmethod
def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests_http.Response], error: Optional[Exception]) -> Union[Tuple[Optional[requests_http.PreparedRequest], Optional[Exception]], Exception]:
pass


class Hooks(ABC):
@abstractmethod
def register_sdk_init_hook(self, hook: SDKInitHook):
pass

@abstractmethod
def register_before_request_hook(self, hook: BeforeRequestHook):
pass

@abstractmethod
def register_after_success_hook(self, hook: AfterSuccessHook):
pass

@abstractmethod
def register_after_error_hook(self, hook: AfterErrorHook):
pass
Loading

0 comments on commit 2454337

Please sign in to comment.