@azure/arm-computeschedule 1.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +100 -0
  4. package/dist/browser/api/computeScheduleContext.d.ts +12 -0
  5. package/dist/browser/api/computeScheduleContext.d.ts.map +1 -0
  6. package/dist/browser/api/computeScheduleContext.js +32 -0
  7. package/dist/browser/api/computeScheduleContext.js.map +1 -0
  8. package/dist/browser/api/index.d.ts +4 -0
  9. package/dist/browser/api/index.d.ts.map +1 -0
  10. package/dist/browser/api/index.js +6 -0
  11. package/dist/browser/api/index.js.map +1 -0
  12. package/dist/browser/api/operations/index.d.ts +10 -0
  13. package/dist/browser/api/operations/index.d.ts.map +1 -0
  14. package/dist/browser/api/operations/index.js +40 -0
  15. package/dist/browser/api/operations/index.js.map +1 -0
  16. package/dist/browser/api/scheduledActions/index.d.ts +41 -0
  17. package/dist/browser/api/scheduledActions/index.d.ts.map +1 -0
  18. package/dist/browser/api/scheduledActions/index.js +550 -0
  19. package/dist/browser/api/scheduledActions/index.js.map +1 -0
  20. package/dist/browser/classic/index.d.ts +3 -0
  21. package/dist/browser/classic/index.d.ts.map +1 -0
  22. package/dist/browser/classic/index.js +4 -0
  23. package/dist/browser/classic/index.js.map +1 -0
  24. package/dist/browser/classic/operations/index.d.ts +14 -0
  25. package/dist/browser/classic/operations/index.d.ts.map +1 -0
  26. package/dist/browser/classic/operations/index.js +12 -0
  27. package/dist/browser/classic/operations/index.js.map +1 -0
  28. package/dist/browser/classic/scheduledActions/index.d.ts +37 -0
  29. package/dist/browser/classic/scheduledActions/index.d.ts.map +1 -0
  30. package/dist/browser/classic/scheduledActions/index.js +20 -0
  31. package/dist/browser/classic/scheduledActions/index.js.map +1 -0
  32. package/dist/browser/computeScheduleClient.d.ts +18 -0
  33. package/dist/browser/computeScheduleClient.d.ts.map +1 -0
  34. package/dist/browser/computeScheduleClient.js +20 -0
  35. package/dist/browser/computeScheduleClient.js.map +1 -0
  36. package/dist/browser/helpers/serializerHelpers.d.ts +3 -0
  37. package/dist/browser/helpers/serializerHelpers.d.ts.map +1 -0
  38. package/dist/browser/helpers/serializerHelpers.js +24 -0
  39. package/dist/browser/helpers/serializerHelpers.js.map +1 -0
  40. package/dist/browser/index.d.ts +6 -0
  41. package/dist/browser/index.d.ts.map +1 -0
  42. package/dist/browser/index.js +5 -0
  43. package/dist/browser/index.js.map +1 -0
  44. package/dist/browser/logger.d.ts +2 -0
  45. package/dist/browser/logger.d.ts.map +1 -0
  46. package/dist/browser/logger.js +5 -0
  47. package/dist/browser/logger.js.map +1 -0
  48. package/dist/browser/models/index.d.ts +3 -0
  49. package/dist/browser/models/index.d.ts.map +1 -0
  50. package/dist/browser/models/index.js +4 -0
  51. package/dist/browser/models/index.js.map +1 -0
  52. package/dist/browser/models/models.d.ts +400 -0
  53. package/dist/browser/models/models.d.ts.map +1 -0
  54. package/dist/browser/models/models.js +159 -0
  55. package/dist/browser/models/models.js.map +1 -0
  56. package/dist/browser/models/options.d.ts +32 -0
  57. package/dist/browser/models/options.d.ts.map +1 -0
  58. package/dist/browser/models/options.js +4 -0
  59. package/dist/browser/models/options.js.map +1 -0
  60. package/dist/browser/package.json +3 -0
  61. package/dist/browser/static-helpers/pagingHelpers.d.ts +72 -0
  62. package/dist/browser/static-helpers/pagingHelpers.d.ts.map +1 -0
  63. package/dist/browser/static-helpers/pagingHelpers.js +137 -0
  64. package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
  65. package/dist/commonjs/api/computeScheduleContext.d.ts +12 -0
  66. package/dist/commonjs/api/computeScheduleContext.d.ts.map +1 -0
  67. package/dist/commonjs/api/computeScheduleContext.js +35 -0
  68. package/dist/commonjs/api/computeScheduleContext.js.map +1 -0
  69. package/dist/commonjs/api/index.d.ts +4 -0
  70. package/dist/commonjs/api/index.d.ts.map +1 -0
  71. package/dist/commonjs/api/index.js +20 -0
  72. package/dist/commonjs/api/index.js.map +1 -0
  73. package/dist/commonjs/api/operations/index.d.ts +10 -0
  74. package/dist/commonjs/api/operations/index.d.ts.map +1 -0
  75. package/dist/commonjs/api/operations/index.js +45 -0
  76. package/dist/commonjs/api/operations/index.js.map +1 -0
  77. package/dist/commonjs/api/scheduledActions/index.d.ts +41 -0
  78. package/dist/commonjs/api/scheduledActions/index.d.ts.map +1 -0
  79. package/dist/commonjs/api/scheduledActions/index.js +579 -0
  80. package/dist/commonjs/api/scheduledActions/index.js.map +1 -0
  81. package/dist/commonjs/classic/index.d.ts +3 -0
  82. package/dist/commonjs/classic/index.d.ts.map +1 -0
  83. package/dist/commonjs/classic/index.js +5 -0
  84. package/dist/commonjs/classic/index.js.map +1 -0
  85. package/dist/commonjs/classic/operations/index.d.ts +14 -0
  86. package/dist/commonjs/classic/operations/index.d.ts.map +1 -0
  87. package/dist/commonjs/classic/operations/index.js +16 -0
  88. package/dist/commonjs/classic/operations/index.js.map +1 -0
  89. package/dist/commonjs/classic/scheduledActions/index.d.ts +37 -0
  90. package/dist/commonjs/classic/scheduledActions/index.d.ts.map +1 -0
  91. package/dist/commonjs/classic/scheduledActions/index.js +24 -0
  92. package/dist/commonjs/classic/scheduledActions/index.js.map +1 -0
  93. package/dist/commonjs/computeScheduleClient.d.ts +18 -0
  94. package/dist/commonjs/computeScheduleClient.d.ts.map +1 -0
  95. package/dist/commonjs/computeScheduleClient.js +24 -0
  96. package/dist/commonjs/computeScheduleClient.js.map +1 -0
  97. package/dist/commonjs/helpers/serializerHelpers.d.ts +3 -0
  98. package/dist/commonjs/helpers/serializerHelpers.d.ts.map +1 -0
  99. package/dist/commonjs/helpers/serializerHelpers.js +27 -0
  100. package/dist/commonjs/helpers/serializerHelpers.js.map +1 -0
  101. package/dist/commonjs/index.d.ts +6 -0
  102. package/dist/commonjs/index.d.ts.map +1 -0
  103. package/dist/commonjs/index.js +15 -0
  104. package/dist/commonjs/index.js.map +1 -0
  105. package/dist/commonjs/logger.d.ts +2 -0
  106. package/dist/commonjs/logger.d.ts.map +1 -0
  107. package/dist/commonjs/logger.js +8 -0
  108. package/dist/commonjs/logger.js.map +1 -0
  109. package/dist/commonjs/models/index.d.ts +3 -0
  110. package/dist/commonjs/models/index.d.ts.map +1 -0
  111. package/dist/commonjs/models/index.js +13 -0
  112. package/dist/commonjs/models/index.js.map +1 -0
  113. package/dist/commonjs/models/models.d.ts +400 -0
  114. package/dist/commonjs/models/models.d.ts.map +1 -0
  115. package/dist/commonjs/models/models.js +175 -0
  116. package/dist/commonjs/models/models.js.map +1 -0
  117. package/dist/commonjs/models/options.d.ts +32 -0
  118. package/dist/commonjs/models/options.d.ts.map +1 -0
  119. package/dist/commonjs/models/options.js +5 -0
  120. package/dist/commonjs/models/options.js.map +1 -0
  121. package/dist/commonjs/package.json +3 -0
  122. package/dist/commonjs/static-helpers/pagingHelpers.d.ts +72 -0
  123. package/dist/commonjs/static-helpers/pagingHelpers.d.ts.map +1 -0
  124. package/dist/commonjs/static-helpers/pagingHelpers.js +140 -0
  125. package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -0
  126. package/dist/commonjs/tsdoc-metadata.json +11 -0
  127. package/dist/esm/api/computeScheduleContext.d.ts +12 -0
  128. package/dist/esm/api/computeScheduleContext.d.ts.map +1 -0
  129. package/dist/esm/api/computeScheduleContext.js +32 -0
  130. package/dist/esm/api/computeScheduleContext.js.map +1 -0
  131. package/dist/esm/api/index.d.ts +4 -0
  132. package/dist/esm/api/index.d.ts.map +1 -0
  133. package/dist/esm/api/index.js +6 -0
  134. package/dist/esm/api/index.js.map +1 -0
  135. package/dist/esm/api/operations/index.d.ts +10 -0
  136. package/dist/esm/api/operations/index.d.ts.map +1 -0
  137. package/dist/esm/api/operations/index.js +40 -0
  138. package/dist/esm/api/operations/index.js.map +1 -0
  139. package/dist/esm/api/scheduledActions/index.d.ts +41 -0
  140. package/dist/esm/api/scheduledActions/index.d.ts.map +1 -0
  141. package/dist/esm/api/scheduledActions/index.js +550 -0
  142. package/dist/esm/api/scheduledActions/index.js.map +1 -0
  143. package/dist/esm/classic/index.d.ts +3 -0
  144. package/dist/esm/classic/index.d.ts.map +1 -0
  145. package/dist/esm/classic/index.js +4 -0
  146. package/dist/esm/classic/index.js.map +1 -0
  147. package/dist/esm/classic/operations/index.d.ts +14 -0
  148. package/dist/esm/classic/operations/index.d.ts.map +1 -0
  149. package/dist/esm/classic/operations/index.js +12 -0
  150. package/dist/esm/classic/operations/index.js.map +1 -0
  151. package/dist/esm/classic/scheduledActions/index.d.ts +37 -0
  152. package/dist/esm/classic/scheduledActions/index.d.ts.map +1 -0
  153. package/dist/esm/classic/scheduledActions/index.js +20 -0
  154. package/dist/esm/classic/scheduledActions/index.js.map +1 -0
  155. package/dist/esm/computeScheduleClient.d.ts +18 -0
  156. package/dist/esm/computeScheduleClient.d.ts.map +1 -0
  157. package/dist/esm/computeScheduleClient.js +20 -0
  158. package/dist/esm/computeScheduleClient.js.map +1 -0
  159. package/dist/esm/helpers/serializerHelpers.d.ts +3 -0
  160. package/dist/esm/helpers/serializerHelpers.d.ts.map +1 -0
  161. package/dist/esm/helpers/serializerHelpers.js +24 -0
  162. package/dist/esm/helpers/serializerHelpers.js.map +1 -0
  163. package/dist/esm/index.d.ts +6 -0
  164. package/dist/esm/index.d.ts.map +1 -0
  165. package/dist/esm/index.js +5 -0
  166. package/dist/esm/index.js.map +1 -0
  167. package/dist/esm/logger.d.ts +2 -0
  168. package/dist/esm/logger.d.ts.map +1 -0
  169. package/dist/esm/logger.js +5 -0
  170. package/dist/esm/logger.js.map +1 -0
  171. package/dist/esm/models/index.d.ts +3 -0
  172. package/dist/esm/models/index.d.ts.map +1 -0
  173. package/dist/esm/models/index.js +4 -0
  174. package/dist/esm/models/index.js.map +1 -0
  175. package/dist/esm/models/models.d.ts +400 -0
  176. package/dist/esm/models/models.d.ts.map +1 -0
  177. package/dist/esm/models/models.js +159 -0
  178. package/dist/esm/models/models.js.map +1 -0
  179. package/dist/esm/models/options.d.ts +32 -0
  180. package/dist/esm/models/options.d.ts.map +1 -0
  181. package/dist/esm/models/options.js +4 -0
  182. package/dist/esm/models/options.js.map +1 -0
  183. package/dist/esm/package.json +3 -0
  184. package/dist/esm/static-helpers/pagingHelpers.d.ts +72 -0
  185. package/dist/esm/static-helpers/pagingHelpers.d.ts.map +1 -0
  186. package/dist/esm/static-helpers/pagingHelpers.js +137 -0
  187. package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
  188. package/dist/react-native/api/computeScheduleContext.d.ts +12 -0
  189. package/dist/react-native/api/computeScheduleContext.d.ts.map +1 -0
  190. package/dist/react-native/api/computeScheduleContext.js +32 -0
  191. package/dist/react-native/api/computeScheduleContext.js.map +1 -0
  192. package/dist/react-native/api/index.d.ts +4 -0
  193. package/dist/react-native/api/index.d.ts.map +1 -0
  194. package/dist/react-native/api/index.js +6 -0
  195. package/dist/react-native/api/index.js.map +1 -0
  196. package/dist/react-native/api/operations/index.d.ts +10 -0
  197. package/dist/react-native/api/operations/index.d.ts.map +1 -0
  198. package/dist/react-native/api/operations/index.js +40 -0
  199. package/dist/react-native/api/operations/index.js.map +1 -0
  200. package/dist/react-native/api/scheduledActions/index.d.ts +41 -0
  201. package/dist/react-native/api/scheduledActions/index.d.ts.map +1 -0
  202. package/dist/react-native/api/scheduledActions/index.js +550 -0
  203. package/dist/react-native/api/scheduledActions/index.js.map +1 -0
  204. package/dist/react-native/classic/index.d.ts +3 -0
  205. package/dist/react-native/classic/index.d.ts.map +1 -0
  206. package/dist/react-native/classic/index.js +4 -0
  207. package/dist/react-native/classic/index.js.map +1 -0
  208. package/dist/react-native/classic/operations/index.d.ts +14 -0
  209. package/dist/react-native/classic/operations/index.d.ts.map +1 -0
  210. package/dist/react-native/classic/operations/index.js +12 -0
  211. package/dist/react-native/classic/operations/index.js.map +1 -0
  212. package/dist/react-native/classic/scheduledActions/index.d.ts +37 -0
  213. package/dist/react-native/classic/scheduledActions/index.d.ts.map +1 -0
  214. package/dist/react-native/classic/scheduledActions/index.js +20 -0
  215. package/dist/react-native/classic/scheduledActions/index.js.map +1 -0
  216. package/dist/react-native/computeScheduleClient.d.ts +18 -0
  217. package/dist/react-native/computeScheduleClient.d.ts.map +1 -0
  218. package/dist/react-native/computeScheduleClient.js +20 -0
  219. package/dist/react-native/computeScheduleClient.js.map +1 -0
  220. package/dist/react-native/helpers/serializerHelpers.d.ts +3 -0
  221. package/dist/react-native/helpers/serializerHelpers.d.ts.map +1 -0
  222. package/dist/react-native/helpers/serializerHelpers.js +24 -0
  223. package/dist/react-native/helpers/serializerHelpers.js.map +1 -0
  224. package/dist/react-native/index.d.ts +6 -0
  225. package/dist/react-native/index.d.ts.map +1 -0
  226. package/dist/react-native/index.js +5 -0
  227. package/dist/react-native/index.js.map +1 -0
  228. package/dist/react-native/logger.d.ts +2 -0
  229. package/dist/react-native/logger.d.ts.map +1 -0
  230. package/dist/react-native/logger.js +5 -0
  231. package/dist/react-native/logger.js.map +1 -0
  232. package/dist/react-native/models/index.d.ts +3 -0
  233. package/dist/react-native/models/index.d.ts.map +1 -0
  234. package/dist/react-native/models/index.js +4 -0
  235. package/dist/react-native/models/index.js.map +1 -0
  236. package/dist/react-native/models/models.d.ts +400 -0
  237. package/dist/react-native/models/models.d.ts.map +1 -0
  238. package/dist/react-native/models/models.js +159 -0
  239. package/dist/react-native/models/models.js.map +1 -0
  240. package/dist/react-native/models/options.d.ts +32 -0
  241. package/dist/react-native/models/options.d.ts.map +1 -0
  242. package/dist/react-native/models/options.js +4 -0
  243. package/dist/react-native/models/options.js.map +1 -0
  244. package/dist/react-native/package.json +3 -0
  245. package/dist/react-native/static-helpers/pagingHelpers.d.ts +72 -0
  246. package/dist/react-native/static-helpers/pagingHelpers.d.ts.map +1 -0
  247. package/dist/react-native/static-helpers/pagingHelpers.js +137 -0
  248. package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -0
  249. package/package.json +169 -0
  250. package/review/arm-computeschedule-models.api.md +306 -0
  251. package/review/arm-computeschedule.api.md +357 -0
@@ -0,0 +1,550 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { scheduleSerializer, executionParametersSerializer, resourcesSerializer, } from "../../models/models.js";
4
+ import { operationOptionsToRequestParameters, createRestError, } from "@azure-rest/core-client";
5
+ export function _scheduledActionsVirtualMachinesSubmitDeallocateSend(context, subscriptionId, locationparameter, requestBody, options = {
6
+ requestOptions: {},
7
+ }) {
8
+ return context
9
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDeallocate", subscriptionId, locationparameter)
10
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
11
+ schedule: scheduleSerializer(requestBody.schedule),
12
+ executionParameters: executionParametersSerializer(requestBody.executionParameters),
13
+ resources: resourcesSerializer(requestBody.resources),
14
+ correlationid: requestBody["correlationid"],
15
+ } }));
16
+ }
17
+ export async function _scheduledActionsVirtualMachinesSubmitDeallocateDeserialize(result) {
18
+ const expectedStatuses = ["200"];
19
+ if (!expectedStatuses.includes(result.status)) {
20
+ throw createRestError(result);
21
+ }
22
+ return {
23
+ description: result.body["description"],
24
+ type: result.body["type"],
25
+ location: result.body["location"],
26
+ results: result.body["results"] === undefined
27
+ ? result.body["results"]
28
+ : result.body["results"].map((p) => {
29
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
30
+ return {
31
+ resourceId: p["resourceId"],
32
+ errorCode: p["errorCode"],
33
+ errorDetails: p["errorDetails"],
34
+ operation: !p.operation
35
+ ? undefined
36
+ : {
37
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
38
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
39
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
40
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
41
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
42
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
43
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
44
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
45
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
46
+ ? undefined
47
+ : {
48
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
49
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
50
+ },
51
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
52
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
53
+ ? undefined
54
+ : {
55
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
56
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
57
+ },
58
+ },
59
+ };
60
+ }),
61
+ };
62
+ }
63
+ /** virtualMachinesSubmitDeallocate: submitDeallocate for a virtual machine */
64
+ export async function scheduledActionsVirtualMachinesSubmitDeallocate(context, subscriptionId, locationparameter, requestBody, options = {
65
+ requestOptions: {},
66
+ }) {
67
+ const result = await _scheduledActionsVirtualMachinesSubmitDeallocateSend(context, subscriptionId, locationparameter, requestBody, options);
68
+ return _scheduledActionsVirtualMachinesSubmitDeallocateDeserialize(result);
69
+ }
70
+ export function _scheduledActionsVirtualMachinesSubmitHibernateSend(context, subscriptionId, locationparameter, requestBody, options = {
71
+ requestOptions: {},
72
+ }) {
73
+ return context
74
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitHibernate", subscriptionId, locationparameter)
75
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
76
+ schedule: scheduleSerializer(requestBody.schedule),
77
+ executionParameters: executionParametersSerializer(requestBody.executionParameters),
78
+ resources: resourcesSerializer(requestBody.resources),
79
+ correlationid: requestBody["correlationid"],
80
+ } }));
81
+ }
82
+ export async function _scheduledActionsVirtualMachinesSubmitHibernateDeserialize(result) {
83
+ const expectedStatuses = ["200"];
84
+ if (!expectedStatuses.includes(result.status)) {
85
+ throw createRestError(result);
86
+ }
87
+ return {
88
+ description: result.body["description"],
89
+ type: result.body["type"],
90
+ location: result.body["location"],
91
+ results: result.body["results"] === undefined
92
+ ? result.body["results"]
93
+ : result.body["results"].map((p) => {
94
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
95
+ return {
96
+ resourceId: p["resourceId"],
97
+ errorCode: p["errorCode"],
98
+ errorDetails: p["errorDetails"],
99
+ operation: !p.operation
100
+ ? undefined
101
+ : {
102
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
103
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
104
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
105
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
106
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
107
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
108
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
109
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
110
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
111
+ ? undefined
112
+ : {
113
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
114
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
115
+ },
116
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
117
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
118
+ ? undefined
119
+ : {
120
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
121
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
122
+ },
123
+ },
124
+ };
125
+ }),
126
+ };
127
+ }
128
+ /** virtualMachinesSubmitHibernate: submitHibernate for a virtual machine */
129
+ export async function scheduledActionsVirtualMachinesSubmitHibernate(context, subscriptionId, locationparameter, requestBody, options = {
130
+ requestOptions: {},
131
+ }) {
132
+ const result = await _scheduledActionsVirtualMachinesSubmitHibernateSend(context, subscriptionId, locationparameter, requestBody, options);
133
+ return _scheduledActionsVirtualMachinesSubmitHibernateDeserialize(result);
134
+ }
135
+ export function _scheduledActionsVirtualMachinesSubmitStartSend(context, subscriptionId, locationparameter, requestBody, options = {
136
+ requestOptions: {},
137
+ }) {
138
+ return context
139
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitStart", subscriptionId, locationparameter)
140
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
141
+ schedule: scheduleSerializer(requestBody.schedule),
142
+ executionParameters: executionParametersSerializer(requestBody.executionParameters),
143
+ resources: resourcesSerializer(requestBody.resources),
144
+ correlationid: requestBody["correlationid"],
145
+ } }));
146
+ }
147
+ export async function _scheduledActionsVirtualMachinesSubmitStartDeserialize(result) {
148
+ const expectedStatuses = ["200"];
149
+ if (!expectedStatuses.includes(result.status)) {
150
+ throw createRestError(result);
151
+ }
152
+ return {
153
+ description: result.body["description"],
154
+ type: result.body["type"],
155
+ location: result.body["location"],
156
+ results: result.body["results"] === undefined
157
+ ? result.body["results"]
158
+ : result.body["results"].map((p) => {
159
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
160
+ return {
161
+ resourceId: p["resourceId"],
162
+ errorCode: p["errorCode"],
163
+ errorDetails: p["errorDetails"],
164
+ operation: !p.operation
165
+ ? undefined
166
+ : {
167
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
168
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
169
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
170
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
171
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
172
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
173
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
174
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
175
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
176
+ ? undefined
177
+ : {
178
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
179
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
180
+ },
181
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
182
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
183
+ ? undefined
184
+ : {
185
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
186
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
187
+ },
188
+ },
189
+ };
190
+ }),
191
+ };
192
+ }
193
+ /** virtualMachinesSubmitStart: submitStart for a virtual machine */
194
+ export async function scheduledActionsVirtualMachinesSubmitStart(context, subscriptionId, locationparameter, requestBody, options = {
195
+ requestOptions: {},
196
+ }) {
197
+ const result = await _scheduledActionsVirtualMachinesSubmitStartSend(context, subscriptionId, locationparameter, requestBody, options);
198
+ return _scheduledActionsVirtualMachinesSubmitStartDeserialize(result);
199
+ }
200
+ export function _scheduledActionsVirtualMachinesExecuteDeallocateSend(context, subscriptionId, locationparameter, requestBody, options = {
201
+ requestOptions: {},
202
+ }) {
203
+ return context
204
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDeallocate", subscriptionId, locationparameter)
205
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
206
+ executionParameters: executionParametersSerializer(requestBody.executionParameters),
207
+ resources: resourcesSerializer(requestBody.resources),
208
+ correlationid: requestBody["correlationid"],
209
+ } }));
210
+ }
211
+ export async function _scheduledActionsVirtualMachinesExecuteDeallocateDeserialize(result) {
212
+ const expectedStatuses = ["200"];
213
+ if (!expectedStatuses.includes(result.status)) {
214
+ throw createRestError(result);
215
+ }
216
+ return {
217
+ description: result.body["description"],
218
+ type: result.body["type"],
219
+ location: result.body["location"],
220
+ results: result.body["results"] === undefined
221
+ ? result.body["results"]
222
+ : result.body["results"].map((p) => {
223
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
224
+ return {
225
+ resourceId: p["resourceId"],
226
+ errorCode: p["errorCode"],
227
+ errorDetails: p["errorDetails"],
228
+ operation: !p.operation
229
+ ? undefined
230
+ : {
231
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
232
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
233
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
234
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
235
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
236
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
237
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
238
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
239
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
240
+ ? undefined
241
+ : {
242
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
243
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
244
+ },
245
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
246
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
247
+ ? undefined
248
+ : {
249
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
250
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
251
+ },
252
+ },
253
+ };
254
+ }),
255
+ };
256
+ }
257
+ /** virtualMachinesExecuteDeallocate: executeDeallocate for a virtual machine */
258
+ export async function scheduledActionsVirtualMachinesExecuteDeallocate(context, subscriptionId, locationparameter, requestBody, options = {
259
+ requestOptions: {},
260
+ }) {
261
+ const result = await _scheduledActionsVirtualMachinesExecuteDeallocateSend(context, subscriptionId, locationparameter, requestBody, options);
262
+ return _scheduledActionsVirtualMachinesExecuteDeallocateDeserialize(result);
263
+ }
264
+ export function _scheduledActionsVirtualMachinesExecuteHibernateSend(context, subscriptionId, locationparameter, requestBody, options = {
265
+ requestOptions: {},
266
+ }) {
267
+ return context
268
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteHibernate", subscriptionId, locationparameter)
269
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
270
+ executionParameters: executionParametersSerializer(requestBody.executionParameters),
271
+ resources: resourcesSerializer(requestBody.resources),
272
+ correlationid: requestBody["correlationid"],
273
+ } }));
274
+ }
275
+ export async function _scheduledActionsVirtualMachinesExecuteHibernateDeserialize(result) {
276
+ const expectedStatuses = ["200"];
277
+ if (!expectedStatuses.includes(result.status)) {
278
+ throw createRestError(result);
279
+ }
280
+ return {
281
+ description: result.body["description"],
282
+ type: result.body["type"],
283
+ location: result.body["location"],
284
+ results: result.body["results"] === undefined
285
+ ? result.body["results"]
286
+ : result.body["results"].map((p) => {
287
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
288
+ return {
289
+ resourceId: p["resourceId"],
290
+ errorCode: p["errorCode"],
291
+ errorDetails: p["errorDetails"],
292
+ operation: !p.operation
293
+ ? undefined
294
+ : {
295
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
296
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
297
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
298
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
299
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
300
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
301
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
302
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
303
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
304
+ ? undefined
305
+ : {
306
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
307
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
308
+ },
309
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
310
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
311
+ ? undefined
312
+ : {
313
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
314
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
315
+ },
316
+ },
317
+ };
318
+ }),
319
+ };
320
+ }
321
+ /** virtualMachinesExecuteHibernate: executeHibernate for a virtual machine */
322
+ export async function scheduledActionsVirtualMachinesExecuteHibernate(context, subscriptionId, locationparameter, requestBody, options = {
323
+ requestOptions: {},
324
+ }) {
325
+ const result = await _scheduledActionsVirtualMachinesExecuteHibernateSend(context, subscriptionId, locationparameter, requestBody, options);
326
+ return _scheduledActionsVirtualMachinesExecuteHibernateDeserialize(result);
327
+ }
328
+ export function _scheduledActionsVirtualMachinesExecuteStartSend(context, subscriptionId, locationparameter, requestBody, options = {
329
+ requestOptions: {},
330
+ }) {
331
+ return context
332
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteStart", subscriptionId, locationparameter)
333
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
334
+ executionParameters: executionParametersSerializer(requestBody.executionParameters),
335
+ resources: resourcesSerializer(requestBody.resources),
336
+ correlationid: requestBody["correlationid"],
337
+ } }));
338
+ }
339
+ export async function _scheduledActionsVirtualMachinesExecuteStartDeserialize(result) {
340
+ const expectedStatuses = ["200"];
341
+ if (!expectedStatuses.includes(result.status)) {
342
+ throw createRestError(result);
343
+ }
344
+ return {
345
+ description: result.body["description"],
346
+ type: result.body["type"],
347
+ location: result.body["location"],
348
+ results: result.body["results"] === undefined
349
+ ? result.body["results"]
350
+ : result.body["results"].map((p) => {
351
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
352
+ return {
353
+ resourceId: p["resourceId"],
354
+ errorCode: p["errorCode"],
355
+ errorDetails: p["errorDetails"],
356
+ operation: !p.operation
357
+ ? undefined
358
+ : {
359
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
360
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
361
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
362
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
363
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
364
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
365
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
366
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
367
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
368
+ ? undefined
369
+ : {
370
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
371
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
372
+ },
373
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
374
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
375
+ ? undefined
376
+ : {
377
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
378
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
379
+ },
380
+ },
381
+ };
382
+ }),
383
+ };
384
+ }
385
+ /** virtualMachinesExecuteStart: executeStart for a virtual machine */
386
+ export async function scheduledActionsVirtualMachinesExecuteStart(context, subscriptionId, locationparameter, requestBody, options = {
387
+ requestOptions: {},
388
+ }) {
389
+ const result = await _scheduledActionsVirtualMachinesExecuteStartSend(context, subscriptionId, locationparameter, requestBody, options);
390
+ return _scheduledActionsVirtualMachinesExecuteStartDeserialize(result);
391
+ }
392
+ export function _scheduledActionsVirtualMachinesGetOperationStatusSend(context, subscriptionId, locationparameter, requestBody, options = {
393
+ requestOptions: {},
394
+ }) {
395
+ return context
396
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationStatus", subscriptionId, locationparameter)
397
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
398
+ operationIds: requestBody["operationIds"],
399
+ correlationid: requestBody["correlationid"],
400
+ } }));
401
+ }
402
+ export async function _scheduledActionsVirtualMachinesGetOperationStatusDeserialize(result) {
403
+ const expectedStatuses = ["200"];
404
+ if (!expectedStatuses.includes(result.status)) {
405
+ throw createRestError(result);
406
+ }
407
+ return {
408
+ results: result.body["results"].map((p) => {
409
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
410
+ return {
411
+ resourceId: p["resourceId"],
412
+ errorCode: p["errorCode"],
413
+ errorDetails: p["errorDetails"],
414
+ operation: !p.operation
415
+ ? undefined
416
+ : {
417
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
418
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
419
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
420
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
421
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
422
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
423
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
424
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
425
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
426
+ ? undefined
427
+ : {
428
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
429
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
430
+ },
431
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
432
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
433
+ ? undefined
434
+ : {
435
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
436
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
437
+ },
438
+ },
439
+ };
440
+ }),
441
+ };
442
+ }
443
+ /** virtualMachinesGetOperationStatus: getOperationStatus for a virtual machine */
444
+ export async function scheduledActionsVirtualMachinesGetOperationStatus(context, subscriptionId, locationparameter, requestBody, options = {
445
+ requestOptions: {},
446
+ }) {
447
+ const result = await _scheduledActionsVirtualMachinesGetOperationStatusSend(context, subscriptionId, locationparameter, requestBody, options);
448
+ return _scheduledActionsVirtualMachinesGetOperationStatusDeserialize(result);
449
+ }
450
+ export function _scheduledActionsVirtualMachinesCancelOperationsSend(context, subscriptionId, locationparameter, requestBody, options = {
451
+ requestOptions: {},
452
+ }) {
453
+ return context
454
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesCancelOperations", subscriptionId, locationparameter)
455
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: {
456
+ operationIds: requestBody["operationIds"],
457
+ correlationid: requestBody["correlationid"],
458
+ } }));
459
+ }
460
+ export async function _scheduledActionsVirtualMachinesCancelOperationsDeserialize(result) {
461
+ const expectedStatuses = ["200"];
462
+ if (!expectedStatuses.includes(result.status)) {
463
+ throw createRestError(result);
464
+ }
465
+ return {
466
+ results: result.body["results"].map((p) => {
467
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
468
+ return {
469
+ resourceId: p["resourceId"],
470
+ errorCode: p["errorCode"],
471
+ errorDetails: p["errorDetails"],
472
+ operation: !p.operation
473
+ ? undefined
474
+ : {
475
+ operationId: (_a = p.operation) === null || _a === void 0 ? void 0 : _a["operationId"],
476
+ resourceId: (_b = p.operation) === null || _b === void 0 ? void 0 : _b["resourceId"],
477
+ opType: (_c = p.operation) === null || _c === void 0 ? void 0 : _c["opType"],
478
+ subscriptionId: (_d = p.operation) === null || _d === void 0 ? void 0 : _d["subscriptionId"],
479
+ deadline: (_e = p.operation) === null || _e === void 0 ? void 0 : _e["deadline"],
480
+ deadlineType: (_f = p.operation) === null || _f === void 0 ? void 0 : _f["deadlineType"],
481
+ state: (_g = p.operation) === null || _g === void 0 ? void 0 : _g["state"],
482
+ timeZone: (_h = p.operation) === null || _h === void 0 ? void 0 : _h["timeZone"],
483
+ resourceOperationError: !((_j = p.operation) === null || _j === void 0 ? void 0 : _j.resourceOperationError)
484
+ ? undefined
485
+ : {
486
+ errorCode: (_l = (_k = p.operation) === null || _k === void 0 ? void 0 : _k.resourceOperationError) === null || _l === void 0 ? void 0 : _l["errorCode"],
487
+ errorDetails: (_o = (_m = p.operation) === null || _m === void 0 ? void 0 : _m.resourceOperationError) === null || _o === void 0 ? void 0 : _o["errorDetails"],
488
+ },
489
+ completedAt: (_p = p.operation) === null || _p === void 0 ? void 0 : _p["completedAt"],
490
+ retryPolicy: !((_q = p.operation) === null || _q === void 0 ? void 0 : _q.retryPolicy)
491
+ ? undefined
492
+ : {
493
+ retryCount: (_s = (_r = p.operation) === null || _r === void 0 ? void 0 : _r.retryPolicy) === null || _s === void 0 ? void 0 : _s["retryCount"],
494
+ retryWindowInMinutes: (_u = (_t = p.operation) === null || _t === void 0 ? void 0 : _t.retryPolicy) === null || _u === void 0 ? void 0 : _u["retryWindowInMinutes"],
495
+ },
496
+ },
497
+ };
498
+ }),
499
+ };
500
+ }
501
+ /** virtualMachinesCancelOperations: cancelOperations for a virtual machine */
502
+ export async function scheduledActionsVirtualMachinesCancelOperations(context, subscriptionId, locationparameter, requestBody, options = {
503
+ requestOptions: {},
504
+ }) {
505
+ const result = await _scheduledActionsVirtualMachinesCancelOperationsSend(context, subscriptionId, locationparameter, requestBody, options);
506
+ return _scheduledActionsVirtualMachinesCancelOperationsDeserialize(result);
507
+ }
508
+ export function _scheduledActionsVirtualMachinesGetOperationErrorsSend(context, subscriptionId, locationparameter, requestBody, options = {
509
+ requestOptions: {},
510
+ }) {
511
+ return context
512
+ .path("/subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesGetOperationErrors", subscriptionId, locationparameter)
513
+ .post(Object.assign(Object.assign({}, operationOptionsToRequestParameters(options)), { body: { operationIds: requestBody["operationIds"] } }));
514
+ }
515
+ export async function _scheduledActionsVirtualMachinesGetOperationErrorsDeserialize(result) {
516
+ const expectedStatuses = ["200"];
517
+ if (!expectedStatuses.includes(result.status)) {
518
+ throw createRestError(result);
519
+ }
520
+ return {
521
+ results: result.body["results"].map((p) => {
522
+ return {
523
+ operationId: p["operationId"],
524
+ creationTime: p["creationTime"],
525
+ activationTime: p["activationTime"],
526
+ completedAt: p["completedAt"],
527
+ operationErrors: p["operationErrors"] === undefined
528
+ ? p["operationErrors"]
529
+ : p["operationErrors"].map((p) => {
530
+ return {
531
+ errorCode: p["errorCode"],
532
+ errorDetails: p["errorDetails"],
533
+ timeStamp: p["timeStamp"],
534
+ crpOperationId: p["crpOperationId"],
535
+ };
536
+ }),
537
+ requestErrorCode: p["requestErrorCode"],
538
+ requestErrorDetails: p["requestErrorDetails"],
539
+ };
540
+ }),
541
+ };
542
+ }
543
+ /** virtualMachinesGetOperationErrors: getOperationErrors associated with an operation on a virtual machine */
544
+ export async function scheduledActionsVirtualMachinesGetOperationErrors(context, subscriptionId, locationparameter, requestBody, options = {
545
+ requestOptions: {},
546
+ }) {
547
+ const result = await _scheduledActionsVirtualMachinesGetOperationErrorsSend(context, subscriptionId, locationparameter, requestBody, options);
548
+ return _scheduledActionsVirtualMachinesGetOperationErrorsDeserialize(result);
549
+ }
550
+ //# sourceMappingURL=index.js.map