Commitment.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\Compute;
  18. class Commitment extends \Google\Collection
  19. {
  20. public const CATEGORY_CATEGORY_UNSPECIFIED = 'CATEGORY_UNSPECIFIED';
  21. public const CATEGORY_LICENSE = 'LICENSE';
  22. public const CATEGORY_MACHINE = 'MACHINE';
  23. public const PLAN_INVALID = 'INVALID';
  24. public const PLAN_THIRTY_SIX_MONTH = 'THIRTY_SIX_MONTH';
  25. public const PLAN_TWELVE_MONTH = 'TWELVE_MONTH';
  26. public const STATUS_ACTIVE = 'ACTIVE';
  27. /**
  28. * Deprecate CANCELED status. Will use separate status to differentiate cancel
  29. * by mergeCud or manual cancellation.
  30. */
  31. public const STATUS_CANCELLED = 'CANCELLED';
  32. public const STATUS_CREATING = 'CREATING';
  33. public const STATUS_EXPIRED = 'EXPIRED';
  34. public const STATUS_NOT_YET_ACTIVE = 'NOT_YET_ACTIVE';
  35. public const TYPE_ACCELERATOR_OPTIMIZED = 'ACCELERATOR_OPTIMIZED';
  36. public const TYPE_ACCELERATOR_OPTIMIZED_A3 = 'ACCELERATOR_OPTIMIZED_A3';
  37. public const TYPE_ACCELERATOR_OPTIMIZED_A3_MEGA = 'ACCELERATOR_OPTIMIZED_A3_MEGA';
  38. public const TYPE_ACCELERATOR_OPTIMIZED_A3_ULTRA = 'ACCELERATOR_OPTIMIZED_A3_ULTRA';
  39. public const TYPE_ACCELERATOR_OPTIMIZED_A4 = 'ACCELERATOR_OPTIMIZED_A4';
  40. public const TYPE_COMPUTE_OPTIMIZED = 'COMPUTE_OPTIMIZED';
  41. public const TYPE_COMPUTE_OPTIMIZED_C2D = 'COMPUTE_OPTIMIZED_C2D';
  42. public const TYPE_COMPUTE_OPTIMIZED_C3 = 'COMPUTE_OPTIMIZED_C3';
  43. public const TYPE_COMPUTE_OPTIMIZED_C3D = 'COMPUTE_OPTIMIZED_C3D';
  44. public const TYPE_COMPUTE_OPTIMIZED_H3 = 'COMPUTE_OPTIMIZED_H3';
  45. public const TYPE_COMPUTE_OPTIMIZED_H4D = 'COMPUTE_OPTIMIZED_H4D';
  46. public const TYPE_GENERAL_PURPOSE = 'GENERAL_PURPOSE';
  47. public const TYPE_GENERAL_PURPOSE_C4 = 'GENERAL_PURPOSE_C4';
  48. public const TYPE_GENERAL_PURPOSE_C4A = 'GENERAL_PURPOSE_C4A';
  49. public const TYPE_GENERAL_PURPOSE_C4D = 'GENERAL_PURPOSE_C4D';
  50. public const TYPE_GENERAL_PURPOSE_E2 = 'GENERAL_PURPOSE_E2';
  51. public const TYPE_GENERAL_PURPOSE_N2 = 'GENERAL_PURPOSE_N2';
  52. public const TYPE_GENERAL_PURPOSE_N2D = 'GENERAL_PURPOSE_N2D';
  53. public const TYPE_GENERAL_PURPOSE_N4 = 'GENERAL_PURPOSE_N4';
  54. public const TYPE_GENERAL_PURPOSE_N4A = 'GENERAL_PURPOSE_N4A';
  55. public const TYPE_GENERAL_PURPOSE_N4D = 'GENERAL_PURPOSE_N4D';
  56. public const TYPE_GENERAL_PURPOSE_T2D = 'GENERAL_PURPOSE_T2D';
  57. public const TYPE_GRAPHICS_OPTIMIZED = 'GRAPHICS_OPTIMIZED';
  58. public const TYPE_GRAPHICS_OPTIMIZED_G4 = 'GRAPHICS_OPTIMIZED_G4';
  59. public const TYPE_MEMORY_OPTIMIZED = 'MEMORY_OPTIMIZED';
  60. public const TYPE_MEMORY_OPTIMIZED_M3 = 'MEMORY_OPTIMIZED_M3';
  61. public const TYPE_MEMORY_OPTIMIZED_M4 = 'MEMORY_OPTIMIZED_M4';
  62. public const TYPE_MEMORY_OPTIMIZED_M4_6TB = 'MEMORY_OPTIMIZED_M4_6TB';
  63. /**
  64. * CUD bucket for X4 machine with 1440 vCPUs and 24TB of memory.
  65. */
  66. public const TYPE_MEMORY_OPTIMIZED_X4_1440_24T = 'MEMORY_OPTIMIZED_X4_1440_24T';
  67. public const TYPE_MEMORY_OPTIMIZED_X4_16TB = 'MEMORY_OPTIMIZED_X4_16TB';
  68. /**
  69. * CUD bucket for X4 machine with 1920 vCPUs and 32TB of memory.
  70. */
  71. public const TYPE_MEMORY_OPTIMIZED_X4_1920_32T = 'MEMORY_OPTIMIZED_X4_1920_32T';
  72. public const TYPE_MEMORY_OPTIMIZED_X4_24TB = 'MEMORY_OPTIMIZED_X4_24TB';
  73. public const TYPE_MEMORY_OPTIMIZED_X4_32TB = 'MEMORY_OPTIMIZED_X4_32TB';
  74. /**
  75. * CUD bucket for X4 machine with 480 vCPUs and 6TB of memory.
  76. */
  77. public const TYPE_MEMORY_OPTIMIZED_X4_480_6T = 'MEMORY_OPTIMIZED_X4_480_6T';
  78. /**
  79. * CUD bucket for X4 machine with 480 vCPUs and 8TB of memory.
  80. */
  81. public const TYPE_MEMORY_OPTIMIZED_X4_480_8T = 'MEMORY_OPTIMIZED_X4_480_8T';
  82. /**
  83. * CUD bucket for X4 machine with 960 vCPUs and 12TB of memory.
  84. */
  85. public const TYPE_MEMORY_OPTIMIZED_X4_960_12T = 'MEMORY_OPTIMIZED_X4_960_12T';
  86. /**
  87. * CUD bucket for X4 machine with 960 vCPUs and 16TB of memory.
  88. */
  89. public const TYPE_MEMORY_OPTIMIZED_X4_960_16T = 'MEMORY_OPTIMIZED_X4_960_16T';
  90. public const TYPE_STORAGE_OPTIMIZED_Z3 = 'STORAGE_OPTIMIZED_Z3';
  91. /**
  92. * Note for internal users: When adding a new enum Type for v1, make sure to
  93. * also add it in the comment for the `optional Type type` definition. This
  94. * ensures that the public documentation displays the new enum Type.
  95. */
  96. public const TYPE_TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED';
  97. protected $collection_key = 'resources';
  98. /**
  99. * Specifies whether to automatically renew the commitment at the end of its
  100. * current term. The default value is false. If you set the field to true,
  101. * each time your commitment reaches the end of its term, Compute Engine
  102. * automatically renews it for another term. You can update this field anytime
  103. * before the commitment expires. For example, if the commitment is set to
  104. * expire at 12 AM UTC-8 on January 3, 2027, you can update this field until
  105. * 11:59 PM UTC-8 on January 2, 2027.
  106. *
  107. * @var bool
  108. */
  109. public $autoRenew;
  110. /**
  111. * The category of the commitment; specifies whether the commitment is for
  112. * hardware or software resources. Category MACHINE specifies that you are
  113. * committing to hardware machine resources such asVCPU or MEMORY, listed in
  114. * resources. Category LICENSE specifies that you are committing to software
  115. * licenses, listed in licenseResources. Note that if you specify MACHINE
  116. * commitments, then you must also specify a type to indicate the machine
  117. * series of the hardware resource that you are committing to.
  118. *
  119. * @var string
  120. */
  121. public $category;
  122. /**
  123. * Output only. [Output Only] Creation timestamp inRFC3339 text format.
  124. *
  125. * @var string
  126. */
  127. public $creationTimestamp;
  128. /**
  129. * [Input Only] Optional, specifies the requested commitment end time
  130. * inRFC3339 text format. Use this option when the desired commitment's end
  131. * date is later than the start date + term duration.
  132. *
  133. * @var string
  134. */
  135. public $customEndTimestamp;
  136. /**
  137. * An optional description of the commitment. You can provide this property
  138. * when you create the resource.
  139. *
  140. * @var string
  141. */
  142. public $description;
  143. /**
  144. * Output only. [Output Only] Commitment end time inRFC3339 text format.
  145. *
  146. * @var string
  147. */
  148. public $endTimestamp;
  149. /**
  150. * @var string[]
  151. */
  152. public $existingReservations;
  153. /**
  154. * Output only. [Output Only] The unique identifier for the resource. This
  155. * identifier is defined by the server.
  156. *
  157. * @var string
  158. */
  159. public $id;
  160. /**
  161. * Output only. [Output Only] Type of the resource. Always compute#commitment
  162. * for commitments.
  163. *
  164. * @var string
  165. */
  166. public $kind;
  167. protected $licenseResourceType = LicenseResourceCommitment::class;
  168. protected $licenseResourceDataType = '';
  169. /**
  170. * The list of source commitments that you are merging to create the new
  171. * merged commitment. For more information, see Merging commitments.
  172. *
  173. * @var string[]
  174. */
  175. public $mergeSourceCommitments;
  176. /**
  177. * Name of the commitment. You must specify a name when you purchase the
  178. * commitment. The name must be 1-63 characters long, and comply withRFC1035.
  179. * Specifically, the name must be 1-63 characters long and match the regular
  180. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  181. * must be a lowercase letter, and all following characters must be a dash,
  182. * lowercase letter, or digit, except the last character, which cannot be a
  183. * dash.
  184. *
  185. * @var string
  186. */
  187. public $name;
  188. /**
  189. * The minimum time duration that you commit to purchasing resources. The plan
  190. * that you choose determines the preset term length of the commitment (which
  191. * is 1 year or 3 years) and affects the discount rate that you receive for
  192. * your resources. Committing to a longer time duration typically gives you a
  193. * higher discount rate. The supported values for this field are TWELVE_MONTH
  194. * (1 year), andTHIRTY_SIX_MONTH (3 years).
  195. *
  196. * @var string
  197. */
  198. public $plan;
  199. /**
  200. * Output only. [Output Only] URL of the region where the commitment and
  201. * committed resources are located.
  202. *
  203. * @var string
  204. */
  205. public $region;
  206. protected $reservationsType = Reservation::class;
  207. protected $reservationsDataType = 'array';
  208. protected $resourceStatusType = CommitmentResourceStatus::class;
  209. protected $resourceStatusDataType = '';
  210. protected $resourcesType = ResourceCommitment::class;
  211. protected $resourcesDataType = 'array';
  212. /**
  213. * Output only. [Output Only] Server-defined URL for the resource.
  214. *
  215. * @var string
  216. */
  217. public $selfLink;
  218. /**
  219. * The source commitment from which you are transferring resources to create
  220. * the new split commitment. For more information, see Split commitments.
  221. *
  222. * @var string
  223. */
  224. public $splitSourceCommitment;
  225. /**
  226. * Output only. [Output Only] Commitment start time inRFC3339 text format.
  227. *
  228. * @var string
  229. */
  230. public $startTimestamp;
  231. /**
  232. * Output only. [Output Only] Status of the commitment with regards to
  233. * eventual expiration (each commitment has an end date defined). Status can
  234. * be one of the following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
  235. *
  236. * @var string
  237. */
  238. public $status;
  239. /**
  240. * Output only. [Output Only] An optional, human-readable explanation of the
  241. * status.
  242. *
  243. * @var string
  244. */
  245. public $statusMessage;
  246. /**
  247. * The type of commitment; specifies the machine series for which you want to
  248. * commit to purchasing resources. The choice of machine series affects the
  249. * discount rate and the eligible resource types.
  250. *
  251. * The type must be one of the following:ACCELERATOR_OPTIMIZED,
  252. * ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED,
  253. * COMPUTE_OPTIMIZED_C2D, COMPUTE_OPTIMIZED_C3,
  254. * COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3,
  255. * GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2,
  256. * GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4,
  257. * GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED,
  258. * GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED,
  259. * MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For example,
  260. * type MEMORY_OPTIMIZED specifies a commitment that applies only to eligible
  261. * resources of memory optimized M1 and M2 machine series. Type
  262. * GENERAL_PURPOSE specifies a commitment that applies only to eligible
  263. * resources of general purpose N1 machine series.
  264. *
  265. * @var string
  266. */
  267. public $type;
  268. /**
  269. * Specifies whether to automatically renew the commitment at the end of its
  270. * current term. The default value is false. If you set the field to true,
  271. * each time your commitment reaches the end of its term, Compute Engine
  272. * automatically renews it for another term. You can update this field anytime
  273. * before the commitment expires. For example, if the commitment is set to
  274. * expire at 12 AM UTC-8 on January 3, 2027, you can update this field until
  275. * 11:59 PM UTC-8 on January 2, 2027.
  276. *
  277. * @param bool $autoRenew
  278. */
  279. public function setAutoRenew($autoRenew)
  280. {
  281. $this->autoRenew = $autoRenew;
  282. }
  283. /**
  284. * @return bool
  285. */
  286. public function getAutoRenew()
  287. {
  288. return $this->autoRenew;
  289. }
  290. /**
  291. * The category of the commitment; specifies whether the commitment is for
  292. * hardware or software resources. Category MACHINE specifies that you are
  293. * committing to hardware machine resources such asVCPU or MEMORY, listed in
  294. * resources. Category LICENSE specifies that you are committing to software
  295. * licenses, listed in licenseResources. Note that if you specify MACHINE
  296. * commitments, then you must also specify a type to indicate the machine
  297. * series of the hardware resource that you are committing to.
  298. *
  299. * Accepted values: CATEGORY_UNSPECIFIED, LICENSE, MACHINE
  300. *
  301. * @param self::CATEGORY_* $category
  302. */
  303. public function setCategory($category)
  304. {
  305. $this->category = $category;
  306. }
  307. /**
  308. * @return self::CATEGORY_*
  309. */
  310. public function getCategory()
  311. {
  312. return $this->category;
  313. }
  314. /**
  315. * Output only. [Output Only] Creation timestamp inRFC3339 text format.
  316. *
  317. * @param string $creationTimestamp
  318. */
  319. public function setCreationTimestamp($creationTimestamp)
  320. {
  321. $this->creationTimestamp = $creationTimestamp;
  322. }
  323. /**
  324. * @return string
  325. */
  326. public function getCreationTimestamp()
  327. {
  328. return $this->creationTimestamp;
  329. }
  330. /**
  331. * [Input Only] Optional, specifies the requested commitment end time
  332. * inRFC3339 text format. Use this option when the desired commitment's end
  333. * date is later than the start date + term duration.
  334. *
  335. * @param string $customEndTimestamp
  336. */
  337. public function setCustomEndTimestamp($customEndTimestamp)
  338. {
  339. $this->customEndTimestamp = $customEndTimestamp;
  340. }
  341. /**
  342. * @return string
  343. */
  344. public function getCustomEndTimestamp()
  345. {
  346. return $this->customEndTimestamp;
  347. }
  348. /**
  349. * An optional description of the commitment. You can provide this property
  350. * when you create the resource.
  351. *
  352. * @param string $description
  353. */
  354. public function setDescription($description)
  355. {
  356. $this->description = $description;
  357. }
  358. /**
  359. * @return string
  360. */
  361. public function getDescription()
  362. {
  363. return $this->description;
  364. }
  365. /**
  366. * Output only. [Output Only] Commitment end time inRFC3339 text format.
  367. *
  368. * @param string $endTimestamp
  369. */
  370. public function setEndTimestamp($endTimestamp)
  371. {
  372. $this->endTimestamp = $endTimestamp;
  373. }
  374. /**
  375. * @return string
  376. */
  377. public function getEndTimestamp()
  378. {
  379. return $this->endTimestamp;
  380. }
  381. /**
  382. * @param string[] $existingReservations
  383. */
  384. public function setExistingReservations($existingReservations)
  385. {
  386. $this->existingReservations = $existingReservations;
  387. }
  388. /**
  389. * @return string[]
  390. */
  391. public function getExistingReservations()
  392. {
  393. return $this->existingReservations;
  394. }
  395. /**
  396. * Output only. [Output Only] The unique identifier for the resource. This
  397. * identifier is defined by the server.
  398. *
  399. * @param string $id
  400. */
  401. public function setId($id)
  402. {
  403. $this->id = $id;
  404. }
  405. /**
  406. * @return string
  407. */
  408. public function getId()
  409. {
  410. return $this->id;
  411. }
  412. /**
  413. * Output only. [Output Only] Type of the resource. Always compute#commitment
  414. * for commitments.
  415. *
  416. * @param string $kind
  417. */
  418. public function setKind($kind)
  419. {
  420. $this->kind = $kind;
  421. }
  422. /**
  423. * @return string
  424. */
  425. public function getKind()
  426. {
  427. return $this->kind;
  428. }
  429. /**
  430. * The license specification required as part of a license commitment.
  431. *
  432. * @param LicenseResourceCommitment $licenseResource
  433. */
  434. public function setLicenseResource(LicenseResourceCommitment $licenseResource)
  435. {
  436. $this->licenseResource = $licenseResource;
  437. }
  438. /**
  439. * @return LicenseResourceCommitment
  440. */
  441. public function getLicenseResource()
  442. {
  443. return $this->licenseResource;
  444. }
  445. /**
  446. * The list of source commitments that you are merging to create the new
  447. * merged commitment. For more information, see Merging commitments.
  448. *
  449. * @param string[] $mergeSourceCommitments
  450. */
  451. public function setMergeSourceCommitments($mergeSourceCommitments)
  452. {
  453. $this->mergeSourceCommitments = $mergeSourceCommitments;
  454. }
  455. /**
  456. * @return string[]
  457. */
  458. public function getMergeSourceCommitments()
  459. {
  460. return $this->mergeSourceCommitments;
  461. }
  462. /**
  463. * Name of the commitment. You must specify a name when you purchase the
  464. * commitment. The name must be 1-63 characters long, and comply withRFC1035.
  465. * Specifically, the name must be 1-63 characters long and match the regular
  466. * expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character
  467. * must be a lowercase letter, and all following characters must be a dash,
  468. * lowercase letter, or digit, except the last character, which cannot be a
  469. * dash.
  470. *
  471. * @param string $name
  472. */
  473. public function setName($name)
  474. {
  475. $this->name = $name;
  476. }
  477. /**
  478. * @return string
  479. */
  480. public function getName()
  481. {
  482. return $this->name;
  483. }
  484. /**
  485. * The minimum time duration that you commit to purchasing resources. The plan
  486. * that you choose determines the preset term length of the commitment (which
  487. * is 1 year or 3 years) and affects the discount rate that you receive for
  488. * your resources. Committing to a longer time duration typically gives you a
  489. * higher discount rate. The supported values for this field are TWELVE_MONTH
  490. * (1 year), andTHIRTY_SIX_MONTH (3 years).
  491. *
  492. * Accepted values: INVALID, THIRTY_SIX_MONTH, TWELVE_MONTH
  493. *
  494. * @param self::PLAN_* $plan
  495. */
  496. public function setPlan($plan)
  497. {
  498. $this->plan = $plan;
  499. }
  500. /**
  501. * @return self::PLAN_*
  502. */
  503. public function getPlan()
  504. {
  505. return $this->plan;
  506. }
  507. /**
  508. * Output only. [Output Only] URL of the region where the commitment and
  509. * committed resources are located.
  510. *
  511. * @param string $region
  512. */
  513. public function setRegion($region)
  514. {
  515. $this->region = $region;
  516. }
  517. /**
  518. * @return string
  519. */
  520. public function getRegion()
  521. {
  522. return $this->region;
  523. }
  524. /**
  525. * The list of new reservations that you want to create and attach to this
  526. * commitment.
  527. *
  528. * You must attach reservations to your commitment if your commitment
  529. * specifies any GPUs or Local SSD disks. For more information, see Attach
  530. * reservations to resource-based commitments.
  531. *
  532. * Specify this property only if you want to create new reservations to
  533. * attach. To attach existing reservations, specify theexistingReservations
  534. * property instead.
  535. *
  536. * @param Reservation[] $reservations
  537. */
  538. public function setReservations($reservations)
  539. {
  540. $this->reservations = $reservations;
  541. }
  542. /**
  543. * @return Reservation[]
  544. */
  545. public function getReservations()
  546. {
  547. return $this->reservations;
  548. }
  549. /**
  550. * Output only. [Output Only] Status information for Commitment resource.
  551. *
  552. * @param CommitmentResourceStatus $resourceStatus
  553. */
  554. public function setResourceStatus(CommitmentResourceStatus $resourceStatus)
  555. {
  556. $this->resourceStatus = $resourceStatus;
  557. }
  558. /**
  559. * @return CommitmentResourceStatus
  560. */
  561. public function getResourceStatus()
  562. {
  563. return $this->resourceStatus;
  564. }
  565. /**
  566. * The list of all the hardware resources, with their types and amounts, that
  567. * you want to commit to. Specify as a separate entry in the list for each
  568. * individual resource type.
  569. *
  570. * @param ResourceCommitment[] $resources
  571. */
  572. public function setResources($resources)
  573. {
  574. $this->resources = $resources;
  575. }
  576. /**
  577. * @return ResourceCommitment[]
  578. */
  579. public function getResources()
  580. {
  581. return $this->resources;
  582. }
  583. /**
  584. * Output only. [Output Only] Server-defined URL for the resource.
  585. *
  586. * @param string $selfLink
  587. */
  588. public function setSelfLink($selfLink)
  589. {
  590. $this->selfLink = $selfLink;
  591. }
  592. /**
  593. * @return string
  594. */
  595. public function getSelfLink()
  596. {
  597. return $this->selfLink;
  598. }
  599. /**
  600. * The source commitment from which you are transferring resources to create
  601. * the new split commitment. For more information, see Split commitments.
  602. *
  603. * @param string $splitSourceCommitment
  604. */
  605. public function setSplitSourceCommitment($splitSourceCommitment)
  606. {
  607. $this->splitSourceCommitment = $splitSourceCommitment;
  608. }
  609. /**
  610. * @return string
  611. */
  612. public function getSplitSourceCommitment()
  613. {
  614. return $this->splitSourceCommitment;
  615. }
  616. /**
  617. * Output only. [Output Only] Commitment start time inRFC3339 text format.
  618. *
  619. * @param string $startTimestamp
  620. */
  621. public function setStartTimestamp($startTimestamp)
  622. {
  623. $this->startTimestamp = $startTimestamp;
  624. }
  625. /**
  626. * @return string
  627. */
  628. public function getStartTimestamp()
  629. {
  630. return $this->startTimestamp;
  631. }
  632. /**
  633. * Output only. [Output Only] Status of the commitment with regards to
  634. * eventual expiration (each commitment has an end date defined). Status can
  635. * be one of the following values: NOT_YET_ACTIVE, ACTIVE, orEXPIRED.
  636. *
  637. * Accepted values: ACTIVE, CANCELLED, CREATING, EXPIRED, NOT_YET_ACTIVE
  638. *
  639. * @param self::STATUS_* $status
  640. */
  641. public function setStatus($status)
  642. {
  643. $this->status = $status;
  644. }
  645. /**
  646. * @return self::STATUS_*
  647. */
  648. public function getStatus()
  649. {
  650. return $this->status;
  651. }
  652. /**
  653. * Output only. [Output Only] An optional, human-readable explanation of the
  654. * status.
  655. *
  656. * @param string $statusMessage
  657. */
  658. public function setStatusMessage($statusMessage)
  659. {
  660. $this->statusMessage = $statusMessage;
  661. }
  662. /**
  663. * @return string
  664. */
  665. public function getStatusMessage()
  666. {
  667. return $this->statusMessage;
  668. }
  669. /**
  670. * The type of commitment; specifies the machine series for which you want to
  671. * commit to purchasing resources. The choice of machine series affects the
  672. * discount rate and the eligible resource types.
  673. *
  674. * The type must be one of the following:ACCELERATOR_OPTIMIZED,
  675. * ACCELERATOR_OPTIMIZED_A3,ACCELERATOR_OPTIMIZED_A3_MEGA,COMPUTE_OPTIMIZED,
  676. * COMPUTE_OPTIMIZED_C2D, COMPUTE_OPTIMIZED_C3,
  677. * COMPUTE_OPTIMIZED_C3D,COMPUTE_OPTIMIZED_H3,
  678. * GENERAL_PURPOSE,GENERAL_PURPOSE_C4, GENERAL_PURPOSE_E2,GENERAL_PURPOSE_N2,
  679. * GENERAL_PURPOSE_N2D,GENERAL_PURPOSE_N4,
  680. * GENERAL_PURPOSE_T2D,GRAPHICS_OPTIMIZED,
  681. * GRAPHICS_OPTIMIZED_G4,MEMORY_OPTIMIZED,
  682. * MEMORY_OPTIMIZED_M3,MEMORY_OPTIMIZED_X4, STORAGE_OPTIMIZED_Z3. For example,
  683. * type MEMORY_OPTIMIZED specifies a commitment that applies only to eligible
  684. * resources of memory optimized M1 and M2 machine series. Type
  685. * GENERAL_PURPOSE specifies a commitment that applies only to eligible
  686. * resources of general purpose N1 machine series.
  687. *
  688. * Accepted values: ACCELERATOR_OPTIMIZED, ACCELERATOR_OPTIMIZED_A3,
  689. * ACCELERATOR_OPTIMIZED_A3_MEGA, ACCELERATOR_OPTIMIZED_A3_ULTRA,
  690. * ACCELERATOR_OPTIMIZED_A4, COMPUTE_OPTIMIZED, COMPUTE_OPTIMIZED_C2D,
  691. * COMPUTE_OPTIMIZED_C3, COMPUTE_OPTIMIZED_C3D, COMPUTE_OPTIMIZED_H3,
  692. * COMPUTE_OPTIMIZED_H4D, GENERAL_PURPOSE, GENERAL_PURPOSE_C4,
  693. * GENERAL_PURPOSE_C4A, GENERAL_PURPOSE_C4D, GENERAL_PURPOSE_E2,
  694. * GENERAL_PURPOSE_N2, GENERAL_PURPOSE_N2D, GENERAL_PURPOSE_N4,
  695. * GENERAL_PURPOSE_N4A, GENERAL_PURPOSE_N4D, GENERAL_PURPOSE_T2D,
  696. * GRAPHICS_OPTIMIZED, GRAPHICS_OPTIMIZED_G4, MEMORY_OPTIMIZED,
  697. * MEMORY_OPTIMIZED_M3, MEMORY_OPTIMIZED_M4, MEMORY_OPTIMIZED_M4_6TB,
  698. * MEMORY_OPTIMIZED_X4_1440_24T, MEMORY_OPTIMIZED_X4_16TB,
  699. * MEMORY_OPTIMIZED_X4_1920_32T, MEMORY_OPTIMIZED_X4_24TB,
  700. * MEMORY_OPTIMIZED_X4_32TB, MEMORY_OPTIMIZED_X4_480_6T,
  701. * MEMORY_OPTIMIZED_X4_480_8T, MEMORY_OPTIMIZED_X4_960_12T,
  702. * MEMORY_OPTIMIZED_X4_960_16T, STORAGE_OPTIMIZED_Z3, TYPE_UNSPECIFIED
  703. *
  704. * @param self::TYPE_* $type
  705. */
  706. public function setType($type)
  707. {
  708. $this->type = $type;
  709. }
  710. /**
  711. * @return self::TYPE_*
  712. */
  713. public function getType()
  714. {
  715. return $this->type;
  716. }
  717. }
  718. // Adding a class alias for backwards compatibility with the previous class name.
  719. class_alias(Commitment::class, 'Google_Service_Compute_Commitment');