• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python deserialize.decimal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中twilio.base.deserialize.decimal函数的典型用法代码示例。如果您正苦于以下问题:Python decimal函数的具体用法?Python decimal怎么用?Python decimal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了decimal函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, version, payload, account_sid, country_code):
        """
        Initialize the VoipInstance

        :returns: twilio.rest.api.v2010.account.available_phone_number.voip.VoipInstance
        :rtype: twilio.rest.api.v2010.account.available_phone_number.voip.VoipInstance
        """
        super(VoipInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'friendly_name': payload['friendly_name'],
            'phone_number': payload['phone_number'],
            'lata': payload['lata'],
            'locality': payload['locality'],
            'rate_center': payload['rate_center'],
            'latitude': deserialize.decimal(payload['latitude']),
            'longitude': deserialize.decimal(payload['longitude']),
            'region': payload['region'],
            'postal_code': payload['postal_code'],
            'iso_country': payload['iso_country'],
            'address_requirements': payload['address_requirements'],
            'beta': payload['beta'],
            'capabilities': payload['capabilities'],
        }

        # Context
        self._context = None
        self._solution = {'account_sid': account_sid, 'country_code': country_code, }
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:29,代码来源:voip.py


示例2: __init__

    def __init__(self, version, payload, account_sid, sid=None):
        """
        Initialize the FeedbackSummaryInstance

        :returns: twilio.rest.api.v2010.account.call.feedback_summary.FeedbackSummaryInstance
        :rtype: twilio.rest.api.v2010.account.call.feedback_summary.FeedbackSummaryInstance
        """
        super(FeedbackSummaryInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_sid': payload['account_sid'],
            'call_count': deserialize.integer(payload['call_count']),
            'call_feedback_count': deserialize.integer(payload['call_feedback_count']),
            'date_created': deserialize.rfc2822_datetime(payload['date_created']),
            'date_updated': deserialize.rfc2822_datetime(payload['date_updated']),
            'end_date': deserialize.iso8601_datetime(payload['end_date']),
            'include_subaccounts': payload['include_subaccounts'],
            'issues': payload['issues'],
            'quality_score_average': deserialize.decimal(payload['quality_score_average']),
            'quality_score_median': deserialize.decimal(payload['quality_score_median']),
            'quality_score_standard_deviation': deserialize.decimal(payload['quality_score_standard_deviation']),
            'sid': payload['sid'],
            'start_date': deserialize.iso8601_datetime(payload['start_date']),
            'status': payload['status'],
        }

        # Context
        self._context = None
        self._solution = {'account_sid': account_sid, 'sid': sid or self._properties['sid'], }
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:30,代码来源:feedback_summary.py


示例3: __init__

    def __init__(self, version, payload, account_sid, call_sid, sid=None):
        """
        Initialize the RecordingInstance

        :returns: twilio.rest.api.v2010.account.call.recording.RecordingInstance
        :rtype: twilio.rest.api.v2010.account.call.recording.RecordingInstance
        """
        super(RecordingInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_sid': payload['account_sid'],
            'api_version': payload['api_version'],
            'call_sid': payload['call_sid'],
            'date_created': deserialize.rfc2822_datetime(payload['date_created']),
            'date_updated': deserialize.rfc2822_datetime(payload['date_updated']),
            'duration': payload['duration'],
            'sid': payload['sid'],
            'price': deserialize.decimal(payload['price']),
            'uri': payload['uri'],
            'encryption_details': payload['encryption_details'],
        }

        # Context
        self._context = None
        self._solution = {
            'account_sid': account_sid,
            'call_sid': call_sid,
            'sid': sid or self._properties['sid'],
        }
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:30,代码来源:recording.py


示例4: __init__

    def __init__(self, version, payload, account_sid, recording_sid, sid=None):
        """
        Initialize the TranscriptionInstance

        :returns: twilio.rest.api.v2010.account.recording.transcription.TranscriptionInstance
        :rtype: twilio.rest.api.v2010.account.recording.transcription.TranscriptionInstance
        """
        super(TranscriptionInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_sid': payload['account_sid'],
            'api_version': payload['api_version'],
            'date_created': deserialize.rfc2822_datetime(payload['date_created']),
            'date_updated': deserialize.rfc2822_datetime(payload['date_updated']),
            'duration': payload['duration'],
            'price': deserialize.decimal(payload['price']),
            'price_unit': payload['price_unit'],
            'recording_sid': payload['recording_sid'],
            'sid': payload['sid'],
            'status': payload['status'],
            'transcription_text': payload['transcription_text'],
            'type': payload['type'],
            'uri': payload['uri'],
        }

        # Context
        self._context = None
        self._solution = {
            'account_sid': account_sid,
            'recording_sid': recording_sid,
            'sid': sid or self._properties['sid'],
        }
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:33,代码来源:transcription.py


示例5: __init__

    def __init__(self, version, payload, sid=None):
        """
        Initialize the FaxInstance

        :returns: twilio.rest.fax.v1.fax.FaxInstance
        :rtype: twilio.rest.fax.v1.fax.FaxInstance
        """
        super(FaxInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'sid': payload['sid'],
            'account_sid': payload['account_sid'],
            'from_': payload['from'],
            'to': payload['to'],
            'quality': payload['quality'],
            'media_sid': payload['media_sid'],
            'media_url': payload['media_url'],
            'num_pages': deserialize.integer(payload['num_pages']),
            'duration': deserialize.integer(payload['duration']),
            'status': payload['status'],
            'direction': payload['direction'],
            'api_version': payload['api_version'],
            'price': deserialize.decimal(payload['price']),
            'price_unit': payload['price_unit'],
            'date_created': deserialize.iso8601_datetime(payload['date_created']),
            'date_updated': deserialize.iso8601_datetime(payload['date_updated']),
            'links': payload['links'],
            'url': payload['url'],
        }

        # Context
        self._context = None
        self._solution = {'sid': sid or self._properties['sid'], }
开发者ID:twilio,项目名称:twilio-python,代码行数:34,代码来源:__init__.py


示例6: __init__

    def __init__(self, version, payload, account_sid, sid=None):
        """
        Initialize the CallInstance

        :returns: twilio.rest.api.v2010.account.call.CallInstance
        :rtype: twilio.rest.api.v2010.account.call.CallInstance
        """
        super(CallInstance, self).__init__(version)

        # Marshaled Properties
        self._properties = {
            'account_sid': payload['account_sid'],
            'annotation': payload['annotation'],
            'answered_by': payload['answered_by'],
            'api_version': payload['api_version'],
            'caller_name': payload['caller_name'],
            'date_created': deserialize.rfc2822_datetime(payload['date_created']),
            'date_updated': deserialize.rfc2822_datetime(payload['date_updated']),
            'direction': payload['direction'],
            'duration': payload['duration'],
            'end_time': deserialize.rfc2822_datetime(payload['end_time']),
            'forwarded_from': payload['forwarded_from'],
            'from_': payload['from'],
            'from_formatted': payload['from_formatted'],
            'group_sid': payload['group_sid'],
            'parent_call_sid': payload['parent_call_sid'],
            'phone_number_sid': payload['phone_number_sid'],
            'price': deserialize.decimal(payload['price']),
            'price_unit': payload['price_unit'],
            'sid': payload['sid'],
            'start_time': deserialize.rfc2822_datetime(payload['start_time']),
            'status': payload['status'],
            'subresource_uris': payload['subresource_uris'],
            'to': payload['to'],
            'to_formatted': payload['to_formatted'],
            'uri': payload['uri'],
        }

        # Context
        self._context = None
        self._solution = {
            'account_sid': account_sid,
            'sid': sid or self._properties['sid'],
        }
开发者ID:pby2017,项目名称:library-for-twilio-python2,代码行数:44,代码来源:__init__.py


示例7: test_positive

 def test_positive(self):
     self.assertEqual(0.0123, deserialize.decimal(0.0123))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py


示例8: test_zero

 def test_zero(self):
     self.assertEqual(0, deserialize.decimal(0))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py


示例9: test_negative

 def test_negative(self):
     self.assertEqual(-0.0123, deserialize.decimal(-0.0123))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py


示例10: test_positive_string

 def test_positive_string(self):
     self.assertEqual(Decimal('0.0123'), deserialize.decimal('0.0123'))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py


示例11: test_negative_string

 def test_negative_string(self):
     self.assertEqual(Decimal('-0.0123'), deserialize.decimal('-0.0123'))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py


示例12: test_zero_string

 def test_zero_string(self):
     self.assertEqual(Decimal('0.0000'), deserialize.decimal('0.0000'))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py


示例13: test_empty_string

 def test_empty_string(self):
     self.assertEqual('', deserialize.decimal(''))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py


示例14: test_none

 def test_none(self):
     self.assertEqual(None, deserialize.decimal(None))
开发者ID:kanyapnp,项目名称:twilio-python,代码行数:2,代码来源:test_deserialize.py



注:本文中的twilio.base.deserialize.decimal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python deserialize.integer函数代码示例发布时间:2022-05-27
下一篇:
Python log.name函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap