Class: Zm::Client::Resource

Inherits:
Base::MailboxObject show all
Defined in:
lib/zm/client/resource/resource.rb

Overview

objectClass: zimbraCalendarResource

Constant Summary collapse

LOCATION =
'Location'
EQUIPMENT =
'Equipment'
TYPES =
[LOCATION, EQUIPMENT].freeze

Instance Attribute Summary

Attributes inherited from Base::MailboxObject

#carLicense, #domain_key, #home_url, #password, #public_url, #used

Attributes inherited from Base::Object

#id, #name, #parent, #token

Instance Method Summary collapse

Methods inherited from Base::MailboxObject

#account_content_by, #account_login, #account_login_password, #account_login_preauth, #aces, #admin_login, #appointments, #contacts, #data_sources, #dls_owner, #documents, #domain_name, #filter_rules, #folders, #identities, #infos, #is_external_transport?, #is_local_transport?, #last_logon, #local_transport, #local_transport!, #logged?, #login, #mailbox_infos, #mbxid, #mbxid!, #memberships, #messages, #mountpoints, #outgoing_filter_rules, #password!, #prefs, #rename!, #rest_account_connector, #search_folders, #shares, #signatures, #soap_account_connector, #tags, #tasks, #token_metadata, #update!, #uploader, #used!

Methods included from HasSoapAdminConnector

#soap_admin_connector

Methods inherited from Base::Object

#clone, #initialize, #inspect, #instance_variables_map, #logger, #recorded?, #save!, #to_h, #to_s, #update_attribute

Constructor Details

This class inherits a constructor from Zm::Client::Base::Object

Instance Method Details

#attrs_writeObject



26
27
28
# File 'lib/zm/client/resource/resource.rb', line 26

def attrs_write
  @parent.zimbra_attributes.all_resource_attrs_writable_names
end

#create!Object



21
22
23
24
# File 'lib/zm/client/resource/resource.rb', line 21

def create!
  resp = sac.invoke(jsns_builder.to_create)
  @id = resp[:CreateCalendarResourceResponse][:calresource].first[:id]
end

#delete!Object



11
12
13
14
# File 'lib/zm/client/resource/resource.rb', line 11

def delete!
  sac.invoke(jsns_builder.to_delete)
  @id = nil
end

#equipment?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/zm/client/resource/resource.rb', line 34

def equipment?
  zimbraCalResType == EQUIPMENT
end

#location?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/zm/client/resource/resource.rb', line 30

def location?
  zimbraCalResType == LOCATION
end

#modify!Object



16
17
18
19
# File 'lib/zm/client/resource/resource.rb', line 16

def modify!
  sac.invoke(jsns_builder.to_update)
  true
end