Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use client entities not related with openapi.yaml tags #134

Closed
15 of 19 tasks
lorddaedra opened this issue Apr 8, 2023 · 0 comments
Closed
15 of 19 tasks

Do not use client entities not related with openapi.yaml tags #134

lorddaedra opened this issue Apr 8, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@lorddaedra
Copy link
Contributor

lorddaedra commented Apr 8, 2023

Currently we use AppliedAddOnClient, GroupClient, AppliedCouponClient and WalletTransactionClient clients. It's completely okay as abstraction around collections but ideally we should not expose them as applied_add_ons, groups, applied_coupons and wallet_transactions properties of the Client instance. Or, at least, we can keep them for compatibility reasons but do not suggest to use by default.

Tasks:

  1. Create aliases for all methods in AppliedAddOnClient, GroupClient, AppliedCouponClient and WalletTransactionClient clients
  • "applyAddOn": AppliedAddOnClient.create -> AddOnClient.apply
  • "findAllBillableMetricGroups": GroupClient.find_all -> BillableMetricClient.find_all_groups
  • "applyCoupon": AppliedCouponClient.create -> CouponClient.apply
  • "findAllAppliedCoupons': AppliedCouponClient.find_all -> CouponClient.find_all_applied
  • "deleteAppliedCoupon": AppliedCouponClient.destroy -> CouponClient.delete_applied
  • "createWalletTransaction": WalletTransactionClient.create -> WalletClient.create_transaction
  • "findAllWalletTransactions": WalletTransactionClient.find_all -> WalletClient.find_all_transactions
  1. Add deprecation comments to classes:
  • AppliedAddOnClient,
  • GroupClient,
  • AppliedCouponClient and
  • WalletTransactionClient.
  1. Add pending deprecation warnings to callable cached properties in Client:
  • applied_add_ons,
  • groups,
  • applied_coupons and
  • wallet_transactions.

1-3 fixed in

Note: algorithm for method name construction: operation name from OpenAPI spec file minus tag name.

After merging PR #135 and publishing new release:

  1. Update Python docs to use these aliases
    Update Python docs lago-docs#172
  2. Replace pending deprecation warning to deprecation warnings in Client:
  • applied_add_ons,
  • groups,
  • applied_coupons and
  • wallet_transactions.
  1. Refactor tests to fix warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants