Skip to content

Commit

Permalink
revert(templates): undo changes within client files and only keep rename
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmattos committed Nov 21, 2023
1 parent d4f910b commit 6f74144
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
from typing import Iterable

import requests # noqa: TCH002
from singer_sdk.streams import GraphQLStream
from singer_sdk.streams import {{ cookiecutter.stream_type }}Stream

{%- if cookiecutter.auth_method in ("OAuth2", "JWT") %}

from {{ cookiecutter.library_name }}.auth import {{ cookiecutter.source_name }}Authenticator
{%- endif %}


class {{ cookiecutter.source_name }}Stream(GraphQLStream):
class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream):
"""{{ cookiecutter.source_name }} stream class."""

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,43 @@
from __future__ import annotations

{% if cookiecutter.auth_method in ("OAuth2", "JWT") -%}
import sys{% endif -%}
import sys
{% endif -%}
from pathlib import Path
from typing import Any, Callable, Iterable

import requests
{% if cookiecutter.auth_method == "API Key" -%}
from singer_sdk.authenticators import APIKeyAuthenticator
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.pagination import BaseAPIPaginator # noqa: TCH002
from singer_sdk.streams import {{ cookiecutter.stream_type }}Stream

{% elif cookiecutter.auth_method == "Bearer Token" -%}
from singer_sdk.authenticators import BearerTokenAuthenticator
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.pagination import BaseAPIPaginator # noqa: TCH002
from singer_sdk.streams import {{ cookiecutter.stream_type }}Stream

{% elif cookiecutter.auth_method == "Basic Auth" -%}
from singer_sdk.authenticators import BasicAuthenticator
{% endif -%}
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.pagination import BaseAPIPaginator # noqa: TCH002
from singer_sdk.streams import RESTStream
from singer_sdk.streams import {{ cookiecutter.stream_type }}Stream

{% elif cookiecutter.auth_method == "Custom or N/A" -%}
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.pagination import BaseAPIPaginator # noqa: TCH002
from singer_sdk.streams import {{ cookiecutter.stream_type }}Stream

{% elif cookiecutter.auth_method in ("OAuth2", "JWT") -%}
from singer_sdk.helpers.jsonpath import extract_jsonpath
from singer_sdk.pagination import BaseAPIPaginator # noqa: TCH002
from singer_sdk.streams import {{ cookiecutter.stream_type }}Stream

from {{ cookiecutter.library_name }}.auth import {{ cookiecutter.source_name }}Authenticator

{% endif -%}

{%- if cookiecutter.auth_method in ("OAuth2", "JWT") -%}
if sys.version_info >= (3, 8):
Expand All @@ -34,7 +53,7 @@
SCHEMAS_DIR = Path(__file__).parent / Path("./schemas")


class {{ cookiecutter.source_name }}Stream(RESTStream):
class {{ cookiecutter.source_name }}Stream({{ cookiecutter.stream_type }}Stream):
"""{{ cookiecutter.source_name }} stream class."""

@property
Expand Down

0 comments on commit 6f74144

Please # to comment.