Class: Bkblz::Task::CreateBucket

Inherits:
BaseTask
  • Object
show all
Defined in:
lib/bkblz/task/create_bucket.rb

Constant Summary collapse

DuplicateBucketError =
Class.new Bkblz::BaseError

Constants included from ClassMethods

Bkblz::Task::ClassMethods::PARAM_SPEC

Instance Attribute Summary

Attributes inherited from BaseTask

#config, #result

Instance Method Summary collapse

Methods inherited from BaseTask

#initialize, #run

Methods included from ClassMethods

#check_one_of, #check_params, #check_required, #run, #task_param, #task_params

Methods included from TaskHelpers

#find_bucket_by_name

Constructor Details

This class inherits a constructor from Bkblz::Task::BaseTask

Instance Method Details

#run_internal(session, params) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/bkblz/task/create_bucket.rb', line 10

def run_internal(session, params)
  bucket_fields = {
    :account_id => session.,
    :bucket_type => "allPrivate"
  }.merge params
  bucket = Bkblz::V1::Model::Bucket.new bucket_fields

  session.send(Bkblz::V1::CreateBucketRequest.new bucket).to_model
end