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 
157  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_):
158  principal( principal_ ),
159  object( object_ ),
160  objectType( objectType_ ),
161  permission( permission_ ),
162  options( options_ )
163  {
164  }
165 
171  std::string principal;
172 
177  std::string object;
178 
209  std::string objectType;
210 
242  std::string permission;
243 
266  std::map<std::string, std::string> options;
267  };
268 } // end namespace gpudb
269 
270 namespace avro
271 {
272  template<> struct codec_traits<gpudb::HasPermissionRequest>
273  {
274  static void encode(Encoder& e, const gpudb::HasPermissionRequest& v)
275  {
276  ::avro::encode(e, v.principal);
277  ::avro::encode(e, v.object);
278  ::avro::encode(e, v.objectType);
279  ::avro::encode(e, v.permission);
280  ::avro::encode(e, v.options);
281  }
282 
283  static void decode(Decoder& d, gpudb::HasPermissionRequest& v)
284  {
285  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
286  {
287  const std::vector<size_t> fo = rd->fieldOrder();
288 
289  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
290  {
291  switch (*it)
292  {
293  case 0:
294  ::avro::decode(d, v.principal);
295  break;
296 
297  case 1:
298  ::avro::decode(d, v.object);
299  break;
300 
301  case 2:
302  ::avro::decode(d, v.objectType);
303  break;
304 
305  case 3:
306  ::avro::decode(d, v.permission);
307  break;
308 
309  case 4:
310  ::avro::decode(d, v.options);
311  break;
312 
313  default:
314  break;
315  }
316  }
317  }
318  else
319  {
320  ::avro::decode(d, v.principal);
321  ::avro::decode(d, v.object);
322  ::avro::decode(d, v.objectType);
323  ::avro::decode(d, v.permission);
324  ::avro::decode(d, v.options);
325  }
326  }
327  };
328 } // end namespace avro
329 
330 namespace gpudb
331 {
338  {
343  principal(std::string()),
344  object(std::string()),
345  objectType(std::string()),
346  permission(std::string()),
347  hasPermission(bool()),
348  filters(std::map<std::string, std::string>()),
349  info(std::map<std::string, std::string>())
350  {
351  }
352 
356  std::string principal;
357 
362  std::string object;
363 
367  std::string objectType;
368 
372  std::string permission;
373 
384 
388  std::map<std::string, std::string> filters;
389 
393  std::map<std::string, std::string> info;
394  };
395 } // end namespace gpudb
396 
397 namespace avro
398 {
399  template<> struct codec_traits<gpudb::HasPermissionResponse>
400  {
401  static void encode(Encoder& e, const gpudb::HasPermissionResponse& v)
402  {
403  ::avro::encode(e, v.principal);
404  ::avro::encode(e, v.object);
405  ::avro::encode(e, v.objectType);
406  ::avro::encode(e, v.permission);
407  ::avro::encode(e, v.hasPermission);
408  ::avro::encode(e, v.filters);
409  ::avro::encode(e, v.info);
410  }
411 
412  static void decode(Decoder& d, gpudb::HasPermissionResponse& v)
413  {
414  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
415  {
416  const std::vector<size_t> fo = rd->fieldOrder();
417 
418  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
419  {
420  switch (*it)
421  {
422  case 0:
423  ::avro::decode(d, v.principal);
424  break;
425 
426  case 1:
427  ::avro::decode(d, v.object);
428  break;
429 
430  case 2:
431  ::avro::decode(d, v.objectType);
432  break;
433 
434  case 3:
435  ::avro::decode(d, v.permission);
436  break;
437 
438  case 4:
439  ::avro::decode(d, v.hasPermission);
440  break;
441 
442  case 5:
443  ::avro::decode(d, v.filters);
444  break;
445 
446  case 6:
447  ::avro::decode(d, v.info);
448  break;
449 
450  default:
451  break;
452  }
453  }
454  }
455  else
456  {
457  ::avro::decode(d, v.principal);
458  ::avro::decode(d, v.object);
459  ::avro::decode(d, v.objectType);
460  ::avro::decode(d, v.permission);
461  ::avro::decode(d, v.hasPermission);
462  ::avro::decode(d, v.filters);
463  ::avro::decode(d, v.info);
464  }
465  }
466  };
467 } // end namespace avro
468 
469 #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.