Delete the object from the Cloud Storage Bucket.
779570
public function delete() {
    $token_header = $this->getOAuthTokenHeader(parent::WRITE_SCOPE);
    if ($token_header === false) {
      trigger_error("Unable to acquire OAuth token.", E_USER_WARNING);
      return false;
    }

    $http_response = $this->makeHttpRequest($this->url,
                                            "DELETE",
                                            $token_header);

    if ($http_response === false) {
      return false;
    }

    // Unlinking the file also removes it from the stat cache.
    // See: http://php.net/manual/en/function.clearstatcache.php
    clearstatcache(true, $this->filename);

    if ($http_response['status_code'] === HttpResponse::NO_CONTENT) {
      return true;
    } else {
      trigger_error($this->getErrorMessage($http_response['status_code'],
                                           $http_response['body']),
                    E_USER_WARNING);
    }

    return false;
  }
562100
def remove_s3_bucket():
    """"""
    logger.debug("[#] Removing S3 bucket")
    client = boto3.client("s3", region_name=PRIMARY_REGION)
    buckets = client.list_buckets()
    matches = [x for x in buckets.get('Buckets', list())
               if x['Name'].startswith(S3_BUCKET_NAME)]
    if len(matches) == 0:
        return
    match = matches.pop()['Name']
    try:
        response = client.list_objects_v2(
            Bucket=match,
        )
    except client.exceptions.NoSuchBucket:
        logger.info("[!] S3 bucket already deleted")
        return True

    while response['KeyCount'] > 0:
        logger.debug('[*] Deleting %d objects from bucket %s'
                     % (len(response['Contents']), match))
        response = client.delete_objects(
            Bucket=match,
            Delete={
                'Objects': [{'Key': obj['Key']} for obj in response['Contents']]
            }
        )
        response = client.list_objects_v2(
            Bucket=match,
        )

    logger.debug('[#] Deleting bucket %s' % match)
    response = client.delete_bucket(
        Bucket=match
    )
    logger.info("[#] Successfully deleted the S3 bucket")

    return response
683816
def delete_datastore(self):
        # type: () -> None
        
        success, result = self._read_from_hdx('datastore', self.data['id'], 'resource_id',
                                              self.actions()['datastore_delete'],
                                              force=True)
        if not success:
            logger.debug(result)
688595
def delete_object_from_file(file_name, save_key, file_location):
    
    file = __os.path.join(file_location, file_name)
    shelve_store = __shelve.open(file)
    del shelve_store[save_key]
    shelve_store.close()
1290374
def del_stream(self, bucket, label):
        
        bucket = self._require_bucket(bucket)
        key = self._require_key(bucket, label)
        key.delete()
466973
def delete(self):
        
        return self.bucket.delete_key(self.name, version_id=self.version_id)
434468
def remove_file_from_s3(awsclient, bucket, key):
    
    client_s3 = awsclient.get_client('s3')
    response = client_s3.delete_object(Bucket=bucket, Key=key)
1195459
def delete(self, for_update=False):
        
        hash_key = self.get_hash_id()
        try:
            original_instance = self.load(hash_key, convert_key=False)
        except KeyError:
            return

        # Remove from the `all` index.
        all_index = self._query.all_index()
        all_index.remove(hash_key)

        # Remove from the secondary indexes.
        for field in self._indexes:
            for index in field.get_indexes():
                index.remove(original_instance)

        if not for_update:
            for field in self._fields.values():
                if isinstance(field, _ContainerField):
                    field._delete(self)

        # Remove the object itself.
        self.__database__.delete(hash_key)
390112
def delete(self, task_id):
    """"""
    if isinstance(task_id, RegisteredTask):
      task_id = task_id.id

    def cloud_delete(api):
      api.delete(task_id)

    if len(self._threads):
      self.put(cloud_delete)
    else:
      cloud_delete(self._api)

    return self
1003214
def delete_blob(call=None, kwargs=None):  # pylint: disable=unused-argument
    '''
    
    '''
    if kwargs is None:
        kwargs = {}

    if 'container' not in kwargs:
        raise SaltCloudSystemExit(
            'A container must be specified'
        )

    if 'blob' not in kwargs:
        raise SaltCloudSystemExit(
            'A blob must be specified'
        )

    storageservice = _get_block_blob_service(kwargs)

    storageservice.delete_blob(kwargs['container'], kwargs['blob'])
    return True
1227382
def remove_bucket(self, bucket_name):
        
        is_valid_bucket_name(bucket_name)
        self._url_open('DELETE', bucket_name=bucket_name)

        # Make sure to purge bucket_name from region cache.
        self._delete_bucket_region(bucket_name)
184345
def delete_object(connection, container: str, object_meta_data: dict) -> None:
    
    connection.delete_object(container, object_meta_data['name'])
273486
def delete(self, bucket=None, ignore=False):
        

        # Make lists
        buckets = bucket
        if isinstance(bucket, six.string_types):
            buckets = [bucket]
        elif bucket is None:
            buckets = reversed(self.buckets)

        # Iterate over buckets
        for bucket in buckets:

            # Non existent bucket
            if bucket not in self.buckets:
                if not ignore:
                    message = 'Bucket "%s" doesn\'t exist' % bucket
                    raise tableschema.exceptions.StorageError(message)
                return

            # Remove from descriptors
            if bucket in self.__descriptors:
                del self.__descriptors[bucket]

            # Remove from dataframes
            if bucket in self.__dataframes:
                del self.__dataframes[bucket]
5453
def delete(self):
        
        # We only allow the object from being deleted once, otherwise
        # we might be deleting another GPU object that got our gl-id
        # after our GPU object was deleted. Also note that e.g.
        # DataBufferView does not have the _glir attribute.
        if hasattr(self, '_glir'):
            # Send our final command into the queue
            self._glir.command('DELETE', self._id)
            # Tell master glir queue that this queue is no longer being used
            self._glir._deletable = True
            # Detach the queue
            del self._glir
242475
def delete_object(self, bucket, object_name):
        
        details = self._details(
            method=b"DELETE",
            url_context=self._url_context(bucket=bucket, object_name=object_name),
        )
        d = self._submit(self._query_factory(details))
        return d
179852
def destroy(force = false)
      delete_bucket
      true
    rescue Error::BucketNotEmpty
      if force
        objects.destroy_all
        retry
      else
        raise
      end
    end
1160261
def delete(options = {})
      options = options.merge(bucket: @bucket_name)
      resp = @client.delete_bucket_policy(options)
      resp.data
    end