Set the S3 client to be used for this upload.
497910
function Client(client) {
  if (this instanceof Client === false) {
    return new Client(client);
  }

  if (!client) {
    throw new Error('Must configure an S3 client before attempting to create an S3 upload stream.');
  }

  this.cachedClient = client;
}
445520
def create_s3app(self):
        """"""
        utils.banner("Creating S3 App Infrastructure")
        primary_region = self.configs['pipeline']['primary_region']
        s3obj = s3.S3Apps(app=self.app,
                          env=self.env,
                          region=self.region,
                          prop_path=self.json_path,
                          primary_region=primary_region)
        s3obj.create_bucket()
522824
def setup(cls, client_id, client_secret):
        
        cls.client_id = client_id
        cls.client_secret = client_secret
1344401
protected function setApiClient()
    {
        $apiDomain = "https://{$this->domain}";

        $client = new ApiClient(
            [
                'domain' => $apiDomain,
                'basePath' => '/',
                'guzzleOptions' => $this->guzzleOptions
            ]
        );

        $this->apiClient = $client;
    }
1085318
@Override
    protected AmazonS3 build(AwsSyncClientParams clientParams) {
        return clientFactory.apply(new AmazonS3ClientParamsWrapper(clientParams, resolveS3ClientOptions()));
    }
894389
def setup(self):
        '''
        
        '''
        self.zoo_client.add_listener(self.state_listener)

        if self.ensure:
            self.zoo_client.ensure_path(self.my_file)
146299
def _put_file(self, file):
        """"""

        post_params = {
            'file_size': file.size,
            'file_hash': file.md5hash(),
            'content_type': self._get_content_type(file),

        }

        headers = self._request_headers('PUT', file.prefixed_name, post_params=post_params)

        with closing(HTTPConnection(self.netloc)) as conn:
            conn.request('PUT', file.prefixed_name, file.read(), headers=headers)
            response = conn.getresponse()

            if response.status not in (200,):
                raise S3IOError(
                    'py3s3 PUT error. '
                    'Response status: {}. '
                    'Reason: {}. '
                    'Response Text: \n'
                    '{}'.format(response.status, response.reason, response.read()))
62181
def upload_file(client, bucket, local_path, remote_path, overwrite=False):
    """"""
    bucket = client.get_bucket(bucket)
    blob = storage.Blob(remote_path, bucket)
    if (not overwrite) and blob.exists():
        raise Conflict('File/object already exists on the bucket!')
    blob.upload_from_filename(local_path)
198347
def upload(ctx):
    """"""
    settings.add_cli_options(ctx.cli_options, settings.TransferAction.Upload)
    ctx.initialize(settings.TransferAction.Upload)
    specs = settings.create_upload_specifications(
        ctx.cli_options, ctx.config)
    del ctx.cli_options
    for spec in specs:
        blobxfer.api.Uploader(
            ctx.general_options, ctx.credentials, spec
        ).start()
999271
async def _put_chunk(
            cls, session: aiohttp.ClientSession,
            upload_uri: str, buf: bytes):
        """"""
        # Build the correct headers.
        headers = {
            'Content-Type': 'application/octet-stream',
            'Content-Length': '%s' % len(buf),
        }
        credentials = cls._handler.session.credentials
        if credentials is not None:
            utils.sign(upload_uri, headers, credentials)

        # Perform upload of chunk.
        async with await session.put(
                upload_uri, data=buf, headers=headers) as response:
            if response.status != 200:
                content = await response.read()
                request = {
                    "body": buf,
                    "headers": headers,
                    "method": "PUT",
                    "uri": upload_uri,
                }
                raise CallError(request, response, content, None)
418061
def InitializeUpload(self, http_request, http=None, client=None):
        """"""
        if self.strategy is None:
            raise exceptions.UserError(
                'No upload strategy set; did you call ConfigureRequest?')
        if http is None and client is None:
            raise exceptions.UserError('Must provide client or http.')
        if self.strategy != RESUMABLE_UPLOAD:
            return
        http = http or client.http
        if client is not None:
            http_request.url = client.FinalizeTransferUrl(http_request.url)
        self.EnsureUninitialized()
        http_response = http_wrapper.MakeRequest(http, http_request,
                                                 retries=self.num_retries)
        if http_response.status_code != http_client.OK:
            raise exceptions.HttpError.FromResponse(http_response)

        self.__server_chunk_granularity = http_response.info.get(
            'X-Goog-Upload-Chunk-Granularity')
        url = http_response.info['location']
        if client is not None:
            url = client.FinalizeTransferUrl(url)
        self._Initialize(http, url)

        # Unless the user has requested otherwise, we want to just
        # go ahead and pump the bytes now.
        if self.auto_transfer:
            return self.StreamInChunks()
        return http_response
484508
function (options) {
        var s3 = {};
        s3.client = connectToS3(options);
        s3.bucket = options.bucket || '';
        return s3;
    }
28368
def _put_bucket_versioning(self):
        """"""
        status = 'Suspended'
        if self.s3props['versioning']['enabled']:
            status = 'Enabled'

        versioning_config = {
            'MFADelete': self.s3props['versioning']['mfa_delete'],
            'Status': status
        }

        _response = self.s3client.put_bucket_versioning(Bucket=self.bucket, VersioningConfiguration=versioning_config)
        LOG.debug('Response setting up S3 versioning: %s', _response)
        LOG.info('S3 versioning configuration updated')
454286
private function setBasicApiClient()
    {
        $this->client = new Client();

        // if using a self issued access token,
        // just authenticate the user right now
        if (!is_null($this->accessToken)) {
            $this->client->authenticate($this->accessToken);
        }
    }
940623
def set_file
      if have_file?
        case original_resource_mounter.send(:storage).class.name
        when 'CarrierWave::Storage::File'
          set_file_for_local_storage
        when 'CarrierWave::Storage::Fog', 'CarrierWave::Storage::AWS'
          set_file_for_remote_storage
        else
          raise UnknowStorage
        end
      else
        raise NoFileForOriginalResource
      end
    end
1260786
function setClientInfo(req) {

	let client = req.client = {};

	initUserAgendAndOS(req.headers, client);
	initClientIp(req, client);
}
638760
def s3_upload(source, destination, profile_name=None):
    
    session = boto3.Session(profile_name=profile_name)
    s3 = session.resource('s3')
    bucket_name, key = _s3_path_split(destination)
    with open(source, 'rb') as data:
        s3.Bucket(bucket_name).put_object(Key=key, Body=data)