Zimbra-Community / python-zimbra

Core framework for easily sending requests to the Zimbra SOAP-API
BSD 2-Clause "Simplified" License
63 stars 26 forks source link

Unable to change identity attribute #32

Open sirio81 opened 4 years ago

sirio81 commented 4 years ago

Hi, I'm not sure this is a bug but I can't figure out what's wrong. I run this request to change zimbraPrefFromDisplay of an identity. I get no error but an empty response and that sounds good.

{'identity': {'a': [{'_content': '577c5a8e-3bcc-4251-a8ed-6ec6abb08737',
                     'name': 'zimbraPrefDefaultSignatureId'},
                    {'zimbraPrefFromDisplay': 'New Fancy Name'}],
              'name': 'zorro'}}

{'ModifyIdentityResponse': {}}

If I check the identity, zimbraPrefFromDisplay didn't change.

The api request syntax is this:

<ModifyMailboxMetadataRequest> ## ModifyMailboxMetadataRequest <meta [section="{section}"]> ## MailCustomMetadata (<a n="{key}">{value}</a> ## KeyValuePair)* </meta> </ModifyMailboxMetadataRequest>

Notice you could pass more attributes (tag ) so my request has a list of attributes with a single element.

My code:

request = comm.gen_request(token=usr_token)
d = {'identity':{
        'name': 'zorro',
        'a': [{'name': 'zimbraPrefDefaultSignatureId', '_content': '577c5a8e-3bcc-4251-a8ed-6ec6abb08737'},
                {'zimbraPrefFromDisplay': 'New Fancy Name'}
                ]
        }
    }
pprint(d)
request.add_request(
    'ModifyIdentityRequest',
    d,
    'urn:zimbraAccount'
)

Any idea or suggestion for debugging?