stigg-api-client-v2 3.36.0__py3-none-any.whl → 3.38.0__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 stigg-api-client-v2 might be problematic. Click here for more details.

@@ -182,6 +182,11 @@ from .fragments import (
182
182
  CouponFragment,
183
183
  CouponFragmentAmountsOff,
184
184
  CouponFragmentSyncStates,
185
+ CreditGrantFragment,
186
+ CreditGrantFragmentCost,
187
+ CreditsBalanceSummaryFragment,
188
+ CreditsBalanceSummaryFragmentBalances,
189
+ CreditsBalanceSummaryFragmentBalancesCurrency,
185
190
  CustomerFragment,
186
191
  CustomerFragmentCoupon,
187
192
  CustomerFragmentEligibleForTrial,
@@ -528,6 +533,8 @@ from .get_coupons import (
528
533
  GetCouponsCouponsEdges,
529
534
  GetCouponsCouponsEdgesNode,
530
535
  )
536
+ from .get_credit_balance import GetCreditBalance, GetCreditBalanceCreditBalanceSummary
537
+ from .get_credit_grants import GetCreditGrants, GetCreditGrantsCreditGrants
531
538
  from .get_customer_by_id import GetCustomerById, GetCustomerByIdGetCustomerByRefId
532
539
  from .get_customer_portal_by_ref_id import (
533
540
  GetCustomerPortalByRefId,
@@ -566,6 +573,7 @@ from .get_subscriptions import (
566
573
  )
567
574
  from .get_usage_history import GetUsageHistory, GetUsageHistoryUsageHistory
568
575
  from .get_usage_history_v_2 import GetUsageHistoryV2, GetUsageHistoryV2UsageHistoryV2
576
+ from .grant_credits import GrantCredits, GrantCreditsCreateCreditGrant
569
577
  from .grant_promotional_entitlements import (
570
578
  GrantPromotionalEntitlements,
571
579
  GrantPromotionalEntitlementsGrantPromotionalEntitlements,
@@ -1110,9 +1118,14 @@ __all__ = [
1110
1118
  "CreateSubscriptionCreateSubscription",
1111
1119
  "CreateWorkflowTriggerInput",
1112
1120
  "CreditBalanceSummaryInput",
1121
+ "CreditGrantFragment",
1122
+ "CreditGrantFragmentCost",
1113
1123
  "CreditGrantInput",
1114
1124
  "CreditGrantType",
1115
1125
  "CreditRateInput",
1126
+ "CreditsBalanceSummaryFragment",
1127
+ "CreditsBalanceSummaryFragmentBalances",
1128
+ "CreditsBalanceSummaryFragmentBalancesCurrency",
1116
1129
  "Currency",
1117
1130
  "CursorPaging",
1118
1131
  "CustomCurrencyInput",
@@ -1318,6 +1331,10 @@ __all__ = [
1318
1331
  "GetCouponsCoupons",
1319
1332
  "GetCouponsCouponsEdges",
1320
1333
  "GetCouponsCouponsEdgesNode",
1334
+ "GetCreditBalance",
1335
+ "GetCreditBalanceCreditBalanceSummary",
1336
+ "GetCreditGrants",
1337
+ "GetCreditGrantsCreditGrants",
1321
1338
  "GetCreditGrantsInput",
1322
1339
  "GetCustomerById",
1323
1340
  "GetCustomerByIdGetCustomerByRefId",
@@ -1359,6 +1376,8 @@ __all__ = [
1359
1376
  "GetUsageHistoryV2UsageHistoryV2",
1360
1377
  "GetWidgetConfigurationInput",
1361
1378
  "GetWorkflowTriggersInput",
1379
+ "GrantCredits",
1380
+ "GrantCreditsCreateCreditGrant",
1362
1381
  "GrantPromotionalEntitlementInput",
1363
1382
  "GrantPromotionalEntitlements",
1364
1383
  "GrantPromotionalEntitlementsGrantPromotionalEntitlements",
@@ -18,6 +18,8 @@ from .get_active_subscriptions import GetActiveSubscriptions
18
18
  from .get_active_subscriptions_list import GetActiveSubscriptionsList
19
19
  from .get_checkout_state import GetCheckoutState
20
20
  from .get_coupons import GetCoupons
21
+ from .get_credit_balance import GetCreditBalance
22
+ from .get_credit_grants import GetCreditGrants
21
23
  from .get_customer_by_id import GetCustomerById
22
24
  from .get_customer_portal_by_ref_id import GetCustomerPortalByRefId
23
25
  from .get_customer_statistics import GetCustomerStatistics
@@ -31,6 +33,7 @@ from .get_subscription import GetSubscription
31
33
  from .get_subscriptions import GetSubscriptions
32
34
  from .get_usage_history import GetUsageHistory
33
35
  from .get_usage_history_v_2 import GetUsageHistoryV2
36
+ from .grant_credits import GrantCredits
34
37
  from .grant_promotional_entitlements import GrantPromotionalEntitlements
35
38
  from .import_customer import ImportCustomer
36
39
  from .import_customer_bulk import ImportCustomerBulk
@@ -39,6 +42,8 @@ from .input_types import (
39
42
  ApplySubscriptionInput,
40
43
  ArchiveCustomerInput,
41
44
  CheckoutStateInput,
45
+ CreditBalanceSummaryInput,
46
+ CreditGrantInput,
42
47
  CursorPaging,
43
48
  CustomerPortalInput,
44
49
  DelegateSubscriptionToCustomerInput,
@@ -49,6 +54,7 @@ from .input_types import (
49
54
  FetchEntitlementQuery,
50
55
  FetchEntitlementsQuery,
51
56
  GetActiveSubscriptionsInput,
57
+ GetCreditGrantsInput,
52
58
  GetCustomerByRefIdInput,
53
59
  GetPaywallInput,
54
60
  GetSubscriptionInput,
@@ -2898,6 +2904,47 @@ class AsyncClient(AsyncBaseClient):
2898
2904
  data = self.get_data(response)
2899
2905
  return TransferSubscriptionToResource.model_validate(data)
2900
2906
 
2907
+ async def grant_credits(
2908
+ self, input: CreditGrantInput, **kwargs: Any
2909
+ ) -> GrantCredits:
2910
+ query = gql(
2911
+ """
2912
+ mutation GrantCredits($input: CreditGrantInput!) {
2913
+ createCreditGrant(input: $input) {
2914
+ ...CreditGrantFragment
2915
+ }
2916
+ }
2917
+
2918
+ fragment CreditGrantFragment on CreditGrant {
2919
+ grantId
2920
+ amount
2921
+ comment
2922
+ currencyId
2923
+ customerId
2924
+ displayName
2925
+ effectiveAt
2926
+ expireAt
2927
+ grantType
2928
+ priority
2929
+ consumedAmount
2930
+ cost {
2931
+ amount
2932
+ currency
2933
+ }
2934
+ createdAt
2935
+ updatedAt
2936
+ resourceId
2937
+ additionalMetaData
2938
+ }
2939
+ """
2940
+ )
2941
+ variables: Dict[str, object] = {"input": input}
2942
+ response = await self.execute(
2943
+ query=query, operation_name="GrantCredits", variables=variables, **kwargs
2944
+ )
2945
+ data = self.get_data(response)
2946
+ return GrantCredits.model_validate(data)
2947
+
2901
2948
  async def get_customer_by_id(
2902
2949
  self, input: GetCustomerByRefIdInput, **kwargs: Any
2903
2950
  ) -> GetCustomerById:
@@ -6361,3 +6408,80 @@ class AsyncClient(AsyncBaseClient):
6361
6408
  )
6362
6409
  data = self.get_data(response)
6363
6410
  return GetUsageHistoryV2.model_validate(data)
6411
+
6412
+ async def get_credit_balance(
6413
+ self, input: CreditBalanceSummaryInput, **kwargs: Any
6414
+ ) -> GetCreditBalance:
6415
+ query = gql(
6416
+ """
6417
+ query GetCreditBalance($input: CreditBalanceSummaryInput!) {
6418
+ creditBalanceSummary(input: $input) {
6419
+ ...CreditsBalanceSummaryFragment
6420
+ }
6421
+ }
6422
+
6423
+ fragment CreditsBalanceSummaryFragment on CreditBalanceSummary {
6424
+ customerId
6425
+ balances {
6426
+ currency {
6427
+ currencyId
6428
+ displayName
6429
+ symbol
6430
+ }
6431
+ currentBalance
6432
+ totalConsumed
6433
+ totalGranted
6434
+ }
6435
+ }
6436
+ """
6437
+ )
6438
+ variables: Dict[str, object] = {"input": input}
6439
+ response = await self.execute(
6440
+ query=query,
6441
+ operation_name="GetCreditBalance",
6442
+ variables=variables,
6443
+ **kwargs
6444
+ )
6445
+ data = self.get_data(response)
6446
+ return GetCreditBalance.model_validate(data)
6447
+
6448
+ async def get_credit_grants(
6449
+ self, input: GetCreditGrantsInput, **kwargs: Any
6450
+ ) -> GetCreditGrants:
6451
+ query = gql(
6452
+ """
6453
+ query GetCreditGrants($input: GetCreditGrantsInput!) {
6454
+ creditGrants(input: $input) {
6455
+ ...CreditGrantFragment
6456
+ }
6457
+ }
6458
+
6459
+ fragment CreditGrantFragment on CreditGrant {
6460
+ grantId
6461
+ amount
6462
+ comment
6463
+ currencyId
6464
+ customerId
6465
+ displayName
6466
+ effectiveAt
6467
+ expireAt
6468
+ grantType
6469
+ priority
6470
+ consumedAmount
6471
+ cost {
6472
+ amount
6473
+ currency
6474
+ }
6475
+ createdAt
6476
+ updatedAt
6477
+ resourceId
6478
+ additionalMetaData
6479
+ }
6480
+ """
6481
+ )
6482
+ variables: Dict[str, object] = {"input": input}
6483
+ response = await self.execute(
6484
+ query=query, operation_name="GetCreditGrants", variables=variables, **kwargs
6485
+ )
6486
+ data = self.get_data(response)
6487
+ return GetCreditGrants.model_validate(data)
stigg/generated/client.py CHANGED
@@ -18,6 +18,8 @@ from .get_active_subscriptions import GetActiveSubscriptions
18
18
  from .get_active_subscriptions_list import GetActiveSubscriptionsList
19
19
  from .get_checkout_state import GetCheckoutState
20
20
  from .get_coupons import GetCoupons
21
+ from .get_credit_balance import GetCreditBalance
22
+ from .get_credit_grants import GetCreditGrants
21
23
  from .get_customer_by_id import GetCustomerById
22
24
  from .get_customer_portal_by_ref_id import GetCustomerPortalByRefId
23
25
  from .get_customer_statistics import GetCustomerStatistics
@@ -31,6 +33,7 @@ from .get_subscription import GetSubscription
31
33
  from .get_subscriptions import GetSubscriptions
32
34
  from .get_usage_history import GetUsageHistory
33
35
  from .get_usage_history_v_2 import GetUsageHistoryV2
36
+ from .grant_credits import GrantCredits
34
37
  from .grant_promotional_entitlements import GrantPromotionalEntitlements
35
38
  from .import_customer import ImportCustomer
36
39
  from .import_customer_bulk import ImportCustomerBulk
@@ -39,6 +42,8 @@ from .input_types import (
39
42
  ApplySubscriptionInput,
40
43
  ArchiveCustomerInput,
41
44
  CheckoutStateInput,
45
+ CreditBalanceSummaryInput,
46
+ CreditGrantInput,
42
47
  CursorPaging,
43
48
  CustomerPortalInput,
44
49
  DelegateSubscriptionToCustomerInput,
@@ -49,6 +54,7 @@ from .input_types import (
49
54
  FetchEntitlementQuery,
50
55
  FetchEntitlementsQuery,
51
56
  GetActiveSubscriptionsInput,
57
+ GetCreditGrantsInput,
52
58
  GetCustomerByRefIdInput,
53
59
  GetPaywallInput,
54
60
  GetSubscriptionInput,
@@ -2896,6 +2902,45 @@ class Client(BaseClient):
2896
2902
  data = self.get_data(response)
2897
2903
  return TransferSubscriptionToResource.model_validate(data)
2898
2904
 
2905
+ def grant_credits(self, input: CreditGrantInput, **kwargs: Any) -> GrantCredits:
2906
+ query = gql(
2907
+ """
2908
+ mutation GrantCredits($input: CreditGrantInput!) {
2909
+ createCreditGrant(input: $input) {
2910
+ ...CreditGrantFragment
2911
+ }
2912
+ }
2913
+
2914
+ fragment CreditGrantFragment on CreditGrant {
2915
+ grantId
2916
+ amount
2917
+ comment
2918
+ currencyId
2919
+ customerId
2920
+ displayName
2921
+ effectiveAt
2922
+ expireAt
2923
+ grantType
2924
+ priority
2925
+ consumedAmount
2926
+ cost {
2927
+ amount
2928
+ currency
2929
+ }
2930
+ createdAt
2931
+ updatedAt
2932
+ resourceId
2933
+ additionalMetaData
2934
+ }
2935
+ """
2936
+ )
2937
+ variables: Dict[str, object] = {"input": input}
2938
+ response = self.execute(
2939
+ query=query, operation_name="GrantCredits", variables=variables, **kwargs
2940
+ )
2941
+ data = self.get_data(response)
2942
+ return GrantCredits.model_validate(data)
2943
+
2899
2944
  def get_customer_by_id(
2900
2945
  self, input: GetCustomerByRefIdInput, **kwargs: Any
2901
2946
  ) -> GetCustomerById:
@@ -6357,3 +6402,80 @@ class Client(BaseClient):
6357
6402
  )
6358
6403
  data = self.get_data(response)
6359
6404
  return GetUsageHistoryV2.model_validate(data)
6405
+
6406
+ def get_credit_balance(
6407
+ self, input: CreditBalanceSummaryInput, **kwargs: Any
6408
+ ) -> GetCreditBalance:
6409
+ query = gql(
6410
+ """
6411
+ query GetCreditBalance($input: CreditBalanceSummaryInput!) {
6412
+ creditBalanceSummary(input: $input) {
6413
+ ...CreditsBalanceSummaryFragment
6414
+ }
6415
+ }
6416
+
6417
+ fragment CreditsBalanceSummaryFragment on CreditBalanceSummary {
6418
+ customerId
6419
+ balances {
6420
+ currency {
6421
+ currencyId
6422
+ displayName
6423
+ symbol
6424
+ }
6425
+ currentBalance
6426
+ totalConsumed
6427
+ totalGranted
6428
+ }
6429
+ }
6430
+ """
6431
+ )
6432
+ variables: Dict[str, object] = {"input": input}
6433
+ response = self.execute(
6434
+ query=query,
6435
+ operation_name="GetCreditBalance",
6436
+ variables=variables,
6437
+ **kwargs
6438
+ )
6439
+ data = self.get_data(response)
6440
+ return GetCreditBalance.model_validate(data)
6441
+
6442
+ def get_credit_grants(
6443
+ self, input: GetCreditGrantsInput, **kwargs: Any
6444
+ ) -> GetCreditGrants:
6445
+ query = gql(
6446
+ """
6447
+ query GetCreditGrants($input: GetCreditGrantsInput!) {
6448
+ creditGrants(input: $input) {
6449
+ ...CreditGrantFragment
6450
+ }
6451
+ }
6452
+
6453
+ fragment CreditGrantFragment on CreditGrant {
6454
+ grantId
6455
+ amount
6456
+ comment
6457
+ currencyId
6458
+ customerId
6459
+ displayName
6460
+ effectiveAt
6461
+ expireAt
6462
+ grantType
6463
+ priority
6464
+ consumedAmount
6465
+ cost {
6466
+ amount
6467
+ currency
6468
+ }
6469
+ createdAt
6470
+ updatedAt
6471
+ resourceId
6472
+ additionalMetaData
6473
+ }
6474
+ """
6475
+ )
6476
+ variables: Dict[str, object] = {"input": input}
6477
+ response = self.execute(
6478
+ query=query, operation_name="GetCreditGrants", variables=variables, **kwargs
6479
+ )
6480
+ data = self.get_data(response)
6481
+ return GetCreditGrants.model_validate(data)