bbc_model.py 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 BBC-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, reservationTimeUnit='Month'):
  34. if paymentTiming:
  35. self.paymentTiming = paymentTiming
  36. self.reservation = {
  37. 'reservationLength': reservationLength,
  38. 'reservationTimeUnit': reservationTimeUnit
  39. }
  40. class TagModel(object):
  41. """
  42. TAGModel
  43. """
  44. def __init__(self, tagKey=None, tagValue=None):
  45. self.tagKey = tagKey
  46. self.tagValue = tagValue