nat_model.py 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
  2. # Copyright 2010 United States Government as represented by the
  3. # Administrator of the National Aeronautics and Space Administration.
  4. # Copyright 2011 Piston Cloud Computing, Inc.
  5. # All Rights Reserved.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License"); you may
  8. # not use this file except in compliance with the License. You may obtain
  9. # a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. # License for the specific language governing permissions and limitations
  17. # under the License.
  18. """
  19. This module provides models for NAT-SDK.
  20. """
  21. class Billing(object):
  22. """
  23. This class define billing.
  24. param: paymentTiming:
  25. The pay time of the payment,
  26. see more detail in https://bce.baidu.com/doc/BCC/API.html#Billing
  27. param: reservationLength:
  28. The duration to buy in specified time unit,
  29. available values are [1,2,3,4,5,6,7,8,9,12,24,36] now.
  30. param: reservationTimeUnit:
  31. The time unit to specify the duration ,only "month" can be used now.
  32. """
  33. def __init__(self, paymentTiming=None, reservationLength=1,
  34. reservationTimeUnit='month'):
  35. if paymentTiming:
  36. self.paymentTiming = paymentTiming
  37. self.reservation = {
  38. 'reservationLength': reservationLength,
  39. 'reservationTimeUnit': reservationTimeUnit.lower()
  40. }