Class: FlexOps::Resources::EmailTemplates

Inherits:
Object
  • Object
show all
Defined in:
lib/flexops/resources/email_templates.rb

Instance Method Summary collapse

Constructor Details

#initialize(http, ws_id_proc) ⇒ EmailTemplates

Returns a new instance of EmailTemplates.



14
15
16
17
# File 'lib/flexops/resources/email_templates.rb', line 14

def initialize(http, ws_id_proc)
  @http = http
  @ws_id = ws_id_proc
end

Instance Method Details

#create(request) ⇒ Object



27
28
29
# File 'lib/flexops/resources/email_templates.rb', line 27

def create(request)
  @http.post("#{ws_path}/shipment-email-templates/", body: request)
end

#delete(id) ⇒ Object



35
36
37
# File 'lib/flexops/resources/email_templates.rb', line 35

def delete(id)
  @http.delete("#{ws_path}/shipment-email-templates/#{id}")
end

#get(id) ⇒ Object



23
24
25
# File 'lib/flexops/resources/email_templates.rb', line 23

def get(id)
  @http.get("#{ws_path}/shipment-email-templates/#{id}")
end

#listObject



19
20
21
# File 'lib/flexops/resources/email_templates.rb', line 19

def list
  @http.get("#{ws_path}/shipment-email-templates/")
end

#preview(id, context = {}) ⇒ Object



39
40
41
# File 'lib/flexops/resources/email_templates.rb', line 39

def preview(id, context = {})
  @http.post("#{ws_path}/shipment-email-templates/#{id}/preview", body: context)
end

#update(id, request) ⇒ Object



31
32
33
# File 'lib/flexops/resources/email_templates.rb', line 31

def update(id, request)
  @http.put("#{ws_path}/shipment-email-templates/#{id}", body: request)
end