Skip to content

Commit

Permalink
auto code generation (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucloud-bot authored May 19, 2022
1 parent 9d16867 commit 8a08fbf
Show file tree
Hide file tree
Showing 10 changed files with 299 additions and 24 deletions.
42 changes: 38 additions & 4 deletions src/UHost/Apis/CreateUHostInstanceRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

use UCloud\Core\Request\Request;
use UCloud\UHost\Params\CreateUHostInstanceParamDisks;
use UCloud\UHost\Params\CreateUHostInstanceParamDisksCustomBackup;
use UCloud\UHost\Params\CreateUHostInstanceParamNetworkInterface;
use UCloud\UHost\Params\CreateUHostInstanceParamNetworkInterfaceEIP;
use UCloud\UHost\Params\CreateUHostInstanceParamNetworkInterfaceIPv6;
use UCloud\UHost\Params\CreateUHostInstanceParamVolumes;
use UCloud\UHost\Params\CreateUHostInstanceParamFeatures;
use UCloud\UHost\Params\CreateUHostInstanceParamSecGroupId;

class CreateUHostInstanceRequest extends Request
{
Expand Down Expand Up @@ -370,7 +372,7 @@ public function setGPU($gpu)
}

/**
* NetCapability: 网络增强特性。枚举值:Normal(默认),不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(仅支持部分可用区,请参考控制台
* NetCapability: 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(详情参考官网文档
*
* @return string|null
*/
Expand All @@ -380,7 +382,7 @@ public function getNetCapability()
}

/**
* NetCapability: 网络增强特性。枚举值:Normal(默认),不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(仅支持部分可用区,请参考控制台
* NetCapability: 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(详情参考官网文档
*
* @param string $netCapability
*/
Expand Down Expand Up @@ -694,7 +696,7 @@ public function setVolumes(array $volumes)
}

/**
* KeyPairId: KeypairId 密钥对ID,LoginMode为KeyPair时此项必须
* KeyPairId: KeypairId 密钥对ID,LoginMode为KeyPair时此项必须
*
* @return string|null
*/
Expand All @@ -704,7 +706,7 @@ public function getKeyPairId()
}

/**
* KeyPairId: KeypairId 密钥对ID,LoginMode为KeyPair时此项必须
* KeyPairId: KeypairId 密钥对ID,LoginMode为KeyPair时此项必须
*
* @param string $keyPairId
*/
Expand Down Expand Up @@ -733,6 +735,38 @@ public function setFeatures(array $features)
$this->set("Features", $features->getAll());
}

/**
* SecGroupId:
*
* @return CreateUHostInstanceParamSecGroupId[]|null
*/
public function getSecGroupId()
{
$items = $this->get("SecGroupId");
if ($items == null) {
return [];
}
$result = [];
foreach ($items as $i => $item) {
array_push($result, new CreateUHostInstanceParamSecGroupId($item));
}
return $result;
}

/**
* SecGroupId:
*
* @param CreateUHostInstanceParamSecGroupId[] $secGroupId
*/
public function setSecGroupId(array $secGroupId)
{
$result = [];
foreach ($secGroupId as $i => $item) {
array_push($result, $item->getAll());
}
return $result;
}

/**
* CouponId: 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
*
Expand Down
24 changes: 22 additions & 2 deletions src/UHost/Params/CreateUHostInstanceParamDisks.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function setType($type)
}

/**
* Size: 磁盘大小,单位GB,必须是10GB的整数倍。请参考[[api:uhost-api:disk_type|磁盘类型]]。
* Size: 磁盘大小,单位GB。请参考[[api:uhost-api:disk_type|磁盘类型]]。
*
* @return integer|null
*/
Expand All @@ -73,7 +73,7 @@ public function getSize()
}

/**
* Size: 磁盘大小,单位GB,必须是10GB的整数倍。请参考[[api:uhost-api:disk_type|磁盘类型]]。
* Size: 磁盘大小,单位GB。请参考[[api:uhost-api:disk_type|磁盘类型]]。
*
* @param int $size
*/
Expand Down Expand Up @@ -161,4 +161,24 @@ public function setCouponId($couponId)
{
$this->set("CouponId", $couponId);
}

/**
* CustomBackup:
*
* @return CreateUHostInstanceParamDisksCustomBackup|null
*/
public function getCustomBackup()
{
return new CreateUHostInstanceParamDisksCustomBackup($this->get("CustomBackup"));
}

/**
* CustomBackup:
*
* @param CreateUHostInstanceParamDisksCustomBackup $customBackup
*/
public function setCustomBackup(array $customBackup)
{
$this->set("CustomBackup", $customBackup->getAll());
}
}
26 changes: 26 additions & 0 deletions src/UHost/Params/CreateUHostInstanceParamDisksCustomBackup.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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\Params;

use UCloud\Core\Request\Request;

class CreateUHostInstanceParamDisksCustomBackup extends Request
{



}
26 changes: 26 additions & 0 deletions src/UHost/Params/CreateUHostInstanceParamSecGroupId.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?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\Params;

use UCloud\Core\Request\Request;

class CreateUHostInstanceParamSecGroupId extends Request
{



}
8 changes: 5 additions & 3 deletions src/UHost/UHostClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,12 @@ public function createIsolationGroup(CreateIsolationGroupRequest $request = null
* [
* "IsBoot" => (string) 是否是系统盘。枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
* "Type" => (string) 磁盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。
* "Size" => (integer) 磁盘大小,单位GB,必须是10GB的整数倍。请参考[[api:uhost-api:disk_type|磁盘类型]]。
* "Size" => (integer) 磁盘大小,单位GB。请参考[[api:uhost-api:disk_type|磁盘类型]]。
* "BackupType" => (string) 磁盘备份方案。枚举值:\\ > NONE,无备份 \\ > DATAARK,数据方舟 \\ > SNAPSHOT,快照 \\当前磁盘支持的备份模式参考 [[api:uhost-api:disk_type|磁盘类型]],默认值:NONE
* "Encrypted" => (boolean) 【功能仅部分可用区开放,详询技术支持】磁盘是否加密。加密:true, 不加密: false加密必须传入对应的的KmsKeyId,默认值false
* "KmsKeyId" => (string) 【功能仅部分可用区开放,详询技术支持】kms key id。选择加密盘时必填。
* "CouponId" => (string) 云盘代金券id。不适用于系统盘/本地盘。请通过DescribeCoupon接口查询,或登录用户中心查看
* "CustomBackup" => (object)
* ]
* ]
* "LoginMode" => (string) 主机登陆模式。密码(默认选项): Password,密钥:KeyPair。
Expand All @@ -222,7 +223,7 @@ public function createIsolationGroup(CreateIsolationGroupRequest $request = null
* "Memory" => (integer) 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值:8192
* "GpuType" => (string) GPU类型,枚举值["K80", "P40", "V100", "T4", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "MI100", "V100S"],MachineType为G时必填
* "GPU" => (integer) GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
* "NetCapability" => (string) 网络增强特性。枚举值:Normal(默认),不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(仅支持部分可用区,请参考控制台
* "NetCapability" => (string) 网络增强特性。枚举值:Normal,不开启; Super,开启网络增强1.0; Ultra,开启网络增强2.0(详情参考官网文档
* "HotplugFeature" => (boolean) 热升级特性。True为开启,False为未开启,默认False。
* "VPCId" => (string) VPC ID。默认为当前地域的默认VPC。
* "SubnetId" => (string) 子网 ID。默认为当前地域的默认子网。
Expand All @@ -249,10 +250,11 @@ public function createIsolationGroup(CreateIsolationGroupRequest $request = null
* "UserData" => (string) 用户自定义数据。当镜像支持Cloud-init Feature时可填写此字段。注意:1、总数据量大小不超过 16K;2、使用base64编码
* "AutoDataDiskInit" => (string) 数据盘是否需要自动分区挂载。当镜像支持“Cloud-init”Feature时可填写此字段。取值 >“On” 自动挂载(默认值)> “Off” 不自动挂载。
* "Volumes" => (array<object>)
* "KeyPairId" => (string) KeypairId 密钥对ID,LoginMode为KeyPair时此项必须
* "KeyPairId" => (string) KeypairId 密钥对ID,LoginMode为KeyPair时此项必须
* "Features" => (object) [
* "UNI" => (boolean) 弹性网卡特性。开启了弹性网卡权限位,此特性才生效,默认 false 未开启,true 开启,仅与 NetCapability Normal 兼容。
* ]
* "SecGroupId" => (array<object>)
* "CouponId" => (string) 主机代金券ID。请通过DescribeCoupon接口查询,或登录用户中心查看
* ]
*
Expand Down
16 changes: 8 additions & 8 deletions src/UPhone/Apis/CreateUPhoneServerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function setName($name)
}

/**
* ServerModelName: 云手机服务器规格名称,不超过64个字节。可通过[查询云手机服务器规格列表]()查询支持的云手机服务器规格。
* ServerModelName: 云手机服务器规格名称,不超过64个字节。可通过[查询云手机服务器规格列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_server_model)查询支持的云手机服务器规格。
*
* @return string|null
*/
Expand All @@ -84,7 +84,7 @@ public function getServerModelName()
}

/**
* ServerModelName: 云手机服务器规格名称,不超过64个字节。可通过[查询云手机服务器规格列表]()查询支持的云手机服务器规格。
* ServerModelName: 云手机服务器规格名称,不超过64个字节。可通过[查询云手机服务器规格列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_server_model)查询支持的云手机服务器规格。
*
* @param string $serverModelName
*/
Expand All @@ -94,7 +94,7 @@ public function setServerModelName($serverModelName)
}

/**
* UPhoneModelName: 云手机规格名称,不超过64个字节。可通过[查询云手机规格列表]()查询支持的云手机规格。
* UPhoneModelName: 云手机规格名称,不超过64个字节。可通过[查询云手机规格列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_model)查询支持的云手机规格。
*
* @return string|null
*/
Expand All @@ -104,7 +104,7 @@ public function getUPhoneModelName()
}

/**
* UPhoneModelName: 云手机规格名称,不超过64个字节。可通过[查询云手机规格列表]()查询支持的云手机规格。
* UPhoneModelName: 云手机规格名称,不超过64个字节。可通过[查询云手机规格列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_model)查询支持的云手机规格。
*
* @param string $uPhoneModelName
*/
Expand All @@ -114,7 +114,7 @@ public function setUPhoneModelName($uPhoneModelName)
}

/**
* ImageId: 云手机镜像ID,不超过32个字节。可通过[查询手机镜像]()查询云手机规格对应的镜像ID。
* ImageId: 云手机镜像ID,不超过32个字节。可通过[查询手机镜像](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_image)查询云手机规格对应的镜像ID。
*
* @return string|null
*/
Expand All @@ -124,7 +124,7 @@ public function getImageId()
}

/**
* ImageId: 云手机镜像ID,不超过32个字节。可通过[查询手机镜像]()查询云手机规格对应的镜像ID。
* ImageId: 云手机镜像ID,不超过32个字节。可通过[查询手机镜像](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_image)查询云手机规格对应的镜像ID。
*
* @param string $imageId
*/
Expand All @@ -134,7 +134,7 @@ public function setImageId($imageId)
}

/**
* CityId: 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取
* CityId: 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取
*
* @return string|null
*/
Expand All @@ -144,7 +144,7 @@ public function getCityId()
}

/**
* CityId: 城市Id,通过[获取城市列表](#DescribeUPhoneCities)获取
* CityId: 城市Id,通过[获取城市列表](https://docs.ucloud.cn/api/uphone-api/describe_u_phone_cities)获取
*
* @param string $cityId
*/
Expand Down
4 changes: 2 additions & 2 deletions src/UPhone/Apis/DescribeUPhoneRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function setOffset($offset)
}

/**
* Limit: 返回数据长度,默认为20,最大100
* Limit: 返回数据长度,默认为200,最大200
*
* @return integer|null
*/
Expand All @@ -139,7 +139,7 @@ public function getLimit()
}

/**
* Limit: 返回数据长度,默认为20,最大100
* Limit: 返回数据长度,默认为200,最大200
*
* @param int $limit
*/
Expand Down
Loading

0 comments on commit 8a08fbf

Please sign in to comment.