-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
1925 lines (1762 loc) · 62.2 KB
/
models.go
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
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package logic
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"net/http"
)
// KeyType enumerates the values for key type.
type KeyType string
const (
// NotSpecified ...
NotSpecified KeyType = "NotSpecified"
// Primary ...
Primary KeyType = "Primary"
// Secondary ...
Secondary KeyType = "Secondary"
)
// PossibleKeyTypeValues returns an array of possible values for the KeyType const type.
func PossibleKeyTypeValues() []KeyType {
return []KeyType{NotSpecified, Primary, Secondary}
}
// ParameterType enumerates the values for parameter type.
type ParameterType string
const (
// ParameterTypeArray ...
ParameterTypeArray ParameterType = "Array"
// ParameterTypeBool ...
ParameterTypeBool ParameterType = "Bool"
// ParameterTypeFloat ...
ParameterTypeFloat ParameterType = "Float"
// ParameterTypeInt ...
ParameterTypeInt ParameterType = "Int"
// ParameterTypeNotSpecified ...
ParameterTypeNotSpecified ParameterType = "NotSpecified"
// ParameterTypeObject ...
ParameterTypeObject ParameterType = "Object"
// ParameterTypeSecureObject ...
ParameterTypeSecureObject ParameterType = "SecureObject"
// ParameterTypeSecureString ...
ParameterTypeSecureString ParameterType = "SecureString"
// ParameterTypeString ...
ParameterTypeString ParameterType = "String"
)
// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type.
func PossibleParameterTypeValues() []ParameterType {
return []ParameterType{ParameterTypeArray, ParameterTypeBool, ParameterTypeFloat, ParameterTypeInt, ParameterTypeNotSpecified, ParameterTypeObject, ParameterTypeSecureObject, ParameterTypeSecureString, ParameterTypeString}
}
// RecurrenceFrequency enumerates the values for recurrence frequency.
type RecurrenceFrequency string
const (
// Day ...
Day RecurrenceFrequency = "Day"
// Hour ...
Hour RecurrenceFrequency = "Hour"
// Minute ...
Minute RecurrenceFrequency = "Minute"
// Month ...
Month RecurrenceFrequency = "Month"
// Second ...
Second RecurrenceFrequency = "Second"
// Week ...
Week RecurrenceFrequency = "Week"
// Year ...
Year RecurrenceFrequency = "Year"
)
// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type.
func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency {
return []RecurrenceFrequency{Day, Hour, Minute, Month, Second, Week, Year}
}
// SkuName enumerates the values for sku name.
type SkuName string
const (
// SkuNameBasic ...
SkuNameBasic SkuName = "Basic"
// SkuNameFree ...
SkuNameFree SkuName = "Free"
// SkuNameNotSpecified ...
SkuNameNotSpecified SkuName = "NotSpecified"
// SkuNamePremium ...
SkuNamePremium SkuName = "Premium"
// SkuNameShared ...
SkuNameShared SkuName = "Shared"
// SkuNameStandard ...
SkuNameStandard SkuName = "Standard"
)
// PossibleSkuNameValues returns an array of possible values for the SkuName const type.
func PossibleSkuNameValues() []SkuName {
return []SkuName{SkuNameBasic, SkuNameFree, SkuNameNotSpecified, SkuNamePremium, SkuNameShared, SkuNameStandard}
}
// WorkflowProvisioningState enumerates the values for workflow provisioning state.
type WorkflowProvisioningState string
const (
// WorkflowProvisioningStateMoving ...
WorkflowProvisioningStateMoving WorkflowProvisioningState = "Moving"
// WorkflowProvisioningStateNotSpecified ...
WorkflowProvisioningStateNotSpecified WorkflowProvisioningState = "NotSpecified"
// WorkflowProvisioningStateSucceeded ...
WorkflowProvisioningStateSucceeded WorkflowProvisioningState = "Succeeded"
)
// PossibleWorkflowProvisioningStateValues returns an array of possible values for the WorkflowProvisioningState const type.
func PossibleWorkflowProvisioningStateValues() []WorkflowProvisioningState {
return []WorkflowProvisioningState{WorkflowProvisioningStateMoving, WorkflowProvisioningStateNotSpecified, WorkflowProvisioningStateSucceeded}
}
// WorkflowState enumerates the values for workflow state.
type WorkflowState string
const (
// WorkflowStateDeleted ...
WorkflowStateDeleted WorkflowState = "Deleted"
// WorkflowStateDisabled ...
WorkflowStateDisabled WorkflowState = "Disabled"
// WorkflowStateEnabled ...
WorkflowStateEnabled WorkflowState = "Enabled"
// WorkflowStateNotSpecified ...
WorkflowStateNotSpecified WorkflowState = "NotSpecified"
// WorkflowStateSuspended ...
WorkflowStateSuspended WorkflowState = "Suspended"
)
// PossibleWorkflowStateValues returns an array of possible values for the WorkflowState const type.
func PossibleWorkflowStateValues() []WorkflowState {
return []WorkflowState{WorkflowStateDeleted, WorkflowStateDisabled, WorkflowStateEnabled, WorkflowStateNotSpecified, WorkflowStateSuspended}
}
// WorkflowStatus enumerates the values for workflow status.
type WorkflowStatus string
const (
// WorkflowStatusAborted ...
WorkflowStatusAborted WorkflowStatus = "Aborted"
// WorkflowStatusCancelled ...
WorkflowStatusCancelled WorkflowStatus = "Cancelled"
// WorkflowStatusFailed ...
WorkflowStatusFailed WorkflowStatus = "Failed"
// WorkflowStatusFaulted ...
WorkflowStatusFaulted WorkflowStatus = "Faulted"
// WorkflowStatusNotSpecified ...
WorkflowStatusNotSpecified WorkflowStatus = "NotSpecified"
// WorkflowStatusPaused ...
WorkflowStatusPaused WorkflowStatus = "Paused"
// WorkflowStatusRunning ...
WorkflowStatusRunning WorkflowStatus = "Running"
// WorkflowStatusSkipped ...
WorkflowStatusSkipped WorkflowStatus = "Skipped"
// WorkflowStatusSucceeded ...
WorkflowStatusSucceeded WorkflowStatus = "Succeeded"
// WorkflowStatusSuspended ...
WorkflowStatusSuspended WorkflowStatus = "Suspended"
// WorkflowStatusTimedOut ...
WorkflowStatusTimedOut WorkflowStatus = "TimedOut"
// WorkflowStatusWaiting ...
WorkflowStatusWaiting WorkflowStatus = "Waiting"
)
// PossibleWorkflowStatusValues returns an array of possible values for the WorkflowStatus const type.
func PossibleWorkflowStatusValues() []WorkflowStatus {
return []WorkflowStatus{WorkflowStatusAborted, WorkflowStatusCancelled, WorkflowStatusFailed, WorkflowStatusFaulted, WorkflowStatusNotSpecified, WorkflowStatusPaused, WorkflowStatusRunning, WorkflowStatusSkipped, WorkflowStatusSucceeded, WorkflowStatusSuspended, WorkflowStatusTimedOut, WorkflowStatusWaiting}
}
// WorkflowTriggerProvisioningState enumerates the values for workflow trigger provisioning state.
type WorkflowTriggerProvisioningState string
const (
// WorkflowTriggerProvisioningStateCreating ...
WorkflowTriggerProvisioningStateCreating WorkflowTriggerProvisioningState = "Creating"
// WorkflowTriggerProvisioningStateNotSpecified ...
WorkflowTriggerProvisioningStateNotSpecified WorkflowTriggerProvisioningState = "NotSpecified"
// WorkflowTriggerProvisioningStateSucceeded ...
WorkflowTriggerProvisioningStateSucceeded WorkflowTriggerProvisioningState = "Succeeded"
// WorkflowTriggerProvisioningStateUpdating ...
WorkflowTriggerProvisioningStateUpdating WorkflowTriggerProvisioningState = "Updating"
)
// PossibleWorkflowTriggerProvisioningStateValues returns an array of possible values for the WorkflowTriggerProvisioningState const type.
func PossibleWorkflowTriggerProvisioningStateValues() []WorkflowTriggerProvisioningState {
return []WorkflowTriggerProvisioningState{WorkflowTriggerProvisioningStateCreating, WorkflowTriggerProvisioningStateNotSpecified, WorkflowTriggerProvisioningStateSucceeded, WorkflowTriggerProvisioningStateUpdating}
}
// ContentHash ...
type ContentHash struct {
// Algorithm - Gets or sets the algorithm.
Algorithm *string `json:"algorithm,omitempty"`
// Value - Gets or sets the value.
Value *string `json:"value,omitempty"`
}
// ContentLink ...
type ContentLink struct {
// URI - Gets or sets the content link URI.
URI *string `json:"uri,omitempty"`
// ContentVersion - Gets or sets the content version.
ContentVersion *string `json:"contentVersion,omitempty"`
// ContentSize - Gets or sets the content size.
ContentSize *int64 `json:"contentSize,omitempty"`
// ContentHash - Gets or sets the content hash.
ContentHash *ContentHash `json:"contentHash,omitempty"`
// Metadata - Gets or sets the metadata.
Metadata interface{} `json:"metadata,omitempty"`
}
// RegenerateSecretKeyParameters ...
type RegenerateSecretKeyParameters struct {
// KeyType - Gets or sets the key type. Possible values include: 'NotSpecified', 'Primary', 'Secondary'
KeyType KeyType `json:"keyType,omitempty"`
}
// Resource ...
type Resource struct {
// ID - Gets or sets the resource id.
ID *string `json:"id,omitempty"`
// Name - Gets the resource name.
Name *string `json:"name,omitempty"`
// Type - Gets the resource type.
Type *string `json:"type,omitempty"`
// Location - Gets or sets the resource location.
Location *string `json:"location,omitempty"`
// Tags - Gets or sets the resource tags.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Resource.
func (r Resource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if r.ID != nil {
objectMap["id"] = r.ID
}
if r.Name != nil {
objectMap["name"] = r.Name
}
if r.Type != nil {
objectMap["type"] = r.Type
}
if r.Location != nil {
objectMap["location"] = r.Location
}
if r.Tags != nil {
objectMap["tags"] = r.Tags
}
return json.Marshal(objectMap)
}
// ResourceReference ...
type ResourceReference struct {
// ID - Gets or sets the resource id.
ID *string `json:"id,omitempty"`
// Name - Gets the resource name.
Name *string `json:"name,omitempty"`
// Type - Gets the resource type.
Type *string `json:"type,omitempty"`
}
// RunWorkflowParameters ...
type RunWorkflowParameters struct {
// Name - Gets or sets the name of workflow run trigger.
Name *string `json:"name,omitempty"`
// Outputs - Gets or sets the outputs of workflow run trigger.
Outputs interface{} `json:"outputs,omitempty"`
}
// Sku ...
type Sku struct {
// Name - Gets or sets the name. Possible values include: 'SkuNameNotSpecified', 'SkuNameFree', 'SkuNameShared', 'SkuNameBasic', 'SkuNameStandard', 'SkuNamePremium'
Name SkuName `json:"name,omitempty"`
// Plan - Gets or sets the reference to plan.
Plan *ResourceReference `json:"plan,omitempty"`
}
// SubResource ...
type SubResource struct {
// ID - Gets or sets the resource id.
ID *string `json:"id,omitempty"`
}
// Workflow ...
type Workflow struct {
autorest.Response `json:"-"`
// WorkflowProperties - Gets or sets the workflow properties.
*WorkflowProperties `json:"properties,omitempty"`
// ID - Gets or sets the resource id.
ID *string `json:"id,omitempty"`
// Name - Gets the resource name.
Name *string `json:"name,omitempty"`
// Type - Gets the resource type.
Type *string `json:"type,omitempty"`
// Location - Gets or sets the resource location.
Location *string `json:"location,omitempty"`
// Tags - Gets or sets the resource tags.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Workflow.
func (w Workflow) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if w.WorkflowProperties != nil {
objectMap["properties"] = w.WorkflowProperties
}
if w.ID != nil {
objectMap["id"] = w.ID
}
if w.Name != nil {
objectMap["name"] = w.Name
}
if w.Type != nil {
objectMap["type"] = w.Type
}
if w.Location != nil {
objectMap["location"] = w.Location
}
if w.Tags != nil {
objectMap["tags"] = w.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Workflow struct.
func (w *Workflow) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var workflowProperties WorkflowProperties
err = json.Unmarshal(*v, &workflowProperties)
if err != nil {
return err
}
w.WorkflowProperties = &workflowProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
w.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
w.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
w.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
w.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
w.Tags = tags
}
}
}
return nil
}
// WorkflowAccessKey ...
type WorkflowAccessKey struct {
autorest.Response `json:"-"`
// WorkflowAccessKeyProperties - Gets or sets the workflow access key properties.
*WorkflowAccessKeyProperties `json:"properties,omitempty"`
// Name - Gets the workflow access key name.
Name *string `json:"name,omitempty"`
// Type - Gets the workflow access key type.
Type *string `json:"type,omitempty"`
// ID - Gets or sets the resource id.
ID *string `json:"id,omitempty"`
}
// MarshalJSON is the custom marshaler for WorkflowAccessKey.
func (wak WorkflowAccessKey) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if wak.WorkflowAccessKeyProperties != nil {
objectMap["properties"] = wak.WorkflowAccessKeyProperties
}
if wak.Name != nil {
objectMap["name"] = wak.Name
}
if wak.Type != nil {
objectMap["type"] = wak.Type
}
if wak.ID != nil {
objectMap["id"] = wak.ID
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for WorkflowAccessKey struct.
func (wak *WorkflowAccessKey) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var workflowAccessKeyProperties WorkflowAccessKeyProperties
err = json.Unmarshal(*v, &workflowAccessKeyProperties)
if err != nil {
return err
}
wak.WorkflowAccessKeyProperties = &workflowAccessKeyProperties
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
wak.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
wak.Type = &typeVar
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
wak.ID = &ID
}
}
}
return nil
}
// WorkflowAccessKeyListResult ...
type WorkflowAccessKeyListResult struct {
autorest.Response `json:"-"`
// Value - Gets or sets a list of workflow access keys.
Value *[]WorkflowAccessKey `json:"value,omitempty"`
// NextLink - Gets or sets the URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
// WorkflowAccessKeyListResultIterator provides access to a complete listing of WorkflowAccessKey values.
type WorkflowAccessKeyListResultIterator struct {
i int
page WorkflowAccessKeyListResultPage
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *WorkflowAccessKeyListResultIterator) Next() error {
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err := iter.page.Next()
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter WorkflowAccessKeyListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter WorkflowAccessKeyListResultIterator) Response() WorkflowAccessKeyListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter WorkflowAccessKeyListResultIterator) Value() WorkflowAccessKey {
if !iter.page.NotDone() {
return WorkflowAccessKey{}
}
return iter.page.Values()[iter.i]
}
// IsEmpty returns true if the ListResult contains no values.
func (waklr WorkflowAccessKeyListResult) IsEmpty() bool {
return waklr.Value == nil || len(*waklr.Value) == 0
}
// workflowAccessKeyListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (waklr WorkflowAccessKeyListResult) workflowAccessKeyListResultPreparer() (*http.Request, error) {
if waklr.NextLink == nil || len(to.String(waklr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(waklr.NextLink)))
}
// WorkflowAccessKeyListResultPage contains a page of WorkflowAccessKey values.
type WorkflowAccessKeyListResultPage struct {
fn func(WorkflowAccessKeyListResult) (WorkflowAccessKeyListResult, error)
waklr WorkflowAccessKeyListResult
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *WorkflowAccessKeyListResultPage) Next() error {
next, err := page.fn(page.waklr)
if err != nil {
return err
}
page.waklr = next
return nil
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page WorkflowAccessKeyListResultPage) NotDone() bool {
return !page.waklr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page WorkflowAccessKeyListResultPage) Response() WorkflowAccessKeyListResult {
return page.waklr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page WorkflowAccessKeyListResultPage) Values() []WorkflowAccessKey {
if page.waklr.IsEmpty() {
return nil
}
return *page.waklr.Value
}
// WorkflowAccessKeyProperties ...
type WorkflowAccessKeyProperties struct {
// NotBefore - Gets or sets the not-before time.
NotBefore *date.Time `json:"notBefore,omitempty"`
// NotAfter - Gets or sets the not-after time.
NotAfter *date.Time `json:"notAfter,omitempty"`
}
// WorkflowFilter ...
type WorkflowFilter struct {
// State - Gets or sets the state of workflows. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended'
State WorkflowState `json:"state,omitempty"`
}
// WorkflowListResult ...
type WorkflowListResult struct {
autorest.Response `json:"-"`
// Value - Gets or sets the list of workflows.
Value *[]Workflow `json:"value,omitempty"`
// NextLink - Gets or sets the URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
// WorkflowListResultIterator provides access to a complete listing of Workflow values.
type WorkflowListResultIterator struct {
i int
page WorkflowListResultPage
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *WorkflowListResultIterator) Next() error {
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err := iter.page.Next()
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter WorkflowListResultIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter WorkflowListResultIterator) Response() WorkflowListResult {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter WorkflowListResultIterator) Value() Workflow {
if !iter.page.NotDone() {
return Workflow{}
}
return iter.page.Values()[iter.i]
}
// IsEmpty returns true if the ListResult contains no values.
func (wlr WorkflowListResult) IsEmpty() bool {
return wlr.Value == nil || len(*wlr.Value) == 0
}
// workflowListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (wlr WorkflowListResult) workflowListResultPreparer() (*http.Request, error) {
if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(wlr.NextLink)))
}
// WorkflowListResultPage contains a page of Workflow values.
type WorkflowListResultPage struct {
fn func(WorkflowListResult) (WorkflowListResult, error)
wlr WorkflowListResult
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *WorkflowListResultPage) Next() error {
next, err := page.fn(page.wlr)
if err != nil {
return err
}
page.wlr = next
return nil
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page WorkflowListResultPage) NotDone() bool {
return !page.wlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page WorkflowListResultPage) Response() WorkflowListResult {
return page.wlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page WorkflowListResultPage) Values() []Workflow {
if page.wlr.IsEmpty() {
return nil
}
return *page.wlr.Value
}
// WorkflowOutputParameter ...
type WorkflowOutputParameter struct {
// Error - Gets the error.
Error interface{} `json:"error,omitempty"`
// Type - Gets or sets the type. Possible values include: 'ParameterTypeNotSpecified', 'ParameterTypeString', 'ParameterTypeSecureString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeBool', 'ParameterTypeArray', 'ParameterTypeObject', 'ParameterTypeSecureObject'
Type ParameterType `json:"type,omitempty"`
// Value - Gets or sets the value.
Value interface{} `json:"value,omitempty"`
// Metadata - Gets or sets the metadata.
Metadata interface{} `json:"metadata,omitempty"`
}
// WorkflowParameter ...
type WorkflowParameter struct {
// Type - Gets or sets the type. Possible values include: 'ParameterTypeNotSpecified', 'ParameterTypeString', 'ParameterTypeSecureString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeBool', 'ParameterTypeArray', 'ParameterTypeObject', 'ParameterTypeSecureObject'
Type ParameterType `json:"type,omitempty"`
// Value - Gets or sets the value.
Value interface{} `json:"value,omitempty"`
// Metadata - Gets or sets the metadata.
Metadata interface{} `json:"metadata,omitempty"`
}
// WorkflowProperties ...
type WorkflowProperties struct {
// ProvisioningState - Gets the provisioning state. Possible values include: 'WorkflowProvisioningStateNotSpecified', 'WorkflowProvisioningStateMoving', 'WorkflowProvisioningStateSucceeded'
ProvisioningState WorkflowProvisioningState `json:"provisioningState,omitempty"`
// CreatedTime - Gets the created time.
CreatedTime *date.Time `json:"createdTime,omitempty"`
// ChangedTime - Gets the changed time.
ChangedTime *date.Time `json:"changedTime,omitempty"`
// State - Gets or sets the state. Possible values include: 'WorkflowStateNotSpecified', 'WorkflowStateEnabled', 'WorkflowStateDisabled', 'WorkflowStateDeleted', 'WorkflowStateSuspended'
State WorkflowState `json:"state,omitempty"`
// Version - Gets the version.
Version *string `json:"version,omitempty"`
// AccessEndpoint - Gets the access endpoint.
AccessEndpoint *string `json:"accessEndpoint,omitempty"`
// Sku - Gets or sets the sku.
Sku *Sku `json:"sku,omitempty"`
// DefinitionLink - Gets or sets the link to definition.
DefinitionLink *ContentLink `json:"definitionLink,omitempty"`
// Definition - Gets or sets the definition.
Definition interface{} `json:"definition,omitempty"`
// ParametersLink - Gets or sets the link to parameters.
ParametersLink *ContentLink `json:"parametersLink,omitempty"`
// Parameters - Gets or sets the parameters.
Parameters map[string]*WorkflowParameter `json:"parameters"`
}
// MarshalJSON is the custom marshaler for WorkflowProperties.
func (wp WorkflowProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if wp.ProvisioningState != "" {
objectMap["provisioningState"] = wp.ProvisioningState
}
if wp.CreatedTime != nil {
objectMap["createdTime"] = wp.CreatedTime
}
if wp.ChangedTime != nil {
objectMap["changedTime"] = wp.ChangedTime
}
if wp.State != "" {
objectMap["state"] = wp.State
}
if wp.Version != nil {
objectMap["version"] = wp.Version
}
if wp.AccessEndpoint != nil {
objectMap["accessEndpoint"] = wp.AccessEndpoint
}
if wp.Sku != nil {
objectMap["sku"] = wp.Sku
}
if wp.DefinitionLink != nil {
objectMap["definitionLink"] = wp.DefinitionLink
}
objectMap["definition"] = wp.Definition
if wp.ParametersLink != nil {
objectMap["parametersLink"] = wp.ParametersLink
}
if wp.Parameters != nil {
objectMap["parameters"] = wp.Parameters
}
return json.Marshal(objectMap)
}
// WorkflowRun ...
type WorkflowRun struct {
autorest.Response `json:"-"`
// WorkflowRunProperties - Gets or sets the workflow run properties.
*WorkflowRunProperties `json:"properties,omitempty"`
// Name - Gets the workflow run name.
Name *string `json:"name,omitempty"`
// Type - Gets the workflow run type.
Type *string `json:"type,omitempty"`
// ID - Gets or sets the resource id.
ID *string `json:"id,omitempty"`
}
// MarshalJSON is the custom marshaler for WorkflowRun.
func (wr WorkflowRun) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if wr.WorkflowRunProperties != nil {
objectMap["properties"] = wr.WorkflowRunProperties
}
if wr.Name != nil {
objectMap["name"] = wr.Name
}
if wr.Type != nil {
objectMap["type"] = wr.Type
}
if wr.ID != nil {
objectMap["id"] = wr.ID
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for WorkflowRun struct.
func (wr *WorkflowRun) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var workflowRunProperties WorkflowRunProperties
err = json.Unmarshal(*v, &workflowRunProperties)
if err != nil {
return err
}
wr.WorkflowRunProperties = &workflowRunProperties
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
wr.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
wr.Type = &typeVar
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
wr.ID = &ID
}
}
}
return nil
}
// WorkflowRunAction ...
type WorkflowRunAction struct {
autorest.Response `json:"-"`
// WorkflowRunActionProperties - Gets or sets the workflow run action properties.
*WorkflowRunActionProperties `json:"properties,omitempty"`
// Name - Gets the workflow run action name.
Name *string `json:"name,omitempty"`
// Type - Gets the workflow run action type.
Type *string `json:"type,omitempty"`
// ID - Gets or sets the resource id.
ID *string `json:"id,omitempty"`
}
// MarshalJSON is the custom marshaler for WorkflowRunAction.
func (wra WorkflowRunAction) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if wra.WorkflowRunActionProperties != nil {
objectMap["properties"] = wra.WorkflowRunActionProperties
}
if wra.Name != nil {
objectMap["name"] = wra.Name
}
if wra.Type != nil {
objectMap["type"] = wra.Type
}
if wra.ID != nil {
objectMap["id"] = wra.ID
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for WorkflowRunAction struct.
func (wra *WorkflowRunAction) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var workflowRunActionProperties WorkflowRunActionProperties
err = json.Unmarshal(*v, &workflowRunActionProperties)
if err != nil {
return err
}
wra.WorkflowRunActionProperties = &workflowRunActionProperties
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
wra.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
wra.Type = &typeVar
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
wra.ID = &ID
}
}
}
return nil
}
// WorkflowRunActionFilter ...
type WorkflowRunActionFilter struct {
// Status - Gets or sets the status of workflow run action. Possible values include: 'WorkflowStatusNotSpecified', 'WorkflowStatusPaused', 'WorkflowStatusRunning', 'WorkflowStatusWaiting', 'WorkflowStatusSucceeded', 'WorkflowStatusSkipped', 'WorkflowStatusSuspended', 'WorkflowStatusCancelled', 'WorkflowStatusFailed', 'WorkflowStatusFaulted', 'WorkflowStatusTimedOut', 'WorkflowStatusAborted'
Status WorkflowStatus `json:"status,omitempty"`
}
// WorkflowRunActionListResult ...
type WorkflowRunActionListResult struct {
autorest.Response `json:"-"`
// Value - Gets or sets a list of workflow run actions.
Value *[]WorkflowRunAction `json:"value,omitempty"`
// NextLink - Gets or sets the URL to get the next set of results.
NextLink *string `json:"nextLink,omitempty"`
}
// WorkflowRunActionListResultIterator provides access to a complete listing of WorkflowRunAction values.
type WorkflowRunActionListResultIterator struct {
i int
page WorkflowRunActionListResultPage
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *WorkflowRunActionListResultIterator) Next() error {
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err := iter.page.Next()
if err != nil {
iter.i--
return err