Class: Zimbra::CosService

Inherits:
HandsoapService show all
Defined in:
lib/zimbra/cos.rb

Defined Under Namespace

Classes: Builder, Parser

Instance Method Summary collapse

Methods inherited from HandsoapService

#on_create_document, #on_response_document

Methods included from HandsoapUriOverrides

#envelope_namespace, #request_content_type, #uri

Methods included from HandsoapNamespaces

#request_namespaces, #response_namespaces

Methods included from HandsoapErrors

#http_error?, #http_not_found?, #on_after_create_http_request, #on_http_error, #report_error, #soap_fault_not_found?

Instance Method Details

#create(name) ⇒ Object



55
56
57
58
59
60
# File 'lib/zimbra/cos.rb', line 55

def create(name)
  response = invoke("n2:CreateCosRequest") do |message|
    Builder.create(message, name)
  end
  Parser.cos_response(response/"//n2:cos")
end

#delete(cos) ⇒ Object



69
70
71
72
73
# File 'lib/zimbra/cos.rb', line 69

def delete(cos)
  xml = invoke("n2:DeleteCosRequest") do |message|
    Builder.delete(message, cos)
  end
end

#get_by_id(id) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/zimbra/cos.rb', line 39

def get_by_id(id)
  response = invoke("n2:GetCosRequest") do |message|
    Builder.get_by_id(message, id)
  end
  return nil if soap_fault_not_found?
  Parser.cos_response(response/"//n2:cos")
end

#get_by_name(name) ⇒ Object



47
48
49
50
51
52
53
# File 'lib/zimbra/cos.rb', line 47

def get_by_name(name)
  response = invoke("n2:GetCosRequest") do |message|
    Builder.get_by_name(message, name)
  end
  return nil if soap_fault_not_found?
  Parser.cos_response(response/"//n2:cos")
end

#modify(cos) ⇒ Object



62
63
64
65
66
67
# File 'lib/zimbra/cos.rb', line 62

def modify(cos)
  xml = invoke("n2:ModifyCosRequest") do |message|
    Builder.modify(message, cos)
  end
  Parser.cos_response(xml/'//n2:cos')
end