Class: BunBun::Client::StorageZone

Inherits:
Namespace
  • Object
show all
Defined in:
lib/bunbun/client/storage_zone.rb

Defined Under Namespace

Classes: Statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Namespace

#inspect

Constructor Details

#initialize(client) ⇒ StorageZone

Returns a new instance of StorageZone.



6
7
8
9
10
# File 'lib/bunbun/client/storage_zone.rb', line 6

def initialize(client)
  super

  @statistics = Statistics.new(client)
end

Instance Attribute Details

#statisticsObject (readonly)

Returns the value of attribute statistics.



35
36
37
# File 'lib/bunbun/client/storage_zone.rb', line 35

def statistics
  @statistics
end

Instance Method Details

#create(body_params) ⇒ Object



12
13
14
# File 'lib/bunbun/client/storage_zone.rb', line 12

def create(body_params)
  @client.post('/storagezone', BunBun::Body.transform_keys(body_params))
end

#delete(id) ⇒ Object



16
17
18
# File 'lib/bunbun/client/storage_zone.rb', line 16

def delete(id)
  @client.delete("/storagezone/#{id}")
end

#get(id) ⇒ Object



20
21
22
# File 'lib/bunbun/client/storage_zone.rb', line 20

def get(id)
  @client.get("/storagezone/#{id}")
end

#list(page: nil, per_page: nil, include_deleted: nil, search: nil) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/bunbun/client/storage_zone.rb', line 24

def list(page: nil, per_page: nil, include_deleted: nil, search: nil)
  params = {
    page: page,
    perPage: per_page,
    includeDeleted: include_deleted,
    search: search
  }

  @client.get(BunBun::URI.join('/storagezone', params))
end

#update(id, body_params) ⇒ Object



37
38
39
# File 'lib/bunbun/client/storage_zone.rb', line 37

def update(id, body_params)
  @client.post("/storagezone/#{id}", BunBun::Body.transform_keys(body_params))
end