Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit fd82b5e

Browse files
Generated types from the latest schema (#49)
* first swoop * added the comment * field descriptions * fix namespaces * final updates * included cloud context into telemetry context * allow to override time * remove type for time
1 parent a16872d commit fd82b5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2042
-680
lines changed

ApplicationInsights/Channel/Contracts/Application.php

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,36 @@
11
<?php
22
namespace ApplicationInsights\Channel\Contracts;
3+
/**
4+
*
5+
* THIS FILE IS AUTO-GENERATED.
6+
* Please do not edit manually.
7+
*
8+
* Use script at <root>/Schema/generateSchema.ps1
9+
*
10+
*/
311

412
/**
5-
* Data contract class for type Application.
13+
* Data contract class for type Application.
614
*/
715
class Application
816
{
917
use Json_Serializer;
1018

1119
/**
12-
* Data array that will store all the values.
20+
* Data array that will store all the values.
1321
*/
1422
private $_data;
1523

1624
/**
17-
* Creates a new Application.
25+
* Creates a new Application.
1826
*/
1927
function __construct()
2028
{
2129
$this->_data = array();
2230
}
2331

2432
/**
25-
* Gets the ver field.
33+
* Gets the ver field. Application version. Information in the application context fields is always about the application that is sending the telemetry.
2634
*/
2735
public function getVer()
2836
{
@@ -31,7 +39,7 @@ public function getVer()
3139
}
3240

3341
/**
34-
* Sets the ver field.
42+
* Sets the ver field. Application version. Information in the application context fields is always about the application that is sending the telemetry.
3543
*/
3644
public function setVer($ver)
3745
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
<?php
2+
namespace ApplicationInsights\Channel\Contracts;
3+
/**
4+
*
5+
* THIS FILE IS AUTO-GENERATED.
6+
* Please do not edit manually.
7+
*
8+
* Use script at <root>/Schema/generateSchema.ps1
9+
*
10+
*/
11+
12+
/**
13+
* Data contract class for type Availability_Data. Instances of AvailabilityData represent the result of executing an availability test.
14+
*/
15+
class Availability_Data extends Base_Data implements Data_Interface
16+
{
17+
18+
/**
19+
* Creates a new AvailabilityData.
20+
*/
21+
function __construct()
22+
{
23+
$this->_envelopeTypeName = 'Microsoft.ApplicationInsights.Availability';
24+
$this->_dataTypeName = 'AvailabilityData';
25+
$this->_data['ver'] = 2;
26+
$this->_data['id'] = NULL;
27+
$this->_data['name'] = NULL;
28+
$this->_data['duration'] = NULL;
29+
$this->_data['success'] = NULL;
30+
}
31+
32+
/**
33+
* Gets the ver field. Schema version
34+
*/
35+
public function getVer()
36+
{
37+
if (array_key_exists('ver', $this->_data)) { return $this->_data['ver']; }
38+
return NULL;
39+
}
40+
41+
/**
42+
* Sets the ver field. Schema version
43+
*/
44+
public function setVer($ver)
45+
{
46+
$this->_data['ver'] = $ver;
47+
}
48+
49+
/**
50+
* Gets the id field. Identifier of a test run. Use it to correlate steps of test run and telemetry generated by the service.
51+
*/
52+
public function getId()
53+
{
54+
if (array_key_exists('id', $this->_data)) { return $this->_data['id']; }
55+
return NULL;
56+
}
57+
58+
/**
59+
* Sets the id field. Identifier of a test run. Use it to correlate steps of test run and telemetry generated by the service.
60+
*/
61+
public function setId($id)
62+
{
63+
$this->_data['id'] = $id;
64+
}
65+
66+
/**
67+
* Gets the name field. Name of the test that these availability results represent.
68+
*/
69+
public function getName()
70+
{
71+
if (array_key_exists('name', $this->_data)) { return $this->_data['name']; }
72+
return NULL;
73+
}
74+
75+
/**
76+
* Sets the name field. Name of the test that these availability results represent.
77+
*/
78+
public function setName($name)
79+
{
80+
$this->_data['name'] = $name;
81+
}
82+
83+
/**
84+
* Gets the duration field. Duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days.
85+
*/
86+
public function getDuration()
87+
{
88+
if (array_key_exists('duration', $this->_data)) { return $this->_data['duration']; }
89+
return NULL;
90+
}
91+
92+
/**
93+
* Sets the duration field. Duration in format: DD.HH:MM:SS.MMMMMM. Must be less than 1000 days.
94+
*/
95+
public function setDuration($duration)
96+
{
97+
$this->_data['duration'] = $duration;
98+
}
99+
100+
/**
101+
* Gets the success field. Success flag.
102+
*/
103+
public function getSuccess()
104+
{
105+
if (array_key_exists('success', $this->_data)) { return $this->_data['success']; }
106+
return NULL;
107+
}
108+
109+
/**
110+
* Sets the success field. Success flag.
111+
*/
112+
public function setSuccess($success)
113+
{
114+
$this->_data['success'] = $success;
115+
}
116+
117+
/**
118+
* Gets the runLocation field. Name of the location where the test was run from.
119+
*/
120+
public function getRunLocation()
121+
{
122+
if (array_key_exists('runLocation', $this->_data)) { return $this->_data['runLocation']; }
123+
return NULL;
124+
}
125+
126+
/**
127+
* Sets the runLocation field. Name of the location where the test was run from.
128+
*/
129+
public function setRunLocation($runLocation)
130+
{
131+
$this->_data['runLocation'] = $runLocation;
132+
}
133+
134+
/**
135+
* Gets the message field. Diagnostic message for the result.
136+
*/
137+
public function getMessage()
138+
{
139+
if (array_key_exists('message', $this->_data)) { return $this->_data['message']; }
140+
return NULL;
141+
}
142+
143+
/**
144+
* Sets the message field. Diagnostic message for the result.
145+
*/
146+
public function setMessage($message)
147+
{
148+
$this->_data['message'] = $message;
149+
}
150+
151+
/**
152+
* Gets the properties field. Collection of custom properties.
153+
*/
154+
public function getProperties()
155+
{
156+
if (array_key_exists('properties', $this->_data)) { return $this->_data['properties']; }
157+
return NULL;
158+
}
159+
160+
/**
161+
* Sets the properties field. Collection of custom properties.
162+
*/
163+
public function setProperties($properties)
164+
{
165+
$this->_data['properties'] = $properties;
166+
}
167+
168+
/**
169+
* Gets the measurements field. Collection of custom measurements.
170+
*/
171+
public function getMeasurements()
172+
{
173+
if (array_key_exists('measurements', $this->_data)) { return $this->_data['measurements']; }
174+
return NULL;
175+
}
176+
177+
/**
178+
* Sets the measurements field. Collection of custom measurements.
179+
*/
180+
public function setMeasurements($measurements)
181+
{
182+
$this->_data['measurements'] = $measurements;
183+
}
184+
}

ApplicationInsights/Channel/Contracts/Base_Data.php

+11-7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ abstract class Base_Data implements Data_Interface
99
use Json_Serializer;
1010
use Version_Manager;
1111

12+
/**
13+
* Override for the time of the event
14+
*/
15+
protected $_time;
16+
1217
/**
1318
* Data array that will store all the values.
1419
*/
@@ -41,19 +46,18 @@ public function getDataTypeName()
4146
}
4247

4348
/**
44-
* Gets the properties field.
49+
* Gets the time of the event.
4550
*/
46-
public function getProperties()
51+
public function getTime()
4752
{
48-
if (array_key_exists('properties', $this->_data)) { return $this->_data['properties']; }
49-
return NULL;
53+
return $this->_time;
5054
}
5155

5256
/**
53-
* Sets the properties field.
57+
* Sets the time of the event.
5458
*/
55-
public function setProperties($properties)
59+
public function setTime($time)
5660
{
57-
$this->_data['properties'] = $properties;
61+
$this->_time = $time;
5862
}
5963
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?php
2+
namespace ApplicationInsights\Channel\Contracts;
3+
/**
4+
*
5+
* THIS FILE IS AUTO-GENERATED.
6+
* Please do not edit manually.
7+
*
8+
* Use script at <root>/Schema/generateSchema.ps1
9+
*
10+
*/
11+
12+
/**
13+
* Data contract class for type Cloud.
14+
*/
15+
class Cloud
16+
{
17+
use Json_Serializer;
18+
19+
/**
20+
* Data array that will store all the values.
21+
*/
22+
private $_data;
23+
24+
/**
25+
* Creates a new Cloud.
26+
*/
27+
function __construct()
28+
{
29+
$this->_data = array();
30+
}
31+
32+
/**
33+
* Gets the role field. Name of the role the application is a part of. Maps directly to the role name in azure.
34+
*/
35+
public function getRole()
36+
{
37+
if (array_key_exists('ai.cloud.role', $this->_data)) { return $this->_data['ai.cloud.role']; }
38+
return NULL;
39+
}
40+
41+
/**
42+
* Sets the role field. Name of the role the application is a part of. Maps directly to the role name in azure.
43+
*/
44+
public function setRole($role)
45+
{
46+
$this->_data['ai.cloud.role'] = $role;
47+
}
48+
49+
/**
50+
* Gets the roleInstance field. Name of the instance where the application is running. Computer name for on-premisis, instance name for Azure.
51+
*/
52+
public function getRoleInstance()
53+
{
54+
if (array_key_exists('ai.cloud.roleInstance', $this->_data)) { return $this->_data['ai.cloud.roleInstance']; }
55+
return NULL;
56+
}
57+
58+
/**
59+
* Sets the roleInstance field. Name of the instance where the application is running. Computer name for on-premisis, instance name for Azure.
60+
*/
61+
public function setRoleInstance($roleInstance)
62+
{
63+
$this->_data['ai.cloud.roleInstance'] = $roleInstance;
64+
}
65+
}

0 commit comments

Comments
 (0)