Class: Zm::Client::SearchFolder

Inherits:
Base::Object show all
Defined in:
lib/zm/client/search_folder/search_folder.rb

Overview

class account SearchFolder

Instance Attribute Summary collapse

Attributes inherited from Base::Object

#parent, #token

Instance Method Summary collapse

Methods inherited from Base::Object

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

Constructor Details

#initialize(parent) ⇒ SearchFolder

define_changed_attributes :name, :color, :rgb, :l, :query, :sortBy



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

def initialize(parent)
  @l = FolderDefault::ROOT[:id]
  @types = 'messages'
  super(parent)
end

Instance Attribute Details

#absFolderPathObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def absFolderPath
  @absFolderPath
end

#activesyncdisabledObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def activesyncdisabled
  @activesyncdisabled
end

#colorObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def color
  @color
end

#deletableObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def deletable
  @deletable
end

#idObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def id
  @id
end

#lObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def l
  @l
end

#luuidObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def luuid
  @luuid
end

#msObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def ms
  @ms
end

#nameObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def name
  @name
end

#queryObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def query
  @query
end

#revObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def rev
  @rev
end

#rgbObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def rgb
  @rgb
end

#sortByObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def sortBy
  @sortBy
end

#typesObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def types
  @types
end

#uuidObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def uuid
  @uuid
end

#webOfflineSyncDaysObject

include Zm::Model::AttributeChangeObserver



9
10
11
# File 'lib/zm/client/search_folder/search_folder.rb', line 9

def webOfflineSyncDays
  @webOfflineSyncDays
end

Instance Method Details

#color!Object



44
45
46
47
48
49
# File 'lib/zm/client/search_folder/search_folder.rb', line 44

def color!
  # @parent.sacc.invoke(jsns_builder.to_color) if color_changed? || rgb_changed?
  @parent.sacc.invoke(jsns_builder.to_color)

  true
end

#create!Object



21
22
23
24
25
26
# File 'lib/zm/client/search_folder/search_folder.rb', line 21

def create!
  rep = @parent.sacc.invoke(jsns_builder.to_jsns)
  json = rep[:CreateSearchFolderResponse][:search].first
  SearchFolderJsnsInitializer.update(self, json)
  @id
end

#delete!Object



51
52
53
54
55
56
# File 'lib/zm/client/search_folder/search_folder.rb', line 51

def delete!
  return false if @id.nil?

  @parent.sacc.invoke(jsns_builder.to_delete)
  @id = nil
end

#modify!Object



28
29
30
31
# File 'lib/zm/client/search_folder/search_folder.rb', line 28

def modify!
  @parent.sacc.invoke(jsns_builder.to_modify)
  true
end

#rename!(new_name) ⇒ Object



37
38
39
40
41
42
# File 'lib/zm/client/search_folder/search_folder.rb', line 37

def rename!(new_name)
  return false if new_name == @name

  @parent.sacc.invoke(jsns_builder.to_rename(new_name))
  @name = new_name
end

#update!(*args) ⇒ Object

Raises:

  • (NotImplementedError)


33
34
35
# File 'lib/zm/client/search_folder/search_folder.rb', line 33

def update!(*args)
  raise NotImplementedError
end