Skip to content

Instantly share code, notes, and snippets.

@bdb1234
Created June 25, 2015 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdb1234/b42738a1f5c373c08e3f to your computer and use it in GitHub Desktop.
Save bdb1234/b42738a1f5c373c08e3f to your computer and use it in GitHub Desktop.
from lotus.declarations import declare_type
declare_type({
'api': 'test_object',
'trove': 'trove.data.TestObject',
'android': 'TestObject',
'spec': {
# Primitive types
'primitive_string': 'string',
'primitive_alphanumeric': 'alphanumeric',
# Lists
'alphanumeric_list': ['alphanumeric'],
# Sets
'string_set': {'string'},
}
})
declare_endpoint({
'api': 'v5/test/object/get',
'trove': {
'parser': 'trove.api.TestObjectParser',
'command': 'trove.commands.FetchTestObjectCommand'
},
'android': {
'parser': 'TestObjectGet'
},
'major_version': 5,
'minor_version': 0,
'method': 'POST',
'auth': True,
'ssl': False,
'user_interaction': True,
'domains': '*',
'opt_nodes': ['v_test'],
'params': {
# Required
'param_string': 'string',
# Described
'param_described_int': 'int, Something numeric',
# Optional
'param_optional_int?': 'int',
# Lists
'int_list?': ['int, Something long'],
# One or more
'param_plus_alphanumeric_list+': 'alphanumeric',
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment