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
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 80
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
|
# 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
}.delete_if { |_, v| v.nil? }
attrs = { folder: folder }
SoapElement.mail(SoapMailConstants::CREATE_FOLDER_REQUEST).add_attributes(attrs)
end
|
#to_patch(options) ⇒ Object
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 55
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
66
67
68
69
70
71
72
73
74
75
76
77
78
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 66
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
# File 'lib/zm/client/folder/folder_jsns_builder.rb', line 31
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
}.delete_if { |_, v| v.nil? }
if @item.is_immutable?
action.delete(:name)
action.delete(:l)
end
attrs = { action: action }
SoapElement.mail(SoapMailConstants::FOLDER_ACTION_REQUEST).add_attributes(attrs)
end
|