forked from Azure/azure-sdk-for-net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArmComputeScheduleModelFactory.cs
More file actions
531 lines (478 loc) · 36.9 KB
/
ArmComputeScheduleModelFactory.cs
File metadata and controls
531 lines (478 loc) · 36.9 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using Azure.Core;
using Azure.ResourceManager.Models;
namespace Azure.ResourceManager.ComputeSchedule.Models
{
/// <summary> Model factory for models. </summary>
public static partial class ArmComputeScheduleModelFactory
{
/// <summary> Initializes a new instance of <see cref="Models.UserRequestSchedule"/>. </summary>
/// <param name="deadline"> The deadline for the operation. </param>
/// <param name="userRequestDeadline"> The deadline for the operation. </param>
/// <param name="timezone"> The timezone for the operation. </param>
/// <param name="userRequestTimezone"> The timezone for the operation. </param>
/// <param name="deadlineType"> The deadlinetype of the operation, this can either be InitiateAt or CompleteBy. </param>
/// <returns> A new <see cref="Models.UserRequestSchedule"/> instance for mocking. </returns>
public static UserRequestSchedule UserRequestSchedule(DateTimeOffset? deadline = null, DateTimeOffset? userRequestDeadline = null, string timezone = null, string userRequestTimezone = null, ScheduledActionDeadlineType deadlineType = default)
{
return new UserRequestSchedule(
deadline,
userRequestDeadline,
timezone,
userRequestTimezone,
deadlineType,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.DeallocateResourceOperationResult"/>. </summary>
/// <param name="description"> The description of the operation response. </param>
/// <param name="resourceType"> The type of resources used in the deallocate request eg virtual machines. </param>
/// <param name="location"> The location of the deallocate request eg westus. </param>
/// <param name="results"> The results from the deallocate request if no errors exist. </param>
/// <returns> A new <see cref="Models.DeallocateResourceOperationResult"/> instance for mocking. </returns>
public static DeallocateResourceOperationResult DeallocateResourceOperationResult(string description = null, string resourceType = null, AzureLocation location = default, IEnumerable<ResourceOperationResult> results = null)
{
results ??= new List<ResourceOperationResult>();
return new DeallocateResourceOperationResult(description, resourceType, location, results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ResourceOperationResult"/>. </summary>
/// <param name="resourceId"> Unique identifier for the resource involved in the operation, eg ArmId. </param>
/// <param name="errorCode"> Resource level error code if it exists. </param>
/// <param name="errorDetails"> Resource level error details if they exist. </param>
/// <param name="operation"> Details of the operation performed on a resource. </param>
/// <returns> A new <see cref="Models.ResourceOperationResult"/> instance for mocking. </returns>
public static ResourceOperationResult ResourceOperationResult(ResourceIdentifier resourceId = null, string errorCode = null, string errorDetails = null, ResourceOperationDetails operation = null)
{
return new ResourceOperationResult(resourceId, errorCode, errorDetails, operation, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ResourceOperationDetails"/>. </summary>
/// <param name="operationId"> Operation identifier for the unique operation. </param>
/// <param name="resourceId"> Unique identifier for the resource involved in the operation, eg ArmId. </param>
/// <param name="opType"> Type of operation performed on the resources. </param>
/// <param name="subscriptionId"> Subscription id attached to the request. </param>
/// <param name="deadline"> Deadline for the operation. </param>
/// <param name="deadlineType"> Type of deadline of the operation. </param>
/// <param name="state"> Current state of the operation. </param>
/// <param name="timezone"> Timezone for the operation. </param>
/// <param name="operationTimezone"> Timezone for the operation. </param>
/// <param name="resourceOperationError"> Operation level errors if they exist. </param>
/// <param name="completedOn"> Time the operation was complete if errors are null. </param>
/// <param name="retryPolicy"> Retry policy the user can pass. </param>
/// <returns> A new <see cref="Models.ResourceOperationDetails"/> instance for mocking. </returns>
public static ResourceOperationDetails ResourceOperationDetails(string operationId = null, ResourceIdentifier resourceId = null, ResourceOperationType? opType = null, string subscriptionId = null, DateTimeOffset? deadline = null, ScheduledActionDeadlineType? deadlineType = null, ScheduledActionOperationState? state = null, string timezone = null, string operationTimezone = null, ResourceOperationError resourceOperationError = null, DateTimeOffset? completedOn = null, UserRequestRetryPolicy retryPolicy = null)
{
return new ResourceOperationDetails(
operationId,
resourceId,
opType,
subscriptionId,
deadline,
deadlineType,
state,
timezone,
operationTimezone,
resourceOperationError,
completedOn,
retryPolicy,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ResourceOperationError"/>. </summary>
/// <param name="errorCode"> Code for the error eg 404, 500. </param>
/// <param name="errorDetails"> Detailed message about the error. </param>
/// <returns> A new <see cref="Models.ResourceOperationError"/> instance for mocking. </returns>
public static ResourceOperationError ResourceOperationError(string errorCode = null, string errorDetails = null)
{
return new ResourceOperationError(errorCode, errorDetails, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.HibernateResourceOperationResult"/>. </summary>
/// <param name="description"> The description of the operation response. </param>
/// <param name="resourceType"> The type of resources used in the Hibernate request eg virtual machines. </param>
/// <param name="location"> The location of the Hibernate request eg westus. </param>
/// <param name="results"> The results from the Hibernate request if no errors exist. </param>
/// <returns> A new <see cref="Models.HibernateResourceOperationResult"/> instance for mocking. </returns>
public static HibernateResourceOperationResult HibernateResourceOperationResult(string description = null, string resourceType = null, AzureLocation location = default, IEnumerable<ResourceOperationResult> results = null)
{
results ??= new List<ResourceOperationResult>();
return new HibernateResourceOperationResult(description, resourceType, location, results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.StartResourceOperationResult"/>. </summary>
/// <param name="description"> The description of the operation response. </param>
/// <param name="resourceType"> The type of resources used in the start request eg virtual machines. </param>
/// <param name="location"> The location of the start request eg westus. </param>
/// <param name="results"> The results from the start request if no errors exist. </param>
/// <returns> A new <see cref="Models.StartResourceOperationResult"/> instance for mocking. </returns>
public static StartResourceOperationResult StartResourceOperationResult(string description = null, string resourceType = null, AzureLocation location = default, IEnumerable<ResourceOperationResult> results = null)
{
results ??= new List<ResourceOperationResult>();
return new StartResourceOperationResult(description, resourceType, location, results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ExecuteCreateContent"/>. </summary>
/// <param name="resourceConfigParameters"> resource creation payload. </param>
/// <param name="executionParameters"> The execution parameters for the request. </param>
/// <param name="correlationId"> CorrelationId item. </param>
/// <returns> A new <see cref="Models.ExecuteCreateContent"/> instance for mocking. </returns>
public static ExecuteCreateContent ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters = null, ScheduledActionExecutionParameterDetail executionParameters = null, string correlationId = null)
{
return new ExecuteCreateContent(resourceConfigParameters, executionParameters, correlationId, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ResourceProvisionPayload"/>. </summary>
/// <param name="baseProfile"> JSON object that contains VM properties that are common across all VMs in this batch (if you want to create 100 VMs in this request, and they all have same vmSize, then include vmSize in baseProfile). </param>
/// <param name="resourceOverrides"> JSON array, that contains VM properties that should to be overridden for each VM in the batch (if you want to create 100 VMs, they all need a distinct computerName property, you pass computerNames for each VM in batch in this array), service will merge baseProfile with VM specific overrides and create a merged VMProfile. </param>
/// <param name="resourceCount"> Number of VMs to be created. </param>
/// <param name="resourcePrefix"> if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. </param>
/// <returns> A new <see cref="Models.ResourceProvisionPayload"/> instance for mocking. </returns>
public static ResourceProvisionPayload ResourceProvisionPayload(IDictionary<string, BinaryData> baseProfile = null, IEnumerable<IDictionary<string, BinaryData>> resourceOverrides = null, int resourceCount = default, string resourcePrefix = null)
{
baseProfile ??= new Dictionary<string, BinaryData>();
resourceOverrides ??= new List<IDictionary<string, BinaryData>>();
return new ResourceProvisionPayload(baseProfile, resourceOverrides?.ToList(), resourceCount, resourcePrefix, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.CreateResourceOperationResult"/>. </summary>
/// <param name="description"> The description of the operation response. </param>
/// <param name="type"> The type of resources used in the create request eg virtual machines. </param>
/// <param name="location"> The location of the start request eg westus. </param>
/// <param name="results"> The results from the start request if no errors exist. </param>
/// <returns> A new <see cref="Models.CreateResourceOperationResult"/> instance for mocking. </returns>
public static CreateResourceOperationResult CreateResourceOperationResult(string description = null, string type = null, AzureLocation location = default, IEnumerable<ResourceOperationResult> results = null)
{
results ??= new List<ResourceOperationResult>();
return new CreateResourceOperationResult(description, type, location, results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ExecuteDeleteContent"/>. </summary>
/// <param name="executionParameters"> The execution parameters for the request. </param>
/// <param name="resourcesIds"> The resources for the request. </param>
/// <param name="correlationId"> CorrelationId item. </param>
/// <param name="isForceDeletion"> Forced delete resource item. </param>
/// <returns> A new <see cref="Models.ExecuteDeleteContent"/> instance for mocking. </returns>
public static ExecuteDeleteContent ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters = null, IEnumerable<ResourceIdentifier> resourcesIds = null, string correlationId = null, bool? isForceDeletion = null)
{
resourcesIds ??= new List<ResourceIdentifier>();
return new ExecuteDeleteContent(executionParameters, resourcesIds != null ? new UserRequestResources(resourcesIds?.ToList(), serializedAdditionalRawData: null) : null, correlationId, isForceDeletion, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.DeleteResourceOperationResult"/>. </summary>
/// <param name="description"> The description of the operation response. </param>
/// <param name="type"> The type of resources used in the delete request eg virtual machines. </param>
/// <param name="location"> The location of the start request eg westus. </param>
/// <param name="results"> The results from the start request if no errors exist. </param>
/// <returns> A new <see cref="Models.DeleteResourceOperationResult"/> instance for mocking. </returns>
public static DeleteResourceOperationResult DeleteResourceOperationResult(string description = null, string type = null, AzureLocation location = default, IEnumerable<ResourceOperationResult> results = null)
{
results ??= new List<ResourceOperationResult>();
return new DeleteResourceOperationResult(description, type, location, results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.GetOperationStatusResult"/>. </summary>
/// <param name="results"> An array of resource operations based on their operation ids. </param>
/// <returns> A new <see cref="Models.GetOperationStatusResult"/> instance for mocking. </returns>
public static GetOperationStatusResult GetOperationStatusResult(IEnumerable<ResourceOperationResult> results = null)
{
results ??= new List<ResourceOperationResult>();
return new GetOperationStatusResult(results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.CancelOperationsResult"/>. </summary>
/// <param name="results"> An array of resource operations that were successfully cancelled. </param>
/// <returns> A new <see cref="Models.CancelOperationsResult"/> instance for mocking. </returns>
public static CancelOperationsResult CancelOperationsResult(IEnumerable<ResourceOperationResult> results = null)
{
results ??= new List<ResourceOperationResult>();
return new CancelOperationsResult(results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.GetOperationErrorsResult"/>. </summary>
/// <param name="results"> An array of operationids and their corresponding errors if any. </param>
/// <returns> A new <see cref="Models.GetOperationErrorsResult"/> instance for mocking. </returns>
public static GetOperationErrorsResult GetOperationErrorsResult(IEnumerable<OperationErrorsResult> results = null)
{
results ??= new List<OperationErrorsResult>();
return new GetOperationErrorsResult(results?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.OperationErrorsResult"/>. </summary>
/// <param name="operationId"> The operationId identifying a vm operation. </param>
/// <param name="createdOn"> The creation time of the error result. </param>
/// <param name="activationOn"> The activation time of a vm operation. </param>
/// <param name="completedOn"> The completion time of the operation if the operation was completed. </param>
/// <param name="operationErrors"> A list of errors associated with the operationid. </param>
/// <param name="requestErrorCode"> Request level error code. </param>
/// <param name="requestErrorDetails"> Request level error details. </param>
/// <returns> A new <see cref="Models.OperationErrorsResult"/> instance for mocking. </returns>
public static OperationErrorsResult OperationErrorsResult(string operationId = null, DateTimeOffset? createdOn = null, DateTimeOffset? activationOn = null, DateTimeOffset? completedOn = null, IEnumerable<OperationErrorDetails> operationErrors = null, string requestErrorCode = null, string requestErrorDetails = null)
{
operationErrors ??= new List<OperationErrorDetails>();
return new OperationErrorsResult(
operationId,
createdOn,
activationOn,
completedOn,
operationErrors?.ToList(),
requestErrorCode,
requestErrorDetails,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.OperationErrorDetails"/>. </summary>
/// <param name="errorCode"> The error code of the operation. </param>
/// <param name="errorDetails"> The error details of the operation. </param>
/// <param name="timestamp"> The timestamp of the error occurence. </param>
/// <param name="errorDetailsTimestamp"> The timestamp of the error occurence. </param>
/// <param name="azureOperationName"> The compute operationid of the Start/Deallocate/Hibernate request. </param>
/// <param name="crpOperationId"> The compute operationid of the Start/Deallocate/Hibernate request. </param>
/// <returns> A new <see cref="Models.OperationErrorDetails"/> instance for mocking. </returns>
public static OperationErrorDetails OperationErrorDetails(string errorCode = null, string errorDetails = null, DateTimeOffset? timestamp = null, DateTimeOffset? errorDetailsTimestamp = null, string azureOperationName = null, string crpOperationId = null)
{
return new OperationErrorDetails(
errorCode,
errorDetails,
timestamp,
errorDetailsTimestamp,
azureOperationName,
crpOperationId,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="ComputeSchedule.ScheduledActionData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="tags"> The tags. </param>
/// <param name="location"> The location. </param>
/// <param name="properties"> The resource-specific properties for this resource. </param>
/// <returns> A new <see cref="ComputeSchedule.ScheduledActionData"/> instance for mocking. </returns>
public static ScheduledActionData ScheduledActionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary<string, string> tags = null, AzureLocation location = default, ScheduledActionProperties properties = null)
{
tags ??= new Dictionary<string, string>();
return new ScheduledActionData(
id,
name,
resourceType,
systemData,
tags,
location,
properties,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ScheduledActionProperties"/>. </summary>
/// <param name="resourceType"> The type of resource the scheduled action is targeting. </param>
/// <param name="actionType"> The action the scheduled action should perform in the resources. </param>
/// <param name="startOn"> The time which the scheduled action is supposed to start running. </param>
/// <param name="endOn"> The time when the scheduled action is supposed to stop scheduling. </param>
/// <param name="schedule"> The schedule the scheduled action is supposed to follow. </param>
/// <param name="notificationSettings"> The notification settings for the scheduled action. </param>
/// <param name="disabled"> Tell if the scheduled action is disabled or not. </param>
/// <param name="provisioningState"> The status of the last provisioning operation performed on the resource. </param>
/// <returns> A new <see cref="Models.ScheduledActionProperties"/> instance for mocking. </returns>
public static ScheduledActionProperties ScheduledActionProperties(ScheduledActionResourceType resourceType = default, ScheduledActionType actionType = default, DateTimeOffset startOn = default, DateTimeOffset? endOn = null, ScheduledActionsSchedule schedule = null, IEnumerable<NotificationSettings> notificationSettings = null, bool? disabled = null, ScheduledActionResourceProvisioningState? provisioningState = null)
{
notificationSettings ??= new List<NotificationSettings>();
return new ScheduledActionProperties(
resourceType,
actionType,
startOn,
endOn,
schedule,
notificationSettings?.ToList(),
disabled,
provisioningState,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ScheduledActionResourceData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="resourceId">
/// The ARM Id of the resource.
/// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}"
/// </param>
/// <param name="notificationSettings"> The desired notification settings for the specified resource. </param>
/// <returns> A new <see cref="Models.ScheduledActionResourceData"/> instance for mocking. </returns>
public static ScheduledActionResourceData ScheduledActionResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier resourceId = null, IEnumerable<NotificationSettings> notificationSettings = null)
{
notificationSettings ??= new List<NotificationSettings>();
return new ScheduledActionResourceData(
id,
name,
resourceType,
systemData,
resourceId,
notificationSettings?.ToList(),
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ScheduledActionResourceOperationResult"/>. </summary>
/// <param name="totalResources"> The total number of resources operated on. </param>
/// <param name="resourcesStatuses"> The resource status of for each resource. </param>
/// <returns> A new <see cref="Models.ScheduledActionResourceOperationResult"/> instance for mocking. </returns>
public static ScheduledActionResourceOperationResult ScheduledActionResourceOperationResult(int totalResources = default, IEnumerable<ScheduledActionResourceStatus> resourcesStatuses = null)
{
resourcesStatuses ??= new List<ScheduledActionResourceStatus>();
return new ScheduledActionResourceOperationResult(totalResources, resourcesStatuses?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ScheduledActionResourceStatus"/>. </summary>
/// <param name="resourceId"> The arm identifier of the resource. </param>
/// <param name="status"> The state the resource is currently on. </param>
/// <param name="error"> Errors encountered while trying to perform. </param>
/// <returns> A new <see cref="Models.ScheduledActionResourceStatus"/> instance for mocking. </returns>
public static ScheduledActionResourceStatus ScheduledActionResourceStatus(ResourceIdentifier resourceId = null, ScheduledActionResourceOperationStatus status = default, ResponseError error = null)
{
return new ScheduledActionResourceStatus(resourceId, status, error, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="ComputeSchedule.ScheduledActionOccurrenceData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="properties"> The resource-specific properties for this resource. </param>
/// <returns> A new <see cref="ComputeSchedule.ScheduledActionOccurrenceData"/> instance for mocking. </returns>
public static ScheduledActionOccurrenceData ScheduledActionOccurrenceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ScheduledActionOccurrenceProperties properties = null)
{
return new ScheduledActionOccurrenceData(
id,
name,
resourceType,
systemData,
properties,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ScheduledActionOccurrenceProperties"/>. </summary>
/// <param name="scheduledOn"> The time the occurrence is scheduled for. This value can be changed by calling the delay API. </param>
/// <param name="resultSummary"> The result for occurrences that achieved a terminal state. </param>
/// <param name="provisioningState"> The aggregated provisioning state of the occurrence. </param>
/// <returns> A new <see cref="Models.ScheduledActionOccurrenceProperties"/> instance for mocking. </returns>
public static ScheduledActionOccurrenceProperties ScheduledActionOccurrenceProperties(DateTimeOffset scheduledOn = default, OccurrenceResultSummary resultSummary = null, ScheduledActionOccurrenceState? provisioningState = null)
{
return new ScheduledActionOccurrenceProperties(scheduledOn, resultSummary, provisioningState, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.OccurrenceResultSummary"/>. </summary>
/// <param name="total"> The total number of resources that the occurrence was supposed to act on. </param>
/// <param name="statuses"> The summarized status of the resources. </param>
/// <returns> A new <see cref="Models.OccurrenceResultSummary"/> instance for mocking. </returns>
public static OccurrenceResultSummary OccurrenceResultSummary(int total = default, IEnumerable<ResourceResultSummary> statuses = null)
{
statuses ??= new List<ResourceResultSummary>();
return new OccurrenceResultSummary(total, statuses?.ToList(), serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ResourceResultSummary"/>. </summary>
/// <param name="code"> The error code for those resources. In case of success, code is populated with Success. </param>
/// <param name="count"> The number of resources that the code applies to. </param>
/// <param name="errorDetails"> The error details for the resources. Not populated on success cases. </param>
/// <returns> A new <see cref="Models.ResourceResultSummary"/> instance for mocking. </returns>
public static ResourceResultSummary ResourceResultSummary(string code = null, int count = default, ResponseError errorDetails = null)
{
return new ResourceResultSummary(code, count, errorDetails, serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ScheduledActionResources"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="properties"> The resource-specific properties for this resource. </param>
/// <returns> A new <see cref="Models.ScheduledActionResources"/> instance for mocking. </returns>
public static ScheduledActionResources ScheduledActionResources(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ScheduledActionsExtensionProperties properties = null)
{
return new ScheduledActionResources(
id,
name,
resourceType,
systemData,
properties,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.ScheduledActionsExtensionProperties"/>. </summary>
/// <param name="resourceType"> The type of resource the scheduled action is targeting. </param>
/// <param name="actionType"> The action the scheduled action should perform in the resources. </param>
/// <param name="startOn"> The time which the scheduled action is supposed to start running. </param>
/// <param name="endOn"> The time when the scheduled action is supposed to stop scheduling. </param>
/// <param name="schedule"> The schedule the scheduled action is supposed to follow. </param>
/// <param name="notificationSettings"> The notification settings for the scheduled action. </param>
/// <param name="disabled"> Tell if the scheduled action is disabled or not. </param>
/// <param name="provisioningState"> The status of the last provisioning operation performed on the resource. </param>
/// <param name="resourceNotificationSettings"> The notification settings for the scheduled action at a resource level. Resource level notification settings are scope to specific resources only and submitted through attach requests. </param>
/// <returns> A new <see cref="Models.ScheduledActionsExtensionProperties"/> instance for mocking. </returns>
public static ScheduledActionsExtensionProperties ScheduledActionsExtensionProperties(ScheduledActionResourceType resourceType = default, ScheduledActionType actionType = default, DateTimeOffset startOn = default, DateTimeOffset? endOn = null, ScheduledActionsSchedule schedule = null, IEnumerable<NotificationSettings> notificationSettings = null, bool? disabled = null, ScheduledActionResourceProvisioningState? provisioningState = null, IEnumerable<NotificationSettings> resourceNotificationSettings = null)
{
notificationSettings ??= new List<NotificationSettings>();
resourceNotificationSettings ??= new List<NotificationSettings>();
return new ScheduledActionsExtensionProperties(
resourceType,
actionType,
startOn,
endOn,
schedule,
notificationSettings?.ToList(),
disabled,
provisioningState,
resourceNotificationSettings?.ToList(),
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.OccurrenceResourceData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="resourceId">
/// The ARM Id of the resource.
/// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}"
/// </param>
/// <param name="notificationSettings"> The desired notification settings for the specified resource. </param>
/// <param name="scheduledOn"> The time the occurrence is scheduled for the resource. </param>
/// <param name="provisioningState"> The current state of the resource. </param>
/// <param name="errorDetails"> Error details for the resource. Only populated if resource is in failed state. </param>
/// <returns> A new <see cref="Models.OccurrenceResourceData"/> instance for mocking. </returns>
public static OccurrenceResourceData OccurrenceResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ResourceIdentifier resourceId = null, IEnumerable<NotificationSettings> notificationSettings = null, DateTimeOffset scheduledOn = default, OccurrenceResourceProvisioningState? provisioningState = null, ResponseError errorDetails = null)
{
notificationSettings ??= new List<NotificationSettings>();
return new OccurrenceResourceData(
id,
name,
resourceType,
systemData,
resourceId,
notificationSettings?.ToList(),
scheduledOn,
provisioningState,
errorDetails,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.OccurrenceExtensionResourceData"/>. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="properties"> The resource-specific properties for this resource. </param>
/// <returns> A new <see cref="Models.OccurrenceExtensionResourceData"/> instance for mocking. </returns>
public static OccurrenceExtensionResourceData OccurrenceExtensionResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, OccurrenceExtensionProperties properties = null)
{
return new OccurrenceExtensionResourceData(
id,
name,
resourceType,
systemData,
properties,
serializedAdditionalRawData: null);
}
/// <summary> Initializes a new instance of <see cref="Models.OccurrenceExtensionProperties"/>. </summary>
/// <param name="resourceId">
/// The ARM Id of the resource.
/// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachines/{vmName}"
/// </param>
/// <param name="notificationSettings"> The desired notification settings for the specified resource. </param>
/// <param name="scheduledOn"> The time the occurrence is scheduled for the resource. Specified in UTC. </param>
/// <param name="provisioningState"> The current state of the resource. </param>
/// <param name="errorDetails"> Error details for the resource. Only populated if resource is in failed state. </param>
/// <param name="scheduledActionId"> The arm identifier of the scheduled action the occurrence belongs to. </param>
/// <returns> A new <see cref="Models.OccurrenceExtensionProperties"/> instance for mocking. </returns>
public static OccurrenceExtensionProperties OccurrenceExtensionProperties(ResourceIdentifier resourceId = null, IEnumerable<NotificationSettings> notificationSettings = null, DateTimeOffset scheduledOn = default, OccurrenceResourceProvisioningState? provisioningState = null, ResponseError errorDetails = null, ResourceIdentifier scheduledActionId = null)
{
notificationSettings ??= new List<NotificationSettings>();
return new OccurrenceExtensionProperties(
resourceId,
notificationSettings?.ToList(),
scheduledOn,
provisioningState,
errorDetails,
scheduledActionId,
serializedAdditionalRawData: null);
}
}
}