@@ -15,8 +15,6 @@ def extract_fr8_crate_contents(contents, manifest_id):
15
15
16
16
AuthenticationType = utility .enum (NONE = 1 , INTERNAL = 2 , EXTERNAL = 3 , INTERNAL_WITH_DOMAIN = 4 )
17
17
18
- ActivityCategory = utility .enum (MONITORS = 1 , RECEIVERS = 2 , PROCESSORS = 3 , FORWARDERS = 4 , SOLUTION = 5 )
19
-
20
18
ActivityType = utility .enum (STANDARD = 1 , LOOP = 2 , SOLUTION = 3 )
21
19
22
20
AvailabilityType = utility .enum (NOTSET = 0 , CONFIGURATION = 1 , RUNTIME = 2 , ALWAYS = 3 )
@@ -39,36 +37,36 @@ def __init__(self, **kwargs):
39
37
40
38
def to_fr8_json (self ):
41
39
return {
42
- 'Name ' : self .name ,
43
- 'Label ' : self .label ,
44
- 'ActivityTemplate ' : self .activity_template .to_fr8_json (),
45
- 'RootPlanNodeId ' : self .root_plan_node_id ,
46
- 'ParentPlanNodeId ' : self .parent_plan_node_id ,
47
- 'CurrentView ' : self .current_view ,
48
- 'Ordering ' : self .ordering ,
49
- 'Id ' : self .id ,
50
- 'CrateStorage ' : self .crate_storage .to_fr8_json (),
51
- 'ChildrenActivities ' : [x .to_fr8_json () for x in self .children_activities ],
52
- 'AuthTokenId ' : self .auth_token_id ,
53
- 'AuthToken ' : self .auth_token .to_fr8_json () if self .auth_token else None ,
40
+ 'name ' : self .name ,
41
+ 'label ' : self .label ,
42
+ 'activityTemplate ' : self .activity_template .to_fr8_json (),
43
+ 'rootPlanNodeId ' : self .root_plan_node_id ,
44
+ 'parentPlanNodeId ' : self .parent_plan_node_id ,
45
+ 'currentView ' : self .current_view ,
46
+ 'ordering ' : self .ordering ,
47
+ 'id ' : self .id ,
48
+ 'crateStorage ' : self .crate_storage .to_fr8_json (),
49
+ 'childrenActivities ' : [x .to_fr8_json () for x in self .children_activities ],
50
+ 'authTokenId ' : self .auth_token_id ,
51
+ 'authToken ' : self .auth_token .to_fr8_json () if self .auth_token else None ,
54
52
}
55
53
56
54
@staticmethod
57
55
def from_fr8_json (json_data ):
58
56
a = ActivityDTO (
59
- name = json_data .get ('Name ' ),
60
- label = json_data .get ('Label ' ),
57
+ name = json_data .get ('name ' ),
58
+ label = json_data .get ('label ' ),
61
59
activity_template = ActivityTemplateDTO .from_fr8_json (json_data .get ('activityTemplate' )),
62
- root_plan_node_id = json_data .get ('RootPlanNodeId ' ),
63
- parent_plan_node_id = json_data .get ('ParentPlanNodeId ' ),
64
- current_view = json_data .get ('CurrentView ' ),
65
- ordering = json_data .get ('Ordering ' ),
66
- id = json_data .get ('Id ' ),
67
- crate_storage = CrateStorageDTO .from_fr8_json (json_data .get ('CrateStorage ' )) if json_data .get ('CrateStorage ' ) else [] ,
68
- children_activities = [ActivityDTO .from_fr8_json (x ) for x in json_data .get ('ChildrenActivities ' )]\
69
- if json_data .get ('ChildrenActivities ' ) else [],
70
- auth_token_id = json_data .get ('AuthTokenId ' ),
71
- auth_token = AuthorizationTokenDTO .from_fr8_json (json_data .get ('AuthToken ' )) if json_data .get ('AuthToken ' ) else None
60
+ root_plan_node_id = json_data .get ('rootPlanNodeId ' ),
61
+ parent_plan_node_id = json_data .get ('parentPlanNodeId ' ),
62
+ current_view = json_data .get ('currentView ' ),
63
+ ordering = json_data .get ('ordering ' ),
64
+ id = json_data .get ('id ' ),
65
+ crate_storage = CrateStorageDTO .from_fr8_json (json_data .get ('crateStorage ' )) if json_data .get ('crateStorage ' ) else CrateStorageDTO () ,
66
+ children_activities = [ActivityDTO .from_fr8_json (x ) for x in json_data .get ('childrenActivities ' )]\
67
+ if json_data .get ('childrenActivities ' ) else [],
68
+ auth_token_id = json_data .get ('authTokenId ' ),
69
+ auth_token = AuthorizationTokenDTO .from_fr8_json (json_data .get ('authToken ' )) if json_data .get ('authToken ' ) else None
72
70
)
73
71
return a
74
72
@@ -96,11 +94,13 @@ def from_fr8_json(json_data):
96
94
97
95
class ActivityCategoryDTO (object ):
98
96
def __init__ (self , ** kwargs ):
97
+ self .id = kwargs .get ('id' )
99
98
self .name = kwargs .get ('name' )
100
99
self .icon_path = kwargs .get ('icon_path' )
101
100
102
101
def to_fr8_json (self ):
103
102
return {
103
+ 'id' : self .id ,
104
104
'name' : self .name ,
105
105
'iconPath' : self .icon_path
106
106
}
@@ -119,11 +119,31 @@ def from_fr8_json(json_data):
119
119
120
120
121
121
ActivityCategories = utility .enum (
122
- MONITORS = ActivityCategoryDTO (name = "Monitor" , icon_path = "/Content/icons/monitor-icon-64x64.png" ),
123
- RECEIVERS = ActivityCategoryDTO (name = "Get" , icon_path = "/Content/icons/get-icon-64x64.png" ),
124
- PROCESSORS = ActivityCategoryDTO (name = "Process" , icon_path = "/Content/icons/process-icon-64x64.png" ),
125
- FORWARDERS = ActivityCategoryDTO (name = "Forward" , icon_path = "/Content/icons/forward-icon-64x64.png" ),
126
- SOLUTION = ActivityCategoryDTO (name = "Solution" )
122
+ MONITORS = ActivityCategoryDTO (
123
+ id = '417DD061-27A1-4DEC-AECD-4F468013FD24' ,
124
+ name = 'Triggers' ,
125
+ icon_path = '/Content/icons/monitor-icon-64x64.png'
126
+ ),
127
+ RECEIVERS = ActivityCategoryDTO (
128
+ id = '29EFB1D7-A9EA-41C5-AC60-AEF1F520E814' ,
129
+ name = 'Get Data' ,
130
+ icon_path = '/Content/icons/get-icon-64x64.png'
131
+ ),
132
+ PROCESSORS = ActivityCategoryDTO (
133
+ id = '69FB6D2C-2083-4696-9457-B7B152D358C2' ,
134
+ name = 'Process' ,
135
+ icon_path = '/Content/icons/process-icon-64x64.png'
136
+ ),
137
+ FORWARDERS = ActivityCategoryDTO (
138
+ id = 'AFD7E981-A21A-4B05-B0B1-3115A5448F22' ,
139
+ name = 'Ship Data' ,
140
+ icon_path = '/Content/icons/forward-icon-64x64.png'
141
+ ),
142
+ SOLUTION = ActivityCategoryDTO (
143
+ id = 'F9DF2AC2-2F10-4D21-B97A-987D46AD65B0' ,
144
+ name = 'Solution' ,
145
+ icon_path = '/Content/icons/solution-icon-64x64.png'
146
+ )
127
147
)
128
148
129
149
@@ -133,8 +153,6 @@ def __init__(self, **kwargs):
133
153
self .name = kwargs .get ('name' )
134
154
self .version = kwargs .get ('version' )
135
155
self .terminal = kwargs .get ('terminal' )
136
- self .web_service = kwargs .get ('web_service' )
137
- self .activity_category = kwargs .get ('activity_category' )
138
156
self .categories = kwargs .get ('categories' )
139
157
self .needs_authentication = kwargs .get ('needs_authentication' , False )
140
158
self .label = kwargs .get ('label' , '' )
@@ -146,10 +164,8 @@ def to_fr8_json(self):
146
164
'id' : self .id ,
147
165
'name' : self .name ,
148
166
'version' : self .version ,
149
- 'terminal' : self .terminal .to_fr8_json (),
150
- 'webService' : self .web_service .to_fr8_json () if self .web_service else None ,
167
+ 'terminal' : self .terminal .to_fr8_json () if self .terminal else None ,
151
168
'categories' : [x .to_fr8_json () for x in self .categories ] if self .categories else None ,
152
- 'category' : self .activity_category ,
153
169
'needsAuthentication' : self .needs_authentication ,
154
170
'label' : self .label ,
155
171
'type' : self .activity_type ,
@@ -184,19 +200,19 @@ def __init__(self, **kwargs):
184
200
185
201
def to_fr8_json (self ):
186
202
return {
187
- 'UserId ' : self .user_id ,
188
- 'Token ' : self .token ,
189
- 'ExternalAccountId ' : self .external_account_id ,
190
- 'ExternalStateToken ' : self .external_state_token
203
+ 'userId ' : self .user_id ,
204
+ 'token ' : self .token ,
205
+ 'externalAccountId ' : self .external_account_id ,
206
+ 'externalStateToken ' : self .external_state_token
191
207
}
192
208
193
209
@staticmethod
194
210
def from_fr8_json (json_data ):
195
211
dto = AuthorizationTokenDTO (
196
- user_id = json_data .get ('UserId ' ),
197
- token = json_data .get ('Token ' ),
198
- external_account_id = json_data .get ('ExternalAccountId ' ),
199
- external_state_token = json_data .get ('ExternalStateToken ' )
212
+ user_id = json_data .get ('userId ' ),
213
+ token = json_data .get ('token ' ),
214
+ external_account_id = json_data .get ('externalAccountId ' ),
215
+ external_state_token = json_data .get ('externalStateToken ' )
200
216
)
201
217
return dto
202
218
@@ -468,23 +484,3 @@ def from_fr8_json(json_data):
468
484
authentication_type = json_data .get ('authenticationType' , AuthenticationType .NONE )
469
485
)
470
486
return t
471
-
472
-
473
- class WebServiceDTO (object ):
474
- def __init__ (self , ** kwargs ):
475
- self .name = kwargs .get ('name' )
476
- self .icon_path = kwargs .get ('icon_path' )
477
-
478
- def to_fr8_json (self ):
479
- return {
480
- 'name' : self .name ,
481
- 'iconPath' : self .icon_path
482
- }
483
-
484
- @staticmethod
485
- def from_fr8_json (json_data ):
486
- dto = WebServiceDTO (
487
- name = json_data .get ('name' ),
488
- icon_path = json_data .get ('iconPath' )
489
- )
490
- return dto
0 commit comments