forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 2
/
models.go
1432 lines (1281 loc) · 50.4 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 scheduler
// 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"
)
// DayOfWeek enumerates the values for day of week.
type DayOfWeek string
const (
// Friday ...
Friday DayOfWeek = "Friday"
// Monday ...
Monday DayOfWeek = "Monday"
// Saturday ...
Saturday DayOfWeek = "Saturday"
// Sunday ...
Sunday DayOfWeek = "Sunday"
// Thursday ...
Thursday DayOfWeek = "Thursday"
// Tuesday ...
Tuesday DayOfWeek = "Tuesday"
// Wednesday ...
Wednesday DayOfWeek = "Wednesday"
)
// PossibleDayOfWeekValues returns an array of possible values for the DayOfWeek const type.
func PossibleDayOfWeekValues() []DayOfWeek {
return []DayOfWeek{Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday}
}
// JobActionType enumerates the values for job action type.
type JobActionType string
const (
// HTTP ...
HTTP JobActionType = "Http"
// HTTPS ...
HTTPS JobActionType = "Https"
// ServiceBusQueue ...
ServiceBusQueue JobActionType = "ServiceBusQueue"
// ServiceBusTopic ...
ServiceBusTopic JobActionType = "ServiceBusTopic"
// StorageQueue ...
StorageQueue JobActionType = "StorageQueue"
)
// PossibleJobActionTypeValues returns an array of possible values for the JobActionType const type.
func PossibleJobActionTypeValues() []JobActionType {
return []JobActionType{HTTP, HTTPS, ServiceBusQueue, ServiceBusTopic, StorageQueue}
}
// JobCollectionState enumerates the values for job collection state.
type JobCollectionState string
const (
// Deleted ...
Deleted JobCollectionState = "Deleted"
// Disabled ...
Disabled JobCollectionState = "Disabled"
// Enabled ...
Enabled JobCollectionState = "Enabled"
// Suspended ...
Suspended JobCollectionState = "Suspended"
)
// PossibleJobCollectionStateValues returns an array of possible values for the JobCollectionState const type.
func PossibleJobCollectionStateValues() []JobCollectionState {
return []JobCollectionState{Deleted, Disabled, Enabled, Suspended}
}
// JobExecutionStatus enumerates the values for job execution status.
type JobExecutionStatus string
const (
// Completed ...
Completed JobExecutionStatus = "Completed"
// Failed ...
Failed JobExecutionStatus = "Failed"
// Postponed ...
Postponed JobExecutionStatus = "Postponed"
)
// PossibleJobExecutionStatusValues returns an array of possible values for the JobExecutionStatus const type.
func PossibleJobExecutionStatusValues() []JobExecutionStatus {
return []JobExecutionStatus{Completed, Failed, Postponed}
}
// JobHistoryActionName enumerates the values for job history action name.
type JobHistoryActionName string
const (
// ErrorAction ...
ErrorAction JobHistoryActionName = "ErrorAction"
// MainAction ...
MainAction JobHistoryActionName = "MainAction"
)
// PossibleJobHistoryActionNameValues returns an array of possible values for the JobHistoryActionName const type.
func PossibleJobHistoryActionNameValues() []JobHistoryActionName {
return []JobHistoryActionName{ErrorAction, MainAction}
}
// JobScheduleDay enumerates the values for job schedule day.
type JobScheduleDay string
const (
// JobScheduleDayFriday ...
JobScheduleDayFriday JobScheduleDay = "Friday"
// JobScheduleDayMonday ...
JobScheduleDayMonday JobScheduleDay = "Monday"
// JobScheduleDaySaturday ...
JobScheduleDaySaturday JobScheduleDay = "Saturday"
// JobScheduleDaySunday ...
JobScheduleDaySunday JobScheduleDay = "Sunday"
// JobScheduleDayThursday ...
JobScheduleDayThursday JobScheduleDay = "Thursday"
// JobScheduleDayTuesday ...
JobScheduleDayTuesday JobScheduleDay = "Tuesday"
// JobScheduleDayWednesday ...
JobScheduleDayWednesday JobScheduleDay = "Wednesday"
)
// PossibleJobScheduleDayValues returns an array of possible values for the JobScheduleDay const type.
func PossibleJobScheduleDayValues() []JobScheduleDay {
return []JobScheduleDay{JobScheduleDayFriday, JobScheduleDayMonday, JobScheduleDaySaturday, JobScheduleDaySunday, JobScheduleDayThursday, JobScheduleDayTuesday, JobScheduleDayWednesday}
}
// JobState enumerates the values for job state.
type JobState string
const (
// JobStateCompleted ...
JobStateCompleted JobState = "Completed"
// JobStateDisabled ...
JobStateDisabled JobState = "Disabled"
// JobStateEnabled ...
JobStateEnabled JobState = "Enabled"
// JobStateFaulted ...
JobStateFaulted JobState = "Faulted"
)
// PossibleJobStateValues returns an array of possible values for the JobState const type.
func PossibleJobStateValues() []JobState {
return []JobState{JobStateCompleted, JobStateDisabled, JobStateEnabled, JobStateFaulted}
}
// 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"
// Week ...
Week RecurrenceFrequency = "Week"
)
// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type.
func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency {
return []RecurrenceFrequency{Day, Hour, Minute, Month, Week}
}
// RetryType enumerates the values for retry type.
type RetryType string
const (
// Fixed ...
Fixed RetryType = "Fixed"
// None ...
None RetryType = "None"
)
// PossibleRetryTypeValues returns an array of possible values for the RetryType const type.
func PossibleRetryTypeValues() []RetryType {
return []RetryType{Fixed, None}
}
// ServiceBusAuthenticationType enumerates the values for service bus authentication type.
type ServiceBusAuthenticationType string
const (
// NotSpecified ...
NotSpecified ServiceBusAuthenticationType = "NotSpecified"
// SharedAccessKey ...
SharedAccessKey ServiceBusAuthenticationType = "SharedAccessKey"
)
// PossibleServiceBusAuthenticationTypeValues returns an array of possible values for the ServiceBusAuthenticationType const type.
func PossibleServiceBusAuthenticationTypeValues() []ServiceBusAuthenticationType {
return []ServiceBusAuthenticationType{NotSpecified, SharedAccessKey}
}
// ServiceBusTransportType enumerates the values for service bus transport type.
type ServiceBusTransportType string
const (
// ServiceBusTransportTypeAMQP ...
ServiceBusTransportTypeAMQP ServiceBusTransportType = "AMQP"
// ServiceBusTransportTypeNetMessaging ...
ServiceBusTransportTypeNetMessaging ServiceBusTransportType = "NetMessaging"
// ServiceBusTransportTypeNotSpecified ...
ServiceBusTransportTypeNotSpecified ServiceBusTransportType = "NotSpecified"
)
// PossibleServiceBusTransportTypeValues returns an array of possible values for the ServiceBusTransportType const type.
func PossibleServiceBusTransportTypeValues() []ServiceBusTransportType {
return []ServiceBusTransportType{ServiceBusTransportTypeAMQP, ServiceBusTransportTypeNetMessaging, ServiceBusTransportTypeNotSpecified}
}
// SkuDefinition enumerates the values for sku definition.
type SkuDefinition string
const (
// Free ...
Free SkuDefinition = "Free"
// P10Premium ...
P10Premium SkuDefinition = "P10Premium"
// P20Premium ...
P20Premium SkuDefinition = "P20Premium"
// Standard ...
Standard SkuDefinition = "Standard"
)
// PossibleSkuDefinitionValues returns an array of possible values for the SkuDefinition const type.
func PossibleSkuDefinitionValues() []SkuDefinition {
return []SkuDefinition{Free, P10Premium, P20Premium, Standard}
}
// Type enumerates the values for type.
type Type string
const (
// TypeActiveDirectoryOAuth ...
TypeActiveDirectoryOAuth Type = "ActiveDirectoryOAuth"
// TypeBasic ...
TypeBasic Type = "Basic"
// TypeClientCertificate ...
TypeClientCertificate Type = "ClientCertificate"
// TypeHTTPAuthentication ...
TypeHTTPAuthentication Type = "HttpAuthentication"
)
// PossibleTypeValues returns an array of possible values for the Type const type.
func PossibleTypeValues() []Type {
return []Type{TypeActiveDirectoryOAuth, TypeBasic, TypeClientCertificate, TypeHTTPAuthentication}
}
// BasicAuthentication ...
type BasicAuthentication struct {
// Username - Gets or sets the username.
Username *string `json:"username,omitempty"`
// Password - Gets or sets the password, return value will always be empty.
Password *string `json:"password,omitempty"`
// Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth'
Type Type `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for BasicAuthentication.
func (ba BasicAuthentication) MarshalJSON() ([]byte, error) {
ba.Type = TypeBasic
objectMap := make(map[string]interface{})
if ba.Username != nil {
objectMap["username"] = ba.Username
}
if ba.Password != nil {
objectMap["password"] = ba.Password
}
if ba.Type != "" {
objectMap["type"] = ba.Type
}
return json.Marshal(objectMap)
}
// AsClientCertAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication.
func (ba BasicAuthentication) AsClientCertAuthentication() (*ClientCertAuthentication, bool) {
return nil, false
}
// AsBasicAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication.
func (ba BasicAuthentication) AsBasicAuthentication() (*BasicAuthentication, bool) {
return &ba, true
}
// AsOAuthAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication.
func (ba BasicAuthentication) AsOAuthAuthentication() (*OAuthAuthentication, bool) {
return nil, false
}
// AsHTTPAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication.
func (ba BasicAuthentication) AsHTTPAuthentication() (*HTTPAuthentication, bool) {
return nil, false
}
// AsBasicHTTPAuthentication is the BasicHTTPAuthentication implementation for BasicAuthentication.
func (ba BasicAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthentication, bool) {
return &ba, true
}
// ClientCertAuthentication ...
type ClientCertAuthentication struct {
// Password - Gets or sets the certificate password, return value will always be empty.
Password *string `json:"password,omitempty"`
// Pfx - Gets or sets the pfx certificate. Accepts certification in base64 encoding, return value will always be empty.
Pfx *string `json:"pfx,omitempty"`
// CertificateThumbprint - Gets or sets the certificate thumbprint.
CertificateThumbprint *string `json:"certificateThumbprint,omitempty"`
// CertificateExpirationDate - Gets or sets the certificate expiration date.
CertificateExpirationDate *date.Time `json:"certificateExpirationDate,omitempty"`
// CertificateSubjectName - Gets or sets the certificate subject name.
CertificateSubjectName *string `json:"certificateSubjectName,omitempty"`
// Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth'
Type Type `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for ClientCertAuthentication.
func (cca ClientCertAuthentication) MarshalJSON() ([]byte, error) {
cca.Type = TypeClientCertificate
objectMap := make(map[string]interface{})
if cca.Password != nil {
objectMap["password"] = cca.Password
}
if cca.Pfx != nil {
objectMap["pfx"] = cca.Pfx
}
if cca.CertificateThumbprint != nil {
objectMap["certificateThumbprint"] = cca.CertificateThumbprint
}
if cca.CertificateExpirationDate != nil {
objectMap["certificateExpirationDate"] = cca.CertificateExpirationDate
}
if cca.CertificateSubjectName != nil {
objectMap["certificateSubjectName"] = cca.CertificateSubjectName
}
if cca.Type != "" {
objectMap["type"] = cca.Type
}
return json.Marshal(objectMap)
}
// AsClientCertAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication.
func (cca ClientCertAuthentication) AsClientCertAuthentication() (*ClientCertAuthentication, bool) {
return &cca, true
}
// AsBasicAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication.
func (cca ClientCertAuthentication) AsBasicAuthentication() (*BasicAuthentication, bool) {
return nil, false
}
// AsOAuthAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication.
func (cca ClientCertAuthentication) AsOAuthAuthentication() (*OAuthAuthentication, bool) {
return nil, false
}
// AsHTTPAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication.
func (cca ClientCertAuthentication) AsHTTPAuthentication() (*HTTPAuthentication, bool) {
return nil, false
}
// AsBasicHTTPAuthentication is the BasicHTTPAuthentication implementation for ClientCertAuthentication.
func (cca ClientCertAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthentication, bool) {
return &cca, true
}
// BasicHTTPAuthentication ...
type BasicHTTPAuthentication interface {
AsClientCertAuthentication() (*ClientCertAuthentication, bool)
AsBasicAuthentication() (*BasicAuthentication, bool)
AsOAuthAuthentication() (*OAuthAuthentication, bool)
AsHTTPAuthentication() (*HTTPAuthentication, bool)
}
// HTTPAuthentication ...
type HTTPAuthentication struct {
// Type - Possible values include: 'TypeHTTPAuthentication', 'TypeClientCertificate', 'TypeBasic', 'TypeActiveDirectoryOAuth'
Type Type `json:"type,omitempty"`
}
func unmarshalBasicHTTPAuthentication(body []byte) (BasicHTTPAuthentication, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["type"] {
case string(TypeClientCertificate):
var cca ClientCertAuthentication
err := json.Unmarshal(body, &cca)
return cca, err
case string(TypeBasic):
var ba BasicAuthentication
err := json.Unmarshal(body, &ba)
return ba, err
case string(TypeActiveDirectoryOAuth):
var oaa OAuthAuthentication
err := json.Unmarshal(body, &oaa)
return oaa, err
default:
var ha HTTPAuthentication
err := json.Unmarshal(body, &ha)
return ha, err
}
}
func unmarshalBasicHTTPAuthenticationArray(body []byte) ([]BasicHTTPAuthentication, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
haArray := make([]BasicHTTPAuthentication, len(rawMessages))
for index, rawMessage := range rawMessages {
ha, err := unmarshalBasicHTTPAuthentication(*rawMessage)
if err != nil {
return nil, err
}
haArray[index] = ha
}
return haArray, nil
}
// MarshalJSON is the custom marshaler for HTTPAuthentication.
func (ha HTTPAuthentication) MarshalJSON() ([]byte, error) {
ha.Type = TypeHTTPAuthentication
objectMap := make(map[string]interface{})
if ha.Type != "" {
objectMap["type"] = ha.Type
}
return json.Marshal(objectMap)
}
// AsClientCertAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication.
func (ha HTTPAuthentication) AsClientCertAuthentication() (*ClientCertAuthentication, bool) {
return nil, false
}
// AsBasicAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication.
func (ha HTTPAuthentication) AsBasicAuthentication() (*BasicAuthentication, bool) {
return nil, false
}
// AsOAuthAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication.
func (ha HTTPAuthentication) AsOAuthAuthentication() (*OAuthAuthentication, bool) {
return nil, false
}
// AsHTTPAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication.
func (ha HTTPAuthentication) AsHTTPAuthentication() (*HTTPAuthentication, bool) {
return &ha, true
}
// AsBasicHTTPAuthentication is the BasicHTTPAuthentication implementation for HTTPAuthentication.
func (ha HTTPAuthentication) AsBasicHTTPAuthentication() (BasicHTTPAuthentication, bool) {
return &ha, true
}
// HTTPRequest ...
type HTTPRequest struct {
// Authentication - Gets or sets the authentication method of the request.
Authentication BasicHTTPAuthentication `json:"authentication,omitempty"`
// URI - Gets or sets the URI of the request.
URI *string `json:"uri,omitempty"`
// Method - Gets or sets the method of the request.
Method *string `json:"method,omitempty"`
// Body - Gets or sets the request body.
Body *string `json:"body,omitempty"`
// Headers - Gets or sets the headers.
Headers map[string]*string `json:"headers"`
}
// MarshalJSON is the custom marshaler for HTTPRequest.
func (hr HTTPRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
objectMap["authentication"] = hr.Authentication
if hr.URI != nil {
objectMap["uri"] = hr.URI
}
if hr.Method != nil {
objectMap["method"] = hr.Method
}
if hr.Body != nil {
objectMap["body"] = hr.Body
}
if hr.Headers != nil {
objectMap["headers"] = hr.Headers
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for HTTPRequest struct.
func (hr *HTTPRequest) 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 "authentication":
if v != nil {
authentication, err := unmarshalBasicHTTPAuthentication(*v)
if err != nil {
return err
}
hr.Authentication = authentication
}
case "uri":
if v != nil {
var URI string
err = json.Unmarshal(*v, &URI)
if err != nil {
return err
}
hr.URI = &URI
}
case "method":
if v != nil {
var method string
err = json.Unmarshal(*v, &method)
if err != nil {
return err
}
hr.Method = &method
}
case "body":
if v != nil {
var body string
err = json.Unmarshal(*v, &body)
if err != nil {
return err
}
hr.Body = &body
}
case "headers":
if v != nil {
var headers map[string]*string
err = json.Unmarshal(*v, &headers)
if err != nil {
return err
}
hr.Headers = headers
}
}
}
return nil
}
// JobAction ...
type JobAction struct {
// Type - Gets or sets the job action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'
Type JobActionType `json:"type,omitempty"`
// Request - Gets or sets the http requests.
Request *HTTPRequest `json:"request,omitempty"`
// QueueMessage - Gets or sets the storage queue message.
QueueMessage *StorageQueueMessage `json:"queueMessage,omitempty"`
// ServiceBusQueueMessage - Gets or sets the service bus queue message.
ServiceBusQueueMessage *ServiceBusQueueMessage `json:"serviceBusQueueMessage,omitempty"`
// ServiceBusTopicMessage - Gets or sets the service bus topic message.
ServiceBusTopicMessage *ServiceBusTopicMessage `json:"serviceBusTopicMessage,omitempty"`
// RetryPolicy - Gets or sets the retry policy.
RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
// ErrorAction - Gets or sets the error action.
ErrorAction *JobErrorAction `json:"errorAction,omitempty"`
}
// JobCollectionDefinition ...
type JobCollectionDefinition struct {
autorest.Response `json:"-"`
// ID - Gets the job collection resource identifier.
ID *string `json:"id,omitempty"`
// Type - Gets the job collection resource type.
Type *string `json:"type,omitempty"`
// Name - Gets or sets the job collection resource name.
Name *string `json:"name,omitempty"`
// Location - Gets or sets the storage account location.
Location *string `json:"location,omitempty"`
// Tags - Gets or sets the tags.
Tags map[string]*string `json:"tags"`
// Properties - Gets or sets the job collection properties.
Properties *JobCollectionProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for JobCollectionDefinition.
func (jcd JobCollectionDefinition) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if jcd.ID != nil {
objectMap["id"] = jcd.ID
}
if jcd.Type != nil {
objectMap["type"] = jcd.Type
}
if jcd.Name != nil {
objectMap["name"] = jcd.Name
}
if jcd.Location != nil {
objectMap["location"] = jcd.Location
}
if jcd.Tags != nil {
objectMap["tags"] = jcd.Tags
}
if jcd.Properties != nil {
objectMap["properties"] = jcd.Properties
}
return json.Marshal(objectMap)
}
// JobCollectionListResult ...
type JobCollectionListResult struct {
autorest.Response `json:"-"`
// Value - Gets the job collections.
Value *[]JobCollectionDefinition `json:"value,omitempty"`
// NextLink - Gets or sets the URL to get the next set of job collections.
NextLink *string `json:"nextLink,omitempty"`
}
// JobCollectionListResultIterator provides access to a complete listing of JobCollectionDefinition values.
type JobCollectionListResultIterator struct {
i int
page JobCollectionListResultPage
}
// 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 *JobCollectionListResultIterator) 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 JobCollectionListResultIterator) 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 JobCollectionListResultIterator) Response() JobCollectionListResult {
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 JobCollectionListResultIterator) Value() JobCollectionDefinition {
if !iter.page.NotDone() {
return JobCollectionDefinition{}
}
return iter.page.Values()[iter.i]
}
// IsEmpty returns true if the ListResult contains no values.
func (jclr JobCollectionListResult) IsEmpty() bool {
return jclr.Value == nil || len(*jclr.Value) == 0
}
// jobCollectionListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (jclr JobCollectionListResult) jobCollectionListResultPreparer() (*http.Request, error) {
if jclr.NextLink == nil || len(to.String(jclr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(jclr.NextLink)))
}
// JobCollectionListResultPage contains a page of JobCollectionDefinition values.
type JobCollectionListResultPage struct {
fn func(JobCollectionListResult) (JobCollectionListResult, error)
jclr JobCollectionListResult
}
// 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 *JobCollectionListResultPage) Next() error {
next, err := page.fn(page.jclr)
if err != nil {
return err
}
page.jclr = next
return nil
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page JobCollectionListResultPage) NotDone() bool {
return !page.jclr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page JobCollectionListResultPage) Response() JobCollectionListResult {
return page.jclr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page JobCollectionListResultPage) Values() []JobCollectionDefinition {
if page.jclr.IsEmpty() {
return nil
}
return *page.jclr.Value
}
// JobCollectionProperties ...
type JobCollectionProperties struct {
// Sku - Gets or sets the SKU.
Sku *Sku `json:"sku,omitempty"`
// State - Gets or sets the state. Possible values include: 'Enabled', 'Disabled', 'Suspended', 'Deleted'
State JobCollectionState `json:"state,omitempty"`
// Quota - Gets or sets the job collection quota.
Quota *JobCollectionQuota `json:"quota,omitempty"`
}
// JobCollectionQuota ...
type JobCollectionQuota struct {
// MaxJobCount - Gets or set the maximum job count.
MaxJobCount *int32 `json:"maxJobCount,omitempty"`
// MaxJobOccurrence - Gets or sets the maximum job occurrence.
MaxJobOccurrence *int32 `json:"maxJobOccurrence,omitempty"`
// MaxRecurrence - Gets or set the maximum recurrence.
MaxRecurrence *JobMaxRecurrence `json:"maxRecurrence,omitempty"`
}
// JobCollectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type JobCollectionsDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *JobCollectionsDeleteFuture) Result(client JobCollectionsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.Done(client)
if err != nil {
err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("scheduler.JobCollectionsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// JobCollectionsDisableFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type JobCollectionsDisableFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *JobCollectionsDisableFuture) Result(client JobCollectionsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.Done(client)
if err != nil {
err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsDisableFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("scheduler.JobCollectionsDisableFuture")
return
}
ar.Response = future.Response()
return
}
// JobCollectionsEnableFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type JobCollectionsEnableFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *JobCollectionsEnableFuture) Result(client JobCollectionsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.Done(client)
if err != nil {
err = autorest.NewErrorWithError(err, "scheduler.JobCollectionsEnableFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("scheduler.JobCollectionsEnableFuture")
return
}
ar.Response = future.Response()
return
}
// JobDefinition ...
type JobDefinition struct {
autorest.Response `json:"-"`
// ID - Gets the job resource identifier.
ID *string `json:"id,omitempty"`
// Type - Gets the job resource type.
Type *string `json:"type,omitempty"`
// Name - Gets the job resource name.
Name *string `json:"name,omitempty"`
// Properties - Gets or sets the job properties.
Properties *JobProperties `json:"properties,omitempty"`
}
// JobErrorAction ...
type JobErrorAction struct {
// Type - Gets or sets the job error action type. Possible values include: 'HTTP', 'HTTPS', 'StorageQueue', 'ServiceBusQueue', 'ServiceBusTopic'
Type JobActionType `json:"type,omitempty"`
// Request - Gets or sets the http requests.
Request *HTTPRequest `json:"request,omitempty"`
// QueueMessage - Gets or sets the storage queue message.
QueueMessage *StorageQueueMessage `json:"queueMessage,omitempty"`
// ServiceBusQueueMessage - Gets or sets the service bus queue message.
ServiceBusQueueMessage *ServiceBusQueueMessage `json:"serviceBusQueueMessage,omitempty"`
// ServiceBusTopicMessage - Gets or sets the service bus topic message.
ServiceBusTopicMessage *ServiceBusTopicMessage `json:"serviceBusTopicMessage,omitempty"`
// RetryPolicy - Gets or sets the retry policy.
RetryPolicy *RetryPolicy `json:"retryPolicy,omitempty"`
}
// JobHistoryDefinition ...
type JobHistoryDefinition struct {
// ID - Gets the job history identifier.
ID *string `json:"id,omitempty"`
// Type - Gets the job history resource type.
Type *string `json:"type,omitempty"`
// Name - Gets the job history name.
Name *string `json:"name,omitempty"`
// Properties - Gets or sets the job history properties.
Properties *JobHistoryDefinitionProperties `json:"properties,omitempty"`
}
// JobHistoryDefinitionProperties ...
type JobHistoryDefinitionProperties struct {
// StartTime - Gets the start time for this job.
StartTime *date.Time `json:"startTime,omitempty"`
// EndTime - Gets the end time for this job.
EndTime *date.Time `json:"endTime,omitempty"`
// ExpectedExecutionTime - Gets the expected execution time for this job.
ExpectedExecutionTime *date.Time `json:"expectedExecutionTime,omitempty"`
// ActionName - Gets the job history action name. Possible values include: 'MainAction', 'ErrorAction'
ActionName JobHistoryActionName `json:"actionName,omitempty"`
// Status - Gets the job history status. Possible values include: 'Completed', 'Failed', 'Postponed'
Status JobExecutionStatus `json:"status,omitempty"`
// Message - Gets the message for the job history.
Message *string `json:"message,omitempty"`
// RetryCount - Gets the retry count for job.
RetryCount *int32 `json:"retryCount,omitempty"`
// RepeatCount - Gets the repeat count for the job.
RepeatCount *int32 `json:"repeatCount,omitempty"`
}
// JobHistoryFilter ...
type JobHistoryFilter struct {
// Status - Gets or sets the job execution status. Possible values include: 'Completed', 'Failed', 'Postponed'
Status JobExecutionStatus `json:"status,omitempty"`
}
// JobHistoryListResult ...
type JobHistoryListResult struct {
autorest.Response `json:"-"`
// Value - Gets or sets the job histories under job.
Value *[]JobHistoryDefinition `json:"value,omitempty"`
// NextLink - Gets or sets the URL to get the next set of job histories.
NextLink *string `json:"nextLink,omitempty"`
}
// JobHistoryListResultIterator provides access to a complete listing of JobHistoryDefinition values.
type JobHistoryListResultIterator struct {
i int
page JobHistoryListResultPage
}
// 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 *JobHistoryListResultIterator) 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 JobHistoryListResultIterator) 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 JobHistoryListResultIterator) Response() JobHistoryListResult {
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 JobHistoryListResultIterator) Value() JobHistoryDefinition {
if !iter.page.NotDone() {
return JobHistoryDefinition{}
}
return iter.page.Values()[iter.i]
}
// IsEmpty returns true if the ListResult contains no values.
func (jhlr JobHistoryListResult) IsEmpty() bool {
return jhlr.Value == nil || len(*jhlr.Value) == 0
}
// jobHistoryListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (jhlr JobHistoryListResult) jobHistoryListResultPreparer() (*http.Request, error) {
if jhlr.NextLink == nil || len(to.String(jhlr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(jhlr.NextLink)))
}
// JobHistoryListResultPage contains a page of JobHistoryDefinition values.
type JobHistoryListResultPage struct {
fn func(JobHistoryListResult) (JobHistoryListResult, error)
jhlr JobHistoryListResult
}
// 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 *JobHistoryListResultPage) Next() error {
next, err := page.fn(page.jhlr)
if err != nil {
return err
}
page.jhlr = next
return nil
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page JobHistoryListResultPage) NotDone() bool {
return !page.jhlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page JobHistoryListResultPage) Response() JobHistoryListResult {
return page.jhlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page JobHistoryListResultPage) Values() []JobHistoryDefinition {
if page.jhlr.IsEmpty() {
return nil
}
return *page.jhlr.Value
}
// JobListResult ...
type JobListResult struct {
autorest.Response `json:"-"`
// Value - Gets or sets all jobs under job collection.
Value *[]JobDefinition `json:"value,omitempty"`