GAM icon indicating copy to clipboard operation
GAM copied to clipboard

Support for date values in custom schemas

Open onekmilesbehind opened this issue 5 years ago • 4 comments

Is your feature request related to a problem? Please describe. When creating a custom user schema, we're limited to bool, double, email, int64, phone, or string as the field types. Google appears to have added support for ISO-8601 date values. If you try to use date as a field value, you get the error "ERROR: type must be one of bool, double, email, int64, phone, string; got DATE"

Describe the solution you'd like Add date as a supported field type for custom user schemas

Describe alternatives you've considered Values could be stored as strings. In my case the values to be stored are dates, so it would be ideal to use the native field type.

onekmilesbehind avatar Mar 16 '21 16:03 onekmilesbehind

Think the relevant code might be lines 6314-6316 in /src/gam/init.py

validTypes = [ 'BOOL', 'DOUBLE', 'EMAIL', 'INT64', 'PHONE', 'STRING' ]

If 'DATE' is added there, I think that would allow the value to be passed through, which should be accepted by the Directory API. That was just my rudimentary scan though, so there may be references elsewhere I completely missed.

onekmilesbehind avatar Mar 16 '21 17:03 onekmilesbehind

I've already submitted a PR for this change.

Ross

On Tue, Mar 16, 2021 at 11:00 AM onekmilesbehind @.***> wrote:

Think the relevant code might be lines 6314-6316 in /src/gam/init.py

validTypes = [ 'BOOL', 'DOUBLE', 'EMAIL', 'INT64', 'PHONE', 'STRING' ]

If 'DATE' is added there, I think that would allow the value to be passed through, which should be accepted by the Directory API. That was just my rudimentary scan though, so there may be references elsewhere I completely missed.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jay0lee/GAM/issues/1334#issuecomment-800485039, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTYL7GNDR5OJFBK6GPJILTD6MCRANCNFSM4ZI5EQZQ .

-- Ross Scroggs @.***

taers232c avatar Mar 16 '21 18:03 taers232c

@taers232c Ross you crafty devil. Thank you!

onekmilesbehind avatar Mar 16 '21 21:03 onekmilesbehind

This appears to be working great now, thanks for the patch!

onekmilesbehind avatar Apr 06 '21 20:04 onekmilesbehind