-
Notifications
You must be signed in to change notification settings - Fork 7
/
Ziggeo.py
110 lines (106 loc) · 4.21 KB
/
Ziggeo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
from ZiggeoConfig import ZiggeoConfig
from ZiggeoConnect import ZiggeoConnect
from ZiggeoAuth import ZiggeoAuth
from ZiggeoVideos import ZiggeoVideos
from ZiggeoStreams import ZiggeoStreams
from ZiggeoAudios import ZiggeoAudios
from ZiggeoAudioStreams import ZiggeoAudioStreams
from ZiggeoAuthtokens import ZiggeoAuthtokens
from ZiggeoApplication import ZiggeoApplication
from ZiggeoEffectProfiles import ZiggeoEffectProfiles
from ZiggeoEffectProfileProcess import ZiggeoEffectProfileProcess
from ZiggeoMetaProfiles import ZiggeoMetaProfiles
from ZiggeoMetaProfileProcess import ZiggeoMetaProfileProcess
from ZiggeoWebhooks import ZiggeoWebhooks
from ZiggeoAnalytics import ZiggeoAnalytics
class Ziggeo:
def __init__(self, token, private_key, encryption_key = None):
self.token = token
self.private_key = private_key
self.encryption_key = encryption_key
self.config = ZiggeoConfig()
server_api_url = self.config.server_api_url
for k, v in self.config.regions.items():
if (self.token.startswith(k)):
server_api_url = v
self.connect = ZiggeoConnect(self, server_api_url)
api_url = self.config.api_url
for k, v in self.config.api_regions.items():
if (self.token.startswith(k)):
api_url = v
self.api_connect = ZiggeoConnect(self, api_url)
cdn_url = self.config.cdn_url
for k, v in self.config.cdn_regions.items():
if (self.token.startswith(k)):
cdn_url = v
self.cdn_connect = ZiggeoConnect(self, cdn_url)
js_cdn_url = self.config.js_cdn_url
for k, v in self.config.js_cdn_regions.items():
if (self.token.startswith(k)):
js_cdn_url = v
self.js_cdn_connect = ZiggeoConnect(self, js_cdn_url)
self.__auth = None
self.__videos = None
self.__streams = None
self.__audios = None
self.__audioStreams = None
self.__authtokens = None
self.__application = None
self.__effectProfiles = None
self.__effectProfileProcess = None
self.__metaProfiles = None
self.__metaProfileProcess = None
self.__webhooks = None
self.__analytics = None
def auth(self):
if (self.__auth == None):
self.__auth = ZiggeoAuth(self)
return self.__auth
def videos(self):
if (self.__videos == None):
self.__videos = ZiggeoVideos(self)
return self.__videos
def streams(self):
if (self.__streams == None):
self.__streams = ZiggeoStreams(self)
return self.__streams
def audios(self):
if (self.__audios == None):
self.__audios = ZiggeoAudios(self)
return self.__audios
def audioStreams(self):
if (self.__audioStreams == None):
self.__audioStreams = ZiggeoAudioStreams(self)
return self.__audioStreams
def authtokens(self):
if (self.__authtokens == None):
self.__authtokens = ZiggeoAuthtokens(self)
return self.__authtokens
def application(self):
if (self.__application == None):
self.__application = ZiggeoApplication(self)
return self.__application
def effectProfiles(self):
if (self.__effectProfiles == None):
self.__effectProfiles = ZiggeoEffectProfiles(self)
return self.__effectProfiles
def effectProfileProcess(self):
if (self.__effectProfileProcess == None):
self.__effectProfileProcess = ZiggeoEffectProfileProcess(self)
return self.__effectProfileProcess
def metaProfiles(self):
if (self.__metaProfiles == None):
self.__metaProfiles = ZiggeoMetaProfiles(self)
return self.__metaProfiles
def metaProfileProcess(self):
if (self.__metaProfileProcess == None):
self.__metaProfileProcess = ZiggeoMetaProfileProcess(self)
return self.__metaProfileProcess
def webhooks(self):
if (self.__webhooks == None):
self.__webhooks = ZiggeoWebhooks(self)
return self.__webhooks
def analytics(self):
if (self.__analytics == None):
self.__analytics = ZiggeoAnalytics(self)
return self.__analytics