openmeter 1.0.0b96__tar.gz → 1.0.0b98__tar.gz

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.

Files changed (21) hide show
  1. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/PKG-INFO +1 -1
  2. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/pyproject.toml +1 -1
  3. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_operations/_operations.py +80 -43
  4. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/_operations/_operations.py +77 -41
  5. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/README.md +0 -0
  6. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/__init__.py +0 -0
  7. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_client.py +0 -0
  8. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_configuration.py +0 -0
  9. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_operations/__init__.py +0 -0
  10. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_operations/_patch.py +0 -0
  11. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_patch.py +0 -0
  12. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_serialization.py +0 -0
  13. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/_vendor.py +0 -0
  14. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/__init__.py +0 -0
  15. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/_client.py +0 -0
  16. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/_configuration.py +0 -0
  17. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/_operations/__init__.py +0 -0
  18. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/_operations/_patch.py +0 -0
  19. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/_patch.py +0 -0
  20. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/aio/_vendor.py +0 -0
  21. {openmeter-1.0.0b96 → openmeter-1.0.0b98}/src/openmeter/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openmeter
3
- Version: 1.0.0b96
3
+ Version: 1.0.0b98
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
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "openmeter"
3
- version = "v1.0.0-beta.96"
3
+ version = "v1.0.0-beta.98"
4
4
  description = "Client for OpenMeter: Real-Time and Scalable Usage Metering"
5
5
  authors = ["Andras Toth <4157749+tothandras@users.noreply.github.com>"]
6
6
  license = "Apache-2.0"
@@ -719,8 +719,8 @@ def build_get_entitlement_history_request(
719
719
  subject_id_or_key: str,
720
720
  entitlement_id: str,
721
721
  *,
722
- from_parameter: datetime.datetime,
723
722
  window_size: str,
723
+ from_parameter: Optional[datetime.datetime] = None,
724
724
  to: Optional[datetime.datetime] = None,
725
725
  window_time_zone: str = "UTC",
726
726
  **kwargs: Any
@@ -740,7 +740,8 @@ def build_get_entitlement_history_request(
740
740
  _url: str = _url.format(**path_format_arguments) # type: ignore
741
741
 
742
742
  # Construct parameters
743
- _params["from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601")
743
+ if from_parameter is not None:
744
+ _params["from"] = _SERIALIZER.query("from_parameter", from_parameter, "iso-8601")
744
745
  if to is not None:
745
746
  _params["to"] = _SERIALIZER.query("to", to, "iso-8601")
746
747
  _params["windowSize"] = _SERIALIZER.query("window_size", window_size, "str")
@@ -3177,14 +3178,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3177
3178
  was last updated. Required.
3178
3179
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date
3179
3180
  of the grant.
3180
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum
3181
- amount of the grant that can be rolled over. Defaults to 0. * maxAmount =
3182
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover
3183
- * maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's
3184
- balance will be the MAX(maxRollover, balance) + amount.
3181
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are
3182
+ rolled over at reset, after which they can have a different balance compared
3183
+ to what they had before the reset. Balance after the reset is calculated as:
3184
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3185
+ MinRolloverAmount)).
3185
3186
  "metadata": {
3186
3187
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3187
3188
  },
3189
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are
3190
+ rolled over at reset, after which they can have a different balance compared
3191
+ to what they had before the reset. Balance after the reset is calculated as:
3192
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3193
+ MinRolloverAmount)).
3188
3194
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time
3189
3195
  the grant will recurr.
3190
3196
  "priority": 1, # Optional. Default value is 1. The priority of the
@@ -3765,14 +3771,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3765
3771
  was last updated. Required.
3766
3772
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date
3767
3773
  of the grant.
3768
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum
3769
- amount of the grant that can be rolled over. Defaults to 0. * maxAmount =
3770
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover
3771
- * maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's
3772
- balance will be the MAX(maxRollover, balance) + amount.
3774
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are
3775
+ rolled over at reset, after which they can have a different balance compared
3776
+ to what they had before the reset. Balance after the reset is calculated as:
3777
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3778
+ MinRolloverAmount)).
3773
3779
  "metadata": {
3774
3780
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3775
3781
  },
3782
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are
3783
+ rolled over at reset, after which they can have a different balance compared
3784
+ to what they had before the reset. Balance after the reset is calculated as:
3785
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3786
+ MinRolloverAmount)).
3776
3787
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time
3777
3788
  the grant will recurr.
3778
3789
  "priority": 1, # Optional. Default value is 1. The priority of the
@@ -3884,14 +3895,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3884
3895
  "duration": "str" # The expiration period duration like month.
3885
3896
  Required. Known values are: "HOUR", "DAY", "WEEK", "MONTH", and "YEAR".
3886
3897
  },
3887
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
3888
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
3889
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
3890
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
3891
- will be the MAX(maxRollover, balance) + amount.
3898
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3899
+ over at reset, after which they can have a different balance compared to what
3900
+ they had before the reset. Balance after the reset is calculated as:
3901
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3902
+ MinRolloverAmount)).
3892
3903
  "metadata": {
3893
3904
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3894
3905
  },
3906
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3907
+ over at reset, after which they can have a different balance compared to what
3908
+ they had before the reset. Balance after the reset is calculated as:
3909
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3910
+ MinRolloverAmount)).
3895
3911
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
3896
3912
  Grants with higher priority are applied first. Priority is a positive decimal
3897
3913
  numbers. With lower numbers indicating higher importance. For example, a priority
@@ -3933,14 +3949,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3933
3949
  last updated. Required.
3934
3950
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date of the
3935
3951
  grant.
3936
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
3937
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
3938
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
3939
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
3940
- will be the MAX(maxRollover, balance) + amount.
3952
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3953
+ over at reset, after which they can have a different balance compared to what
3954
+ they had before the reset. Balance after the reset is calculated as:
3955
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3956
+ MinRolloverAmount)).
3941
3957
  "metadata": {
3942
3958
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3943
3959
  },
3960
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3961
+ over at reset, after which they can have a different balance compared to what
3962
+ they had before the reset. Balance after the reset is calculated as:
3963
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3964
+ MinRolloverAmount)).
3944
3965
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time the grant
3945
3966
  will recurr.
3946
3967
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
@@ -4017,14 +4038,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4017
4038
  last updated. Required.
4018
4039
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date of the
4019
4040
  grant.
4020
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
4021
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
4022
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
4023
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
4024
- will be the MAX(maxRollover, balance) + amount.
4041
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
4042
+ over at reset, after which they can have a different balance compared to what
4043
+ they had before the reset. Balance after the reset is calculated as:
4044
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
4045
+ MinRolloverAmount)).
4025
4046
  "metadata": {
4026
4047
  "str": "str" # Optional. Dictionary of :code:`<string>`.
4027
4048
  },
4049
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
4050
+ over at reset, after which they can have a different balance compared to what
4051
+ they had before the reset. Balance after the reset is calculated as:
4052
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
4053
+ MinRolloverAmount)).
4028
4054
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time the grant
4029
4055
  will recurr.
4030
4056
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
@@ -4081,14 +4107,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4081
4107
  "duration": "str" # The expiration period duration like month.
4082
4108
  Required. Known values are: "HOUR", "DAY", "WEEK", "MONTH", and "YEAR".
4083
4109
  },
4084
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
4085
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
4086
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
4087
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
4088
- will be the MAX(maxRollover, balance) + amount.
4110
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
4111
+ over at reset, after which they can have a different balance compared to what
4112
+ they had before the reset. Balance after the reset is calculated as:
4113
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
4114
+ MinRolloverAmount)).
4089
4115
  "metadata": {
4090
4116
  "str": "str" # Optional. Dictionary of :code:`<string>`.
4091
4117
  },
4118
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
4119
+ over at reset, after which they can have a different balance compared to what
4120
+ they had before the reset. Balance after the reset is calculated as:
4121
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
4122
+ MinRolloverAmount)).
4092
4123
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
4093
4124
  Grants with higher priority are applied first. Priority is a positive decimal
4094
4125
  numbers. With lower numbers indicating higher importance. For example, a priority
@@ -4130,14 +4161,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4130
4161
  last updated. Required.
4131
4162
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date of the
4132
4163
  grant.
4133
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
4134
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
4135
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
4136
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
4137
- will be the MAX(maxRollover, balance) + amount.
4164
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
4165
+ over at reset, after which they can have a different balance compared to what
4166
+ they had before the reset. Balance after the reset is calculated as:
4167
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
4168
+ MinRolloverAmount)).
4138
4169
  "metadata": {
4139
4170
  "str": "str" # Optional. Dictionary of :code:`<string>`.
4140
4171
  },
4172
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
4173
+ over at reset, after which they can have a different balance compared to what
4174
+ they had before the reset. Balance after the reset is calculated as:
4175
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
4176
+ MinRolloverAmount)).
4141
4177
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time the grant
4142
4178
  will recurr.
4143
4179
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
@@ -4311,8 +4347,8 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4311
4347
  subject_id_or_key: str,
4312
4348
  entitlement_id: str,
4313
4349
  *,
4314
- from_parameter: datetime.datetime,
4315
4350
  window_size: str,
4351
+ from_parameter: Optional[datetime.datetime] = None,
4316
4352
  to: Optional[datetime.datetime] = None,
4317
4353
  window_time_zone: str = "UTC",
4318
4354
  **kwargs: Any
@@ -4329,13 +4365,14 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4329
4365
  :type subject_id_or_key: str
4330
4366
  :param entitlement_id: A unique ULID for an entitlement. Required.
4331
4367
  :type entitlement_id: str
4332
- :keyword from_parameter: Start of time range to query entitlement: date-time in RFC 3339
4333
- format.
4334
- Gets truncated to the granularity of the underlying meter. Required.
4335
- :paramtype from_parameter: ~datetime.datetime
4336
4368
  :keyword window_size: Size of the time window to group the history by. Cannot be shorter than
4337
4369
  meter granularity. Known values are: "MINUTE", "HOUR", and "DAY". Required.
4338
4370
  :paramtype window_size: str
4371
+ :keyword from_parameter: Start of time range to query entitlement: date-time in RFC 3339
4372
+ format. Defaults to
4373
+ the last reset.
4374
+ Gets truncated to the granularity of the underlying meter. Default value is None.
4375
+ :paramtype from_parameter: ~datetime.datetime
4339
4376
  :keyword to: End of time range to query entitlement: date-time in RFC 3339 format. Defaults to
4340
4377
  now.
4341
4378
  If not now then gets truncated to the granularity of the underlying meter. Default value is
@@ -4421,8 +4458,8 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
4421
4458
  _request = build_get_entitlement_history_request(
4422
4459
  subject_id_or_key=subject_id_or_key,
4423
4460
  entitlement_id=entitlement_id,
4424
- from_parameter=from_parameter,
4425
4461
  window_size=window_size,
4462
+ from_parameter=from_parameter,
4426
4463
  to=to,
4427
4464
  window_time_zone=window_time_zone,
4428
4465
  headers=_headers,
@@ -2476,14 +2476,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
2476
2476
  was last updated. Required.
2477
2477
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date
2478
2478
  of the grant.
2479
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum
2480
- amount of the grant that can be rolled over. Defaults to 0. * maxAmount =
2481
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover
2482
- * maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's
2483
- balance will be the MAX(maxRollover, balance) + amount.
2479
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are
2480
+ rolled over at reset, after which they can have a different balance compared
2481
+ to what they had before the reset. Balance after the reset is calculated as:
2482
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
2483
+ MinRolloverAmount)).
2484
2484
  "metadata": {
2485
2485
  "str": "str" # Optional. Dictionary of :code:`<string>`.
2486
2486
  },
2487
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are
2488
+ rolled over at reset, after which they can have a different balance compared
2489
+ to what they had before the reset. Balance after the reset is calculated as:
2490
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
2491
+ MinRolloverAmount)).
2487
2492
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time
2488
2493
  the grant will recurr.
2489
2494
  "priority": 1, # Optional. Default value is 1. The priority of the
@@ -3064,14 +3069,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3064
3069
  was last updated. Required.
3065
3070
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date
3066
3071
  of the grant.
3067
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum
3068
- amount of the grant that can be rolled over. Defaults to 0. * maxAmount =
3069
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover
3070
- * maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's
3071
- balance will be the MAX(maxRollover, balance) + amount.
3072
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are
3073
+ rolled over at reset, after which they can have a different balance compared
3074
+ to what they had before the reset. Balance after the reset is calculated as:
3075
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3076
+ MinRolloverAmount)).
3072
3077
  "metadata": {
3073
3078
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3074
3079
  },
3080
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are
3081
+ rolled over at reset, after which they can have a different balance compared
3082
+ to what they had before the reset. Balance after the reset is calculated as:
3083
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3084
+ MinRolloverAmount)).
3075
3085
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time
3076
3086
  the grant will recurr.
3077
3087
  "priority": 1, # Optional. Default value is 1. The priority of the
@@ -3183,14 +3193,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3183
3193
  "duration": "str" # The expiration period duration like month.
3184
3194
  Required. Known values are: "HOUR", "DAY", "WEEK", "MONTH", and "YEAR".
3185
3195
  },
3186
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
3187
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
3188
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
3189
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
3190
- will be the MAX(maxRollover, balance) + amount.
3196
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3197
+ over at reset, after which they can have a different balance compared to what
3198
+ they had before the reset. Balance after the reset is calculated as:
3199
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3200
+ MinRolloverAmount)).
3191
3201
  "metadata": {
3192
3202
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3193
3203
  },
3204
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3205
+ over at reset, after which they can have a different balance compared to what
3206
+ they had before the reset. Balance after the reset is calculated as:
3207
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3208
+ MinRolloverAmount)).
3194
3209
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
3195
3210
  Grants with higher priority are applied first. Priority is a positive decimal
3196
3211
  numbers. With lower numbers indicating higher importance. For example, a priority
@@ -3232,14 +3247,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3232
3247
  last updated. Required.
3233
3248
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date of the
3234
3249
  grant.
3235
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
3236
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
3237
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
3238
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
3239
- will be the MAX(maxRollover, balance) + amount.
3250
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3251
+ over at reset, after which they can have a different balance compared to what
3252
+ they had before the reset. Balance after the reset is calculated as:
3253
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3254
+ MinRolloverAmount)).
3240
3255
  "metadata": {
3241
3256
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3242
3257
  },
3258
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3259
+ over at reset, after which they can have a different balance compared to what
3260
+ they had before the reset. Balance after the reset is calculated as:
3261
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3262
+ MinRolloverAmount)).
3243
3263
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time the grant
3244
3264
  will recurr.
3245
3265
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
@@ -3316,14 +3336,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3316
3336
  last updated. Required.
3317
3337
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date of the
3318
3338
  grant.
3319
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
3320
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
3321
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
3322
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
3323
- will be the MAX(maxRollover, balance) + amount.
3339
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3340
+ over at reset, after which they can have a different balance compared to what
3341
+ they had before the reset. Balance after the reset is calculated as:
3342
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3343
+ MinRolloverAmount)).
3324
3344
  "metadata": {
3325
3345
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3326
3346
  },
3347
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3348
+ over at reset, after which they can have a different balance compared to what
3349
+ they had before the reset. Balance after the reset is calculated as:
3350
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3351
+ MinRolloverAmount)).
3327
3352
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time the grant
3328
3353
  will recurr.
3329
3354
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
@@ -3380,14 +3405,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3380
3405
  "duration": "str" # The expiration period duration like month.
3381
3406
  Required. Known values are: "HOUR", "DAY", "WEEK", "MONTH", and "YEAR".
3382
3407
  },
3383
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
3384
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
3385
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
3386
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
3387
- will be the MAX(maxRollover, balance) + amount.
3408
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3409
+ over at reset, after which they can have a different balance compared to what
3410
+ they had before the reset. Balance after the reset is calculated as:
3411
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3412
+ MinRolloverAmount)).
3388
3413
  "metadata": {
3389
3414
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3390
3415
  },
3416
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3417
+ over at reset, after which they can have a different balance compared to what
3418
+ they had before the reset. Balance after the reset is calculated as:
3419
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3420
+ MinRolloverAmount)).
3391
3421
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
3392
3422
  Grants with higher priority are applied first. Priority is a positive decimal
3393
3423
  numbers. With lower numbers indicating higher importance. For example, a priority
@@ -3429,14 +3459,19 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3429
3459
  last updated. Required.
3430
3460
  "expiresAt": "2020-02-20 00:00:00", # Optional. The expiration date of the
3431
3461
  grant.
3432
- "maxRolloverAmount": 0, # Optional. Default value is 0. The maximum amount
3433
- of the grant that can be rolled over. Defaults to 0. * maxAmount =
3434
- {original_amount} -> rollover original amount * maxAmount = 0 -> no rollover *
3435
- maxAmount = 90 -> rollover 90 max If it's larger than 0 then the grant's balance
3436
- will be the MAX(maxRollover, balance) + amount.
3462
+ "maxRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3463
+ over at reset, after which they can have a different balance compared to what
3464
+ they had before the reset. Balance after the reset is calculated as:
3465
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3466
+ MinRolloverAmount)).
3437
3467
  "metadata": {
3438
3468
  "str": "str" # Optional. Dictionary of :code:`<string>`.
3439
3469
  },
3470
+ "minRolloverAmount": 0, # Optional. Default value is 0. Grants are rolled
3471
+ over at reset, after which they can have a different balance compared to what
3472
+ they had before the reset. Balance after the reset is calculated as:
3473
+ Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset,
3474
+ MinRolloverAmount)).
3440
3475
  "nextRecurrence": "2020-02-20 00:00:00", # Optional. The next time the grant
3441
3476
  will recurr.
3442
3477
  "priority": 1, # Optional. Default value is 1. The priority of the grant.
@@ -3610,8 +3645,8 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3610
3645
  subject_id_or_key: str,
3611
3646
  entitlement_id: str,
3612
3647
  *,
3613
- from_parameter: datetime.datetime,
3614
3648
  window_size: str,
3649
+ from_parameter: Optional[datetime.datetime] = None,
3615
3650
  to: Optional[datetime.datetime] = None,
3616
3651
  window_time_zone: str = "UTC",
3617
3652
  **kwargs: Any
@@ -3628,13 +3663,14 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3628
3663
  :type subject_id_or_key: str
3629
3664
  :param entitlement_id: A unique ULID for an entitlement. Required.
3630
3665
  :type entitlement_id: str
3631
- :keyword from_parameter: Start of time range to query entitlement: date-time in RFC 3339
3632
- format.
3633
- Gets truncated to the granularity of the underlying meter. Required.
3634
- :paramtype from_parameter: ~datetime.datetime
3635
3666
  :keyword window_size: Size of the time window to group the history by. Cannot be shorter than
3636
3667
  meter granularity. Known values are: "MINUTE", "HOUR", and "DAY". Required.
3637
3668
  :paramtype window_size: str
3669
+ :keyword from_parameter: Start of time range to query entitlement: date-time in RFC 3339
3670
+ format. Defaults to
3671
+ the last reset.
3672
+ Gets truncated to the granularity of the underlying meter. Default value is None.
3673
+ :paramtype from_parameter: ~datetime.datetime
3638
3674
  :keyword to: End of time range to query entitlement: date-time in RFC 3339 format. Defaults to
3639
3675
  now.
3640
3676
  If not now then gets truncated to the granularity of the underlying meter. Default value is
@@ -3720,8 +3756,8 @@ class ClientOperationsMixin(ClientMixinABC): # pylint: disable=too-many-public-
3720
3756
  _request = build_get_entitlement_history_request(
3721
3757
  subject_id_or_key=subject_id_or_key,
3722
3758
  entitlement_id=entitlement_id,
3723
- from_parameter=from_parameter,
3724
3759
  window_size=window_size,
3760
+ from_parameter=from_parameter,
3725
3761
  to=to,
3726
3762
  window_time_zone=window_time_zone,
3727
3763
  headers=_headers,
File without changes