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 
150  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_):
151  principal( principal_ ),
152  object( object_ ),
153  objectType( objectType_ ),
154  permission( permission_ ),
155  options( options_ )
156  {
157  }
158 
164  std::string principal;
165 
170  std::string object;
171 
202  std::string objectType;
203 
231  std::string permission;
232 
255  std::map<std::string, std::string> options;
256  };
257 } // end namespace gpudb
258 
259 namespace avro
260 {
261  template<> struct codec_traits<gpudb::HasPermissionRequest>
262  {
263  static void encode(Encoder& e, const gpudb::HasPermissionRequest& v)
264  {
265  ::avro::encode(e, v.principal);
266  ::avro::encode(e, v.object);
267  ::avro::encode(e, v.objectType);
268  ::avro::encode(e, v.permission);
269  ::avro::encode(e, v.options);
270  }
271 
272  static void decode(Decoder& d, gpudb::HasPermissionRequest& v)
273  {
274  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
275  {
276  const std::vector<size_t> fo = rd->fieldOrder();
277 
278  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
279  {
280  switch (*it)
281  {
282  case 0:
283  ::avro::decode(d, v.principal);
284  break;
285 
286  case 1:
287  ::avro::decode(d, v.object);
288  break;
289 
290  case 2:
291  ::avro::decode(d, v.objectType);
292  break;
293 
294  case 3:
295  ::avro::decode(d, v.permission);
296  break;
297 
298  case 4:
299  ::avro::decode(d, v.options);
300  break;
301 
302  default:
303  break;
304  }
305  }
306  }
307  else
308  {
309  ::avro::decode(d, v.principal);
310  ::avro::decode(d, v.object);
311  ::avro::decode(d, v.objectType);
312  ::avro::decode(d, v.permission);
313  ::avro::decode(d, v.options);
314  }
315  }
316  };
317 } // end namespace avro
318 
319 namespace gpudb
320 {
327  {
332  principal(std::string()),
333  object(std::string()),
334  objectType(std::string()),
335  permission(std::string()),
336  hasPermission(bool()),
337  filters(std::map<std::string, std::string>()),
338  info(std::map<std::string, std::string>())
339  {
340  }
341 
345  std::string principal;
346 
351  std::string object;
352 
356  std::string objectType;
357 
361  std::string permission;
362 
373 
377  std::map<std::string, std::string> filters;
378 
382  std::map<std::string, std::string> info;
383  };
384 } // end namespace gpudb
385 
386 namespace avro
387 {
388  template<> struct codec_traits<gpudb::HasPermissionResponse>
389  {
390  static void encode(Encoder& e, const gpudb::HasPermissionResponse& v)
391  {
392  ::avro::encode(e, v.principal);
393  ::avro::encode(e, v.object);
394  ::avro::encode(e, v.objectType);
395  ::avro::encode(e, v.permission);
396  ::avro::encode(e, v.hasPermission);
397  ::avro::encode(e, v.filters);
398  ::avro::encode(e, v.info);
399  }
400 
401  static void decode(Decoder& d, gpudb::HasPermissionResponse& v)
402  {
403  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
404  {
405  const std::vector<size_t> fo = rd->fieldOrder();
406 
407  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
408  {
409  switch (*it)
410  {
411  case 0:
412  ::avro::decode(d, v.principal);
413  break;
414 
415  case 1:
416  ::avro::decode(d, v.object);
417  break;
418 
419  case 2:
420  ::avro::decode(d, v.objectType);
421  break;
422 
423  case 3:
424  ::avro::decode(d, v.permission);
425  break;
426 
427  case 4:
428  ::avro::decode(d, v.hasPermission);
429  break;
430 
431  case 5:
432  ::avro::decode(d, v.filters);
433  break;
434 
435  case 6:
436  ::avro::decode(d, v.info);
437  break;
438 
439  default:
440  break;
441  }
442  }
443  }
444  else
445  {
446  ::avro::decode(d, v.principal);
447  ::avro::decode(d, v.object);
448  ::avro::decode(d, v.objectType);
449  ::avro::decode(d, v.permission);
450  ::avro::decode(d, v.hasPermission);
451  ::avro::decode(d, v.filters);
452  ::avro::decode(d, v.info);
453  }
454  }
455  };
456 } // end namespace avro
457 
458 #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.