ResourceCommitment.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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 ResourceCommitment extends \Google\Model
  19. {
  20. public const TYPE_ACCELERATOR = 'ACCELERATOR';
  21. public const TYPE_LOCAL_SSD = 'LOCAL_SSD';
  22. public const TYPE_MEMORY = 'MEMORY';
  23. public const TYPE_UNSPECIFIED = 'UNSPECIFIED';
  24. public const TYPE_VCPU = 'VCPU';
  25. /**
  26. * Name of the accelerator type or GPU resource. Specify this field only when
  27. * the type of hardware resource is ACCELERATOR.
  28. *
  29. * @var string
  30. */
  31. public $acceleratorType;
  32. /**
  33. * The quantity of the hardware resource that you want to commit to purchasing
  34. * (in a type-dependent unit). - For vCPUs, you must specify an integer
  35. * value. - For memory, you specify the amount of MB that you want. The
  36. * value you specify must be a multiple of 256 MB, with up to 6.5 GB of
  37. * memory per every vCPU. - For GPUs, you must specify an integer value.
  38. * - For Local SSD disks, you must specify the amount in GB. The size of a
  39. * single Local SSD disk is 375 GB.
  40. *
  41. * @var string
  42. */
  43. public $amount;
  44. /**
  45. * The type of hardware resource that you want to specify. You can specify any
  46. * of the following values: - VCPU - MEMORY - LOCAL_SSD -
  47. * ACCELERATOR
  48. *
  49. * Specify as a separate entry in the list for each individual resource type.
  50. *
  51. * @var string
  52. */
  53. public $type;
  54. /**
  55. * Name of the accelerator type or GPU resource. Specify this field only when
  56. * the type of hardware resource is ACCELERATOR.
  57. *
  58. * @param string $acceleratorType
  59. */
  60. public function setAcceleratorType($acceleratorType)
  61. {
  62. $this->acceleratorType = $acceleratorType;
  63. }
  64. /**
  65. * @return string
  66. */
  67. public function getAcceleratorType()
  68. {
  69. return $this->acceleratorType;
  70. }
  71. /**
  72. * The quantity of the hardware resource that you want to commit to purchasing
  73. * (in a type-dependent unit). - For vCPUs, you must specify an integer
  74. * value. - For memory, you specify the amount of MB that you want. The
  75. * value you specify must be a multiple of 256 MB, with up to 6.5 GB of
  76. * memory per every vCPU. - For GPUs, you must specify an integer value.
  77. * - For Local SSD disks, you must specify the amount in GB. The size of a
  78. * single Local SSD disk is 375 GB.
  79. *
  80. * @param string $amount
  81. */
  82. public function setAmount($amount)
  83. {
  84. $this->amount = $amount;
  85. }
  86. /**
  87. * @return string
  88. */
  89. public function getAmount()
  90. {
  91. return $this->amount;
  92. }
  93. /**
  94. * The type of hardware resource that you want to specify. You can specify any
  95. * of the following values: - VCPU - MEMORY - LOCAL_SSD -
  96. * ACCELERATOR
  97. *
  98. * Specify as a separate entry in the list for each individual resource type.
  99. *
  100. * Accepted values: ACCELERATOR, LOCAL_SSD, MEMORY, UNSPECIFIED, VCPU
  101. *
  102. * @param self::TYPE_* $type
  103. */
  104. public function setType($type)
  105. {
  106. $this->type = $type;
  107. }
  108. /**
  109. * @return self::TYPE_*
  110. */
  111. public function getType()
  112. {
  113. return $this->type;
  114. }
  115. }
  116. // Adding a class alias for backwards compatibility with the previous class name.
  117. class_alias(ResourceCommitment::class, 'Google_Service_Compute_ResourceCommitment');