Class: Zm::Client::IdentityJsnsBuilder
- Inherits:
-
Object
- Object
- Zm::Client::IdentityJsnsBuilder
- Defined in:
- lib/zm/client/identity/identity_jsns_builder.rb
Overview
class for account identity jsns builder
Instance Method Summary collapse
- #attrs ⇒ Object
-
#initialize(item) ⇒ IdentityJsnsBuilder
constructor
A new instance of IdentityJsnsBuilder.
- #to_delete ⇒ Object
- #to_jsns ⇒ Object
- #to_patch(hash) ⇒ Object
- #to_update ⇒ Object
Constructor Details
#initialize(item) ⇒ IdentityJsnsBuilder
Returns a new instance of IdentityJsnsBuilder.
7 8 9 |
# File 'lib/zm/client/identity/identity_jsns_builder.rb', line 7 def initialize(item) @item = item end |
Instance Method Details
#attrs ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/zm/client/identity/identity_jsns_builder.rb', line 43 def attrs { zimbraPrefIdentityName: @item.zimbraPrefIdentityName, zimbraPrefFromDisplay: @item.zimbraPrefFromDisplay, zimbraPrefFromAddress: @item.zimbraPrefFromAddress, zimbraPrefFromAddressType: @item.zimbraPrefFromAddressType, zimbraPrefReplyToEnabled: @item.zimbraPrefReplyToEnabled, zimbraPrefReplyToDisplay: @item.zimbraPrefReplyToDisplay, zimbraPrefReplyToAddress: @item.zimbraPrefReplyToAddress, zimbraPrefDefaultSignatureId: @item.zimbraPrefDefaultSignatureId, zimbraPrefForwardReplySignatureId: @item.zimbraPrefForwardReplySignatureId, zimbraPrefWhenSentToEnabled: @item.zimbraPrefWhenSentToEnabled, zimbraPrefWhenInFoldersEnabled: @item.zimbraPrefWhenInFoldersEnabled, zimbraPrefWhenSentToAddresses: @item.zimbraPrefWhenSentToAddresses } end |
#to_delete ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/zm/client/identity/identity_jsns_builder.rb', line 35 def to_delete soap_request = SoapElement.account(SoapAccountConstants::DELETE_IDENTITY_REQUEST) node_identity = SoapElement.create(SoapConstants::IDENTITY) .add_attributes({ id: @item.id }) soap_request.add_node(node_identity) soap_request end |
#to_jsns ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/zm/client/identity/identity_jsns_builder.rb', line 11 def to_jsns soap_request = SoapElement.account(SoapAccountConstants::CREATE_IDENTITY_REQUEST) node_identity = SoapElement.create(SoapConstants::IDENTITY) .add_attributes({ name: @item.name, _attrs: attrs }) soap_request.add_node(node_identity) soap_request end |
#to_patch(hash) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/zm/client/identity/identity_jsns_builder.rb', line 27 def to_patch(hash) soap_request = SoapElement.account(SoapAccountConstants::MODIFY_IDENTITY_REQUEST) node_identity = SoapElement.create(SoapConstants::IDENTITY) .add_attributes({ id: @item.id, _attrs: hash }) soap_request.add_node(node_identity) soap_request end |
#to_update ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/zm/client/identity/identity_jsns_builder.rb', line 19 def to_update soap_request = SoapElement.account(SoapAccountConstants::MODIFY_IDENTITY_REQUEST) node_identity = SoapElement.create(SoapConstants::IDENTITY) .add_attributes({ id: @item.id, _attrs: attrs }) soap_request.add_node(node_identity) soap_request end |