GPUdb C++ API  Version 7.2.3.0
has_permission.h
Go to the documentation of this file.
1 /*
2  * This file was autogenerated by the Kinetica schema processor.
3  *
4  * DO NOT EDIT DIRECTLY.
5  */
6 #ifndef __HAS_PERMISSION_H__
7 #define __HAS_PERMISSION_H__
8 
9 namespace gpudb
10 {
20  {
25  principal(std::string()),
26  object(std::string()),
27  objectType(std::string()),
28  permission(std::string()),
29  options(std::map<std::string, std::string>())
30  {
31  }
32 
160  HasPermissionRequest(const std::string& principal_, const std::string& object_, const std::string& objectType_, const std::string& permission_, const std::map<std::string, std::string>& options_):
161  principal( principal_ ),
162  object( object_ ),
163  objectType( objectType_ ),
164  permission( permission_ ),
165  options( options_ )
166  {
167  }
168 
174  std::string principal;
175 
180  std::string object;
181 
214  std::string objectType;
215 
247  std::string permission;
248 
271  std::map<std::string, std::string> options;
272  };
273 } // end namespace gpudb
274 
275 namespace avro
276 {
277  template<> struct codec_traits<gpudb::HasPermissionRequest>
278  {
279  static void encode(Encoder& e, const gpudb::HasPermissionRequest& v)
280  {
281  ::avro::encode(e, v.principal);
282  ::avro::encode(e, v.object);
283  ::avro::encode(e, v.objectType);
284  ::avro::encode(e, v.permission);
285  ::avro::encode(e, v.options);
286  }
287 
288  static void decode(Decoder& d, gpudb::HasPermissionRequest& v)
289  {
290  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
291  {
292  const std::vector<size_t> fo = rd->fieldOrder();
293 
294  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
295  {
296  switch (*it)
297  {
298  case 0:
299  ::avro::decode(d, v.principal);
300  break;
301 
302  case 1:
303  ::avro::decode(d, v.object);
304  break;
305 
306  case 2:
307  ::avro::decode(d, v.objectType);
308  break;
309 
310  case 3:
311  ::avro::decode(d, v.permission);
312  break;
313 
314  case 4:
315  ::avro::decode(d, v.options);
316  break;
317 
318  default:
319  break;
320  }
321  }
322  }
323  else
324  {
325  ::avro::decode(d, v.principal);
326  ::avro::decode(d, v.object);
327  ::avro::decode(d, v.objectType);
328  ::avro::decode(d, v.permission);
329  ::avro::decode(d, v.options);
330  }
331  }
332  };
333 } // end namespace avro
334 
335 namespace gpudb
336 {
343  {
348  principal(std::string()),
349  object(std::string()),
350  objectType(std::string()),
351  permission(std::string()),
352  hasPermission(bool()),
353  filters(std::map<std::string, std::string>()),
354  info(std::map<std::string, std::string>())
355  {
356  }
357 
361  std::string principal;
362 
367  std::string object;
368 
372  std::string objectType;
373 
377  std::string permission;
378 
389 
393  std::map<std::string, std::string> filters;
394 
398  std::map<std::string, std::string> info;
399  };
400 } // end namespace gpudb
401 
402 namespace avro
403 {
404  template<> struct codec_traits<gpudb::HasPermissionResponse>
405  {
406  static void encode(Encoder& e, const gpudb::HasPermissionResponse& v)
407  {
408  ::avro::encode(e, v.principal);
409  ::avro::encode(e, v.object);
410  ::avro::encode(e, v.objectType);
411  ::avro::encode(e, v.permission);
412  ::avro::encode(e, v.hasPermission);
413  ::avro::encode(e, v.filters);
414  ::avro::encode(e, v.info);
415  }
416 
417  static void decode(Decoder& d, gpudb::HasPermissionResponse& v)
418  {
419  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
420  {
421  const std::vector<size_t> fo = rd->fieldOrder();
422 
423  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
424  {
425  switch (*it)
426  {
427  case 0:
428  ::avro::decode(d, v.principal);
429  break;
430 
431  case 1:
432  ::avro::decode(d, v.object);
433  break;
434 
435  case 2:
436  ::avro::decode(d, v.objectType);
437  break;
438 
439  case 3:
440  ::avro::decode(d, v.permission);
441  break;
442 
443  case 4:
444  ::avro::decode(d, v.hasPermission);
445  break;
446 
447  case 5:
448  ::avro::decode(d, v.filters);
449  break;
450 
451  case 6:
452  ::avro::decode(d, v.info);
453  break;
454 
455  default:
456  break;
457  }
458  }
459  }
460  else
461  {
462  ::avro::decode(d, v.principal);
463  ::avro::decode(d, v.object);
464  ::avro::decode(d, v.objectType);
465  ::avro::decode(d, v.permission);
466  ::avro::decode(d, v.hasPermission);
467  ::avro::decode(d, v.filters);
468  ::avro::decode(d, v.info);
469  }
470  }
471  };
472 } // end namespace avro
473 
474 #endif // __HAS_PERMISSION_H__
HasPermissionRequest()
Constructs a HasPermissionRequest object with default parameters.
HasPermissionResponse()
Constructs a HasPermissionResponse object with default parameters.
std::string objectType
The type of object being checked.
std::string permission
Value of permission.
std::string principal
Value of principal.
std::string objectType
Value of objectType.
std::string principal
Name of the user for which the permission is being checked.
HasPermissionRequest(const std::string &principal_, const std::string &object_, const std::string &objectType_, const std::string &permission_, const std::map< std::string, std::string > &options_)
Constructs a HasPermissionRequest object with the specified parameters.
A set of parameters for GPUdb::hasPermission.
A set of results returned by GPUdb::hasPermission.
std::map< std::string, std::string > info
Additional information.
std::string object
Fully-qualified value of object.
std::map< std::string, std::string > filters
Map of column/filters that have been granted.
bool hasPermission
Indicates whether the specified user has the specified permission on the specified target.
std::string permission
Permission to check for.
std::map< std::string, std::string > options
Optional parameters.
std::string object
Name of object to check for the requested permission.