MachineGroup.php
4.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/**
* Copyright (C) Alibaba Cloud Computing
* All rights reserved
*/
class Aliyun_Log_Models_MachineGroup_GroupAttribute {
public $externalName;
public $groupTopic;
public function __construct($externalName=null,$groupTopic=null){
$this->externalName = $externalName;
$this->groupTopic = $groupTopic;
}
public function toArray(){
$resArray = array();
if($this->externalName!==null)
$resArray['externalName'] = $this->externalName;
if($this->groupTopic!==null)
$resArray['groupTopic'] = $this->groupTopic;
return $resArray;
}
}
class Aliyun_Log_Models_MachineGroup {
private $groupName;
private $groupType;
private $groupAttribute;
private $machineList;
private $createTime;
private $lastModifyTime;
public function __construct($groupName='',$groupType='',$groupAttribute=null,
$machineList=null,$createTime=null,$lastModifyTime=null) {
$this->groupName = $groupName;
$this->groupType = $groupType;
$this->groupAttribute = $groupAttribute;
$this->machineList = $machineList;
$this->createTime = $createTime;
$this->lastModifyTime = $lastModifyTime;
}
public function getGroupName(){
return $this->groupName;
}
public function setGroupName($groupName){
$this->groupName = $groupName;
}
public function getGroupType(){
return $this->groupType;
}
public function setGroupType($groupType){
$this->groupType = $groupType;
}
public function getGroupAttribute(){
return $this->groupAttribute;
}
public function setGroupAttribute($groupAttribute){
$this->groupAttribute = $groupAttribute;
}
public function getMachineList(){
return $this->machineList;
}
public function setMachineList($machineList){
$this->machineList = $machineList;
}
public function getCreateTime(){
return $this->createTime;
}
public function setCreateTime($createTime){
$this->createTime = $createTime;
}
public function getLastModifyTime(){
return $this->lastModifyTime;
}
public function setLastModifyTime($lastModifyTime){
$this->lastModifyTime = $lastModifyTime;
}
public function toArray(){
$format_array = array();
if($this->groupName!==null)
$format_array['groupName'] = $this->groupName;
if($this->groupType!==null)
$format_array['groupType'] = $this->groupType;
if($this->groupAttribute!==null)
$format_array['groupAttribute'] = $this->groupAttribute->toArray();
if($this->machineList!==null){
$mlArr = array();
foreach($this->machineList as $value){
$mlArr[] = $value->toArray();
}
$format_array['machineList'] = $mlArr;
}
if($this->createTime!==null)
$format_array['createTime'] = $this->createTime;
if($this->lastModifyTime!==null)
$format_array['lastModifyTime'] = $this->lastModifyTime;
return $format_array;
}
public function setFromArray($resp){
$groupAttribute = null;
if(isset($resp['groupAttribute'])){
$groupAttributeArr = $resp['groupAttribute'];
$groupAttribute = new Aliyun_Log_Models_MachineGroup_GroupAttribute();
if(isset($groupAttributeArr['externalName']))
$groupAttribute->externalName = $groupAttributeArr['externalName'];
if(isset($groupAttributeArr['groupTopic']))
$groupAttribute->groupTopic = $groupAttributeArr['groupTopic'];
}
$groupName = ($resp['groupName']!==null)?$resp['groupName']:null;
$groupType = ($resp['groupType']!==null)?$resp['groupType']:null;
$machineList = array();
if(isset($resp['machineList']) && is_array($resp['machineList']) && count($resp['machineList'])>0){
foreach($resp['machineList'] as $value){
$machine = new Aliyun_Log_Models_Machine();
$machine->setFromArray($value);
$machineList[] = $machine;
}
}
$createTime = ($resp['createTime']!==null)?$resp['createTime']:null;
$lastModifyTime = ($resp['lastModifyTime']!==null)?$resp['lastModifyTime']:null;
$this->setGroupName($groupName);
$this->setGroupType($groupType);
$this->setGroupAttribute($groupAttribute);
$this->setMachineList($machineList);
$this->setCreateTime($createTime);
$this->setLastModifyTime($lastModifyTime);
}
}