PageRenderTime 33ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/backwpup/sdk/WindowsAzure/ServiceManagement/Models/GetAffinityGroupPropertiesResult.php

https://bitbucket.org/cesarmedrano/cesarmedrano
PHP | 158 lines | 56 code | 18 blank | 84 comment | 0 complexity | 379318a05d4fe664fa9fae43f8f1a056 MD5 | raw file
  1. <?php
  2. /**
  3. * LICENSE: Licensed under the Apache License, Version 2.0 (the "License");
  4. * you may not use this file except in compliance with the License.
  5. * You may obtain a copy of the License at
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Unless required by applicable law or agreed to in writing, software
  9. * distributed under the License is distributed on an "AS IS" BASIS,
  10. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. * See the License for the specific language governing permissions and
  12. * limitations under the License.
  13. *
  14. * PHP version 5
  15. *
  16. * @category Microsoft
  17. * @package WindowsAzure\ServiceManagement\Models
  18. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  19. * @copyright 2012 Microsoft Corporation
  20. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  21. * @link https://github.com/windowsazure/azure-sdk-for-php
  22. */
  23. namespace WindowsAzure\ServiceManagement\Models;
  24. use WindowsAzure\Common\Internal\Resources;
  25. use WindowsAzure\Common\Internal\Utilities;
  26. /**
  27. * The result of calling getAffinityGroupProperties API.
  28. *
  29. * @category Microsoft
  30. * @package WindowsAzure\ServiceManagement\Models
  31. * @author Azure PHP SDK <azurephpsdk@microsoft.com>
  32. * @copyright 2012 Microsoft Corporation
  33. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
  34. * @version Release: @package_version@
  35. * @link https://github.com/windowsazure/azure-sdk-for-php
  36. */
  37. class GetAffinityGroupPropertiesResult
  38. {
  39. /**
  40. * @var AffinityGroup
  41. */
  42. private $_affinityGroup;
  43. /**
  44. * @var array
  45. */
  46. private $_hostedServices;
  47. /**
  48. * @var array
  49. */
  50. private $_storageServices;
  51. /**
  52. * Creates GetAffinityGroupPropertiesResult from parsed response into array.
  53. *
  54. * @param array $parsed The parsed HTTP response body.
  55. *
  56. * @return GetAffinityGroupPropertiesResult
  57. */
  58. public static function create($parsed)
  59. {
  60. $result = new GetAffinityGroupPropertiesResult();
  61. $hostedServices = Utilities::tryGetArray(
  62. Resources::XTAG_HOSTED_SERVICES,
  63. $parsed
  64. );
  65. $storageServices = Utilities::tryGetArray(
  66. Resources::XTAG_STORAGE_SERVICES,
  67. $parsed
  68. );
  69. $result->_affinityGroup = new AffinityGroup($parsed);
  70. foreach ($hostedServices as $value) {
  71. $service = new HostedService($value);
  72. $result->_hostedServices[] = $service;
  73. }
  74. foreach ($storageServices as $value) {
  75. $service = new StorageService($value);
  76. $result->_storageServices[] = $service;
  77. }
  78. return $result;
  79. }
  80. /**
  81. * Gets the affinityGroup.
  82. *
  83. * @return AffinityGroup
  84. */
  85. public function getAffinityGroup()
  86. {
  87. return $this->_affinityGroup;
  88. }
  89. /**
  90. * Sets the affinityGroup.
  91. *
  92. * @param AffinityGroup $affinityGroup The affinityGroup.
  93. *
  94. * @return none
  95. */
  96. public function setAffinityGroup($affinityGroup)
  97. {
  98. $this->_affinityGroup = $affinityGroup;
  99. }
  100. /**
  101. * Gets the hostedServices.
  102. *
  103. * @return array
  104. */
  105. public function getHostedServices()
  106. {
  107. return $this->_hostedServices;
  108. }
  109. /**
  110. * Sets the hostedServices.
  111. *
  112. * @param array $hostedServices The hostedServices.
  113. *
  114. * @return none
  115. */
  116. public function setHostedServices($hostedServices)
  117. {
  118. $this->_hostedServices = $hostedServices;
  119. }
  120. /**
  121. * Gets the storageServices.
  122. *
  123. * @return array
  124. */
  125. public function getStorageServices()
  126. {
  127. return $this->_storageServices;
  128. }
  129. /**
  130. * Sets the storageServices.
  131. *
  132. * @param array $storageServices The storageServices.
  133. *
  134. * @return none
  135. */
  136. public function setStorageServices($storageServices)
  137. {
  138. $this->_storageServices = $storageServices;
  139. }
  140. }