Skip to content

Commit

Permalink
auto code generation (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucloud-bot authored May 9, 2022
1 parent 8e4ff34 commit 9d16867
Show file tree
Hide file tree
Showing 17 changed files with 1,695 additions and 0 deletions.
91 changes: 91 additions & 0 deletions src/UHost/Apis/DescribeAvailableInstanceTypesRequest.php
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);
}
}
67 changes: 67 additions & 0 deletions src/UHost/Apis/DescribeAvailableInstanceTypesResponse.php
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;
}
}
Loading

0 comments on commit 9d16867

Please sign in to comment.