21
21
22
22
class IotJobsClient (awsiot .MqttServiceClient ):
23
23
24
- def publish_describe (self , request ):
24
+ def publish_describe_job_execution (self , request ):
25
25
# type: (DescribeJobExecutionRequest) -> concurrent.futures.Future
26
26
"""
27
27
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution
@@ -42,7 +42,7 @@ def publish_describe(self, request):
42
42
topic = '$aws/things/{0.thing_name}/jobs/{0.job_id}/get' .format (request ),
43
43
payload = request .to_payload ())
44
44
45
- def publish_get_pending (self , request ):
45
+ def publish_get_pending_job_executions (self , request ):
46
46
# type: (GetPendingJobExecutionsRequest) -> concurrent.futures.Future
47
47
"""
48
48
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions
@@ -61,7 +61,7 @@ def publish_get_pending(self, request):
61
61
topic = '$aws/things/{0.thing_name}/jobs/get' .format (request ),
62
62
payload = request .to_payload ())
63
63
64
- def publish_start_next_pending (self , request ):
64
+ def publish_start_next_pending_job_execution (self , request ):
65
65
# type: (StartNextPendingJobExecutionRequest) -> concurrent.futures.Future
66
66
"""
67
67
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution
@@ -80,7 +80,7 @@ def publish_start_next_pending(self, request):
80
80
topic = '$aws/things/{0.thing_name}/jobs/start-next' .format (request ),
81
81
payload = request .to_payload ())
82
82
83
- def publish_update (self , request ):
83
+ def publish_update_job_execution (self , request ):
84
84
# type: (UpdateJobExecutionRequest) -> concurrent.futures.Future
85
85
"""
86
86
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution
@@ -101,7 +101,7 @@ def publish_update(self, request):
101
101
topic = '$aws/things/{0.thing_name}/jobs/{0.job_id}/update' .format (request ),
102
102
payload = request .to_payload ())
103
103
104
- def subscribe_to_describe_accepted (self , request , on_accepted ):
104
+ def subscribe_to_describe_job_execution_accepted (self , request , on_accepted ):
105
105
# type: (DescribeJobExecutionSubscriptionRequest, typing.Callable[[DescribeJobExecutionResponse], None]) -> concurrent.futures.Future
106
106
"""
107
107
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution
@@ -129,7 +129,7 @@ def subscribe_to_describe_accepted(self, request, on_accepted):
129
129
callback = on_accepted ,
130
130
payload_to_class_fn = DescribeJobExecutionResponse .from_payload )
131
131
132
- def subscribe_to_describe_rejected (self , request , on_rejected ):
132
+ def subscribe_to_describe_job_execution_rejected (self , request , on_rejected ):
133
133
# type: (DescribeJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
134
134
"""
135
135
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-describejobexecution
@@ -157,33 +157,7 @@ def subscribe_to_describe_rejected(self, request, on_rejected):
157
157
callback = on_rejected ,
158
158
payload_to_class_fn = RejectedError .from_payload )
159
159
160
- def subscribe_to_executions_changed_events (self , request , on_job_executions_changed ):
161
- # type: (JobExecutionsChangedEventsSubscriptionRequest, typing.Callable[[JobExecutionsChangedEvent], None]) -> concurrent.futures.Future
162
- """
163
- API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-jobexecutionschanged
164
-
165
- Parameters:
166
- request - `JobExecutionsChangedEventsSubscriptionRequest` instance.
167
- on_job_executions_changed - Callback to invoke each time the on_job_executions_changed event is received.
168
- The callback should take 1 argument of type `JobExecutionsChangedEvent`.
169
- The callback is not expected to return anything.
170
-
171
- Returns a concurrent.futures.Future, whose result will be None if the
172
- subscription is successful. The Future's result will be an exception
173
- if the subscription is unsuccessful.
174
- """
175
- if not request .thing_name :
176
- raise ValueError ("request.thing_name is required" )
177
-
178
- if not on_job_executions_changed :
179
- raise ValueError ("on_job_executions_changed is required" )
180
-
181
- return self ._subscribe_operation (
182
- topic = '$aws/things/{0.thing_name}/jobs/notify' .format (request ),
183
- callback = on_job_executions_changed ,
184
- payload_to_class_fn = JobExecutionsChangedEvent .from_payload )
185
-
186
- def subscribe_to_get_pending_accepted (self , request , on_accepted ):
160
+ def subscribe_to_get_pending_job_executions_accepted (self , request , on_accepted ):
187
161
# type: (GetPendingJobExecutionsSubscriptionRequest, typing.Callable[[GetPendingJobExecutionsResponse], None]) -> concurrent.futures.Future
188
162
"""
189
163
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions
@@ -209,7 +183,7 @@ def subscribe_to_get_pending_accepted(self, request, on_accepted):
209
183
callback = on_accepted ,
210
184
payload_to_class_fn = GetPendingJobExecutionsResponse .from_payload )
211
185
212
- def subscribe_to_get_pending_rejected (self , request , on_rejected ):
186
+ def subscribe_to_get_pending_job_executions_rejected (self , request , on_rejected ):
213
187
# type: (GetPendingJobExecutionsSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
214
188
"""
215
189
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-getpendingjobexecutions
@@ -235,14 +209,40 @@ def subscribe_to_get_pending_rejected(self, request, on_rejected):
235
209
callback = on_rejected ,
236
210
payload_to_class_fn = RejectedError .from_payload )
237
211
238
- def subscribe_to_next_changed_events (self , request , on_next_job_execution_changed ):
239
- # type: (NextJobExecutionChangedEventsSubscriptionRequest, typing.Callable[[NextJobExecutionChangedEvent], None]) -> concurrent.futures.Future
212
+ def subscribe_to_job_executions_changed_events (self , request , on_event ):
213
+ # type: (JobExecutionsChangedSubscriptionRequest, typing.Callable[[JobExecutionsChangedEvent], None]) -> concurrent.futures.Future
214
+ """
215
+ API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-jobexecutionschanged
216
+
217
+ Parameters:
218
+ request - `JobExecutionsChangedSubscriptionRequest` instance.
219
+ on_event - Callback to invoke each time the on_event event is received.
220
+ The callback should take 1 argument of type `JobExecutionsChangedEvent`.
221
+ The callback is not expected to return anything.
222
+
223
+ Returns a concurrent.futures.Future, whose result will be None if the
224
+ subscription is successful. The Future's result will be an exception
225
+ if the subscription is unsuccessful.
226
+ """
227
+ if not request .thing_name :
228
+ raise ValueError ("request.thing_name is required" )
229
+
230
+ if not on_event :
231
+ raise ValueError ("on_event is required" )
232
+
233
+ return self ._subscribe_operation (
234
+ topic = '$aws/things/{0.thing_name}/jobs/notify' .format (request ),
235
+ callback = on_event ,
236
+ payload_to_class_fn = JobExecutionsChangedEvent .from_payload )
237
+
238
+ def subscribe_to_next_job_execution_changed_events (self , request , on_event ):
239
+ # type: (NextJobExecutionChangedSubscriptionRequest, typing.Callable[[NextJobExecutionChangedEvent], None]) -> concurrent.futures.Future
240
240
"""
241
241
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-nextjobexecutionchanged
242
242
243
243
Parameters:
244
- request - `NextJobExecutionChangedEventsSubscriptionRequest ` instance.
245
- on_next_job_execution_changed - Callback to invoke each time the on_next_job_execution_changed event is received.
244
+ request - `NextJobExecutionChangedSubscriptionRequest ` instance.
245
+ on_event - Callback to invoke each time the on_event event is received.
246
246
The callback should take 1 argument of type `NextJobExecutionChangedEvent`.
247
247
The callback is not expected to return anything.
248
248
@@ -253,15 +253,15 @@ def subscribe_to_next_changed_events(self, request, on_next_job_execution_change
253
253
if not request .thing_name :
254
254
raise ValueError ("request.thing_name is required" )
255
255
256
- if not on_next_job_execution_changed :
257
- raise ValueError ("on_next_job_execution_changed is required" )
256
+ if not on_event :
257
+ raise ValueError ("on_event is required" )
258
258
259
259
return self ._subscribe_operation (
260
260
topic = '$aws/things/{0.thing_name}/jobs/notify-next' .format (request ),
261
- callback = on_next_job_execution_changed ,
261
+ callback = on_event ,
262
262
payload_to_class_fn = NextJobExecutionChangedEvent .from_payload )
263
263
264
- def subscribe_to_start_next_pending_accepted (self , request , on_accepted ):
264
+ def subscribe_to_start_next_pending_job_execution_accepted (self , request , on_accepted ):
265
265
# type: (StartNextPendingJobExecutionSubscriptionRequest, typing.Callable[[StartNextJobExecutionResponse], None]) -> concurrent.futures.Future
266
266
"""
267
267
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution
@@ -287,7 +287,7 @@ def subscribe_to_start_next_pending_accepted(self, request, on_accepted):
287
287
callback = on_accepted ,
288
288
payload_to_class_fn = StartNextJobExecutionResponse .from_payload )
289
289
290
- def subscribe_to_start_next_pending_rejected (self , request , on_rejected ):
290
+ def subscribe_to_start_next_pending_job_execution_rejected (self , request , on_rejected ):
291
291
# type: (StartNextPendingJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
292
292
"""
293
293
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-startnextpendingjobexecution
@@ -313,7 +313,7 @@ def subscribe_to_start_next_pending_rejected(self, request, on_rejected):
313
313
callback = on_rejected ,
314
314
payload_to_class_fn = RejectedError .from_payload )
315
315
316
- def subscribe_to_update_accepted (self , request , on_accepted ):
316
+ def subscribe_to_update_job_execution_accepted (self , request , on_accepted ):
317
317
# type: (UpdateJobExecutionSubscriptionRequest, typing.Callable[[UpdateJobExecutionResponse], None]) -> concurrent.futures.Future
318
318
"""
319
319
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution
@@ -341,7 +341,7 @@ def subscribe_to_update_accepted(self, request, on_accepted):
341
341
callback = on_accepted ,
342
342
payload_to_class_fn = UpdateJobExecutionResponse .from_payload )
343
343
344
- def subscribe_to_update_rejected (self , request , on_rejected ):
344
+ def subscribe_to_update_job_execution_rejected (self , request , on_rejected ):
345
345
# type: (UpdateJobExecutionSubscriptionRequest, typing.Callable[[RejectedError], None]) -> concurrent.futures.Future
346
346
"""
347
347
API Docs: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-api.html#mqtt-updatejobexecution
@@ -605,7 +605,7 @@ def from_payload(cls, payload):
605
605
new .timestamp = datetime .datetime .fromtimestamp (val )
606
606
return new
607
607
608
- class JobExecutionsChangedEventsSubscriptionRequest (awsiot .ModeledClass ):
608
+ class JobExecutionsChangedSubscriptionRequest (awsiot .ModeledClass ):
609
609
__slots__ = ['thing_name' ]
610
610
611
611
def __init__ (self , thing_name = None ):
@@ -642,7 +642,7 @@ def from_payload(cls, payload):
642
642
new .timestamp = datetime .datetime .fromtimestamp (val )
643
643
return new
644
644
645
- class NextJobExecutionChangedEventsSubscriptionRequest (awsiot .ModeledClass ):
645
+ class NextJobExecutionChangedSubscriptionRequest (awsiot .ModeledClass ):
646
646
__slots__ = ['thing_name' ]
647
647
648
648
def __init__ (self , thing_name = None ):
0 commit comments