GPUdb C++ API  Version 7.2.2.4
has_role.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_ROLE_H__
7 #define __HAS_ROLE_H__
8 
9 namespace gpudb
10 {
18  {
23  principal(std::string()),
24  role(std::string()),
25  options(std::map<std::string, std::string>())
26  {
27  }
28 
79  HasRoleRequest(const std::string& principal_, const std::string& role_, const std::map<std::string, std::string>& options_):
80  principal( principal_ ),
81  role( role_ ),
82  options( options_ )
83  {
84  }
85 
91  std::string principal;
92 
96  std::string role;
97 
130  std::map<std::string, std::string> options;
131  };
132 } // end namespace gpudb
133 
134 namespace avro
135 {
136  template<> struct codec_traits<gpudb::HasRoleRequest>
137  {
138  static void encode(Encoder& e, const gpudb::HasRoleRequest& v)
139  {
140  ::avro::encode(e, v.principal);
141  ::avro::encode(e, v.role);
142  ::avro::encode(e, v.options);
143  }
144 
145  static void decode(Decoder& d, gpudb::HasRoleRequest& v)
146  {
147  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
148  {
149  const std::vector<size_t> fo = rd->fieldOrder();
150 
151  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
152  {
153  switch (*it)
154  {
155  case 0:
156  ::avro::decode(d, v.principal);
157  break;
158 
159  case 1:
160  ::avro::decode(d, v.role);
161  break;
162 
163  case 2:
164  ::avro::decode(d, v.options);
165  break;
166 
167  default:
168  break;
169  }
170  }
171  }
172  else
173  {
174  ::avro::decode(d, v.principal);
175  ::avro::decode(d, v.role);
176  ::avro::decode(d, v.options);
177  }
178  }
179  };
180 } // end namespace avro
181 
182 namespace gpudb
183 {
189  {
194  principal(std::string()),
195  role(std::string()),
196  hasRole(bool()),
197  info(std::map<std::string, std::string>())
198  {
199  }
200 
204  std::string principal;
205 
210  std::string role;
211 
221  bool hasRole;
222 
239  std::map<std::string, std::string> info;
240  };
241 } // end namespace gpudb
242 
243 namespace avro
244 {
245  template<> struct codec_traits<gpudb::HasRoleResponse>
246  {
247  static void encode(Encoder& e, const gpudb::HasRoleResponse& v)
248  {
249  ::avro::encode(e, v.principal);
250  ::avro::encode(e, v.role);
251  ::avro::encode(e, v.hasRole);
252  ::avro::encode(e, v.info);
253  }
254 
255  static void decode(Decoder& d, gpudb::HasRoleResponse& v)
256  {
257  if (::avro::ResolvingDecoder *rd = dynamic_cast< ::avro::ResolvingDecoder*>(&d))
258  {
259  const std::vector<size_t> fo = rd->fieldOrder();
260 
261  for (std::vector<size_t>::const_iterator it = fo.begin(); it != fo.end(); ++it)
262  {
263  switch (*it)
264  {
265  case 0:
266  ::avro::decode(d, v.principal);
267  break;
268 
269  case 1:
270  ::avro::decode(d, v.role);
271  break;
272 
273  case 2:
274  ::avro::decode(d, v.hasRole);
275  break;
276 
277  case 3:
278  ::avro::decode(d, v.info);
279  break;
280 
281  default:
282  break;
283  }
284  }
285  }
286  else
287  {
288  ::avro::decode(d, v.principal);
289  ::avro::decode(d, v.role);
290  ::avro::decode(d, v.hasRole);
291  ::avro::decode(d, v.info);
292  }
293  }
294  };
295 } // end namespace avro
296 
297 #endif // __HAS_ROLE_H__
A set of results returned by GPUdb::hasRole.
Definition: has_role.h:188
A set of parameters for GPUdb::hasRole.
Definition: has_role.h:17
std::string principal
Value of principal.
Definition: has_role.h:204
HasRoleRequest()
Constructs a HasRoleRequest object with default parameters.
Definition: has_role.h:22
std::string role
role for which membership is being checked
Definition: has_role.h:210
std::string principal
Name of the user for which role membersih is being checked.
Definition: has_role.h:91
HasRoleResponse()
Constructs a HasRoleResponse object with default parameters.
Definition: has_role.h:193
bool hasRole
Indicates whether the specified user has membership in the specified target role.
Definition: has_role.h:221
std::string role
Name of role to check for membership.
Definition: has_role.h:96
std::map< std::string, std::string > info
Additional information.
Definition: has_role.h:239
std::map< std::string, std::string > options
Optional parameters.
Definition: has_role.h:130
HasRoleRequest(const std::string &principal_, const std::string &role_, const std::map< std::string, std::string > &options_)
Constructs a HasRoleRequest object with the specified parameters.
Definition: has_role.h:79