aiosnow icon indicating copy to clipboard operation
aiosnow copied to clipboard

Add Support for Request parameters

Open weyCC81 opened this issue 2 years ago • 0 comments

Is there a simple option on the client or resource to give nested values back?

Comparison with "pysnow" There were the following parameters in pysnow available

client.parameters.display_value = False client.parameters.exclude_reference_link = True

Implementation in "aiosnow" I found an option to call the display value for nested objects, but it looks like there is a lot of code needed to implement that. What options are available to define some specific values of a table to be display values?

Workaround 01 / #27 #97

<StringMapping [key=1da4392, value=Company)]>

Usage of ModelSchema with json_normalize = partly solved (is that the way to go?)

Workaround 02 / #91

<IntegerMapping [key=7, value=Closed]>

Usage of fields definition = partly solved (just key not value) https://github.com/rbw/aiosnow/blob/ae362b9238461d1823f1fc3564578832c899ea04/docs/usage/model/declare.rst

Solution

fields.String(pluck=Pluck.DISPLAY_VALUE)

Is it possible to enable Pluck on a global scale?

Reference:

  • https://pysnow.readthedocs.io/en/latest/usage/parameters.html
  • https://github.com/rbw/pysnow/issues/188
  • https://github.com/rbw/aiosnow/tree/ae362b9238461d1823f1fc3564578832c899ea04/examples

weyCC81 avatar Aug 14 '22 20:08 weyCC81