forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
3762 lines (3437 loc) · 129 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 servicebus
// 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 (
"context"
"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"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/servicebus/mgmt/2017-04-01/servicebus"
// AccessKeys namespace/ServiceBus Connection String
type AccessKeys struct {
autorest.Response `json:"-"`
// PrimaryConnectionString - READ-ONLY; Primary connection string of the created namespace authorization rule.
PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"`
// SecondaryConnectionString - READ-ONLY; Secondary connection string of the created namespace authorization rule.
SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"`
// AliasPrimaryConnectionString - READ-ONLY; Primary connection string of the alias if GEO DR is enabled
AliasPrimaryConnectionString *string `json:"aliasPrimaryConnectionString,omitempty"`
// AliasSecondaryConnectionString - READ-ONLY; Secondary connection string of the alias if GEO DR is enabled
AliasSecondaryConnectionString *string `json:"aliasSecondaryConnectionString,omitempty"`
// PrimaryKey - READ-ONLY; A base64-encoded 256-bit primary key for signing and validating the SAS token.
PrimaryKey *string `json:"primaryKey,omitempty"`
// SecondaryKey - READ-ONLY; A base64-encoded 256-bit primary key for signing and validating the SAS token.
SecondaryKey *string `json:"secondaryKey,omitempty"`
// KeyName - READ-ONLY; A string that describes the authorization rule.
KeyName *string `json:"keyName,omitempty"`
}
// Action represents the filter actions which are allowed for the transformation of a message that have
// been matched by a filter expression.
type Action struct {
// SQLExpression - SQL expression. e.g. MyProperty='ABC'
SQLExpression *string `json:"sqlExpression,omitempty"`
// CompatibilityLevel - This property is reserved for future use. An integer value showing the compatibility level, currently hard-coded to 20.
CompatibilityLevel *int32 `json:"compatibilityLevel,omitempty"`
// RequiresPreprocessing - Value that indicates whether the rule action requires preprocessing.
RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"`
}
// ArmDisasterRecovery single item in List or Get Alias(Disaster Recovery configuration) operation
type ArmDisasterRecovery struct {
autorest.Response `json:"-"`
// ArmDisasterRecoveryProperties - Properties required to the Create Or Update Alias(Disaster Recovery configurations)
*ArmDisasterRecoveryProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for ArmDisasterRecovery.
func (adr ArmDisasterRecovery) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if adr.ArmDisasterRecoveryProperties != nil {
objectMap["properties"] = adr.ArmDisasterRecoveryProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for ArmDisasterRecovery struct.
func (adr *ArmDisasterRecovery) 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 armDisasterRecoveryProperties ArmDisasterRecoveryProperties
err = json.Unmarshal(*v, &armDisasterRecoveryProperties)
if err != nil {
return err
}
adr.ArmDisasterRecoveryProperties = &armDisasterRecoveryProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
adr.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
adr.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
adr.Type = &typeVar
}
}
}
return nil
}
// ArmDisasterRecoveryListResult the result of the List Alias(Disaster Recovery configuration) operation.
type ArmDisasterRecoveryListResult struct {
autorest.Response `json:"-"`
// Value - List of Alias(Disaster Recovery configurations)
Value *[]ArmDisasterRecovery `json:"value,omitempty"`
// NextLink - READ-ONLY; Link to the next set of results. Not empty if Value contains incomplete list of Alias(Disaster Recovery configuration)
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for ArmDisasterRecoveryListResult.
func (adrlr ArmDisasterRecoveryListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if adrlr.Value != nil {
objectMap["value"] = adrlr.Value
}
return json.Marshal(objectMap)
}
// ArmDisasterRecoveryListResultIterator provides access to a complete listing of ArmDisasterRecovery
// values.
type ArmDisasterRecoveryListResultIterator struct {
i int
page ArmDisasterRecoveryListResultPage
}
// NextWithContext 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 *ArmDisasterRecoveryListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ArmDisasterRecoveryListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ArmDisasterRecoveryListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter ArmDisasterRecoveryListResultIterator) 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 ArmDisasterRecoveryListResultIterator) Response() ArmDisasterRecoveryListResult {
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 ArmDisasterRecoveryListResultIterator) Value() ArmDisasterRecovery {
if !iter.page.NotDone() {
return ArmDisasterRecovery{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the ArmDisasterRecoveryListResultIterator type.
func NewArmDisasterRecoveryListResultIterator(page ArmDisasterRecoveryListResultPage) ArmDisasterRecoveryListResultIterator {
return ArmDisasterRecoveryListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (adrlr ArmDisasterRecoveryListResult) IsEmpty() bool {
return adrlr.Value == nil || len(*adrlr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (adrlr ArmDisasterRecoveryListResult) hasNextLink() bool {
return adrlr.NextLink != nil && len(*adrlr.NextLink) != 0
}
// armDisasterRecoveryListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (adrlr ArmDisasterRecoveryListResult) armDisasterRecoveryListResultPreparer(ctx context.Context) (*http.Request, error) {
if !adrlr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(adrlr.NextLink)))
}
// ArmDisasterRecoveryListResultPage contains a page of ArmDisasterRecovery values.
type ArmDisasterRecoveryListResultPage struct {
fn func(context.Context, ArmDisasterRecoveryListResult) (ArmDisasterRecoveryListResult, error)
adrlr ArmDisasterRecoveryListResult
}
// NextWithContext 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 *ArmDisasterRecoveryListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ArmDisasterRecoveryListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.adrlr)
if err != nil {
return err
}
page.adrlr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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.
// Deprecated: Use NextWithContext() instead.
func (page *ArmDisasterRecoveryListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page ArmDisasterRecoveryListResultPage) NotDone() bool {
return !page.adrlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page ArmDisasterRecoveryListResultPage) Response() ArmDisasterRecoveryListResult {
return page.adrlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page ArmDisasterRecoveryListResultPage) Values() []ArmDisasterRecovery {
if page.adrlr.IsEmpty() {
return nil
}
return *page.adrlr.Value
}
// Creates a new instance of the ArmDisasterRecoveryListResultPage type.
func NewArmDisasterRecoveryListResultPage(cur ArmDisasterRecoveryListResult, getNextPage func(context.Context, ArmDisasterRecoveryListResult) (ArmDisasterRecoveryListResult, error)) ArmDisasterRecoveryListResultPage {
return ArmDisasterRecoveryListResultPage{
fn: getNextPage,
adrlr: cur,
}
}
// ArmDisasterRecoveryProperties properties required to the Create Or Update Alias(Disaster Recovery
// configurations)
type ArmDisasterRecoveryProperties struct {
// ProvisioningState - READ-ONLY; Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed'
ProvisioningState ProvisioningStateDR `json:"provisioningState,omitempty"`
// PendingReplicationOperationsCount - READ-ONLY; Number of entities pending to be replicated.
PendingReplicationOperationsCount *int64 `json:"pendingReplicationOperationsCount,omitempty"`
// PartnerNamespace - ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing
PartnerNamespace *string `json:"partnerNamespace,omitempty"`
// AlternateName - Primary/Secondary eventhub namespace name, which is part of GEO DR pairing
AlternateName *string `json:"alternateName,omitempty"`
// Role - READ-ONLY; role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values include: 'Primary', 'PrimaryNotReplicating', 'Secondary'
Role RoleDisasterRecovery `json:"role,omitempty"`
}
// MarshalJSON is the custom marshaler for ArmDisasterRecoveryProperties.
func (adr ArmDisasterRecoveryProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if adr.PartnerNamespace != nil {
objectMap["partnerNamespace"] = adr.PartnerNamespace
}
if adr.AlternateName != nil {
objectMap["alternateName"] = adr.AlternateName
}
return json.Marshal(objectMap)
}
// CaptureDescription properties to configure capture description for eventhub
type CaptureDescription struct {
// Enabled - A value that indicates whether capture description is enabled.
Enabled *bool `json:"enabled,omitempty"`
// Encoding - Enumerates the possible values for the encoding format of capture description. Possible values include: 'Avro', 'AvroDeflate'
Encoding EncodingCaptureDescription `json:"encoding,omitempty"`
// IntervalInSeconds - The time window allows you to set the frequency with which the capture to Azure Blobs will happen, value should between 60 to 900 seconds
IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"`
// SizeLimitInBytes - The size window defines the amount of data built up in your Event Hub before an capture operation, value should be between 10485760 and 524288000 bytes
SizeLimitInBytes *int32 `json:"sizeLimitInBytes,omitempty"`
// Destination - Properties of Destination where capture will be stored. (Storage Account, Blob Names)
Destination *Destination `json:"destination,omitempty"`
}
// CheckNameAvailability description of a Check Name availability request properties.
type CheckNameAvailability struct {
// Name - The Name to check the namespace name availability and The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number.
Name *string `json:"name,omitempty"`
}
// CheckNameAvailabilityResult description of a Check Name availability request properties.
type CheckNameAvailabilityResult struct {
autorest.Response `json:"-"`
// Message - READ-ONLY; The detailed info regarding the reason associated with the namespace.
Message *string `json:"message,omitempty"`
// NameAvailable - Value indicating namespace is availability, true if the namespace is available; otherwise, false.
NameAvailable *bool `json:"nameAvailable,omitempty"`
// Reason - The reason for unavailability of a namespace. Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription'
Reason UnavailableReason `json:"reason,omitempty"`
}
// MarshalJSON is the custom marshaler for CheckNameAvailabilityResult.
func (cnar CheckNameAvailabilityResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cnar.NameAvailable != nil {
objectMap["nameAvailable"] = cnar.NameAvailable
}
if cnar.Reason != "" {
objectMap["reason"] = cnar.Reason
}
return json.Marshal(objectMap)
}
// CorrelationFilter represents the correlation filter expression.
type CorrelationFilter struct {
// Properties - dictionary object for custom filters
Properties map[string]*string `json:"properties"`
// CorrelationID - Identifier of the correlation.
CorrelationID *string `json:"correlationId,omitempty"`
// MessageID - Identifier of the message.
MessageID *string `json:"messageId,omitempty"`
// To - Address to send to.
To *string `json:"to,omitempty"`
// ReplyTo - Address of the queue to reply to.
ReplyTo *string `json:"replyTo,omitempty"`
// Label - Application specific label.
Label *string `json:"label,omitempty"`
// SessionID - Session identifier.
SessionID *string `json:"sessionId,omitempty"`
// ReplyToSessionID - Session identifier to reply to.
ReplyToSessionID *string `json:"replyToSessionId,omitempty"`
// ContentType - Content type of the message.
ContentType *string `json:"contentType,omitempty"`
// RequiresPreprocessing - Value that indicates whether the rule action requires preprocessing.
RequiresPreprocessing *bool `json:"requiresPreprocessing,omitempty"`
}
// MarshalJSON is the custom marshaler for CorrelationFilter.
func (cf CorrelationFilter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if cf.Properties != nil {
objectMap["properties"] = cf.Properties
}
if cf.CorrelationID != nil {
objectMap["correlationId"] = cf.CorrelationID
}
if cf.MessageID != nil {
objectMap["messageId"] = cf.MessageID
}
if cf.To != nil {
objectMap["to"] = cf.To
}
if cf.ReplyTo != nil {
objectMap["replyTo"] = cf.ReplyTo
}
if cf.Label != nil {
objectMap["label"] = cf.Label
}
if cf.SessionID != nil {
objectMap["sessionId"] = cf.SessionID
}
if cf.ReplyToSessionID != nil {
objectMap["replyToSessionId"] = cf.ReplyToSessionID
}
if cf.ContentType != nil {
objectMap["contentType"] = cf.ContentType
}
if cf.RequiresPreprocessing != nil {
objectMap["requiresPreprocessing"] = cf.RequiresPreprocessing
}
return json.Marshal(objectMap)
}
// Destination capture storage details for capture description
type Destination struct {
// Name - Name for capture destination
Name *string `json:"name,omitempty"`
// DestinationProperties - Properties describing the storage account, blob container and archive name format for capture destination
*DestinationProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for Destination.
func (d Destination) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if d.Name != nil {
objectMap["name"] = d.Name
}
if d.DestinationProperties != nil {
objectMap["properties"] = d.DestinationProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Destination struct.
func (d *Destination) 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 "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
d.Name = &name
}
case "properties":
if v != nil {
var destinationProperties DestinationProperties
err = json.Unmarshal(*v, &destinationProperties)
if err != nil {
return err
}
d.DestinationProperties = &destinationProperties
}
}
}
return nil
}
// DestinationProperties properties describing the storage account, blob container and archive name format
// for capture destination
type DestinationProperties struct {
// StorageAccountResourceID - Resource id of the storage account to be used to create the blobs
StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
// BlobContainer - Blob container Name
BlobContainer *string `json:"blobContainer,omitempty"`
// ArchiveNameFormat - Blob naming convention for archive, e.g. {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order
ArchiveNameFormat *string `json:"archiveNameFormat,omitempty"`
}
// ErrorAdditionalInfo the resource management error additional info.
type ErrorAdditionalInfo struct {
// Type - READ-ONLY; The additional info type.
Type *string `json:"type,omitempty"`
// Info - READ-ONLY; The additional info.
Info interface{} `json:"info,omitempty"`
}
// ErrorResponse the resource management error response.
type ErrorResponse struct {
// Error - The error object.
Error *ErrorResponseError `json:"error,omitempty"`
}
// ErrorResponseError the error object.
type ErrorResponseError struct {
// Code - READ-ONLY; The error code.
Code *string `json:"code,omitempty"`
// Message - READ-ONLY; The error message.
Message *string `json:"message,omitempty"`
// Target - READ-ONLY; The error target.
Target *string `json:"target,omitempty"`
// Details - READ-ONLY; The error details.
Details *[]ErrorResponse `json:"details,omitempty"`
// AdditionalInfo - READ-ONLY; The error additional info.
AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
}
// Eventhub single item in List or Get Event Hub operation
type Eventhub struct {
// EventhubProperties - Properties supplied to the Create Or Update Event Hub operation.
*EventhubProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for Eventhub.
func (e Eventhub) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if e.EventhubProperties != nil {
objectMap["properties"] = e.EventhubProperties
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Eventhub struct.
func (e *Eventhub) 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 eventhubProperties EventhubProperties
err = json.Unmarshal(*v, &eventhubProperties)
if err != nil {
return err
}
e.EventhubProperties = &eventhubProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
e.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
e.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
e.Type = &typeVar
}
}
}
return nil
}
// EventHubListResult the result of the List EventHubs operation.
type EventHubListResult struct {
autorest.Response `json:"-"`
// Value - Result of the List EventHubs operation.
Value *[]Eventhub `json:"value,omitempty"`
// NextLink - READ-ONLY; Link to the next set of results. Not empty if Value contains incomplete list of EventHubs.
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for EventHubListResult.
func (ehlr EventHubListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ehlr.Value != nil {
objectMap["value"] = ehlr.Value
}
return json.Marshal(objectMap)
}
// EventHubListResultIterator provides access to a complete listing of Eventhub values.
type EventHubListResultIterator struct {
i int
page EventHubListResultPage
}
// NextWithContext 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 *EventHubListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/EventHubListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *EventHubListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter EventHubListResultIterator) 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 EventHubListResultIterator) Response() EventHubListResult {
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 EventHubListResultIterator) Value() Eventhub {
if !iter.page.NotDone() {
return Eventhub{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the EventHubListResultIterator type.
func NewEventHubListResultIterator(page EventHubListResultPage) EventHubListResultIterator {
return EventHubListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (ehlr EventHubListResult) IsEmpty() bool {
return ehlr.Value == nil || len(*ehlr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (ehlr EventHubListResult) hasNextLink() bool {
return ehlr.NextLink != nil && len(*ehlr.NextLink) != 0
}
// eventHubListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (ehlr EventHubListResult) eventHubListResultPreparer(ctx context.Context) (*http.Request, error) {
if !ehlr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(ehlr.NextLink)))
}
// EventHubListResultPage contains a page of Eventhub values.
type EventHubListResultPage struct {
fn func(context.Context, EventHubListResult) (EventHubListResult, error)
ehlr EventHubListResult
}
// NextWithContext 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 *EventHubListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/EventHubListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.ehlr)
if err != nil {
return err
}
page.ehlr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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.
// Deprecated: Use NextWithContext() instead.
func (page *EventHubListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page EventHubListResultPage) NotDone() bool {
return !page.ehlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page EventHubListResultPage) Response() EventHubListResult {
return page.ehlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page EventHubListResultPage) Values() []Eventhub {
if page.ehlr.IsEmpty() {
return nil
}
return *page.ehlr.Value
}
// Creates a new instance of the EventHubListResultPage type.
func NewEventHubListResultPage(cur EventHubListResult, getNextPage func(context.Context, EventHubListResult) (EventHubListResult, error)) EventHubListResultPage {
return EventHubListResultPage{
fn: getNextPage,
ehlr: cur,
}
}
// EventhubProperties properties supplied to the Create Or Update Event Hub operation.
type EventhubProperties struct {
// PartitionIds - READ-ONLY; Current number of shards on the Event Hub.
PartitionIds *[]string `json:"partitionIds,omitempty"`
// CreatedAt - READ-ONLY; Exact time the Event Hub was created.
CreatedAt *date.Time `json:"createdAt,omitempty"`
// UpdatedAt - READ-ONLY; The exact time the message was updated.
UpdatedAt *date.Time `json:"updatedAt,omitempty"`
// MessageRetentionInDays - Number of days to retain the events for this Event Hub, value should be 1 to 7 days
MessageRetentionInDays *int64 `json:"messageRetentionInDays,omitempty"`
// PartitionCount - Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
PartitionCount *int64 `json:"partitionCount,omitempty"`
// Status - Enumerates the possible values for the status of a Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', 'Unknown'
Status EntityStatus `json:"status,omitempty"`
// CaptureDescription - Properties of capture description
CaptureDescription *CaptureDescription `json:"captureDescription,omitempty"`
}
// MarshalJSON is the custom marshaler for EventhubProperties.
func (e EventhubProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if e.MessageRetentionInDays != nil {
objectMap["messageRetentionInDays"] = e.MessageRetentionInDays
}
if e.PartitionCount != nil {
objectMap["partitionCount"] = e.PartitionCount
}
if e.Status != "" {
objectMap["status"] = e.Status
}
if e.CaptureDescription != nil {
objectMap["captureDescription"] = e.CaptureDescription
}
return json.Marshal(objectMap)
}
// MessageCountDetails message Count Details.
type MessageCountDetails struct {
// ActiveMessageCount - READ-ONLY; Number of active messages in the queue, topic, or subscription.
ActiveMessageCount *int64 `json:"activeMessageCount,omitempty"`
// DeadLetterMessageCount - READ-ONLY; Number of messages that are dead lettered.
DeadLetterMessageCount *int64 `json:"deadLetterMessageCount,omitempty"`
// ScheduledMessageCount - READ-ONLY; Number of scheduled messages.
ScheduledMessageCount *int64 `json:"scheduledMessageCount,omitempty"`
// TransferMessageCount - READ-ONLY; Number of messages transferred to another queue, topic, or subscription.
TransferMessageCount *int64 `json:"transferMessageCount,omitempty"`
// TransferDeadLetterMessageCount - READ-ONLY; Number of messages transferred into dead letters.
TransferDeadLetterMessageCount *int64 `json:"transferDeadLetterMessageCount,omitempty"`
}
// MigrationConfigListResult the result of the List migrationConfigurations operation.
type MigrationConfigListResult struct {
autorest.Response `json:"-"`
// Value - List of Migration Configs
Value *[]MigrationConfigProperties `json:"value,omitempty"`
// NextLink - READ-ONLY; Link to the next set of results. Not empty if Value contains incomplete list of migrationConfigurations
NextLink *string `json:"nextLink,omitempty"`
}
// MarshalJSON is the custom marshaler for MigrationConfigListResult.
func (mclr MigrationConfigListResult) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mclr.Value != nil {
objectMap["value"] = mclr.Value
}
return json.Marshal(objectMap)
}
// MigrationConfigListResultIterator provides access to a complete listing of MigrationConfigProperties
// values.
type MigrationConfigListResultIterator struct {
i int
page MigrationConfigListResultPage
}
// NextWithContext 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 *MigrationConfigListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MigrationConfigListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *MigrationConfigListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter MigrationConfigListResultIterator) 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 MigrationConfigListResultIterator) Response() MigrationConfigListResult {
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 MigrationConfigListResultIterator) Value() MigrationConfigProperties {
if !iter.page.NotDone() {
return MigrationConfigProperties{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the MigrationConfigListResultIterator type.
func NewMigrationConfigListResultIterator(page MigrationConfigListResultPage) MigrationConfigListResultIterator {
return MigrationConfigListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (mclr MigrationConfigListResult) IsEmpty() bool {
return mclr.Value == nil || len(*mclr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (mclr MigrationConfigListResult) hasNextLink() bool {
return mclr.NextLink != nil && len(*mclr.NextLink) != 0
}
// migrationConfigListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (mclr MigrationConfigListResult) migrationConfigListResultPreparer(ctx context.Context) (*http.Request, error) {
if !mclr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(mclr.NextLink)))
}
// MigrationConfigListResultPage contains a page of MigrationConfigProperties values.
type MigrationConfigListResultPage struct {
fn func(context.Context, MigrationConfigListResult) (MigrationConfigListResult, error)
mclr MigrationConfigListResult
}
// NextWithContext 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 *MigrationConfigListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MigrationConfigListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
sc = page.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
for {
next, err := page.fn(ctx, page.mclr)
if err != nil {
return err
}
page.mclr = next
if !next.hasNextLink() || !next.IsEmpty() {
break
}
}
return nil
}
// 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.
// Deprecated: Use NextWithContext() instead.
func (page *MigrationConfigListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page MigrationConfigListResultPage) NotDone() bool {
return !page.mclr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page MigrationConfigListResultPage) Response() MigrationConfigListResult {
return page.mclr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page MigrationConfigListResultPage) Values() []MigrationConfigProperties {
if page.mclr.IsEmpty() {
return nil
}
return *page.mclr.Value
}
// Creates a new instance of the MigrationConfigListResultPage type.
func NewMigrationConfigListResultPage(cur MigrationConfigListResult, getNextPage func(context.Context, MigrationConfigListResult) (MigrationConfigListResult, error)) MigrationConfigListResultPage {
return MigrationConfigListResultPage{
fn: getNextPage,
mclr: cur,
}
}
// MigrationConfigProperties single item in List or Get Migration Config operation
type MigrationConfigProperties struct {
autorest.Response `json:"-"`
// MigrationConfigPropertiesProperties - Properties required to the Create Migration Configuration
*MigrationConfigPropertiesProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; Resource type
Type *string `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for MigrationConfigProperties.