vpc-20160428/src/Models/CreateCommonBandwidthPackageRequest.php (185 lines of code) (raw):

<?php // This file is auto-generated, don't edit it. Thanks. namespace AlibabaCloud\SDK\Vpc\V20160428\Models; use AlibabaCloud\Dara\Model; use AlibabaCloud\SDK\Vpc\V20160428\Models\CreateCommonBandwidthPackageRequest\tag; class CreateCommonBandwidthPackageRequest extends Model { /** * @var int */ public $bandwidth; /** * @var string */ public $clientToken; /** * @var string */ public $description; /** * @var string */ public $ISP; /** * @var string */ public $internetChargeType; /** * @var string */ public $name; /** * @var string */ public $ownerAccount; /** * @var int */ public $ownerId; /** * @var int */ public $ratio; /** * @var string */ public $regionId; /** * @var string */ public $resourceGroupId; /** * @var string */ public $resourceOwnerAccount; /** * @var int */ public $resourceOwnerId; /** * @var string[] */ public $securityProtectionTypes; /** * @var tag[] */ public $tag; /** * @var string */ public $zone; protected $_name = [ 'bandwidth' => 'Bandwidth', 'clientToken' => 'ClientToken', 'description' => 'Description', 'ISP' => 'ISP', 'internetChargeType' => 'InternetChargeType', 'name' => 'Name', 'ownerAccount' => 'OwnerAccount', 'ownerId' => 'OwnerId', 'ratio' => 'Ratio', 'regionId' => 'RegionId', 'resourceGroupId' => 'ResourceGroupId', 'resourceOwnerAccount' => 'ResourceOwnerAccount', 'resourceOwnerId' => 'ResourceOwnerId', 'securityProtectionTypes' => 'SecurityProtectionTypes', 'tag' => 'Tag', 'zone' => 'Zone', ]; public function validate() { if (\is_array($this->securityProtectionTypes)) { Model::validateArray($this->securityProtectionTypes); } if (\is_array($this->tag)) { Model::validateArray($this->tag); } parent::validate(); } public function toArray($noStream = false) { $res = []; if (null !== $this->bandwidth) { $res['Bandwidth'] = $this->bandwidth; } if (null !== $this->clientToken) { $res['ClientToken'] = $this->clientToken; } if (null !== $this->description) { $res['Description'] = $this->description; } if (null !== $this->ISP) { $res['ISP'] = $this->ISP; } if (null !== $this->internetChargeType) { $res['InternetChargeType'] = $this->internetChargeType; } if (null !== $this->name) { $res['Name'] = $this->name; } if (null !== $this->ownerAccount) { $res['OwnerAccount'] = $this->ownerAccount; } if (null !== $this->ownerId) { $res['OwnerId'] = $this->ownerId; } if (null !== $this->ratio) { $res['Ratio'] = $this->ratio; } if (null !== $this->regionId) { $res['RegionId'] = $this->regionId; } if (null !== $this->resourceGroupId) { $res['ResourceGroupId'] = $this->resourceGroupId; } if (null !== $this->resourceOwnerAccount) { $res['ResourceOwnerAccount'] = $this->resourceOwnerAccount; } if (null !== $this->resourceOwnerId) { $res['ResourceOwnerId'] = $this->resourceOwnerId; } if (null !== $this->securityProtectionTypes) { if (\is_array($this->securityProtectionTypes)) { $res['SecurityProtectionTypes'] = []; $n1 = 0; foreach ($this->securityProtectionTypes as $item1) { $res['SecurityProtectionTypes'][$n1++] = $item1; } } } if (null !== $this->tag) { if (\is_array($this->tag)) { $res['Tag'] = []; $n1 = 0; foreach ($this->tag as $item1) { $res['Tag'][$n1++] = null !== $item1 ? $item1->toArray($noStream) : $item1; } } } if (null !== $this->zone) { $res['Zone'] = $this->zone; } return $res; } public function toMap($noStream = false) { return $this->toArray($noStream); } public static function fromMap($map = []) { $model = new self(); if (isset($map['Bandwidth'])) { $model->bandwidth = $map['Bandwidth']; } if (isset($map['ClientToken'])) { $model->clientToken = $map['ClientToken']; } if (isset($map['Description'])) { $model->description = $map['Description']; } if (isset($map['ISP'])) { $model->ISP = $map['ISP']; } if (isset($map['InternetChargeType'])) { $model->internetChargeType = $map['InternetChargeType']; } if (isset($map['Name'])) { $model->name = $map['Name']; } if (isset($map['OwnerAccount'])) { $model->ownerAccount = $map['OwnerAccount']; } if (isset($map['OwnerId'])) { $model->ownerId = $map['OwnerId']; } if (isset($map['Ratio'])) { $model->ratio = $map['Ratio']; } if (isset($map['RegionId'])) { $model->regionId = $map['RegionId']; } if (isset($map['ResourceGroupId'])) { $model->resourceGroupId = $map['ResourceGroupId']; } if (isset($map['ResourceOwnerAccount'])) { $model->resourceOwnerAccount = $map['ResourceOwnerAccount']; } if (isset($map['ResourceOwnerId'])) { $model->resourceOwnerId = $map['ResourceOwnerId']; } if (isset($map['SecurityProtectionTypes'])) { if (!empty($map['SecurityProtectionTypes'])) { $model->securityProtectionTypes = []; $n1 = 0; foreach ($map['SecurityProtectionTypes'] as $item1) { $model->securityProtectionTypes[$n1++] = $item1; } } } if (isset($map['Tag'])) { if (!empty($map['Tag'])) { $model->tag = []; $n1 = 0; foreach ($map['Tag'] as $item1) { $model->tag[$n1++] = tag::fromMap($item1); } } } if (isset($map['Zone'])) { $model->zone = $map['Zone']; } return $model; } }