openmeter 1.0.0b129__py3-none-any.whl → 1.0.0b131__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.
Potentially problematic release.
This version of openmeter might be problematic. Click here for more details.
- openmeter/_operations/_operations.py +83 -0
- openmeter/aio/_operations/_operations.py +65 -0
- {openmeter-1.0.0b129.dist-info → openmeter-1.0.0b131.dist-info}/METADATA +1 -1
- {openmeter-1.0.0b129.dist-info → openmeter-1.0.0b131.dist-info}/RECORD +5 -5
- {openmeter-1.0.0b129.dist-info → openmeter-1.0.0b131.dist-info}/WHEEL +0 -0
|
@@ -431,6 +431,25 @@ def build_list_entitlements_request(
|
|
|
431
431
|
return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
|
|
432
432
|
|
|
433
433
|
|
|
434
|
+
def build_get_entitlement_by_id_request(entitlement_id: str, **kwargs: Any) -> HttpRequest:
|
|
435
|
+
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
|
436
|
+
|
|
437
|
+
accept = _headers.pop("Accept", "application/json, application/problem+json")
|
|
438
|
+
|
|
439
|
+
# Construct URL
|
|
440
|
+
_url = "/api/v1/entitlements/{entitlementId}"
|
|
441
|
+
path_format_arguments = {
|
|
442
|
+
"entitlementId": _SERIALIZER.url("entitlement_id", entitlement_id, "str"),
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
_url: str = _url.format(**path_format_arguments) # type: ignore
|
|
446
|
+
|
|
447
|
+
# Construct headers
|
|
448
|
+
_headers["Accept"] = _SERIALIZER.header("accept", accept, "str")
|
|
449
|
+
|
|
450
|
+
return HttpRequest(method="GET", url=_url, headers=_headers, **kwargs)
|
|
451
|
+
|
|
452
|
+
|
|
434
453
|
def build_list_features_request(
|
|
435
454
|
*,
|
|
436
455
|
page: int = 1,
|
|
@@ -3050,6 +3069,70 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
|
|
|
3050
3069
|
|
|
3051
3070
|
return cast(Any, deserialized) # type: ignore
|
|
3052
3071
|
|
|
3072
|
+
@distributed_trace
|
|
3073
|
+
def get_entitlement_by_id(self, entitlement_id: str, **kwargs: Any) -> JSON:
|
|
3074
|
+
"""Get an entitlement.
|
|
3075
|
+
|
|
3076
|
+
Get entitlement by id.
|
|
3077
|
+
|
|
3078
|
+
:param entitlement_id: A unique ULID for an entitlement. Required.
|
|
3079
|
+
:type entitlement_id: str
|
|
3080
|
+
:return: JSON object
|
|
3081
|
+
:rtype: JSON
|
|
3082
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
|
3083
|
+
|
|
3084
|
+
Example:
|
|
3085
|
+
.. code-block:: python
|
|
3086
|
+
|
|
3087
|
+
# response body for status code(s): 200
|
|
3088
|
+
response == {
|
|
3089
|
+
"lastReset": "2020-02-20 00:00:00" # Optional. The last time usage was
|
|
3090
|
+
reset.
|
|
3091
|
+
}
|
|
3092
|
+
"""
|
|
3093
|
+
error_map = {
|
|
3094
|
+
409: ResourceExistsError,
|
|
3095
|
+
304: ResourceNotModifiedError,
|
|
3096
|
+
401: lambda response: ClientAuthenticationError(response=response),
|
|
3097
|
+
404: lambda response: ResourceNotFoundError(response=response),
|
|
3098
|
+
}
|
|
3099
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
3100
|
+
|
|
3101
|
+
_headers = kwargs.pop("headers", {}) or {}
|
|
3102
|
+
_params = kwargs.pop("params", {}) or {}
|
|
3103
|
+
|
|
3104
|
+
cls: ClsType[JSON] = kwargs.pop("cls", None)
|
|
3105
|
+
|
|
3106
|
+
_request = build_get_entitlement_by_id_request(
|
|
3107
|
+
entitlement_id=entitlement_id,
|
|
3108
|
+
headers=_headers,
|
|
3109
|
+
params=_params,
|
|
3110
|
+
)
|
|
3111
|
+
_request.url = self._client.format_url(_request.url)
|
|
3112
|
+
|
|
3113
|
+
_stream = False
|
|
3114
|
+
pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access
|
|
3115
|
+
_request, stream=_stream, **kwargs
|
|
3116
|
+
)
|
|
3117
|
+
|
|
3118
|
+
response = pipeline_response.http_response
|
|
3119
|
+
|
|
3120
|
+
if response.status_code not in [200]:
|
|
3121
|
+
if _stream:
|
|
3122
|
+
response.read() # Load the body in memory and close the socket
|
|
3123
|
+
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
|
|
3124
|
+
raise HttpResponseError(response=response)
|
|
3125
|
+
|
|
3126
|
+
if response.content:
|
|
3127
|
+
deserialized = response.json()
|
|
3128
|
+
else:
|
|
3129
|
+
deserialized = None
|
|
3130
|
+
|
|
3131
|
+
if cls:
|
|
3132
|
+
return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore
|
|
3133
|
+
|
|
3134
|
+
return cast(JSON, deserialized) # type: ignore
|
|
3135
|
+
|
|
3053
3136
|
@distributed_trace
|
|
3054
3137
|
def list_features(
|
|
3055
3138
|
self,
|
|
@@ -37,6 +37,7 @@ from ..._operations._operations import (
|
|
|
37
37
|
build_delete_notification_rule_request,
|
|
38
38
|
build_delete_subject_request,
|
|
39
39
|
build_get_debug_metrics_request,
|
|
40
|
+
build_get_entitlement_by_id_request,
|
|
40
41
|
build_get_entitlement_history_request,
|
|
41
42
|
build_get_entitlement_request,
|
|
42
43
|
build_get_entitlement_value_request,
|
|
@@ -2006,6 +2007,70 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
|
|
|
2006
2007
|
|
|
2007
2008
|
return cast(Any, deserialized) # type: ignore
|
|
2008
2009
|
|
|
2010
|
+
@distributed_trace_async
|
|
2011
|
+
async def get_entitlement_by_id(self, entitlement_id: str, **kwargs: Any) -> JSON:
|
|
2012
|
+
"""Get an entitlement.
|
|
2013
|
+
|
|
2014
|
+
Get entitlement by id.
|
|
2015
|
+
|
|
2016
|
+
:param entitlement_id: A unique ULID for an entitlement. Required.
|
|
2017
|
+
:type entitlement_id: str
|
|
2018
|
+
:return: JSON object
|
|
2019
|
+
:rtype: JSON
|
|
2020
|
+
:raises ~azure.core.exceptions.HttpResponseError:
|
|
2021
|
+
|
|
2022
|
+
Example:
|
|
2023
|
+
.. code-block:: python
|
|
2024
|
+
|
|
2025
|
+
# response body for status code(s): 200
|
|
2026
|
+
response == {
|
|
2027
|
+
"lastReset": "2020-02-20 00:00:00" # Optional. The last time usage was
|
|
2028
|
+
reset.
|
|
2029
|
+
}
|
|
2030
|
+
"""
|
|
2031
|
+
error_map = {
|
|
2032
|
+
409: ResourceExistsError,
|
|
2033
|
+
304: ResourceNotModifiedError,
|
|
2034
|
+
401: lambda response: ClientAuthenticationError(response=response),
|
|
2035
|
+
404: lambda response: ResourceNotFoundError(response=response),
|
|
2036
|
+
}
|
|
2037
|
+
error_map.update(kwargs.pop("error_map", {}) or {})
|
|
2038
|
+
|
|
2039
|
+
_headers = kwargs.pop("headers", {}) or {}
|
|
2040
|
+
_params = kwargs.pop("params", {}) or {}
|
|
2041
|
+
|
|
2042
|
+
cls: ClsType[JSON] = kwargs.pop("cls", None)
|
|
2043
|
+
|
|
2044
|
+
_request = build_get_entitlement_by_id_request(
|
|
2045
|
+
entitlement_id=entitlement_id,
|
|
2046
|
+
headers=_headers,
|
|
2047
|
+
params=_params,
|
|
2048
|
+
)
|
|
2049
|
+
_request.url = self._client.format_url(_request.url)
|
|
2050
|
+
|
|
2051
|
+
_stream = False
|
|
2052
|
+
pipeline_response: PipelineResponse = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
|
|
2053
|
+
_request, stream=_stream, **kwargs
|
|
2054
|
+
)
|
|
2055
|
+
|
|
2056
|
+
response = pipeline_response.http_response
|
|
2057
|
+
|
|
2058
|
+
if response.status_code not in [200]:
|
|
2059
|
+
if _stream:
|
|
2060
|
+
await response.read() # Load the body in memory and close the socket
|
|
2061
|
+
map_error(status_code=response.status_code, response=response, error_map=error_map) # type: ignore
|
|
2062
|
+
raise HttpResponseError(response=response)
|
|
2063
|
+
|
|
2064
|
+
if response.content:
|
|
2065
|
+
deserialized = response.json()
|
|
2066
|
+
else:
|
|
2067
|
+
deserialized = None
|
|
2068
|
+
|
|
2069
|
+
if cls:
|
|
2070
|
+
return cls(pipeline_response, cast(JSON, deserialized), {}) # type: ignore
|
|
2071
|
+
|
|
2072
|
+
return cast(JSON, deserialized) # type: ignore
|
|
2073
|
+
|
|
2009
2074
|
@distributed_trace_async
|
|
2010
2075
|
async def list_features(
|
|
2011
2076
|
self,
|
|
@@ -2,7 +2,7 @@ openmeter/__init__.py,sha256=7klRT7LAGDqBcZsl7LGZrgrABVwyncgVUlidfaPiJm4,702
|
|
|
2
2
|
openmeter/_client.py,sha256=TIXIPi_UVO-d5BHra7_xIiKmLfZBrmc4L_Xq2gxi4lM,3982
|
|
3
3
|
openmeter/_configuration.py,sha256=CIdMxPaIXwDLaCsnvmdmHTfplV_cRp24101RJCEWtes,1807
|
|
4
4
|
openmeter/_operations/__init__.py,sha256=GVYObnS1nT-wbN8ONRxlAiH6NBeAXlOBi7olGJE9niA,682
|
|
5
|
-
openmeter/_operations/_operations.py,sha256=
|
|
5
|
+
openmeter/_operations/_operations.py,sha256=jbEzKlZdYuAkgCNybuSk9nskZOYspGY9y9fxPfOiL2g,276409
|
|
6
6
|
openmeter/_operations/_patch.py,sha256=ptSL-JhY1fbGT9Cw2cUkPF1TPz5qVgXwTMMT5h41XUc,4874
|
|
7
7
|
openmeter/_patch.py,sha256=P7PMm3Gbjlk56lI6B_Ra43hSW5qGMEmN3cNYGH5uZ3s,674
|
|
8
8
|
openmeter/_serialization.py,sha256=vQIv-wuCQabtiIq2DXOr7-InGADqxlXTGNEKv9OlDPs,78873
|
|
@@ -11,11 +11,11 @@ openmeter/aio/__init__.py,sha256=7klRT7LAGDqBcZsl7LGZrgrABVwyncgVUlidfaPiJm4,702
|
|
|
11
11
|
openmeter/aio/_client.py,sha256=O0VpMfw42UuTN_ZTIL3dw944PviLIrBBCSp7UaexyKQ,4100
|
|
12
12
|
openmeter/aio/_configuration.py,sha256=NtT-cxQWkt8q_FvMfwqqil18Tt9zJmWGVju4U9s7OsE,1817
|
|
13
13
|
openmeter/aio/_operations/__init__.py,sha256=GVYObnS1nT-wbN8ONRxlAiH6NBeAXlOBi7olGJE9niA,682
|
|
14
|
-
openmeter/aio/_operations/_operations.py,sha256=
|
|
14
|
+
openmeter/aio/_operations/_operations.py,sha256=d7yuEZODJrnndzwAKnszveD1kc1kZb1gd_c84oo0D0k,238139
|
|
15
15
|
openmeter/aio/_operations/_patch.py,sha256=P7PMm3Gbjlk56lI6B_Ra43hSW5qGMEmN3cNYGH5uZ3s,674
|
|
16
16
|
openmeter/aio/_patch.py,sha256=P7PMm3Gbjlk56lI6B_Ra43hSW5qGMEmN3cNYGH5uZ3s,674
|
|
17
17
|
openmeter/aio/_vendor.py,sha256=CFsSbXOBydpg_f_uciu6Pe6cvF__6ofZ6KFEhkaMMEU,862
|
|
18
18
|
openmeter/py.typed,sha256=dcrsqJrcYfTX-ckLFJMTaj6mD8aDe2u0tkQG-ZYxnEg,26
|
|
19
|
-
openmeter-1.0.
|
|
20
|
-
openmeter-1.0.
|
|
21
|
-
openmeter-1.0.
|
|
19
|
+
openmeter-1.0.0b131.dist-info/METADATA,sha256=paWYfu_9rjOsipMMrKVspXcKaIs-q98u7YVIeW4Vsf4,2258
|
|
20
|
+
openmeter-1.0.0b131.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
21
|
+
openmeter-1.0.0b131.dist-info/RECORD,,
|
|
File without changes
|