-
Notifications
You must be signed in to change notification settings - Fork 796
/
models.go
2016 lines (1804 loc) · 71.3 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 datadog
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// 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/preview/datadog/mgmt/2020-02-01-preview/datadog"
// AgreementProperties terms properties.
type AgreementProperties struct {
// Publisher - Publisher identifier string.
Publisher *string `json:"publisher,omitempty"`
// Product - Product identifier string.
Product *string `json:"product,omitempty"`
// Plan - Plan identifier string.
Plan *string `json:"plan,omitempty"`
// LicenseTextLink - Link to HTML with Microsoft and Publisher terms.
LicenseTextLink *string `json:"licenseTextLink,omitempty"`
// PrivacyPolicyLink - Link to the privacy policy of the publisher.
PrivacyPolicyLink *string `json:"privacyPolicyLink,omitempty"`
// RetrieveDatetime - Date and time in UTC of when the terms were accepted. This is empty if Accepted is false.
RetrieveDatetime *date.Time `json:"retrieveDatetime,omitempty"`
// Signature - Terms signature.
Signature *string `json:"signature,omitempty"`
// Accepted - If any version of the terms have been accepted, otherwise false.
Accepted *bool `json:"accepted,omitempty"`
}
// AgreementResource ...
type AgreementResource struct {
autorest.Response `json:"-"`
// ID - READ-ONLY; ARM id of the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Name of the agreement.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
// Properties - Represents the properties of the resource.
Properties *AgreementProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for AgreementResource.
func (ar AgreementResource) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ar.Properties != nil {
objectMap["properties"] = ar.Properties
}
return json.Marshal(objectMap)
}
// AgreementResourceListResponse response of a list operation.
type AgreementResourceListResponse struct {
autorest.Response `json:"-"`
// Value - Results of a list operation.
Value *[]AgreementResource `json:"value,omitempty"`
// NextLink - Link to the next set of results, if any.
NextLink *string `json:"nextLink,omitempty"`
}
// AgreementResourceListResponseIterator provides access to a complete listing of AgreementResource values.
type AgreementResourceListResponseIterator struct {
i int
page AgreementResourceListResponsePage
}
// 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 *AgreementResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AgreementResourceListResponseIterator.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 *AgreementResourceListResponseIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter AgreementResourceListResponseIterator) 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 AgreementResourceListResponseIterator) Response() AgreementResourceListResponse {
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 AgreementResourceListResponseIterator) Value() AgreementResource {
if !iter.page.NotDone() {
return AgreementResource{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the AgreementResourceListResponseIterator type.
func NewAgreementResourceListResponseIterator(page AgreementResourceListResponsePage) AgreementResourceListResponseIterator {
return AgreementResourceListResponseIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (arlr AgreementResourceListResponse) IsEmpty() bool {
return arlr.Value == nil || len(*arlr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (arlr AgreementResourceListResponse) hasNextLink() bool {
return arlr.NextLink != nil && len(*arlr.NextLink) != 0
}
// agreementResourceListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (arlr AgreementResourceListResponse) agreementResourceListResponsePreparer(ctx context.Context) (*http.Request, error) {
if !arlr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(arlr.NextLink)))
}
// AgreementResourceListResponsePage contains a page of AgreementResource values.
type AgreementResourceListResponsePage struct {
fn func(context.Context, AgreementResourceListResponse) (AgreementResourceListResponse, error)
arlr AgreementResourceListResponse
}
// 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 *AgreementResourceListResponsePage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/AgreementResourceListResponsePage.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.arlr)
if err != nil {
return err
}
page.arlr = 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 *AgreementResourceListResponsePage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page AgreementResourceListResponsePage) NotDone() bool {
return !page.arlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page AgreementResourceListResponsePage) Response() AgreementResourceListResponse {
return page.arlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page AgreementResourceListResponsePage) Values() []AgreementResource {
if page.arlr.IsEmpty() {
return nil
}
return *page.arlr.Value
}
// Creates a new instance of the AgreementResourceListResponsePage type.
func NewAgreementResourceListResponsePage(cur AgreementResourceListResponse, getNextPage func(context.Context, AgreementResourceListResponse) (AgreementResourceListResponse, error)) AgreementResourceListResponsePage {
return AgreementResourceListResponsePage{
fn: getNextPage,
arlr: cur,
}
}
// APIKey ...
type APIKey struct {
autorest.Response `json:"-"`
// CreatedBy - The user that created the API key.
CreatedBy *string `json:"createdBy,omitempty"`
// Name - The name of the API key.
Name *string `json:"name,omitempty"`
// Key - The value of the API key.
Key *string `json:"key,omitempty"`
// Created - The time of creation of the API key.
Created *string `json:"created,omitempty"`
}
// APIKeyListResponse response of a list operation.
type APIKeyListResponse struct {
autorest.Response `json:"-"`
// Value - Results of a list operation.
Value *[]APIKey `json:"value,omitempty"`
// NextLink - Link to the next set of results, if any.
NextLink *string `json:"nextLink,omitempty"`
}
// APIKeyListResponseIterator provides access to a complete listing of APIKey values.
type APIKeyListResponseIterator struct {
i int
page APIKeyListResponsePage
}
// 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 *APIKeyListResponseIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResponseIterator.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 *APIKeyListResponseIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter APIKeyListResponseIterator) 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 APIKeyListResponseIterator) Response() APIKeyListResponse {
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 APIKeyListResponseIterator) Value() APIKey {
if !iter.page.NotDone() {
return APIKey{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the APIKeyListResponseIterator type.
func NewAPIKeyListResponseIterator(page APIKeyListResponsePage) APIKeyListResponseIterator {
return APIKeyListResponseIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (aklr APIKeyListResponse) IsEmpty() bool {
return aklr.Value == nil || len(*aklr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (aklr APIKeyListResponse) hasNextLink() bool {
return aklr.NextLink != nil && len(*aklr.NextLink) != 0
}
// aPIKeyListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (aklr APIKeyListResponse) aPIKeyListResponsePreparer(ctx context.Context) (*http.Request, error) {
if !aklr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(aklr.NextLink)))
}
// APIKeyListResponsePage contains a page of APIKey values.
type APIKeyListResponsePage struct {
fn func(context.Context, APIKeyListResponse) (APIKeyListResponse, error)
aklr APIKeyListResponse
}
// 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 *APIKeyListResponsePage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResponsePage.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.aklr)
if err != nil {
return err
}
page.aklr = 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 *APIKeyListResponsePage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page APIKeyListResponsePage) NotDone() bool {
return !page.aklr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page APIKeyListResponsePage) Response() APIKeyListResponse {
return page.aklr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page APIKeyListResponsePage) Values() []APIKey {
if page.aklr.IsEmpty() {
return nil
}
return *page.aklr.Value
}
// Creates a new instance of the APIKeyListResponsePage type.
func NewAPIKeyListResponsePage(cur APIKeyListResponse, getNextPage func(context.Context, APIKeyListResponse) (APIKeyListResponse, error)) APIKeyListResponsePage {
return APIKeyListResponsePage{
fn: getNextPage,
aklr: cur,
}
}
// ErrorResponseBody ...
type ErrorResponseBody struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
Details *[]ErrorResponseBody `json:"details,omitempty"`
}
// FilteringTag the definition of a filtering tag. Filtering tags are used for capturing resources and
// include/exclude them from being monitored.
type FilteringTag struct {
// Name - The name (also known as the key) of the tag.
Name *string `json:"name,omitempty"`
// Value - The value of the tag.
Value *string `json:"value,omitempty"`
// Action - Possible values include: 'Include', 'Exclude'
Action TagAction `json:"action,omitempty"`
}
// Host ...
type Host struct {
// Name - The name of the host.
Name *string `json:"name,omitempty"`
// Aliases - The aliases for the host.
Aliases *[]string `json:"aliases,omitempty"`
// Apps - The Datadog integrations reporting metrics for the host.
Apps *[]string `json:"apps,omitempty"`
Meta *HostMetadata `json:"meta,omitempty"`
}
// HostListResponse response of a list operation.
type HostListResponse struct {
autorest.Response `json:"-"`
// Value - Results of a list operation.
Value *[]Host `json:"value,omitempty"`
// NextLink - Link to the next set of results, if any.
NextLink *string `json:"nextLink,omitempty"`
}
// HostListResponseIterator provides access to a complete listing of Host values.
type HostListResponseIterator struct {
i int
page HostListResponsePage
}
// 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 *HostListResponseIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/HostListResponseIterator.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 *HostListResponseIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter HostListResponseIterator) 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 HostListResponseIterator) Response() HostListResponse {
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 HostListResponseIterator) Value() Host {
if !iter.page.NotDone() {
return Host{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the HostListResponseIterator type.
func NewHostListResponseIterator(page HostListResponsePage) HostListResponseIterator {
return HostListResponseIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (hlr HostListResponse) IsEmpty() bool {
return hlr.Value == nil || len(*hlr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (hlr HostListResponse) hasNextLink() bool {
return hlr.NextLink != nil && len(*hlr.NextLink) != 0
}
// hostListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (hlr HostListResponse) hostListResponsePreparer(ctx context.Context) (*http.Request, error) {
if !hlr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(hlr.NextLink)))
}
// HostListResponsePage contains a page of Host values.
type HostListResponsePage struct {
fn func(context.Context, HostListResponse) (HostListResponse, error)
hlr HostListResponse
}
// 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 *HostListResponsePage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/HostListResponsePage.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.hlr)
if err != nil {
return err
}
page.hlr = 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 *HostListResponsePage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page HostListResponsePage) NotDone() bool {
return !page.hlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page HostListResponsePage) Response() HostListResponse {
return page.hlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page HostListResponsePage) Values() []Host {
if page.hlr.IsEmpty() {
return nil
}
return *page.hlr.Value
}
// Creates a new instance of the HostListResponsePage type.
func NewHostListResponsePage(cur HostListResponse, getNextPage func(context.Context, HostListResponse) (HostListResponse, error)) HostListResponsePage {
return HostListResponsePage{
fn: getNextPage,
hlr: cur,
}
}
// HostMetadata ...
type HostMetadata struct {
// AgentVersion - The agent version.
AgentVersion *string `json:"agentVersion,omitempty"`
InstallMethod *InstallMethod `json:"installMethod,omitempty"`
LogsAgent *LogsAgent `json:"logsAgent,omitempty"`
}
// IdentityProperties ...
type IdentityProperties struct {
// PrincipalID - READ-ONLY; The identity ID.
PrincipalID *string `json:"principalId,omitempty"`
// TenantID - READ-ONLY; The tenant ID of resource.
TenantID *string `json:"tenantId,omitempty"`
// Type - Possible values include: 'SystemAssigned', 'UserAssigned'
Type ManagedIdentityTypes `json:"type,omitempty"`
}
// MarshalJSON is the custom marshaler for IdentityProperties.
func (IP IdentityProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if IP.Type != "" {
objectMap["type"] = IP.Type
}
return json.Marshal(objectMap)
}
// InstallMethod ...
type InstallMethod struct {
// Tool - The tool.
Tool *string `json:"tool,omitempty"`
// ToolVersion - The tool version.
ToolVersion *string `json:"toolVersion,omitempty"`
// InstallerVersion - The installer version.
InstallerVersion *string `json:"installerVersion,omitempty"`
}
// LinkedResource the definition of a linked resource.
type LinkedResource struct {
// ID - The ARM id of the linked resource.
ID *string `json:"id,omitempty"`
}
// LinkedResourceListResponse response of a list operation.
type LinkedResourceListResponse struct {
autorest.Response `json:"-"`
// Value - Results of a list operation.
Value *[]LinkedResource `json:"value,omitempty"`
// NextLink - Link to the next set of results, if any.
NextLink *string `json:"nextLink,omitempty"`
}
// LinkedResourceListResponseIterator provides access to a complete listing of LinkedResource values.
type LinkedResourceListResponseIterator struct {
i int
page LinkedResourceListResponsePage
}
// 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 *LinkedResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LinkedResourceListResponseIterator.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 *LinkedResourceListResponseIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter LinkedResourceListResponseIterator) 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 LinkedResourceListResponseIterator) Response() LinkedResourceListResponse {
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 LinkedResourceListResponseIterator) Value() LinkedResource {
if !iter.page.NotDone() {
return LinkedResource{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the LinkedResourceListResponseIterator type.
func NewLinkedResourceListResponseIterator(page LinkedResourceListResponsePage) LinkedResourceListResponseIterator {
return LinkedResourceListResponseIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (lrlr LinkedResourceListResponse) IsEmpty() bool {
return lrlr.Value == nil || len(*lrlr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (lrlr LinkedResourceListResponse) hasNextLink() bool {
return lrlr.NextLink != nil && len(*lrlr.NextLink) != 0
}
// linkedResourceListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (lrlr LinkedResourceListResponse) linkedResourceListResponsePreparer(ctx context.Context) (*http.Request, error) {
if !lrlr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(lrlr.NextLink)))
}
// LinkedResourceListResponsePage contains a page of LinkedResource values.
type LinkedResourceListResponsePage struct {
fn func(context.Context, LinkedResourceListResponse) (LinkedResourceListResponse, error)
lrlr LinkedResourceListResponse
}
// 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 *LinkedResourceListResponsePage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/LinkedResourceListResponsePage.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.lrlr)
if err != nil {
return err
}
page.lrlr = 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 *LinkedResourceListResponsePage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page LinkedResourceListResponsePage) NotDone() bool {
return !page.lrlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page LinkedResourceListResponsePage) Response() LinkedResourceListResponse {
return page.lrlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page LinkedResourceListResponsePage) Values() []LinkedResource {
if page.lrlr.IsEmpty() {
return nil
}
return *page.lrlr.Value
}
// Creates a new instance of the LinkedResourceListResponsePage type.
func NewLinkedResourceListResponsePage(cur LinkedResourceListResponse, getNextPage func(context.Context, LinkedResourceListResponse) (LinkedResourceListResponse, error)) LinkedResourceListResponsePage {
return LinkedResourceListResponsePage{
fn: getNextPage,
lrlr: cur,
}
}
// LogRules set of rules for sending logs for the Monitor resource.
type LogRules struct {
// SendAadLogs - Flag specifying if AAD logs should be sent for the Monitor resource.
SendAadLogs *bool `json:"sendAadLogs,omitempty"`
// SendSubscriptionLogs - Flag specifying if Azure subscription logs should be sent for the Monitor resource.
SendSubscriptionLogs *bool `json:"sendSubscriptionLogs,omitempty"`
// SendResourceLogs - Flag specifying if Azure resource logs should be sent for the Monitor resource.
SendResourceLogs *bool `json:"sendResourceLogs,omitempty"`
// FilteringTags - List of filtering tags to be used for capturing logs. This only takes effect if SendResourceLogs flag is enabled. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
FilteringTags *[]FilteringTag `json:"filteringTags,omitempty"`
}
// LogsAgent ...
type LogsAgent struct {
// Transport - The transport.
Transport *string `json:"transport,omitempty"`
}
// MetricRules set of rules for sending metrics for the Monitor resource.
type MetricRules struct {
// FilteringTags - List of filtering tags to be used for capturing metrics. If empty, all resources will be captured. If only Exclude action is specified, the rules will apply to the list of all available resources. If Include actions are specified, the rules will only include resources with the associated tags.
FilteringTags *[]FilteringTag `json:"filteringTags,omitempty"`
}
// MonitoredResource the properties of a resource currently being monitored by the Datadog monitor
// resource.
type MonitoredResource struct {
// ID - The ARM id of the resource.
ID *string `json:"id,omitempty"`
// SendingMetrics - Flag indicating if resource is sending metrics to Datadog.
SendingMetrics *bool `json:"sendingMetrics,omitempty"`
// ReasonForMetricsStatus - Reason for why the resource is sending metrics (or why it is not sending).
ReasonForMetricsStatus *string `json:"reasonForMetricsStatus,omitempty"`
// SendingLogs - Flag indicating if resource is sending logs to Datadog.
SendingLogs *bool `json:"sendingLogs,omitempty"`
// ReasonForLogsStatus - Reason for why the resource is sending logs (or why it is not sending).
ReasonForLogsStatus *string `json:"reasonForLogsStatus,omitempty"`
}
// MonitoredResourceListResponse response of a list operation.
type MonitoredResourceListResponse struct {
autorest.Response `json:"-"`
// Value - Results of a list operation.
Value *[]MonitoredResource `json:"value,omitempty"`
// NextLink - Link to the next set of results, if any.
NextLink *string `json:"nextLink,omitempty"`
}
// MonitoredResourceListResponseIterator provides access to a complete listing of MonitoredResource values.
type MonitoredResourceListResponseIterator struct {
i int
page MonitoredResourceListResponsePage
}
// 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 *MonitoredResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MonitoredResourceListResponseIterator.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 *MonitoredResourceListResponseIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter MonitoredResourceListResponseIterator) 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 MonitoredResourceListResponseIterator) Response() MonitoredResourceListResponse {
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 MonitoredResourceListResponseIterator) Value() MonitoredResource {
if !iter.page.NotDone() {
return MonitoredResource{}
}
return iter.page.Values()[iter.i]
}
// Creates a new instance of the MonitoredResourceListResponseIterator type.
func NewMonitoredResourceListResponseIterator(page MonitoredResourceListResponsePage) MonitoredResourceListResponseIterator {
return MonitoredResourceListResponseIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
func (mrlr MonitoredResourceListResponse) IsEmpty() bool {
return mrlr.Value == nil || len(*mrlr.Value) == 0
}
// hasNextLink returns true if the NextLink is not empty.
func (mrlr MonitoredResourceListResponse) hasNextLink() bool {
return mrlr.NextLink != nil && len(*mrlr.NextLink) != 0
}
// monitoredResourceListResponsePreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (mrlr MonitoredResourceListResponse) monitoredResourceListResponsePreparer(ctx context.Context) (*http.Request, error) {
if !mrlr.hasNextLink() {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(mrlr.NextLink)))
}
// MonitoredResourceListResponsePage contains a page of MonitoredResource values.
type MonitoredResourceListResponsePage struct {
fn func(context.Context, MonitoredResourceListResponse) (MonitoredResourceListResponse, error)
mrlr MonitoredResourceListResponse
}
// 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 *MonitoredResourceListResponsePage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/MonitoredResourceListResponsePage.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.mrlr)
if err != nil {
return err
}
page.mrlr = 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 *MonitoredResourceListResponsePage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page MonitoredResourceListResponsePage) NotDone() bool {
return !page.mrlr.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page MonitoredResourceListResponsePage) Response() MonitoredResourceListResponse {
return page.mrlr
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page MonitoredResourceListResponsePage) Values() []MonitoredResource {
if page.mrlr.IsEmpty() {
return nil
}
return *page.mrlr.Value
}
// Creates a new instance of the MonitoredResourceListResponsePage type.
func NewMonitoredResourceListResponsePage(cur MonitoredResourceListResponse, getNextPage func(context.Context, MonitoredResourceListResponse) (MonitoredResourceListResponse, error)) MonitoredResourceListResponsePage {
return MonitoredResourceListResponsePage{
fn: getNextPage,
mrlr: cur,
}
}
// MonitoringTagRules capture logs and metrics of Azure resources based on ARM tags.
type MonitoringTagRules struct {
autorest.Response `json:"-"`
// Name - READ-ONLY; Name of the rule set.
Name *string `json:"name,omitempty"`
// ID - READ-ONLY; The id of the rule set.
ID *string `json:"id,omitempty"`
// Type - READ-ONLY; The type of the rule set.
Type *string `json:"type,omitempty"`
Properties *MonitoringTagRulesProperties `json:"properties,omitempty"`
}
// MarshalJSON is the custom marshaler for MonitoringTagRules.
func (mtr MonitoringTagRules) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mtr.Properties != nil {