This function routes any action_type to the correct S3 connector actions. :return: Object
(self, opts)
| 598 | |
| 599 | @with_connection |
| 600 | def fetch_data(self, opts): |
| 601 | """ |
| 602 | This function routes any action_type to the correct S3 connector actions. |
| 603 | :return: Object |
| 604 | """ |
| 605 | if 'action_type' not in opts: |
| 606 | raise Exception('Provide action_type key.') |
| 607 | if 'event_data' not in opts: |
| 608 | raise Exception('Provide event_data key.') |
| 609 | action_type = opts.pop('action_type') |
| 610 | if action_type == 'fetch_object': |
| 611 | return self.__fetch_object(opts) |
| 612 | if action_type == 'get_string_data': |
| 613 | return self.__get_string_data(opts) |
| 614 | if action_type == 'list_objects': |
| 615 | return self.__fetch_object(opts) |
| 616 | if action_type == 'count_objects': |
| 617 | return self.__count_objects(opts) |
| 618 | if action_type == 'fetch_folder': |
| 619 | return self.__start_folder_fetch(opts) |
| 620 | if action_type == 'list_buckets': |
| 621 | return self.__list_buckets(opts) |
| 622 | if action_type == 'get_folder_contents': |
| 623 | return self.__get_folder_contents(opts) |
| 624 | if action_type == 'get_pre_signed_url': |
| 625 | return self.__get_pre_signed_url(opts) |
| 626 | if action_type == 'custom_image_upload_url': |
| 627 | return self.__custom_image_upload_url(opts) |
| 628 | |
| 629 | @with_connection |
| 630 | def put_data(self, opts): |