model.py 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # -*- coding: utf-8 -*-
  2. # Copyright (c) 2014 Baidu.com, Inc. All Rights Reserved
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  5. # except in compliance with the License. You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software distributed under the
  10. # License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  11. # either express or implied. See the License for the specific language governing permissions
  12. # and limitations under the License.
  13. """
  14. This module provide billing information and eip status condition.
  15. """
  16. from enum import Enum
  17. class Billing(object):
  18. """
  19. billing information
  20. """
  21. def __init__(self, payment_timing=None, billing_method=None, reservation_length=None,
  22. reservation_time_unit=None):
  23. """
  24. :type payment_timing: string
  25. :param payment_timing: The pay time of the payment, default value 'Postpaid'
  26. :type billing_method: string
  27. :param billing_method: The way of eip charging, default value 'ByBandwidth'
  28. :type reservation_length: int
  29. :param reservation_length: purchase length
  30. :type reservation_time_unit: string
  31. :param reservation_time_unit: time unit of purchasing,default 'Month'
  32. """
  33. self.payment_timing = payment_timing
  34. self.billing_method = billing_method
  35. self.reservation_length = reservation_length
  36. self.reservation_time_unit = reservation_time_unit or 'Month'
  37. class EipStatus(Enum):
  38. """
  39. eip status enum query condition.
  40. """
  41. AVAILABLE = b'available'
  42. BINDED = b'binded'
  43. PAUSED = b'paused'