Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

GetUploadDetails.py 2.6KB

před 2 roky
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # -*- coding: utf-8 -*-
  2. # This file is auto-generated, don't edit it. Thanks.
  3. import sys
  4. from typing import List
  5. from alibabacloud_vod20170321.client import Client as vod20170321Client
  6. from alibabacloud_tea_openapi import models as open_api_models
  7. from alibabacloud_vod20170321 import models as vod_20170321_models
  8. from alibabacloud_tea_util import models as util_models
  9. from alibabacloud_tea_util.client import Client as UtilClient
  10. class Sample:
  11. def __init__(self):
  12. pass
  13. @staticmethod
  14. def create_client(
  15. access_key_id: str,
  16. access_key_secret: str,
  17. ) -> vod20170321Client:
  18. """
  19. 使用AK&SK初始化账号Client
  20. @param access_key_id:
  21. @param access_key_secret:
  22. @return: Client
  23. @throws Exception
  24. """
  25. config = open_api_models.Config(
  26. # 您的 AccessKey ID,
  27. access_key_id=access_key_id,
  28. # 您的 AccessKey Secret,
  29. access_key_secret=access_key_secret
  30. )
  31. # 访问的域名
  32. config.endpoint = f'vod.cn-shanghai.aliyuncs.com'
  33. return vod20170321Client(config)
  34. @staticmethod
  35. def main(
  36. args: List[str],
  37. ) -> None:
  38. client = Sample.create_client('LTAI5tSJ62TLMUb4SZuf285A', 'MWYynm30filZ7x0HqSHlU3pdLVNeI7')
  39. get_upload_details_request = vod_20170321_models.GetUploadDetailsRequest(
  40. media_ids='6d040a5749f74b80afac476563250d6d',
  41. media_type='video'
  42. )
  43. runtime = util_models.RuntimeOptions()
  44. try:
  45. # 复制代码运行请自行打印 API 的返回值
  46. ret=client.get_upload_details_with_options(get_upload_details_request, runtime)
  47. print(ret)
  48. except Exception as error:
  49. # 如有需要,请打印 error
  50. UtilClient.assert_as_string(error.message)
  51. @staticmethod
  52. async def main_async(
  53. args: List[str],
  54. ) -> None:
  55. client = Sample.create_client('accessKeyId', 'accessKeySecret')
  56. get_upload_details_request = vod_20170321_models.GetUploadDetailsRequest(
  57. media_ids='6d040a5749f74b80afac476563250d6d',
  58. media_type='video'
  59. )
  60. runtime = util_models.RuntimeOptions()
  61. try:
  62. # 复制代码运行请自行打印 API 的返回值
  63. await client.get_upload_details_with_options_async(get_upload_details_request, runtime)
  64. except Exception as error:
  65. # 如有需要,请打印 error
  66. UtilClient.assert_as_string(error.message)
  67. if __name__ == '__main__':
  68. Sample.main(sys.argv[1:])