openmeter 1.0.0b120__py3-none-any.whl → 1.0.0b121__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.

@@ -627,7 +627,7 @@ def build_delete_entitlement_request(subject_id_or_key: str, entitlement_id: str
627
627
 
628
628
  def build_list_entitlement_grants_request(
629
629
  subject_id_or_key: str,
630
- entitlement_id: str,
630
+ entitlement_id_or_feature_key: str,
631
631
  *,
632
632
  include_deleted: bool = False,
633
633
  order_by: str = "updatedAt",
@@ -639,10 +639,12 @@ def build_list_entitlement_grants_request(
639
639
  accept = _headers.pop("Accept", "application/json, application/problem+json")
640
640
 
641
641
  # Construct URL
642
- _url = "/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}/grants"
642
+ _url = "/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants"
643
643
  path_format_arguments = {
644
644
  "subjectIdOrKey": _SERIALIZER.url("subject_id_or_key", subject_id_or_key, "str"),
645
- "entitlementId": _SERIALIZER.url("entitlement_id", entitlement_id, "str"),
645
+ "entitlementIdOrFeatureKey": _SERIALIZER.url(
646
+ "entitlement_id_or_feature_key", entitlement_id_or_feature_key, "str"
647
+ ),
646
648
  }
647
649
 
648
650
  _url: str = _url.format(**path_format_arguments) # type: ignore
@@ -659,17 +661,21 @@ def build_list_entitlement_grants_request(
659
661
  return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)
660
662
 
661
663
 
662
- def build_create_grant_request(subject_id_or_key: str, entitlement_id: str, **kwargs: Any) -> HttpRequest:
664
+ def build_create_grant_request(
665
+ subject_id_or_key: str, entitlement_id_or_feature_key: str, **kwargs: Any
666
+ ) -> HttpRequest:
663
667
  _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
664
668
 
665
669
  content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
666
670
  accept = _headers.pop("Accept", "application/json, application/problem+json")
667
671
 
668
672
  # Construct URL
669
- _url = "/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementId}/grants"
673
+ _url = "/api/v1/subjects/{subjectIdOrKey}/entitlements/{entitlementIdOrFeatureKey}/grants"
670
674
  path_format_arguments = {
671
675
  "subjectIdOrKey": _SERIALIZER.url("subject_id_or_key", subject_id_or_key, "str"),
672
- "entitlementId": _SERIALIZER.url("entitlement_id", entitlement_id, "str"),
676
+ "entitlementIdOrFeatureKey": _SERIALIZER.url(
677
+ "entitlement_id_or_feature_key", entitlement_id_or_feature_key, "str"
678
+ ),
673
679
  }
674
680
 
675
681
  _url: str = _url.format(**path_format_arguments) # type: ignore
@@ -3874,7 +3880,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3874
3880
  def list_entitlement_grants(
3875
3881
  self,
3876
3882
  subject_id_or_key: str,
3877
- entitlement_id: str,
3883
+ entitlement_id_or_feature_key: str,
3878
3884
  *,
3879
3885
  include_deleted: bool = False,
3880
3886
  order_by: str = "updatedAt",
@@ -3883,13 +3889,14 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3883
3889
  # pylint: disable=line-too-long
3884
3890
  """List grants for an entitlement.
3885
3891
 
3886
- List all grants issued for an entitlement. This endpoint is intended for administrative
3887
- purposes.
3892
+ List all grants issued for an entitlement. The entitlement can be defined either by its id or
3893
+ featureKey.
3888
3894
 
3889
3895
  :param subject_id_or_key: A unique identifier for a subject. Required.
3890
3896
  :type subject_id_or_key: str
3891
- :param entitlement_id: A unique ULID for an entitlement. Required.
3892
- :type entitlement_id: str
3897
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
3898
+ Required.
3899
+ :type entitlement_id_or_feature_key: str
3893
3900
  :keyword include_deleted: Include deleted entries. Default value is False.
3894
3901
  :paramtype include_deleted: bool
3895
3902
  :keyword order_by: Order by field. Known values are: "id", "createdAt", and "updatedAt".
@@ -3980,7 +3987,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3980
3987
 
3981
3988
  _request = build_list_entitlement_grants_request(
3982
3989
  subject_id_or_key=subject_id_or_key,
3983
- entitlement_id=entitlement_id,
3990
+ entitlement_id_or_feature_key=entitlement_id_or_feature_key,
3984
3991
  include_deleted=include_deleted,
3985
3992
  order_by=order_by,
3986
3993
  headers=_headers,
@@ -4015,7 +4022,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4015
4022
  def create_grant(
4016
4023
  self,
4017
4024
  subject_id_or_key: str,
4018
- entitlement_id: str,
4025
+ entitlement_id_or_feature_key: str,
4019
4026
  body: JSON,
4020
4027
  *,
4021
4028
  content_type: str = "application/json",
@@ -4048,8 +4055,9 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4048
4055
 
4049
4056
  :param subject_id_or_key: A unique identifier for a subject. Required.
4050
4057
  :type subject_id_or_key: str
4051
- :param entitlement_id: A unique ULID for an entitlement. Required.
4052
- :type entitlement_id: str
4058
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
4059
+ Required.
4060
+ :type entitlement_id_or_feature_key: str
4053
4061
  :param body: The grant to create. Required.
4054
4062
  :type body: JSON
4055
4063
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
@@ -4169,7 +4177,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4169
4177
  def create_grant(
4170
4178
  self,
4171
4179
  subject_id_or_key: str,
4172
- entitlement_id: str,
4180
+ entitlement_id_or_feature_key: str,
4173
4181
  body: IO[bytes],
4174
4182
  *,
4175
4183
  content_type: str = "application/json",
@@ -4202,8 +4210,9 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4202
4210
 
4203
4211
  :param subject_id_or_key: A unique identifier for a subject. Required.
4204
4212
  :type subject_id_or_key: str
4205
- :param entitlement_id: A unique ULID for an entitlement. Required.
4206
- :type entitlement_id: str
4213
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
4214
+ Required.
4215
+ :type entitlement_id_or_feature_key: str
4207
4216
  :param body: The grant to create. Required.
4208
4217
  :type body: IO[bytes]
4209
4218
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
@@ -4277,7 +4286,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4277
4286
 
4278
4287
  @distributed_trace
4279
4288
  def create_grant(
4280
- self, subject_id_or_key: str, entitlement_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any
4289
+ self, subject_id_or_key: str, entitlement_id_or_feature_key: str, body: Union[JSON, IO[bytes]], **kwargs: Any
4281
4290
  ) -> JSON:
4282
4291
  # pylint: disable=line-too-long
4283
4292
  """Create a grant.
@@ -4306,8 +4315,9 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4306
4315
 
4307
4316
  :param subject_id_or_key: A unique identifier for a subject. Required.
4308
4317
  :type subject_id_or_key: str
4309
- :param entitlement_id: A unique ULID for an entitlement. Required.
4310
- :type entitlement_id: str
4318
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
4319
+ Required.
4320
+ :type entitlement_id_or_feature_key: str
4311
4321
  :param body: The grant to create. Is either a JSON type or a IO[bytes] type. Required.
4312
4322
  :type body: JSON or IO[bytes]
4313
4323
  :return: JSON object
@@ -4445,7 +4455,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4445
4455
 
4446
4456
  _request = build_create_grant_request(
4447
4457
  subject_id_or_key=subject_id_or_key,
4448
- entitlement_id=entitlement_id,
4458
+ entitlement_id_or_feature_key=entitlement_id_or_feature_key,
4449
4459
  content_type=content_type,
4450
4460
  json=_json,
4451
4461
  content=_content,
@@ -3159,7 +3159,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3159
3159
  async def list_entitlement_grants(
3160
3160
  self,
3161
3161
  subject_id_or_key: str,
3162
- entitlement_id: str,
3162
+ entitlement_id_or_feature_key: str,
3163
3163
  *,
3164
3164
  include_deleted: bool = False,
3165
3165
  order_by: str = "updatedAt",
@@ -3168,13 +3168,14 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3168
3168
  # pylint: disable=line-too-long
3169
3169
  """List grants for an entitlement.
3170
3170
 
3171
- List all grants issued for an entitlement. This endpoint is intended for administrative
3172
- purposes.
3171
+ List all grants issued for an entitlement. The entitlement can be defined either by its id or
3172
+ featureKey.
3173
3173
 
3174
3174
  :param subject_id_or_key: A unique identifier for a subject. Required.
3175
3175
  :type subject_id_or_key: str
3176
- :param entitlement_id: A unique ULID for an entitlement. Required.
3177
- :type entitlement_id: str
3176
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
3177
+ Required.
3178
+ :type entitlement_id_or_feature_key: str
3178
3179
  :keyword include_deleted: Include deleted entries. Default value is False.
3179
3180
  :paramtype include_deleted: bool
3180
3181
  :keyword order_by: Order by field. Known values are: "id", "createdAt", and "updatedAt".
@@ -3265,7 +3266,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3265
3266
 
3266
3267
  _request = build_list_entitlement_grants_request(
3267
3268
  subject_id_or_key=subject_id_or_key,
3268
- entitlement_id=entitlement_id,
3269
+ entitlement_id_or_feature_key=entitlement_id_or_feature_key,
3269
3270
  include_deleted=include_deleted,
3270
3271
  order_by=order_by,
3271
3272
  headers=_headers,
@@ -3300,7 +3301,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3300
3301
  async def create_grant(
3301
3302
  self,
3302
3303
  subject_id_or_key: str,
3303
- entitlement_id: str,
3304
+ entitlement_id_or_feature_key: str,
3304
3305
  body: JSON,
3305
3306
  *,
3306
3307
  content_type: str = "application/json",
@@ -3333,8 +3334,9 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3333
3334
 
3334
3335
  :param subject_id_or_key: A unique identifier for a subject. Required.
3335
3336
  :type subject_id_or_key: str
3336
- :param entitlement_id: A unique ULID for an entitlement. Required.
3337
- :type entitlement_id: str
3337
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
3338
+ Required.
3339
+ :type entitlement_id_or_feature_key: str
3338
3340
  :param body: The grant to create. Required.
3339
3341
  :type body: JSON
3340
3342
  :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
@@ -3454,7 +3456,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3454
3456
  async def create_grant(
3455
3457
  self,
3456
3458
  subject_id_or_key: str,
3457
- entitlement_id: str,
3459
+ entitlement_id_or_feature_key: str,
3458
3460
  body: IO[bytes],
3459
3461
  *,
3460
3462
  content_type: str = "application/json",
@@ -3487,8 +3489,9 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3487
3489
 
3488
3490
  :param subject_id_or_key: A unique identifier for a subject. Required.
3489
3491
  :type subject_id_or_key: str
3490
- :param entitlement_id: A unique ULID for an entitlement. Required.
3491
- :type entitlement_id: str
3492
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
3493
+ Required.
3494
+ :type entitlement_id_or_feature_key: str
3492
3495
  :param body: The grant to create. Required.
3493
3496
  :type body: IO[bytes]
3494
3497
  :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
@@ -3562,7 +3565,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3562
3565
 
3563
3566
  @distributed_trace_async
3564
3567
  async def create_grant(
3565
- self, subject_id_or_key: str, entitlement_id: str, body: Union[JSON, IO[bytes]], **kwargs: Any
3568
+ self, subject_id_or_key: str, entitlement_id_or_feature_key: str, body: Union[JSON, IO[bytes]], **kwargs: Any
3566
3569
  ) -> JSON:
3567
3570
  # pylint: disable=line-too-long
3568
3571
  """Create a grant.
@@ -3591,8 +3594,9 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3591
3594
 
3592
3595
  :param subject_id_or_key: A unique identifier for a subject. Required.
3593
3596
  :type subject_id_or_key: str
3594
- :param entitlement_id: A unique ULID for an entitlement. Required.
3595
- :type entitlement_id: str
3597
+ :param entitlement_id_or_feature_key: The id of the entitlement or the key of the feature.
3598
+ Required.
3599
+ :type entitlement_id_or_feature_key: str
3596
3600
  :param body: The grant to create. Is either a JSON type or a IO[bytes] type. Required.
3597
3601
  :type body: JSON or IO[bytes]
3598
3602
  :return: JSON object
@@ -3730,7 +3734,7 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3730
3734
 
3731
3735
  _request = build_create_grant_request(
3732
3736
  subject_id_or_key=subject_id_or_key,
3733
- entitlement_id=entitlement_id,
3737
+ entitlement_id_or_feature_key=entitlement_id_or_feature_key,
3734
3738
  content_type=content_type,
3735
3739
  json=_json,
3736
3740
  content=_content,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openmeter
3
- Version: 1.0.0b120
3
+ Version: 1.0.0b121
4
4
  Summary: Client for OpenMeter: Real-Time and Scalable Usage Metering
5
5
  Home-page: https://openmeter.io
6
6
  License: Apache-2.0
@@ -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=XFln9LwwStsvKhc9gMciyj6nz7k4IGZOMvDMOfTdkwM,221259
5
+ openmeter/_operations/_operations.py,sha256=b0jsfwyj01mPdHocTNMCtXkZH6sS4dK1Ub9fN83MCDE,221807
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=YlZd83T58UjtNJd0_UIvnVNjouCrozkN1d_Un0IXXmY,195118
14
+ openmeter/aio/_operations/_operations.py,sha256=7cQfmudM5h6Ak5A1vi7pVOZgZD2lC99BsS0wT_xHoHE,195478
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.0b120.dist-info/METADATA,sha256=dLyvac5ODK6ypRUepwjh8gWCKEvJyjqS9sunXUdP0rs,2258
20
- openmeter-1.0.0b120.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
- openmeter-1.0.0b120.dist-info/RECORD,,
19
+ openmeter-1.0.0b121.dist-info/METADATA,sha256=Vxn4IXYy2Ph-OOvK9nwt-gPHvtVBCB3nv9Egra79aC4,2258
20
+ openmeter-1.0.0b121.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
21
+ openmeter-1.0.0b121.dist-info/RECORD,,