Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"files": {
"README.md": "0575cdb9dbd9d11ba72c347ebd2cfb1a9e68b50208ce144d07c01e46802e1a10",
"pyproject.toml": "94e3cbb02f22fa0b7c2b081fbbb7a797a151ff4e368303e49f69f95f8ae0c96c",
"src/api_key_auth_client/__init__.py": "c9cc2cd353b5b05a7dce3ad05a0e499c8cb368281e2146219dcff4c269e3a1bb",
"src/api_key_auth_client/_private/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"src/api_key_auth_client/_private/endpoints.py": "7d515fe771678e82ddbe07798d6b7e48c25c6c9bec19cec9318deb0bc5064ead",
"src/api_key_auth_client/_private/schemas.py": "64ebd9bc142c33fba620c877d1c1e6f3d258a4875ad38dbf905bcaa2505d471d",
"src/api_key_auth_client/aio/__init__.py": "01574d80de484082fae6de0f710510098e064007fd330bffd9f2e63efc5e75e6",
"src/api_key_auth_client/aio/client.py": "03ff3b33f191c3debf70cd95b37611c6937ecdd21c708ec68a492ca0ca2182fa",
"src/api_key_auth_client/aio/config.py": "5f9cefe2070a5a2a0d69c9fd45c0b2fbff065fdd9e09c4b56fc99db67ec3676d",
"src/api_key_auth_client/client.py": "d5de89636e23b7912a79b21712c5759e8efc98db5501cf05a986996d7471b03b",
"src/api_key_auth_client/config.py": "63a8567780b54a2ffb89e7df6f38b1a2c6d5838fa371f03e32011582ee5ebcff",
"src/api_key_auth_client/models.py": "a05bc9c5dcb44288446bb6ac4a5c0f98cbd1612adb9fb7cbf935e1401617091f",
"src/api_key_auth_client/models.pyi": "8a0650b60d4aa7b90f260cf404e1c67b3014db96f18d837011629eff59725bfb",
"src/api_key_auth_client/py.typed": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"version": 1
}
5 changes: 5 additions & 0 deletions codegen-output-py/api-key-auth-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Code generated by smithy-python-codegen DO NOT EDIT. -->

## api_key_auth_client Client Package

Python client for the API key auth fixture
37 changes: 37 additions & 0 deletions codegen-output-py/api-key-auth-client/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Code generated by smithy-python-codegen DO NOT EDIT.

[project]
name = "api_key_auth_client"
version = "0.0.1"
description = "Python client for the API key auth fixture"
readme = "README.md"
requires-python = ">=3.12"
keywords = ["smithy", "api_key_auth_client"]
license = {text = "Apache-2.0"}
dependencies = [
"smithy-core~=0.13.0",
"smithy-http[aiohttp,cbor,urllib3]~=0.10.0",
]

[build-system]
requires = [
"hatchling",
]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = [
"src/api_key_auth_client",
]

[tool.pyright]
typeCheckingMode = "strict"

[tool.ruff]
target-version = "py312"

[tool.ruff.lint]
ignore = ["F841"]

[tool.ruff.format]
skip-magic-trailing-comma = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from importlib import import_module
from typing import TYPE_CHECKING, Any

__version__: str = "0.0.1"

if TYPE_CHECKING:
from .aio.client import AsyncApiKeyService
from .aio.config import AsyncConfig
from .client import ApiKeyService
from .config import Config

__all__ = ["ApiKeyService", "AsyncApiKeyService", "AsyncConfig", "Config"]

_EXPORTS = {
"ApiKeyService": ".client",
"Config": ".config",
"AsyncApiKeyService": ".aio.client",
"AsyncConfig": ".aio.config",
}


def __getattr__(name: str) -> Any:
if name in _EXPORTS:
return getattr(import_module(_EXPORTS[name], __name__), name)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from smithy_core.endpoints import EndpointBdd

# fmt: off
# Tags: ref=0, attr=1, call=2, list=3, map=4, error=5, endpoint=6.
BDD = EndpointBdd(
# (name, type, required, default, builtin, client_context_attribute)
parameters=(
("endpoint", "string", False, None, "SDK::Endpoint", None),
),
functions=("isSet",),
conditions=(
((2, "isSet", (0, "endpoint")), None), # 0: isSet(endpoint)
),
results=(
None, # 0: no match
(6, (0, "endpoint"), None, ()), # 1
(5, "(default endpointRuleSet) endpoint is not set - you must configure an endpoint."), # 2
),
root=2,
# (condition, high, low); 1 and -1 are terminals, a negative reference is a
# complement edge, and 100_000_000 + k is result k.
nodes=(
-1, 1, -1,
0, 100_000_001, 100_000_002,
),
)
# fmt: on
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
from smithy_core._schema_compact import StaticOperationSchema, StaticSchema

n0 = "example.apikey"
_s0 = "GetThingInput"
_s1 = "smithy.synthetic#originalShapeId"
_s2 = "example.apikey#GetThingInput"
_s3 = "smithy.api#input"
_s4 = "name"
_s5 = "GetThingOutput"
_s6 = "example.apikey#GetThingOutput"
_s7 = "smithy.api#output"
_s8 = "value"
_s9 = "HealthInput"
_s10 = "smithy.api#Unit"
_s11 = "HealthOutput"
_s12 = "PingInput"
_s13 = "PingOutput"
_s14 = "GetThing"
_s15 = "Health"
_s16 = "Ping"
_s17 = "ApiKeyService"
_s18 = "smithy.protocols#rpcv2Cbor"

GET_THING_INPUT: StaticSchema = (
18,
n0,
_s0,
{_s1: _s2, _s3: None},
(_s4,),
((3, 0),),
)

GET_THING_OUTPUT: StaticSchema = (
18,
n0,
_s5,
{_s1: _s6, _s7: None},
(_s8,),
((3, 0),),
)

HEALTH_INPUT: StaticSchema = (
18,
n0,
_s9,
{_s1: _s10, _s3: None},
)

HEALTH_OUTPUT: StaticSchema = (
18,
n0,
_s11,
{_s1: _s10, _s7: None},
)

PING_INPUT: StaticSchema = (
18,
n0,
_s12,
{_s1: _s10, _s3: None},
)

PING_OUTPUT: StaticSchema = (
18,
n0,
_s13,
{_s1: _s10, _s7: None},
)

GET_THING: StaticOperationSchema = (
23,
n0,
_s14,
0,
GET_THING_INPUT,
GET_THING_OUTPUT,
(),
)

HEALTH: StaticOperationSchema = (
23,
n0,
_s15,
0,
HEALTH_INPUT,
HEALTH_OUTPUT,
(),
)

PING: StaticOperationSchema = (
23,
n0,
_s16,
0,
PING_INPUT,
PING_OUTPUT,
(),
)

API_KEY_SERVICE: StaticSchema = (
21,
n0,
_s17,
{_s18: None},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from importlib import import_module
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from .client import AsyncApiKeyService
from .config import AsyncConfig

__all__ = ["AsyncApiKeyService", "AsyncConfig"]

_EXPORTS = {
"AsyncApiKeyService": ".client",
"AsyncConfig": ".config",
}


def __getattr__(name: str) -> Any:
if name in _EXPORTS:
return getattr(import_module(_EXPORTS[name], __name__), name)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
from __future__ import annotations

from typing import Unpack, overload

from smithy_core.aio.client import AsyncClient
from smithy_http.plugins import user_agent_plugin

from api_key_auth_client import models
from api_key_auth_client.aio.config import AsyncConfig, Plugin


class AsyncApiKeyService(AsyncClient[AsyncConfig]):
"A service that authenticates with an API key."

_client_plugins = (user_agent_plugin,)

@overload
async def get_thing(
self,
request: models.GetThingInput | models.GetThingInputDict,
/,
*,
plugins: list[Plugin] | None = None,
) -> models.GetThingOutput: ...

@overload
async def get_thing(
self,
/,
*,
plugins: list[Plugin] | None = None,
**kwargs: Unpack[models.GetThingInputDict],
) -> models.GetThingOutput:
"""
Uses the service's API key auth.

:param plugins: Callables that change the configuration for this call
only.
"""

async def get_thing(
self, /, *args: object, plugins: list[Plugin] | None = None, **kwargs: object
) -> models.GetThingOutput:
return await self._invoke(
self._select_input(models.GET_THING, args, kwargs),
models.GET_THING,
[],
plugins,
)

@overload
async def health(
self,
request: models.HealthInput | models.HealthInputDict,
/,
*,
plugins: list[Plugin] | None = None,
) -> models.HealthOutput: ...

@overload
async def health(
self,
/,
*,
plugins: list[Plugin] | None = None,
**kwargs: Unpack[models.HealthInputDict],
) -> models.HealthOutput:
"""
Needs no auth.

:param plugins: Callables that change the configuration for this call
only.
"""

async def health(
self, /, *args: object, plugins: list[Plugin] | None = None, **kwargs: object
) -> models.HealthOutput:
return await self._invoke(
self._select_input(models.HEALTH, args, kwargs),
models.HEALTH,
[],
plugins,
)

@overload
async def ping(
self,
request: models.PingInput | models.PingInputDict,
/,
*,
plugins: list[Plugin] | None = None,
) -> models.PingOutput: ...

@overload
async def ping(
self,
/,
*,
plugins: list[Plugin] | None = None,
**kwargs: Unpack[models.PingInputDict],
) -> models.PingOutput:
"""
Sends the API key when it has one.

:param plugins: Callables that change the configuration for this call
only.
"""

async def ping(
self, /, *args: object, plugins: list[Plugin] | None = None, **kwargs: object
) -> models.PingOutput:
return await self._invoke(
self._select_input(models.PING, args, kwargs),
models.PING,
[],
plugins,
)

def _new_config(self) -> AsyncConfig:
return AsyncConfig()
Loading
Loading