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