How to use the boto3.utils.inject_attribute function in boto3

To help you get started, we’ve selected a few boto3 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github boto / boto3 / tests / unit / test_utils.py View on Github external
def test_shadowing_existing_var_raises_exception(self):
        class_attributes = {'foo': 'preexisting'}
        with self.assertRaises(RuntimeError):
            utils.inject_attribute(class_attributes, 'foo', 'bar')
github boto / boto3 / tests / unit / test_utils.py View on Github external
def test_inject_attributes_with_no_shadowing(self):
        class_attributes = {}
        utils.inject_attribute(class_attributes, 'foo', 'bar')
        self.assertEqual(class_attributes['foo'], 'bar')
github theriley106 / EchoLinguistics / sampleSkill / lambda / boto3 / resources / action.py View on Github external
def inject(self, class_attributes, service_context, event_name, **kwargs):
        resource_name = event_name.rsplit(".")[-1]
        action = Action(self.name, self.model, {})
        self.function.__name__ = self.name
        self.function.__doc__ = ActionDocstring(
            resource_name=resource_name,
            event_emitter=self.emitter,
            action_model=action,
            service_model=service_context.service_model,
            include_signature=False
        )
        inject_attribute(class_attributes, self.name, self.function)
github boto / boto3 / boto3 / s3 / inject.py View on Github external
def inject_bucket_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'load', bucket_load)
    utils.inject_attribute(class_attributes, 'upload_file', bucket_upload_file)
    utils.inject_attribute(
        class_attributes, 'download_file', bucket_download_file)
    utils.inject_attribute(class_attributes, 'copy', bucket_copy)
    utils.inject_attribute(
        class_attributes, 'upload_fileobj', bucket_upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', bucket_download_fileobj)
github boto / boto3 / boto3 / s3 / inject.py View on Github external
def inject_object_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', object_upload_file)
    utils.inject_attribute(
        class_attributes, 'download_file', object_download_file)
    utils.inject_attribute(class_attributes, 'copy', object_copy)
    utils.inject_attribute(
        class_attributes, 'upload_fileobj', object_upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', object_download_fileobj)
github terrycain / aioboto3 / aioboto3 / s3 / inject.py View on Github external
def inject_s3_transfer_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', upload_file)
    utils.inject_attribute(class_attributes, 'download_file', download_file)
    utils.inject_attribute(class_attributes, 'copy', copy)
    utils.inject_attribute(class_attributes, 'upload_fileobj', upload_fileobj)
    utils.inject_attribute(class_attributes, 'download_fileobj', download_fileobj)
github terrycain / aioboto3 / aioboto3 / s3 / inject.py View on Github external
def inject_s3_transfer_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', upload_file)
    utils.inject_attribute(class_attributes, 'download_file', download_file)
    utils.inject_attribute(class_attributes, 'copy', copy)
    utils.inject_attribute(class_attributes, 'upload_fileobj', upload_fileobj)
    utils.inject_attribute(class_attributes, 'download_fileobj', download_fileobj)
github boto / boto3 / boto3 / s3 / inject.py View on Github external
def inject_object_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', object_upload_file)
    utils.inject_attribute(
        class_attributes, 'download_file', object_download_file)
    utils.inject_attribute(class_attributes, 'copy', object_copy)
    utils.inject_attribute(
        class_attributes, 'upload_fileobj', object_upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', object_download_fileobj)
github boto / boto3 / boto3 / s3 / inject.py View on Github external
def inject_object_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', object_upload_file)
    utils.inject_attribute(
        class_attributes, 'download_file', object_download_file)
    utils.inject_attribute(class_attributes, 'copy', object_copy)
    utils.inject_attribute(
        class_attributes, 'upload_fileobj', object_upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', object_download_fileobj)
github boto / boto3 / boto3 / s3 / inject.py View on Github external
def inject_s3_transfer_methods(class_attributes, **kwargs):
    utils.inject_attribute(class_attributes, 'upload_file', upload_file)
    utils.inject_attribute(class_attributes, 'download_file', download_file)
    utils.inject_attribute(class_attributes, 'copy', copy)
    utils.inject_attribute(class_attributes, 'upload_fileobj', upload_fileobj)
    utils.inject_attribute(
        class_attributes, 'download_fileobj', download_fileobj)