CreateDatabaseRequest.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_cms.proto
  4. namespace Ydb\Cms;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Request to create a new database. For successfull creation
  10. * specified database shouldn't exist. At least one storage
  11. * unit should be requested for the database.
  12. *
  13. * Generated from protobuf message <code>Ydb.Cms.CreateDatabaseRequest</code>
  14. */
  15. class CreateDatabaseRequest extends \Google\Protobuf\Internal\Message
  16. {
  17. /**
  18. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  19. */
  20. protected $operation_params = null;
  21. /**
  22. * Required. Full path to database's home dir. Used as database ID.
  23. *
  24. * Generated from protobuf field <code>string path = 2;</code>
  25. */
  26. protected $path = '';
  27. /**
  28. * Additional database options.
  29. *
  30. * Generated from protobuf field <code>.Ydb.Cms.DatabaseOptions options = 4;</code>
  31. */
  32. protected $options = null;
  33. /**
  34. * Attach attributes to database.
  35. *
  36. * Generated from protobuf field <code>map<string, string> attributes = 5;</code>
  37. */
  38. private $attributes;
  39. /**
  40. * Optional quotas for schema operations
  41. *
  42. * Generated from protobuf field <code>.Ydb.Cms.SchemaOperationQuotas schema_operation_quotas = 8;</code>
  43. */
  44. protected $schema_operation_quotas = null;
  45. /**
  46. * Optional idempotency key
  47. *
  48. * Generated from protobuf field <code>string idempotency_key = 9;</code>
  49. */
  50. protected $idempotency_key = '';
  51. /**
  52. * Optional quotas for the database
  53. *
  54. * Generated from protobuf field <code>.Ydb.Cms.DatabaseQuotas database_quotas = 10;</code>
  55. */
  56. protected $database_quotas = null;
  57. protected $resources_kind;
  58. /**
  59. * Constructor.
  60. *
  61. * @param array $data {
  62. * Optional. Data for populating the Message object.
  63. *
  64. * @type \Ydb\Operations\OperationParams $operation_params
  65. * @type string $path
  66. * Required. Full path to database's home dir. Used as database ID.
  67. * @type \Ydb\Cms\Resources $resources
  68. * Resources to allocate for database by CMS.
  69. * @type \Ydb\Cms\Resources $shared_resources
  70. * Shared resources can be used by serverless databases.
  71. * @type \Ydb\Cms\ServerlessResources $serverless_resources
  72. * If specified, the created database will be "serverless".
  73. * @type \Ydb\Cms\DatabaseOptions $options
  74. * Additional database options.
  75. * @type array|\Google\Protobuf\Internal\MapField $attributes
  76. * Attach attributes to database.
  77. * @type \Ydb\Cms\SchemaOperationQuotas $schema_operation_quotas
  78. * Optional quotas for schema operations
  79. * @type string $idempotency_key
  80. * Optional idempotency key
  81. * @type \Ydb\Cms\DatabaseQuotas $database_quotas
  82. * Optional quotas for the database
  83. * }
  84. */
  85. public function __construct($data = NULL) {
  86. \GPBMetadata\Protos\YdbCms::initOnce();
  87. parent::__construct($data);
  88. }
  89. /**
  90. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  91. * @return \Ydb\Operations\OperationParams|null
  92. */
  93. public function getOperationParams()
  94. {
  95. return $this->operation_params;
  96. }
  97. public function hasOperationParams()
  98. {
  99. return isset($this->operation_params);
  100. }
  101. public function clearOperationParams()
  102. {
  103. unset($this->operation_params);
  104. }
  105. /**
  106. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  107. * @param \Ydb\Operations\OperationParams $var
  108. * @return $this
  109. */
  110. public function setOperationParams($var)
  111. {
  112. GPBUtil::checkMessage($var, \Ydb\Operations\OperationParams::class);
  113. $this->operation_params = $var;
  114. return $this;
  115. }
  116. /**
  117. * Required. Full path to database's home dir. Used as database ID.
  118. *
  119. * Generated from protobuf field <code>string path = 2;</code>
  120. * @return string
  121. */
  122. public function getPath()
  123. {
  124. return $this->path;
  125. }
  126. /**
  127. * Required. Full path to database's home dir. Used as database ID.
  128. *
  129. * Generated from protobuf field <code>string path = 2;</code>
  130. * @param string $var
  131. * @return $this
  132. */
  133. public function setPath($var)
  134. {
  135. GPBUtil::checkString($var, True);
  136. $this->path = $var;
  137. return $this;
  138. }
  139. /**
  140. * Resources to allocate for database by CMS.
  141. *
  142. * Generated from protobuf field <code>.Ydb.Cms.Resources resources = 3;</code>
  143. * @return \Ydb\Cms\Resources|null
  144. */
  145. public function getResources()
  146. {
  147. return $this->readOneof(3);
  148. }
  149. public function hasResources()
  150. {
  151. return $this->hasOneof(3);
  152. }
  153. /**
  154. * Resources to allocate for database by CMS.
  155. *
  156. * Generated from protobuf field <code>.Ydb.Cms.Resources resources = 3;</code>
  157. * @param \Ydb\Cms\Resources $var
  158. * @return $this
  159. */
  160. public function setResources($var)
  161. {
  162. GPBUtil::checkMessage($var, \Ydb\Cms\Resources::class);
  163. $this->writeOneof(3, $var);
  164. return $this;
  165. }
  166. /**
  167. * Shared resources can be used by serverless databases.
  168. *
  169. * Generated from protobuf field <code>.Ydb.Cms.Resources shared_resources = 6;</code>
  170. * @return \Ydb\Cms\Resources|null
  171. */
  172. public function getSharedResources()
  173. {
  174. return $this->readOneof(6);
  175. }
  176. public function hasSharedResources()
  177. {
  178. return $this->hasOneof(6);
  179. }
  180. /**
  181. * Shared resources can be used by serverless databases.
  182. *
  183. * Generated from protobuf field <code>.Ydb.Cms.Resources shared_resources = 6;</code>
  184. * @param \Ydb\Cms\Resources $var
  185. * @return $this
  186. */
  187. public function setSharedResources($var)
  188. {
  189. GPBUtil::checkMessage($var, \Ydb\Cms\Resources::class);
  190. $this->writeOneof(6, $var);
  191. return $this;
  192. }
  193. /**
  194. * If specified, the created database will be "serverless".
  195. *
  196. * Generated from protobuf field <code>.Ydb.Cms.ServerlessResources serverless_resources = 7;</code>
  197. * @return \Ydb\Cms\ServerlessResources|null
  198. */
  199. public function getServerlessResources()
  200. {
  201. return $this->readOneof(7);
  202. }
  203. public function hasServerlessResources()
  204. {
  205. return $this->hasOneof(7);
  206. }
  207. /**
  208. * If specified, the created database will be "serverless".
  209. *
  210. * Generated from protobuf field <code>.Ydb.Cms.ServerlessResources serverless_resources = 7;</code>
  211. * @param \Ydb\Cms\ServerlessResources $var
  212. * @return $this
  213. */
  214. public function setServerlessResources($var)
  215. {
  216. GPBUtil::checkMessage($var, \Ydb\Cms\ServerlessResources::class);
  217. $this->writeOneof(7, $var);
  218. return $this;
  219. }
  220. /**
  221. * Additional database options.
  222. *
  223. * Generated from protobuf field <code>.Ydb.Cms.DatabaseOptions options = 4;</code>
  224. * @return \Ydb\Cms\DatabaseOptions|null
  225. */
  226. public function getOptions()
  227. {
  228. return $this->options;
  229. }
  230. public function hasOptions()
  231. {
  232. return isset($this->options);
  233. }
  234. public function clearOptions()
  235. {
  236. unset($this->options);
  237. }
  238. /**
  239. * Additional database options.
  240. *
  241. * Generated from protobuf field <code>.Ydb.Cms.DatabaseOptions options = 4;</code>
  242. * @param \Ydb\Cms\DatabaseOptions $var
  243. * @return $this
  244. */
  245. public function setOptions($var)
  246. {
  247. GPBUtil::checkMessage($var, \Ydb\Cms\DatabaseOptions::class);
  248. $this->options = $var;
  249. return $this;
  250. }
  251. /**
  252. * Attach attributes to database.
  253. *
  254. * Generated from protobuf field <code>map<string, string> attributes = 5;</code>
  255. * @return \Google\Protobuf\Internal\MapField
  256. */
  257. public function getAttributes()
  258. {
  259. return $this->attributes;
  260. }
  261. /**
  262. * Attach attributes to database.
  263. *
  264. * Generated from protobuf field <code>map<string, string> attributes = 5;</code>
  265. * @param array|\Google\Protobuf\Internal\MapField $var
  266. * @return $this
  267. */
  268. public function setAttributes($var)
  269. {
  270. $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
  271. $this->attributes = $arr;
  272. return $this;
  273. }
  274. /**
  275. * Optional quotas for schema operations
  276. *
  277. * Generated from protobuf field <code>.Ydb.Cms.SchemaOperationQuotas schema_operation_quotas = 8;</code>
  278. * @return \Ydb\Cms\SchemaOperationQuotas|null
  279. */
  280. public function getSchemaOperationQuotas()
  281. {
  282. return $this->schema_operation_quotas;
  283. }
  284. public function hasSchemaOperationQuotas()
  285. {
  286. return isset($this->schema_operation_quotas);
  287. }
  288. public function clearSchemaOperationQuotas()
  289. {
  290. unset($this->schema_operation_quotas);
  291. }
  292. /**
  293. * Optional quotas for schema operations
  294. *
  295. * Generated from protobuf field <code>.Ydb.Cms.SchemaOperationQuotas schema_operation_quotas = 8;</code>
  296. * @param \Ydb\Cms\SchemaOperationQuotas $var
  297. * @return $this
  298. */
  299. public function setSchemaOperationQuotas($var)
  300. {
  301. GPBUtil::checkMessage($var, \Ydb\Cms\SchemaOperationQuotas::class);
  302. $this->schema_operation_quotas = $var;
  303. return $this;
  304. }
  305. /**
  306. * Optional idempotency key
  307. *
  308. * Generated from protobuf field <code>string idempotency_key = 9;</code>
  309. * @return string
  310. */
  311. public function getIdempotencyKey()
  312. {
  313. return $this->idempotency_key;
  314. }
  315. /**
  316. * Optional idempotency key
  317. *
  318. * Generated from protobuf field <code>string idempotency_key = 9;</code>
  319. * @param string $var
  320. * @return $this
  321. */
  322. public function setIdempotencyKey($var)
  323. {
  324. GPBUtil::checkString($var, True);
  325. $this->idempotency_key = $var;
  326. return $this;
  327. }
  328. /**
  329. * Optional quotas for the database
  330. *
  331. * Generated from protobuf field <code>.Ydb.Cms.DatabaseQuotas database_quotas = 10;</code>
  332. * @return \Ydb\Cms\DatabaseQuotas|null
  333. */
  334. public function getDatabaseQuotas()
  335. {
  336. return $this->database_quotas;
  337. }
  338. public function hasDatabaseQuotas()
  339. {
  340. return isset($this->database_quotas);
  341. }
  342. public function clearDatabaseQuotas()
  343. {
  344. unset($this->database_quotas);
  345. }
  346. /**
  347. * Optional quotas for the database
  348. *
  349. * Generated from protobuf field <code>.Ydb.Cms.DatabaseQuotas database_quotas = 10;</code>
  350. * @param \Ydb\Cms\DatabaseQuotas $var
  351. * @return $this
  352. */
  353. public function setDatabaseQuotas($var)
  354. {
  355. GPBUtil::checkMessage($var, \Ydb\Cms\DatabaseQuotas::class);
  356. $this->database_quotas = $var;
  357. return $this;
  358. }
  359. /**
  360. * @return string
  361. */
  362. public function getResourcesKind()
  363. {
  364. return $this->whichOneof("resources_kind");
  365. }
  366. }