-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e4ff34
commit 9d16867
Showing
17 changed files
with
1,695 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
/** | ||
* Copyright 2022 UCloud Technology Co., Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
namespace UCloud\UHost\Apis; | ||
|
||
use UCloud\Core\Request\Request; | ||
|
||
class DescribeAvailableInstanceTypesRequest extends Request | ||
{ | ||
public function __construct() | ||
{ | ||
parent::__construct(["Action" => "DescribeAvailableInstanceTypes"]); | ||
$this->markRequired("Region"); | ||
$this->markRequired("Zone"); | ||
} | ||
|
||
|
||
|
||
/** | ||
* Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) | ||
* | ||
* @return string|null | ||
*/ | ||
public function getRegion() | ||
{ | ||
return $this->get("Region"); | ||
} | ||
|
||
/** | ||
* Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) | ||
* | ||
* @param string $region | ||
*/ | ||
public function setRegion($region) | ||
{ | ||
$this->set("Region", $region); | ||
} | ||
|
||
/** | ||
* Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) | ||
* | ||
* @return string|null | ||
*/ | ||
public function getZone() | ||
{ | ||
return $this->get("Zone"); | ||
} | ||
|
||
/** | ||
* Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) | ||
* | ||
* @param string $zone | ||
*/ | ||
public function setZone($zone) | ||
{ | ||
$this->set("Zone", $zone); | ||
} | ||
|
||
/** | ||
* ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 | ||
* | ||
* @return string|null | ||
*/ | ||
public function getProjectId() | ||
{ | ||
return $this->get("ProjectId"); | ||
} | ||
|
||
/** | ||
* ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 | ||
* | ||
* @param string $projectId | ||
*/ | ||
public function setProjectId($projectId) | ||
{ | ||
$this->set("ProjectId", $projectId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
/** | ||
* Copyright 2022 UCloud Technology Co., Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
namespace UCloud\UHost\Apis; | ||
|
||
use UCloud\Core\Response\Response; | ||
use UCloud\UHost\Models\AvailableInstanceTypes; | ||
use UCloud\UHost\Models\CpuPlatforms; | ||
use UCloud\UHost\Models\Disks; | ||
use UCloud\UHost\Models\BootDiskInfo; | ||
use UCloud\UHost\Models\DataDiskInfo; | ||
use UCloud\UHost\Models\MachineSizes; | ||
use UCloud\UHost\Models\Collection; | ||
use UCloud\UHost\Models\Features; | ||
use UCloud\UHost\Models\FeatureModes; | ||
use UCloud\UHost\Models\GraphicsMemory; | ||
use UCloud\UHost\Models\Performance; | ||
|
||
class DescribeAvailableInstanceTypesResponse extends Response | ||
{ | ||
|
||
|
||
/** | ||
* AvailableInstanceTypes: AvailableInstanceTypes | ||
* | ||
* @return AvailableInstanceTypes[]|null | ||
*/ | ||
public function getAvailableInstanceTypes() | ||
{ | ||
$items = $this->get("AvailableInstanceTypes"); | ||
if ($items == null) { | ||
return []; | ||
} | ||
$result = []; | ||
foreach ($items as $i => $item) { | ||
array_push($result, new AvailableInstanceTypes($item)); | ||
} | ||
return $result; | ||
} | ||
|
||
/** | ||
* AvailableInstanceTypes: AvailableInstanceTypes | ||
* | ||
* @param AvailableInstanceTypes[] $availableInstanceTypes | ||
*/ | ||
public function setAvailableInstanceTypes(array $availableInstanceTypes) | ||
{ | ||
$result = []; | ||
foreach ($availableInstanceTypes as $i => $item) { | ||
array_push($result, $item->getAll()); | ||
} | ||
return $result; | ||
} | ||
} |
Oops, something went wrong.