methodaws 0.0.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- method-security/methodaws/__init__.py +33 -0
- method-security/methodaws/core/__init__.py +27 -0
- method-security/methodaws/core/datetime_utils.py +28 -0
- method-security/methodaws/core/pydantic_utilities.py +179 -0
- method-security/methodaws/core/serialization.py +167 -0
- method-security/methodaws/py.typed +0 -0
- method-security/methodaws/resources/__init__.py +33 -0
- method-security/methodaws/resources/loadbalancer/__init__.py +29 -0
- method-security/methodaws/resources/loadbalancer/certificate.py +19 -0
- method-security/methodaws/resources/loadbalancer/ip_address_type.py +5 -0
- method-security/methodaws/resources/loadbalancer/listener.py +24 -0
- method-security/methodaws/resources/loadbalancer/load_balancer_report.py +27 -0
- method-security/methodaws/resources/loadbalancer/load_balancer_state.py +5 -0
- method-security/methodaws/resources/loadbalancer/load_balancer_v_1.py +29 -0
- method-security/methodaws/resources/loadbalancer/load_balancer_v_2.py +39 -0
- method-security/methodaws/resources/loadbalancer/protocol.py +5 -0
- method-security/methodaws/resources/loadbalancer/target.py +22 -0
- method-security/methodaws/resources/loadbalancer/target_group.py +28 -0
- method-security/methodaws/resources/loadbalancer/target_group_ip_address_type.py +5 -0
- method-security/methodaws/resources/loadbalancer/target_type.py +5 -0
- methodaws-0.0.10.dist-info/METADATA +25 -0
- methodaws-0.0.10.dist-info/RECORD +23 -0
- methodaws-0.0.10.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .resources import (
|
|
4
|
+
Certificate,
|
|
5
|
+
IpAddressType,
|
|
6
|
+
Listener,
|
|
7
|
+
LoadBalancerReport,
|
|
8
|
+
LoadBalancerState,
|
|
9
|
+
LoadBalancerV1,
|
|
10
|
+
LoadBalancerV2,
|
|
11
|
+
Protocol,
|
|
12
|
+
Target,
|
|
13
|
+
TargetGroup,
|
|
14
|
+
TargetGroupIpAddressType,
|
|
15
|
+
TargetType,
|
|
16
|
+
loadbalancer,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"Certificate",
|
|
21
|
+
"IpAddressType",
|
|
22
|
+
"Listener",
|
|
23
|
+
"LoadBalancerReport",
|
|
24
|
+
"LoadBalancerState",
|
|
25
|
+
"LoadBalancerV1",
|
|
26
|
+
"LoadBalancerV2",
|
|
27
|
+
"Protocol",
|
|
28
|
+
"Target",
|
|
29
|
+
"TargetGroup",
|
|
30
|
+
"TargetGroupIpAddressType",
|
|
31
|
+
"TargetType",
|
|
32
|
+
"loadbalancer",
|
|
33
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .datetime_utils import serialize_datetime
|
|
4
|
+
from .pydantic_utilities import (
|
|
5
|
+
IS_PYDANTIC_V2,
|
|
6
|
+
UniversalBaseModel,
|
|
7
|
+
UniversalRootModel,
|
|
8
|
+
deep_union_pydantic_dicts,
|
|
9
|
+
parse_obj_as,
|
|
10
|
+
universal_field_validator,
|
|
11
|
+
universal_root_validator,
|
|
12
|
+
update_forward_refs,
|
|
13
|
+
)
|
|
14
|
+
from .serialization import FieldMetadata
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"FieldMetadata",
|
|
18
|
+
"IS_PYDANTIC_V2",
|
|
19
|
+
"UniversalBaseModel",
|
|
20
|
+
"UniversalRootModel",
|
|
21
|
+
"deep_union_pydantic_dicts",
|
|
22
|
+
"parse_obj_as",
|
|
23
|
+
"serialize_datetime",
|
|
24
|
+
"universal_field_validator",
|
|
25
|
+
"universal_root_validator",
|
|
26
|
+
"update_forward_refs",
|
|
27
|
+
]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def serialize_datetime(v: dt.datetime) -> str:
|
|
7
|
+
"""
|
|
8
|
+
Serialize a datetime including timezone info.
|
|
9
|
+
|
|
10
|
+
Uses the timezone info provided if present, otherwise uses the current runtime's timezone info.
|
|
11
|
+
|
|
12
|
+
UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
def _serialize_zoned_datetime(v: dt.datetime) -> str:
|
|
16
|
+
if v.tzinfo is not None and v.tzinfo.tzname(None) == dt.timezone.utc.tzname(None):
|
|
17
|
+
# UTC is a special case where we use "Z" at the end instead of "+00:00"
|
|
18
|
+
return v.isoformat().replace("+00:00", "Z")
|
|
19
|
+
else:
|
|
20
|
+
# Delegate to the typical +/- offset format
|
|
21
|
+
return v.isoformat()
|
|
22
|
+
|
|
23
|
+
if v.tzinfo is not None:
|
|
24
|
+
return _serialize_zoned_datetime(v)
|
|
25
|
+
else:
|
|
26
|
+
local_tz = dt.datetime.now().astimezone().tzinfo
|
|
27
|
+
localized_dt = v.replace(tzinfo=local_tz)
|
|
28
|
+
return _serialize_zoned_datetime(localized_dt)
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# nopycln: file
|
|
4
|
+
import datetime as dt
|
|
5
|
+
import typing
|
|
6
|
+
from collections import defaultdict
|
|
7
|
+
from functools import wraps
|
|
8
|
+
|
|
9
|
+
import pydantic
|
|
10
|
+
|
|
11
|
+
from .datetime_utils import serialize_datetime
|
|
12
|
+
|
|
13
|
+
IS_PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
|
|
14
|
+
|
|
15
|
+
if IS_PYDANTIC_V2:
|
|
16
|
+
# isort will try to reformat the comments on these imports, which breaks mypy
|
|
17
|
+
# isort: off
|
|
18
|
+
from pydantic.v1.datetime_parse import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
19
|
+
parse_date as parse_date,
|
|
20
|
+
)
|
|
21
|
+
from pydantic.v1.datetime_parse import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
22
|
+
parse_datetime as parse_datetime,
|
|
23
|
+
)
|
|
24
|
+
from pydantic.v1.json import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
25
|
+
ENCODERS_BY_TYPE as encoders_by_type,
|
|
26
|
+
)
|
|
27
|
+
from pydantic.v1.typing import ( # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
28
|
+
get_args as get_args,
|
|
29
|
+
)
|
|
30
|
+
from pydantic.v1.typing import get_origin as get_origin # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
31
|
+
from pydantic.v1.typing import ( # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
32
|
+
is_literal_type as is_literal_type,
|
|
33
|
+
)
|
|
34
|
+
from pydantic.v1.typing import is_union as is_union # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
35
|
+
from pydantic.v1.fields import ModelField as ModelField # type: ignore # pyright: ignore[reportMissingImports] # Pydantic v2
|
|
36
|
+
else:
|
|
37
|
+
from pydantic.datetime_parse import parse_date as parse_date # type: ignore # Pydantic v1
|
|
38
|
+
from pydantic.datetime_parse import parse_datetime as parse_datetime # type: ignore # Pydantic v1
|
|
39
|
+
from pydantic.fields import ModelField as ModelField # type: ignore # Pydantic v1
|
|
40
|
+
from pydantic.json import ENCODERS_BY_TYPE as encoders_by_type # type: ignore # Pydantic v1
|
|
41
|
+
from pydantic.typing import get_args as get_args # type: ignore # Pydantic v1
|
|
42
|
+
from pydantic.typing import get_origin as get_origin # type: ignore # Pydantic v1
|
|
43
|
+
from pydantic.typing import is_literal_type as is_literal_type # type: ignore # Pydantic v1
|
|
44
|
+
from pydantic.typing import is_union as is_union # type: ignore # Pydantic v1
|
|
45
|
+
|
|
46
|
+
# isort: on
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
T = typing.TypeVar("T")
|
|
50
|
+
Model = typing.TypeVar("Model", bound=pydantic.BaseModel)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def deep_union_pydantic_dicts(
|
|
54
|
+
source: typing.Dict[str, typing.Any], destination: typing.Dict[str, typing.Any]
|
|
55
|
+
) -> typing.Dict[str, typing.Any]:
|
|
56
|
+
for key, value in source.items():
|
|
57
|
+
if isinstance(value, dict):
|
|
58
|
+
node = destination.setdefault(key, {})
|
|
59
|
+
deep_union_pydantic_dicts(value, node)
|
|
60
|
+
else:
|
|
61
|
+
destination[key] = value
|
|
62
|
+
|
|
63
|
+
return destination
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def parse_obj_as(type_: typing.Type[T], object_: typing.Any) -> T:
|
|
67
|
+
if IS_PYDANTIC_V2:
|
|
68
|
+
adapter = pydantic.TypeAdapter(type_) # type: ignore # Pydantic v2
|
|
69
|
+
return adapter.validate_python(object_)
|
|
70
|
+
else:
|
|
71
|
+
return pydantic.parse_obj_as(type_, object_)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def to_jsonable_with_fallback(
|
|
75
|
+
obj: typing.Any, fallback_serializer: typing.Callable[[typing.Any], typing.Any]
|
|
76
|
+
) -> typing.Any:
|
|
77
|
+
if IS_PYDANTIC_V2:
|
|
78
|
+
from pydantic_core import to_jsonable_python
|
|
79
|
+
|
|
80
|
+
return to_jsonable_python(obj, fallback=fallback_serializer)
|
|
81
|
+
else:
|
|
82
|
+
return fallback_serializer(obj)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class UniversalBaseModel(pydantic.BaseModel):
|
|
86
|
+
class Config:
|
|
87
|
+
populate_by_name = True
|
|
88
|
+
smart_union = True
|
|
89
|
+
allow_population_by_field_name = True
|
|
90
|
+
json_encoders = {dt.datetime: serialize_datetime}
|
|
91
|
+
|
|
92
|
+
def json(self, **kwargs: typing.Any) -> str:
|
|
93
|
+
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
94
|
+
if IS_PYDANTIC_V2:
|
|
95
|
+
return super().model_dump_json(**kwargs_with_defaults) # type: ignore # Pydantic v2
|
|
96
|
+
else:
|
|
97
|
+
return super().json(**kwargs_with_defaults)
|
|
98
|
+
|
|
99
|
+
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
|
100
|
+
kwargs_with_defaults_exclude_unset: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
|
101
|
+
kwargs_with_defaults_exclude_none: typing.Any = {"by_alias": True, "exclude_none": True, **kwargs}
|
|
102
|
+
|
|
103
|
+
if IS_PYDANTIC_V2:
|
|
104
|
+
return deep_union_pydantic_dicts(
|
|
105
|
+
super().model_dump(**kwargs_with_defaults_exclude_unset), # type: ignore # Pydantic v2
|
|
106
|
+
super().model_dump(**kwargs_with_defaults_exclude_none), # type: ignore # Pydantic v2
|
|
107
|
+
)
|
|
108
|
+
else:
|
|
109
|
+
return deep_union_pydantic_dicts(
|
|
110
|
+
super().dict(**kwargs_with_defaults_exclude_unset), super().dict(**kwargs_with_defaults_exclude_none)
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
UniversalRootModel: typing.Type[typing.Any]
|
|
115
|
+
if IS_PYDANTIC_V2:
|
|
116
|
+
|
|
117
|
+
class V2RootModel(UniversalBaseModel, pydantic.RootModel): # type: ignore # Pydantic v2
|
|
118
|
+
pass
|
|
119
|
+
|
|
120
|
+
UniversalRootModel = V2RootModel
|
|
121
|
+
else:
|
|
122
|
+
UniversalRootModel = UniversalBaseModel
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def encode_by_type(o: typing.Any) -> typing.Any:
|
|
126
|
+
encoders_by_class_tuples: typing.Dict[
|
|
127
|
+
typing.Callable[[typing.Any], typing.Any], typing.Tuple[typing.Any, ...]
|
|
128
|
+
] = defaultdict(tuple)
|
|
129
|
+
for type_, encoder in encoders_by_type.items():
|
|
130
|
+
encoders_by_class_tuples[encoder] += (type_,)
|
|
131
|
+
|
|
132
|
+
if type(o) in encoders_by_type:
|
|
133
|
+
return encoders_by_type[type(o)](o)
|
|
134
|
+
for encoder, classes_tuple in encoders_by_class_tuples.items():
|
|
135
|
+
if isinstance(o, classes_tuple):
|
|
136
|
+
return encoder(o)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def update_forward_refs(model: typing.Type["Model"], **localns: typing.Any) -> None:
|
|
140
|
+
if IS_PYDANTIC_V2:
|
|
141
|
+
model.model_rebuild(force=True, raise_errors=False) # type: ignore # Pydantic v2
|
|
142
|
+
else:
|
|
143
|
+
model.update_forward_refs(**localns)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
# Mirrors Pydantic's internal typing
|
|
147
|
+
AnyCallable = typing.Callable[..., typing.Any]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def universal_root_validator(pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]:
|
|
151
|
+
def decorator(func: AnyCallable) -> AnyCallable:
|
|
152
|
+
@wraps(func)
|
|
153
|
+
def validate(*args: typing.Any, **kwargs: typing.Any) -> AnyCallable:
|
|
154
|
+
if IS_PYDANTIC_V2:
|
|
155
|
+
wrapped_func = pydantic.model_validator("before" if pre else "after")(func) # type: ignore # Pydantic v2
|
|
156
|
+
else:
|
|
157
|
+
wrapped_func = pydantic.root_validator(pre=pre)(func) # type: ignore # Pydantic v1
|
|
158
|
+
|
|
159
|
+
return wrapped_func(*args, **kwargs)
|
|
160
|
+
|
|
161
|
+
return validate
|
|
162
|
+
|
|
163
|
+
return decorator
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
def universal_field_validator(field_name: str, pre: bool = False) -> typing.Callable[[AnyCallable], AnyCallable]:
|
|
167
|
+
def decorator(func: AnyCallable) -> AnyCallable:
|
|
168
|
+
@wraps(func)
|
|
169
|
+
def validate(*args: typing.Any, **kwargs: typing.Any) -> AnyCallable:
|
|
170
|
+
if IS_PYDANTIC_V2:
|
|
171
|
+
wrapped_func = pydantic.field_validator(field_name, mode="before" if pre else "after")(func) # type: ignore # Pydantic v2
|
|
172
|
+
else:
|
|
173
|
+
wrapped_func = pydantic.validator(field_name, pre=pre)(func)
|
|
174
|
+
|
|
175
|
+
return wrapped_func(*args, **kwargs)
|
|
176
|
+
|
|
177
|
+
return validate
|
|
178
|
+
|
|
179
|
+
return decorator
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import collections
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import typing_extensions
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class FieldMetadata:
|
|
10
|
+
"""
|
|
11
|
+
Metadata class used to annotate fields to provide additional information.
|
|
12
|
+
|
|
13
|
+
Example:
|
|
14
|
+
class MyDict(TypedDict):
|
|
15
|
+
field: typing.Annotated[str, FieldMetadata(alias="field_name")]
|
|
16
|
+
|
|
17
|
+
Will serialize: `{"field": "value"}`
|
|
18
|
+
To: `{"field_name": "value"}`
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
alias: str
|
|
22
|
+
|
|
23
|
+
def __init__(self, *, alias: str) -> None:
|
|
24
|
+
self.alias = alias
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def convert_and_respect_annotation_metadata(
|
|
28
|
+
*, object_: typing.Any, annotation: typing.Any, inner_type: typing.Optional[typing.Any] = None
|
|
29
|
+
) -> typing.Any:
|
|
30
|
+
"""
|
|
31
|
+
Respect the metadata annotations on a field, such as aliasing. This function effectively
|
|
32
|
+
manipulates the dict-form of an object to respect the metadata annotations. This is primarily used for
|
|
33
|
+
TypedDicts, which cannot support aliasing out of the box, and can be extended for additional
|
|
34
|
+
utilities, such as defaults.
|
|
35
|
+
|
|
36
|
+
Parameters
|
|
37
|
+
----------
|
|
38
|
+
object_ : typing.Any
|
|
39
|
+
|
|
40
|
+
annotation : type
|
|
41
|
+
The type we're looking to apply typing annotations from
|
|
42
|
+
|
|
43
|
+
inner_type : typing.Optional[type]
|
|
44
|
+
|
|
45
|
+
Returns
|
|
46
|
+
-------
|
|
47
|
+
typing.Any
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
if object_ is None:
|
|
51
|
+
return None
|
|
52
|
+
if inner_type is None:
|
|
53
|
+
inner_type = annotation
|
|
54
|
+
|
|
55
|
+
clean_type = _remove_annotations(inner_type)
|
|
56
|
+
if typing_extensions.is_typeddict(clean_type) and isinstance(object_, typing.Mapping):
|
|
57
|
+
return _convert_typeddict(object_, clean_type)
|
|
58
|
+
|
|
59
|
+
if (
|
|
60
|
+
# If you're iterating on a string, do not bother to coerce it to a sequence.
|
|
61
|
+
(not isinstance(object_, str))
|
|
62
|
+
and (
|
|
63
|
+
(
|
|
64
|
+
(
|
|
65
|
+
typing_extensions.get_origin(clean_type) == typing.List
|
|
66
|
+
or typing_extensions.get_origin(clean_type) == list
|
|
67
|
+
or clean_type == typing.List
|
|
68
|
+
)
|
|
69
|
+
and isinstance(object_, typing.List)
|
|
70
|
+
)
|
|
71
|
+
or (
|
|
72
|
+
(
|
|
73
|
+
typing_extensions.get_origin(clean_type) == typing.Set
|
|
74
|
+
or typing_extensions.get_origin(clean_type) == set
|
|
75
|
+
or clean_type == typing.Set
|
|
76
|
+
)
|
|
77
|
+
and isinstance(object_, typing.Set)
|
|
78
|
+
)
|
|
79
|
+
or (
|
|
80
|
+
(
|
|
81
|
+
typing_extensions.get_origin(clean_type) == typing.Sequence
|
|
82
|
+
or typing_extensions.get_origin(clean_type) == collections.abc.Sequence
|
|
83
|
+
or clean_type == typing.Sequence
|
|
84
|
+
)
|
|
85
|
+
and isinstance(object_, typing.Sequence)
|
|
86
|
+
)
|
|
87
|
+
)
|
|
88
|
+
):
|
|
89
|
+
inner_type = typing_extensions.get_args(clean_type)[0]
|
|
90
|
+
return [
|
|
91
|
+
convert_and_respect_annotation_metadata(object_=item, annotation=annotation, inner_type=inner_type)
|
|
92
|
+
for item in object_
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
if typing_extensions.get_origin(clean_type) == typing.Union:
|
|
96
|
+
# We should be able to ~relatively~ safely try to convert keys against all
|
|
97
|
+
# member types in the union, the edge case here is if one member aliases a field
|
|
98
|
+
# of the same name to a different name from another member
|
|
99
|
+
# Or if another member aliases a field of the same name that another member does not.
|
|
100
|
+
for member in typing_extensions.get_args(clean_type):
|
|
101
|
+
object_ = convert_and_respect_annotation_metadata(object_=object_, annotation=annotation, inner_type=member)
|
|
102
|
+
return object_
|
|
103
|
+
|
|
104
|
+
annotated_type = _get_annotation(annotation)
|
|
105
|
+
if annotated_type is None:
|
|
106
|
+
return object_
|
|
107
|
+
|
|
108
|
+
# If the object is not a TypedDict, a Union, or other container (list, set, sequence, etc.)
|
|
109
|
+
# Then we can safely call it on the recursive conversion.
|
|
110
|
+
return object_
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def _convert_typeddict(object_: typing.Mapping[str, object], expected_type: typing.Any) -> typing.Mapping[str, object]:
|
|
114
|
+
converted_object: typing.Dict[str, object] = {}
|
|
115
|
+
annotations = typing_extensions.get_type_hints(expected_type, include_extras=True)
|
|
116
|
+
for key, value in object_.items():
|
|
117
|
+
type_ = annotations.get(key)
|
|
118
|
+
if type_ is None:
|
|
119
|
+
converted_object[key] = value
|
|
120
|
+
else:
|
|
121
|
+
converted_object[_alias_key(key, type_)] = convert_and_respect_annotation_metadata(
|
|
122
|
+
object_=value, annotation=type_
|
|
123
|
+
)
|
|
124
|
+
return converted_object
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _get_annotation(type_: typing.Any) -> typing.Optional[typing.Any]:
|
|
128
|
+
maybe_annotated_type = typing_extensions.get_origin(type_)
|
|
129
|
+
if maybe_annotated_type is None:
|
|
130
|
+
return None
|
|
131
|
+
|
|
132
|
+
if maybe_annotated_type == typing_extensions.NotRequired:
|
|
133
|
+
type_ = typing_extensions.get_args(type_)[0]
|
|
134
|
+
maybe_annotated_type = typing_extensions.get_origin(type_)
|
|
135
|
+
|
|
136
|
+
if maybe_annotated_type == typing_extensions.Annotated:
|
|
137
|
+
return type_
|
|
138
|
+
|
|
139
|
+
return None
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def _remove_annotations(type_: typing.Any) -> typing.Any:
|
|
143
|
+
maybe_annotated_type = typing_extensions.get_origin(type_)
|
|
144
|
+
if maybe_annotated_type is None:
|
|
145
|
+
return type_
|
|
146
|
+
|
|
147
|
+
if maybe_annotated_type == typing_extensions.NotRequired:
|
|
148
|
+
return _remove_annotations(typing_extensions.get_args(type_)[0])
|
|
149
|
+
|
|
150
|
+
if maybe_annotated_type == typing_extensions.Annotated:
|
|
151
|
+
return _remove_annotations(typing_extensions.get_args(type_)[0])
|
|
152
|
+
|
|
153
|
+
return type_
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def _alias_key(key: str, type_: typing.Any) -> str:
|
|
157
|
+
maybe_annotated_type = _get_annotation(type_)
|
|
158
|
+
|
|
159
|
+
if maybe_annotated_type is not None:
|
|
160
|
+
# The actual annotations are 1 onward, the first is the annotated type
|
|
161
|
+
annotations = typing_extensions.get_args(maybe_annotated_type)[1:]
|
|
162
|
+
|
|
163
|
+
for annotation in annotations:
|
|
164
|
+
if isinstance(annotation, FieldMetadata) and annotation.alias is not None:
|
|
165
|
+
return annotation.alias
|
|
166
|
+
|
|
167
|
+
return key
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from . import loadbalancer
|
|
4
|
+
from .loadbalancer import (
|
|
5
|
+
Certificate,
|
|
6
|
+
IpAddressType,
|
|
7
|
+
Listener,
|
|
8
|
+
LoadBalancerReport,
|
|
9
|
+
LoadBalancerState,
|
|
10
|
+
LoadBalancerV1,
|
|
11
|
+
LoadBalancerV2,
|
|
12
|
+
Protocol,
|
|
13
|
+
Target,
|
|
14
|
+
TargetGroup,
|
|
15
|
+
TargetGroupIpAddressType,
|
|
16
|
+
TargetType,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"Certificate",
|
|
21
|
+
"IpAddressType",
|
|
22
|
+
"Listener",
|
|
23
|
+
"LoadBalancerReport",
|
|
24
|
+
"LoadBalancerState",
|
|
25
|
+
"LoadBalancerV1",
|
|
26
|
+
"LoadBalancerV2",
|
|
27
|
+
"Protocol",
|
|
28
|
+
"Target",
|
|
29
|
+
"TargetGroup",
|
|
30
|
+
"TargetGroupIpAddressType",
|
|
31
|
+
"TargetType",
|
|
32
|
+
"loadbalancer",
|
|
33
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
from .certificate import Certificate
|
|
4
|
+
from .ip_address_type import IpAddressType
|
|
5
|
+
from .listener import Listener
|
|
6
|
+
from .load_balancer_report import LoadBalancerReport
|
|
7
|
+
from .load_balancer_state import LoadBalancerState
|
|
8
|
+
from .load_balancer_v_1 import LoadBalancerV1
|
|
9
|
+
from .load_balancer_v_2 import LoadBalancerV2
|
|
10
|
+
from .protocol import Protocol
|
|
11
|
+
from .target import Target
|
|
12
|
+
from .target_group import TargetGroup
|
|
13
|
+
from .target_group_ip_address_type import TargetGroupIpAddressType
|
|
14
|
+
from .target_type import TargetType
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"Certificate",
|
|
18
|
+
"IpAddressType",
|
|
19
|
+
"Listener",
|
|
20
|
+
"LoadBalancerReport",
|
|
21
|
+
"LoadBalancerState",
|
|
22
|
+
"LoadBalancerV1",
|
|
23
|
+
"LoadBalancerV2",
|
|
24
|
+
"Protocol",
|
|
25
|
+
"Target",
|
|
26
|
+
"TargetGroup",
|
|
27
|
+
"TargetGroupIpAddressType",
|
|
28
|
+
"TargetType",
|
|
29
|
+
]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Certificate(UniversalBaseModel):
|
|
11
|
+
arn: str
|
|
12
|
+
is_default: bool = pydantic.Field(alias="isDefault")
|
|
13
|
+
|
|
14
|
+
if IS_PYDANTIC_V2:
|
|
15
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
|
|
16
|
+
else:
|
|
17
|
+
|
|
18
|
+
class Config:
|
|
19
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .certificate import Certificate
|
|
9
|
+
from .protocol import Protocol
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Listener(UniversalBaseModel):
|
|
13
|
+
arn: typing.Optional[str] = None
|
|
14
|
+
protocol: typing.Optional[Protocol] = None
|
|
15
|
+
port: int
|
|
16
|
+
certificates: typing.Optional[typing.List[Certificate]] = None
|
|
17
|
+
load_balancer_arn: typing.Optional[str] = pydantic.Field(alias="loadBalancerArn", default=None)
|
|
18
|
+
|
|
19
|
+
if IS_PYDANTIC_V2:
|
|
20
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
|
|
21
|
+
else:
|
|
22
|
+
|
|
23
|
+
class Config:
|
|
24
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .load_balancer_v_1 import LoadBalancerV1
|
|
9
|
+
from .load_balancer_v_2 import LoadBalancerV2
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class LoadBalancerReport(UniversalBaseModel):
|
|
13
|
+
account_id: str = pydantic.Field(alias="accountId")
|
|
14
|
+
v_2_load_balancers: typing.Optional[typing.List[LoadBalancerV2]] = pydantic.Field(
|
|
15
|
+
alias="v2LoadBalancers", default=None
|
|
16
|
+
)
|
|
17
|
+
v_1_load_balancers: typing.Optional[typing.List[LoadBalancerV1]] = pydantic.Field(
|
|
18
|
+
alias="v1LoadBalancers", default=None
|
|
19
|
+
)
|
|
20
|
+
errors: typing.Optional[typing.List[str]] = None
|
|
21
|
+
|
|
22
|
+
if IS_PYDANTIC_V2:
|
|
23
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
|
|
24
|
+
else:
|
|
25
|
+
|
|
26
|
+
class Config:
|
|
27
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from .listener import Listener
|
|
10
|
+
from .target import Target
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class LoadBalancerV1(UniversalBaseModel):
|
|
14
|
+
name: str
|
|
15
|
+
created_time: dt.datetime = pydantic.Field(alias="createdTime")
|
|
16
|
+
dns_name: str = pydantic.Field(alias="dnsName")
|
|
17
|
+
security_group_ids: typing.List[str] = pydantic.Field(alias="securityGroupIds")
|
|
18
|
+
vpc_id: str = pydantic.Field(alias="vpcId")
|
|
19
|
+
subnet_ids: typing.List[str] = pydantic.Field(alias="subnetIds")
|
|
20
|
+
hosted_zone_id: typing.Optional[str] = pydantic.Field(alias="hostedZoneId", default=None)
|
|
21
|
+
targets: typing.List[Target]
|
|
22
|
+
listeners: typing.List[Listener]
|
|
23
|
+
|
|
24
|
+
if IS_PYDANTIC_V2:
|
|
25
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
|
|
26
|
+
else:
|
|
27
|
+
|
|
28
|
+
class Config:
|
|
29
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import datetime as dt
|
|
4
|
+
import typing
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
9
|
+
from .ip_address_type import IpAddressType
|
|
10
|
+
from .listener import Listener
|
|
11
|
+
from .load_balancer_state import LoadBalancerState
|
|
12
|
+
from .target_group import TargetGroup
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class LoadBalancerV2(UniversalBaseModel):
|
|
16
|
+
"""
|
|
17
|
+
LoadBalancer represents a load balancer that distributes incoming network traffic across multiple servers.
|
|
18
|
+
As defined by the AWS Go SDK (https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2@v1.33.1/types#LoadBalancer)
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
arn: str
|
|
22
|
+
name: str
|
|
23
|
+
created_time: dt.datetime = pydantic.Field(alias="createdTime")
|
|
24
|
+
dns_name: str = pydantic.Field(alias="dnsName")
|
|
25
|
+
ip_address_type: IpAddressType = pydantic.Field(alias="ipAddressType")
|
|
26
|
+
security_group_ids: typing.List[str] = pydantic.Field(alias="securityGroupIds")
|
|
27
|
+
state: typing.Optional[LoadBalancerState] = None
|
|
28
|
+
vpc_id: str = pydantic.Field(alias="vpcId")
|
|
29
|
+
listeners: typing.Optional[typing.List[Listener]] = None
|
|
30
|
+
subnet_ids: typing.List[str] = pydantic.Field(alias="subnetIds")
|
|
31
|
+
hosted_zone_id: typing.Optional[str] = pydantic.Field(alias="hostedZoneId", default=None)
|
|
32
|
+
target_groups: typing.List[TargetGroup] = pydantic.Field(alias="targetGroups")
|
|
33
|
+
|
|
34
|
+
if IS_PYDANTIC_V2:
|
|
35
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
|
|
36
|
+
else:
|
|
37
|
+
|
|
38
|
+
class Config:
|
|
39
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .target_type import TargetType
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Target(UniversalBaseModel):
|
|
12
|
+
id: str
|
|
13
|
+
type: TargetType
|
|
14
|
+
port: int
|
|
15
|
+
availability_zone: typing.Optional[str] = pydantic.Field(alias="availabilityZone", default=None)
|
|
16
|
+
|
|
17
|
+
if IS_PYDANTIC_V2:
|
|
18
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
|
|
19
|
+
else:
|
|
20
|
+
|
|
21
|
+
class Config:
|
|
22
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
|
|
7
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
8
|
+
from .protocol import Protocol
|
|
9
|
+
from .target import Target
|
|
10
|
+
from .target_group_ip_address_type import TargetGroupIpAddressType
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class TargetGroup(UniversalBaseModel):
|
|
14
|
+
arn: str
|
|
15
|
+
name: str
|
|
16
|
+
ip_address_type: TargetGroupIpAddressType = pydantic.Field(alias="ipAddressType")
|
|
17
|
+
load_balancer_arn: str = pydantic.Field(alias="loadBalancerArn")
|
|
18
|
+
port: int
|
|
19
|
+
protocol: typing.Optional[Protocol] = None
|
|
20
|
+
vpc_id: str = pydantic.Field(alias="vpcId")
|
|
21
|
+
targets: typing.List[Target]
|
|
22
|
+
|
|
23
|
+
if IS_PYDANTIC_V2:
|
|
24
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow") # type: ignore # Pydantic v2
|
|
25
|
+
else:
|
|
26
|
+
|
|
27
|
+
class Config:
|
|
28
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: methodaws
|
|
3
|
+
Version: 0.0.10
|
|
4
|
+
Summary:
|
|
5
|
+
Requires-Python: >=3.8,<4.0
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: Operating System :: MacOS
|
|
8
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Operating System :: POSIX
|
|
11
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Dist: pydantic (>=1.9.2)
|
|
22
|
+
Requires-Dist: pydantic-core (>=2.18.2,<3.0.0)
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
method-security/methodaws/__init__.py,sha256=B84xoWeObgulwjGKjnpbEDk5yBfb98eMu4l2HqLACcw,621
|
|
2
|
+
method-security/methodaws/core/__init__.py,sha256=Z7MBmjdOvLg2XS19a5VrUGugUtHHcL81I6q2UGb8zFk,673
|
|
3
|
+
method-security/methodaws/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
|
|
4
|
+
method-security/methodaws/core/pydantic_utilities.py,sha256=5Fg3PRO5be9PZ4LKvMOLNs5zcT6WJGj22yZO1jfQhtU,7092
|
|
5
|
+
method-security/methodaws/core/serialization.py,sha256=TLuzwJ-hs4-SvGQSME5-mhXmVyIEdmPTDMEjZzsPZ08,5849
|
|
6
|
+
method-security/methodaws/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
method-security/methodaws/resources/__init__.py,sha256=Q7JXKbu89O5aC6a7by554p1WTcHE-g5qDHQioaIjNHs,633
|
|
8
|
+
method-security/methodaws/resources/loadbalancer/__init__.py,sha256=dluY-TwlrZEACN4ydRiRikK3-qRDrbqt2SFRUrgP-k8,836
|
|
9
|
+
method-security/methodaws/resources/loadbalancer/certificate.py,sha256=THjvxT-EPUMfcDJSht22qr12cWmwoNJnYTmXJ73Hsl8,506
|
|
10
|
+
method-security/methodaws/resources/loadbalancer/ip_address_type.py,sha256=1q5ach_kZ-MsF5kt494kro2vpod8hAdaYDoRtk31guE,191
|
|
11
|
+
method-security/methodaws/resources/loadbalancer/listener.py,sha256=5gSriXjA3qkj8QDRbKw0Nf3OQ953M_7P58hMmVpTaEk,766
|
|
12
|
+
method-security/methodaws/resources/loadbalancer/load_balancer_report.py,sha256=Apry6cVOrF8UWwaFtBEJ4HMB0e9FNPq6xgR57wjm6AU,922
|
|
13
|
+
method-security/methodaws/resources/loadbalancer/load_balancer_state.py,sha256=DWF5zlZi4nV3SnX7uTccNmIOnn12Dg0VyJ_uQUm6D4w,196
|
|
14
|
+
method-security/methodaws/resources/loadbalancer/load_balancer_v_1.py,sha256=MgYhrgzb4TvfHXEE_xcdh5PEvEEatNm8dQHVtQ-PErs,1018
|
|
15
|
+
method-security/methodaws/resources/loadbalancer/load_balancer_v_2.py,sha256=novAwRh4Is_AFdMYgTYtE9aOnYYU0wZGrK8qX2u1nn4,1607
|
|
16
|
+
method-security/methodaws/resources/loadbalancer/protocol.py,sha256=2HUZTlYawxF4LnZaPl3w-R83NrheE28Q1_lPuU8I2J0,191
|
|
17
|
+
method-security/methodaws/resources/loadbalancer/target.py,sha256=v3e0phJNuJP670HoVE6wgSipIBc-ARk1tMf0b70Cx8M,615
|
|
18
|
+
method-security/methodaws/resources/loadbalancer/target_group.py,sha256=zJY5xUAZW3jcriBQKDqi84alQeAzSOzgpPmOV8gh5X8,885
|
|
19
|
+
method-security/methodaws/resources/loadbalancer/target_group_ip_address_type.py,sha256=Bvs3mIEYUgNx3saQC2Pn4bs1teZ1vtO1IyrPe5dPvBk,164
|
|
20
|
+
method-security/methodaws/resources/loadbalancer/target_type.py,sha256=5ALqbIeDr_fPwzDn4q3QcT8AnFD0YIre0iLqpcRt2II,162
|
|
21
|
+
methodaws-0.0.10.dist-info/METADATA,sha256=mi--TIRHrUkwVBp-F7cEtsqW8aSRzUDR9nQ47RGOm6o,927
|
|
22
|
+
methodaws-0.0.10.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
23
|
+
methodaws-0.0.10.dist-info/RECORD,,
|