ecs-20140526/src/Models/InvokeCommandShrinkRequest.php (249 lines of code) (raw):
<?php
// This file is auto-generated, don't edit it. Thanks.
namespace AlibabaCloud\SDK\Ecs\V20140526\Models;
use AlibabaCloud\Dara\Model;
use AlibabaCloud\SDK\Ecs\V20140526\Models\InvokeCommandShrinkRequest\resourceTag;
use AlibabaCloud\SDK\Ecs\V20140526\Models\InvokeCommandShrinkRequest\tag;
class InvokeCommandShrinkRequest extends Model
{
/**
* @var string
*/
public $clientToken;
/**
* @var string
*/
public $commandId;
/**
* @var string
*/
public $containerId;
/**
* @var string
*/
public $containerName;
/**
* @var string
*/
public $frequency;
/**
* @var string[]
*/
public $instanceId;
/**
* @var string
*/
public $launcher;
/**
* @var string
*/
public $ownerAccount;
/**
* @var int
*/
public $ownerId;
/**
* @var string
*/
public $parametersShrink;
/**
* @var string
*/
public $regionId;
/**
* @var string
*/
public $repeatMode;
/**
* @var string
*/
public $resourceGroupId;
/**
* @var string
*/
public $resourceOwnerAccount;
/**
* @var int
*/
public $resourceOwnerId;
/**
* @var resourceTag[]
*/
public $resourceTag;
/**
* @var tag[]
*/
public $tag;
/**
* @var string
*/
public $terminationMode;
/**
* @var bool
*/
public $timed;
/**
* @var int
*/
public $timeout;
/**
* @var string
*/
public $username;
/**
* @var string
*/
public $windowsPasswordName;
protected $_name = [
'clientToken' => 'ClientToken',
'commandId' => 'CommandId',
'containerId' => 'ContainerId',
'containerName' => 'ContainerName',
'frequency' => 'Frequency',
'instanceId' => 'InstanceId',
'launcher' => 'Launcher',
'ownerAccount' => 'OwnerAccount',
'ownerId' => 'OwnerId',
'parametersShrink' => 'Parameters',
'regionId' => 'RegionId',
'repeatMode' => 'RepeatMode',
'resourceGroupId' => 'ResourceGroupId',
'resourceOwnerAccount' => 'ResourceOwnerAccount',
'resourceOwnerId' => 'ResourceOwnerId',
'resourceTag' => 'ResourceTag',
'tag' => 'Tag',
'terminationMode' => 'TerminationMode',
'timed' => 'Timed',
'timeout' => 'Timeout',
'username' => 'Username',
'windowsPasswordName' => 'WindowsPasswordName',
];
public function validate()
{
if (\is_array($this->instanceId)) {
Model::validateArray($this->instanceId);
}
if (\is_array($this->resourceTag)) {
Model::validateArray($this->resourceTag);
}
if (\is_array($this->tag)) {
Model::validateArray($this->tag);
}
parent::validate();
}
public function toArray($noStream = false)
{
$res = [];
if (null !== $this->clientToken) {
$res['ClientToken'] = $this->clientToken;
}
if (null !== $this->commandId) {
$res['CommandId'] = $this->commandId;
}
if (null !== $this->containerId) {
$res['ContainerId'] = $this->containerId;
}
if (null !== $this->containerName) {
$res['ContainerName'] = $this->containerName;
}
if (null !== $this->frequency) {
$res['Frequency'] = $this->frequency;
}
if (null !== $this->instanceId) {
if (\is_array($this->instanceId)) {
$res['InstanceId'] = [];
$n1 = 0;
foreach ($this->instanceId as $item1) {
$res['InstanceId'][$n1++] = $item1;
}
}
}
if (null !== $this->launcher) {
$res['Launcher'] = $this->launcher;
}
if (null !== $this->ownerAccount) {
$res['OwnerAccount'] = $this->ownerAccount;
}
if (null !== $this->ownerId) {
$res['OwnerId'] = $this->ownerId;
}
if (null !== $this->parametersShrink) {
$res['Parameters'] = $this->parametersShrink;
}
if (null !== $this->regionId) {
$res['RegionId'] = $this->regionId;
}
if (null !== $this->repeatMode) {
$res['RepeatMode'] = $this->repeatMode;
}
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->resourceTag) {
if (\is_array($this->resourceTag)) {
$res['ResourceTag'] = [];
$n1 = 0;
foreach ($this->resourceTag as $item1) {
$res['ResourceTag'][$n1++] = null !== $item1 ? $item1->toArray($noStream) : $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->terminationMode) {
$res['TerminationMode'] = $this->terminationMode;
}
if (null !== $this->timed) {
$res['Timed'] = $this->timed;
}
if (null !== $this->timeout) {
$res['Timeout'] = $this->timeout;
}
if (null !== $this->username) {
$res['Username'] = $this->username;
}
if (null !== $this->windowsPasswordName) {
$res['WindowsPasswordName'] = $this->windowsPasswordName;
}
return $res;
}
public function toMap($noStream = false)
{
return $this->toArray($noStream);
}
public static function fromMap($map = [])
{
$model = new self();
if (isset($map['ClientToken'])) {
$model->clientToken = $map['ClientToken'];
}
if (isset($map['CommandId'])) {
$model->commandId = $map['CommandId'];
}
if (isset($map['ContainerId'])) {
$model->containerId = $map['ContainerId'];
}
if (isset($map['ContainerName'])) {
$model->containerName = $map['ContainerName'];
}
if (isset($map['Frequency'])) {
$model->frequency = $map['Frequency'];
}
if (isset($map['InstanceId'])) {
if (!empty($map['InstanceId'])) {
$model->instanceId = [];
$n1 = 0;
foreach ($map['InstanceId'] as $item1) {
$model->instanceId[$n1++] = $item1;
}
}
}
if (isset($map['Launcher'])) {
$model->launcher = $map['Launcher'];
}
if (isset($map['OwnerAccount'])) {
$model->ownerAccount = $map['OwnerAccount'];
}
if (isset($map['OwnerId'])) {
$model->ownerId = $map['OwnerId'];
}
if (isset($map['Parameters'])) {
$model->parametersShrink = $map['Parameters'];
}
if (isset($map['RegionId'])) {
$model->regionId = $map['RegionId'];
}
if (isset($map['RepeatMode'])) {
$model->repeatMode = $map['RepeatMode'];
}
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['ResourceTag'])) {
if (!empty($map['ResourceTag'])) {
$model->resourceTag = [];
$n1 = 0;
foreach ($map['ResourceTag'] as $item1) {
$model->resourceTag[$n1++] = resourceTag::fromMap($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['TerminationMode'])) {
$model->terminationMode = $map['TerminationMode'];
}
if (isset($map['Timed'])) {
$model->timed = $map['Timed'];
}
if (isset($map['Timeout'])) {
$model->timeout = $map['Timeout'];
}
if (isset($map['Username'])) {
$model->username = $map['Username'];
}
if (isset($map['WindowsPasswordName'])) {
$model->windowsPasswordName = $map['WindowsPasswordName'];
}
return $model;
}
}