Specify query operator

The PureCloudPlatformApiSdk.UserSearchCriteria class transforms operator to lowercase, which is denied as bad request.

q = PureCloudPlatformApiSdk.UserSearchCriteria()
q.value = "my@email.com"
q.fields = ['email']
q.operator = 'AND'
q
>>>{'end_value': None,
>>>'fields': ['email'],
>>>'group': None,
>>>'operator': 'and',  #  <<<< lower case
>>>'start_value': None,
>>>'type': 'contains',
>>>'value': 'my@email.com',
>>>'values': None}
body.query = [q]
user = api.post_search(body)
>>> {"status":400,"code":"invalid.value","message":"Value [and] is not valid for field type [Operator]. Allowable values are: AND, OR, NOT"}

I've opened API-2452 to address this issue. It looks like enum members are being forced to lowercase incorrectly.

This is fixed as of PureCloudPlatformClientV2 5.0.2. Example from my test:

search_api = PureCloudPlatformClientV2.SearchApi()

query = PureCloudPlatformClientV2.UserSearchCriteria()
query.type = 'EXACT'
query.value = 'my@email.com'
query.fields = ['email']
query.operator = 'AND'

body = PureCloudPlatformClientV2.SearchRequest()
body.types = ['USERS']
body.query = [query]

response = search_api.post_search(body)
pprint(response)