csn_model.py 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # -*- coding: utf-8 -*-
  2. """
  3. model for csn client
  4. """
  5. # Copyright 2023 Baidu, Inc.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
  8. # the License. You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
  13. # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
  14. # specific language governing permissions and limitations under the License.
  15. class Billing(object):
  16. """
  17. billing information
  18. """
  19. def __init__(self, payment_timing=None, reservation_length=None, reservation_time_unit=None, billing_method=None):
  20. """
  21. :type payment_timing: string
  22. :param payment_timing: The pay time of the payment
  23. :type reservation_length: int
  24. :param reservation_length: purchase length
  25. :type reservation_time_unit: string
  26. :param reservation_time_unit: time unit of purchasing, default 'month'
  27. :type billing_method: string
  28. :param billing_method: The billing method of the payment, include ByTraffic, ByBandwidth,
  29. PeakBandwidth_Percent_95, Enhanced_Percent_95
  30. """
  31. self.paymentTiming = payment_timing
  32. if billing_method:
  33. self.billingMethod = billing_method
  34. self.reservation = {
  35. "reservationLength": reservation_length,
  36. "reservationTimeUnit": reservation_time_unit
  37. }