Class: Zm::Client::FolderJsnsBuilder
Overview
class for account folder jsns builder
Instance Method Summary
collapse
#build, #initialize, #to_color, #to_delete, #to_move, #to_rename, #to_tag, #to_trash
Instance Method Details
#to_empty ⇒ Object
86
87
88
89
90
91
92
93
94
95
96
97
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 86
def to_empty
action = {
op: :empty,
id: @item.id,
recursive: false
}
attrs = { action: action }
SoapElement.mail(SoapMailConstants::FOLDER_ACTION_REQUEST)
.add_attributes(attrs)
end
|
#to_jsns ⇒ Object
Also known as:
to_create
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 12
def to_jsns
folder = {
f: @item.f,
name: @item.name,
l: @item.l,
color: @item.color,
rgb: @item.rgb,
url: @item.url,
fb: @item.fb,
view: @item.view
}
folder.compact!
attrs = { folder: folder }
SoapElement.mail(SoapMailConstants::CREATE_FOLDER_REQUEST)
.add_attributes(attrs)
end
|
#to_patch(options) ⇒ Object
59
60
61
62
63
64
65
66
67
68
69
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 59
def to_patch(options)
action = {
op: :update,
id: @item.id
}.merge(options)
attrs = { action: action }
SoapElement.mail(SoapMailConstants::FOLDER_ACTION_REQUEST)
.add_attributes(attrs)
end
|
#to_retentionpolicy ⇒ Object
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 71
def to_retentionpolicy
retentionpolicy = @item.retention_policies.all.map { |rp| retentionpolicy_jsns(rp) }.reduce({}, :merge)
attrs = {
action: {
op: :retentionpolicy,
id: @item.id,
retentionPolicy: retentionpolicy
}
}
SoapElement.mail(SoapMailConstants::FOLDER_ACTION_REQUEST)
.add_attributes(attrs)
end
|
#to_update ⇒ Object
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 33
def to_update
action = {
op: :update,
id: @item.id,
f: @item.f,
name: @item.name,
l: @item.l,
color: @item.color,
rgb: @item.rgb,
url: @item.url,
fb: @item.fb,
view: @item.view
}
action.compact!
if @item.is_immutable?
action.delete(:name)
action.delete(:l)
end
attrs = { action: action }
SoapElement.mail(SoapMailConstants::FOLDER_ACTION_REQUEST)
.add_attributes(attrs)
end
|