def call_service(sample):
 operation = None
 while (operation not in ['c', 'C', 'g', 'G', 'u', 'U', 'd', 'D', 'q', 'Q']):
  operation = raw_input('Do [c=create|g=get|u=update|d=delete|q=quit]: ')
 operation = operation.lower()
 if (operation == 'q'):
  return 'n'
 resource_properties = get_input(operation)
 if (operation == 'c'):
  sample.create(resource_properties)
 elif (operation == 'g'):
  sample.get(resource_properties['resource_id'])
 elif (operation == 'u'):
  sample.update(resource_properties)
 elif (operation == 'd'):
  sample.delete(resource_properties['resource_id'])
 do_continue = None
 while (do_continue not in ['', 'y', 'Y', 'n', 'N']):
  do_continue = raw_input('Want to continue (Y/n): ')
 if (do_continue == ''):
  do_continue = 'y'
 return do_continue.lower()

def call_service ( sample ) : operation = None while ( operation not in [ 'c' , 'C' , 'g' , 'G' , 'u' , 'U' , 'd' , 'D' , 'q' , 'Q' ] ) : operation = raw_input ( 'Do [c=create|g=get|u=update|d=delete|q=quit]: ' ) operation = operation . lower ( ) if ( operation == 'q' ) : return 'n' resource_properties = get_input ( operation ) if ( operation == 'c' ) : sample . create ( resource_properties ) elif ( operation == 'g' ) : sample . get ( resource_properties [ 'resource_id' ] ) elif ( operation == 'u' ) : sample . update ( resource_properties ) elif ( operation == 'd' ) : sample . delete ( resource_properties [ 'resource_id' ] ) do_continue = None while ( do_continue not in [ '' , 'y' , 'Y' , 'n' , 'N' ] ) : do_continue = raw_input ( 'Want to continue (Y/n): ' ) if ( do_continue == '' ) : do_continue = 'y' return do_continue . lower ( )
calls the service methods on the user input .