Class: Postscale::Resources::Templates
- Inherits:
-
Resource
- Object
- Resource
- Postscale::Resources::Templates
show all
- Defined in:
- lib/postscale/resources/templates.rb
Instance Method Summary
collapse
Methods inherited from Resource
#initialize
Instance Method Details
#create(request = nil, **kwargs) ⇒ Object
6
7
8
|
# File 'lib/postscale/resources/templates.rb', line 6
def create(request = nil, **kwargs)
@http.post("/v1/templates", json: request_hash(request, kwargs))
end
|
#delete(id) ⇒ Object
22
23
24
|
# File 'lib/postscale/resources/templates.rb', line 22
def delete(id)
@http.delete("/v1/templates/#{encode(id)}")
end
|
#get(id) ⇒ Object
14
15
16
|
# File 'lib/postscale/resources/templates.rb', line 14
def get(id)
@http.get("/v1/templates/#{encode(id)}")
end
|
#list(params = nil, **kwargs) ⇒ Object
10
11
12
|
# File 'lib/postscale/resources/templates.rb', line 10
def list(params = nil, **kwargs)
@http.get("/v1/templates", params: params_hash(params, kwargs))
end
|
#preview(id, request = nil, **kwargs) ⇒ Object
26
27
28
|
# File 'lib/postscale/resources/templates.rb', line 26
def preview(id, request = nil, **kwargs)
@http.post("/v1/templates/#{encode(id)}/preview", json: request_hash(request, kwargs))
end
|
#update(id, request = nil, **kwargs) ⇒ Object
18
19
20
|
# File 'lib/postscale/resources/templates.rb', line 18
def update(id, request = nil, **kwargs)
@http.put("/v1/templates/#{encode(id)}", json: request_hash(request, kwargs))
end
|