1package datadog 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/datadog/mgmt/2020-02-01-preview/datadog" 22 23// AgreementProperties terms properties. 24type AgreementProperties struct { 25 // Publisher - Publisher identifier string. 26 Publisher *string `json:"publisher,omitempty"` 27 // Product - Product identifier string. 28 Product *string `json:"product,omitempty"` 29 // Plan - Plan identifier string. 30 Plan *string `json:"plan,omitempty"` 31 // LicenseTextLink - Link to HTML with Microsoft and Publisher terms. 32 LicenseTextLink *string `json:"licenseTextLink,omitempty"` 33 // PrivacyPolicyLink - Link to the privacy policy of the publisher. 34 PrivacyPolicyLink *string `json:"privacyPolicyLink,omitempty"` 35 // RetrieveDatetime - Date and time in UTC of when the terms were accepted. This is empty if Accepted is false. 36 RetrieveDatetime *date.Time `json:"retrieveDatetime,omitempty"` 37 // Signature - Terms signature. 38 Signature *string `json:"signature,omitempty"` 39 // Accepted - If any version of the terms have been accepted, otherwise false. 40 Accepted *bool `json:"accepted,omitempty"` 41} 42 43// AgreementResource ... 44type AgreementResource struct { 45 autorest.Response `json:"-"` 46 // ID - READ-ONLY; ARM id of the resource. 47 ID *string `json:"id,omitempty"` 48 // Name - READ-ONLY; Name of the agreement. 49 Name *string `json:"name,omitempty"` 50 // Type - READ-ONLY; The type of the resource. 51 Type *string `json:"type,omitempty"` 52 // Properties - Represents the properties of the resource. 53 Properties *AgreementProperties `json:"properties,omitempty"` 54} 55 56// MarshalJSON is the custom marshaler for AgreementResource. 57func (ar AgreementResource) MarshalJSON() ([]byte, error) { 58 objectMap := make(map[string]interface{}) 59 if ar.Properties != nil { 60 objectMap["properties"] = ar.Properties 61 } 62 return json.Marshal(objectMap) 63} 64 65// AgreementResourceListResponse response of a list operation. 66type AgreementResourceListResponse struct { 67 autorest.Response `json:"-"` 68 // Value - Results of a list operation. 69 Value *[]AgreementResource `json:"value,omitempty"` 70 // NextLink - Link to the next set of results, if any. 71 NextLink *string `json:"nextLink,omitempty"` 72} 73 74// AgreementResourceListResponseIterator provides access to a complete listing of AgreementResource values. 75type AgreementResourceListResponseIterator struct { 76 i int 77 page AgreementResourceListResponsePage 78} 79 80// NextWithContext advances to the next value. If there was an error making 81// the request the iterator does not advance and the error is returned. 82func (iter *AgreementResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) { 83 if tracing.IsEnabled() { 84 ctx = tracing.StartSpan(ctx, fqdn+"/AgreementResourceListResponseIterator.NextWithContext") 85 defer func() { 86 sc := -1 87 if iter.Response().Response.Response != nil { 88 sc = iter.Response().Response.Response.StatusCode 89 } 90 tracing.EndSpan(ctx, sc, err) 91 }() 92 } 93 iter.i++ 94 if iter.i < len(iter.page.Values()) { 95 return nil 96 } 97 err = iter.page.NextWithContext(ctx) 98 if err != nil { 99 iter.i-- 100 return err 101 } 102 iter.i = 0 103 return nil 104} 105 106// Next advances to the next value. If there was an error making 107// the request the iterator does not advance and the error is returned. 108// Deprecated: Use NextWithContext() instead. 109func (iter *AgreementResourceListResponseIterator) Next() error { 110 return iter.NextWithContext(context.Background()) 111} 112 113// NotDone returns true if the enumeration should be started or is not yet complete. 114func (iter AgreementResourceListResponseIterator) NotDone() bool { 115 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 116} 117 118// Response returns the raw server response from the last page request. 119func (iter AgreementResourceListResponseIterator) Response() AgreementResourceListResponse { 120 return iter.page.Response() 121} 122 123// Value returns the current value or a zero-initialized value if the 124// iterator has advanced beyond the end of the collection. 125func (iter AgreementResourceListResponseIterator) Value() AgreementResource { 126 if !iter.page.NotDone() { 127 return AgreementResource{} 128 } 129 return iter.page.Values()[iter.i] 130} 131 132// Creates a new instance of the AgreementResourceListResponseIterator type. 133func NewAgreementResourceListResponseIterator(page AgreementResourceListResponsePage) AgreementResourceListResponseIterator { 134 return AgreementResourceListResponseIterator{page: page} 135} 136 137// IsEmpty returns true if the ListResult contains no values. 138func (arlr AgreementResourceListResponse) IsEmpty() bool { 139 return arlr.Value == nil || len(*arlr.Value) == 0 140} 141 142// hasNextLink returns true if the NextLink is not empty. 143func (arlr AgreementResourceListResponse) hasNextLink() bool { 144 return arlr.NextLink != nil && len(*arlr.NextLink) != 0 145} 146 147// agreementResourceListResponsePreparer prepares a request to retrieve the next set of results. 148// It returns nil if no more results exist. 149func (arlr AgreementResourceListResponse) agreementResourceListResponsePreparer(ctx context.Context) (*http.Request, error) { 150 if !arlr.hasNextLink() { 151 return nil, nil 152 } 153 return autorest.Prepare((&http.Request{}).WithContext(ctx), 154 autorest.AsJSON(), 155 autorest.AsGet(), 156 autorest.WithBaseURL(to.String(arlr.NextLink))) 157} 158 159// AgreementResourceListResponsePage contains a page of AgreementResource values. 160type AgreementResourceListResponsePage struct { 161 fn func(context.Context, AgreementResourceListResponse) (AgreementResourceListResponse, error) 162 arlr AgreementResourceListResponse 163} 164 165// NextWithContext advances to the next page of values. If there was an error making 166// the request the page does not advance and the error is returned. 167func (page *AgreementResourceListResponsePage) NextWithContext(ctx context.Context) (err error) { 168 if tracing.IsEnabled() { 169 ctx = tracing.StartSpan(ctx, fqdn+"/AgreementResourceListResponsePage.NextWithContext") 170 defer func() { 171 sc := -1 172 if page.Response().Response.Response != nil { 173 sc = page.Response().Response.Response.StatusCode 174 } 175 tracing.EndSpan(ctx, sc, err) 176 }() 177 } 178 for { 179 next, err := page.fn(ctx, page.arlr) 180 if err != nil { 181 return err 182 } 183 page.arlr = next 184 if !next.hasNextLink() || !next.IsEmpty() { 185 break 186 } 187 } 188 return nil 189} 190 191// Next advances to the next page of values. If there was an error making 192// the request the page does not advance and the error is returned. 193// Deprecated: Use NextWithContext() instead. 194func (page *AgreementResourceListResponsePage) Next() error { 195 return page.NextWithContext(context.Background()) 196} 197 198// NotDone returns true if the page enumeration should be started or is not yet complete. 199func (page AgreementResourceListResponsePage) NotDone() bool { 200 return !page.arlr.IsEmpty() 201} 202 203// Response returns the raw server response from the last page request. 204func (page AgreementResourceListResponsePage) Response() AgreementResourceListResponse { 205 return page.arlr 206} 207 208// Values returns the slice of values for the current page or nil if there are no values. 209func (page AgreementResourceListResponsePage) Values() []AgreementResource { 210 if page.arlr.IsEmpty() { 211 return nil 212 } 213 return *page.arlr.Value 214} 215 216// Creates a new instance of the AgreementResourceListResponsePage type. 217func NewAgreementResourceListResponsePage(cur AgreementResourceListResponse, getNextPage func(context.Context, AgreementResourceListResponse) (AgreementResourceListResponse, error)) AgreementResourceListResponsePage { 218 return AgreementResourceListResponsePage{ 219 fn: getNextPage, 220 arlr: cur, 221 } 222} 223 224// APIKey ... 225type APIKey struct { 226 autorest.Response `json:"-"` 227 // CreatedBy - The user that created the API key. 228 CreatedBy *string `json:"createdBy,omitempty"` 229 // Name - The name of the API key. 230 Name *string `json:"name,omitempty"` 231 // Key - The value of the API key. 232 Key *string `json:"key,omitempty"` 233 // Created - The time of creation of the API key. 234 Created *string `json:"created,omitempty"` 235} 236 237// APIKeyListResponse response of a list operation. 238type APIKeyListResponse struct { 239 autorest.Response `json:"-"` 240 // Value - Results of a list operation. 241 Value *[]APIKey `json:"value,omitempty"` 242 // NextLink - Link to the next set of results, if any. 243 NextLink *string `json:"nextLink,omitempty"` 244} 245 246// APIKeyListResponseIterator provides access to a complete listing of APIKey values. 247type APIKeyListResponseIterator struct { 248 i int 249 page APIKeyListResponsePage 250} 251 252// NextWithContext advances to the next value. If there was an error making 253// the request the iterator does not advance and the error is returned. 254func (iter *APIKeyListResponseIterator) NextWithContext(ctx context.Context) (err error) { 255 if tracing.IsEnabled() { 256 ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResponseIterator.NextWithContext") 257 defer func() { 258 sc := -1 259 if iter.Response().Response.Response != nil { 260 sc = iter.Response().Response.Response.StatusCode 261 } 262 tracing.EndSpan(ctx, sc, err) 263 }() 264 } 265 iter.i++ 266 if iter.i < len(iter.page.Values()) { 267 return nil 268 } 269 err = iter.page.NextWithContext(ctx) 270 if err != nil { 271 iter.i-- 272 return err 273 } 274 iter.i = 0 275 return nil 276} 277 278// Next advances to the next value. If there was an error making 279// the request the iterator does not advance and the error is returned. 280// Deprecated: Use NextWithContext() instead. 281func (iter *APIKeyListResponseIterator) Next() error { 282 return iter.NextWithContext(context.Background()) 283} 284 285// NotDone returns true if the enumeration should be started or is not yet complete. 286func (iter APIKeyListResponseIterator) NotDone() bool { 287 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 288} 289 290// Response returns the raw server response from the last page request. 291func (iter APIKeyListResponseIterator) Response() APIKeyListResponse { 292 return iter.page.Response() 293} 294 295// Value returns the current value or a zero-initialized value if the 296// iterator has advanced beyond the end of the collection. 297func (iter APIKeyListResponseIterator) Value() APIKey { 298 if !iter.page.NotDone() { 299 return APIKey{} 300 } 301 return iter.page.Values()[iter.i] 302} 303 304// Creates a new instance of the APIKeyListResponseIterator type. 305func NewAPIKeyListResponseIterator(page APIKeyListResponsePage) APIKeyListResponseIterator { 306 return APIKeyListResponseIterator{page: page} 307} 308 309// IsEmpty returns true if the ListResult contains no values. 310func (aklr APIKeyListResponse) IsEmpty() bool { 311 return aklr.Value == nil || len(*aklr.Value) == 0 312} 313 314// hasNextLink returns true if the NextLink is not empty. 315func (aklr APIKeyListResponse) hasNextLink() bool { 316 return aklr.NextLink != nil && len(*aklr.NextLink) != 0 317} 318 319// aPIKeyListResponsePreparer prepares a request to retrieve the next set of results. 320// It returns nil if no more results exist. 321func (aklr APIKeyListResponse) aPIKeyListResponsePreparer(ctx context.Context) (*http.Request, error) { 322 if !aklr.hasNextLink() { 323 return nil, nil 324 } 325 return autorest.Prepare((&http.Request{}).WithContext(ctx), 326 autorest.AsJSON(), 327 autorest.AsGet(), 328 autorest.WithBaseURL(to.String(aklr.NextLink))) 329} 330 331// APIKeyListResponsePage contains a page of APIKey values. 332type APIKeyListResponsePage struct { 333 fn func(context.Context, APIKeyListResponse) (APIKeyListResponse, error) 334 aklr APIKeyListResponse 335} 336 337// NextWithContext advances to the next page of values. If there was an error making 338// the request the page does not advance and the error is returned. 339func (page *APIKeyListResponsePage) NextWithContext(ctx context.Context) (err error) { 340 if tracing.IsEnabled() { 341 ctx = tracing.StartSpan(ctx, fqdn+"/APIKeyListResponsePage.NextWithContext") 342 defer func() { 343 sc := -1 344 if page.Response().Response.Response != nil { 345 sc = page.Response().Response.Response.StatusCode 346 } 347 tracing.EndSpan(ctx, sc, err) 348 }() 349 } 350 for { 351 next, err := page.fn(ctx, page.aklr) 352 if err != nil { 353 return err 354 } 355 page.aklr = next 356 if !next.hasNextLink() || !next.IsEmpty() { 357 break 358 } 359 } 360 return nil 361} 362 363// Next advances to the next page of values. If there was an error making 364// the request the page does not advance and the error is returned. 365// Deprecated: Use NextWithContext() instead. 366func (page *APIKeyListResponsePage) Next() error { 367 return page.NextWithContext(context.Background()) 368} 369 370// NotDone returns true if the page enumeration should be started or is not yet complete. 371func (page APIKeyListResponsePage) NotDone() bool { 372 return !page.aklr.IsEmpty() 373} 374 375// Response returns the raw server response from the last page request. 376func (page APIKeyListResponsePage) Response() APIKeyListResponse { 377 return page.aklr 378} 379 380// Values returns the slice of values for the current page or nil if there are no values. 381func (page APIKeyListResponsePage) Values() []APIKey { 382 if page.aklr.IsEmpty() { 383 return nil 384 } 385 return *page.aklr.Value 386} 387 388// Creates a new instance of the APIKeyListResponsePage type. 389func NewAPIKeyListResponsePage(cur APIKeyListResponse, getNextPage func(context.Context, APIKeyListResponse) (APIKeyListResponse, error)) APIKeyListResponsePage { 390 return APIKeyListResponsePage{ 391 fn: getNextPage, 392 aklr: cur, 393 } 394} 395 396// ErrorResponseBody ... 397type ErrorResponseBody struct { 398 Code *string `json:"code,omitempty"` 399 Message *string `json:"message,omitempty"` 400 Target *string `json:"target,omitempty"` 401 Details *[]ErrorResponseBody `json:"details,omitempty"` 402} 403 404// FilteringTag the definition of a filtering tag. Filtering tags are used for capturing resources and 405// include/exclude them from being monitored. 406type FilteringTag struct { 407 // Name - The name (also known as the key) of the tag. 408 Name *string `json:"name,omitempty"` 409 // Value - The value of the tag. 410 Value *string `json:"value,omitempty"` 411 // Action - Possible values include: 'Include', 'Exclude' 412 Action TagAction `json:"action,omitempty"` 413} 414 415// Host ... 416type Host struct { 417 // Name - The name of the host. 418 Name *string `json:"name,omitempty"` 419 // Aliases - The aliases for the host. 420 Aliases *[]string `json:"aliases,omitempty"` 421 // Apps - The Datadog integrations reporting metrics for the host. 422 Apps *[]string `json:"apps,omitempty"` 423 Meta *HostMetadata `json:"meta,omitempty"` 424} 425 426// HostListResponse response of a list operation. 427type HostListResponse struct { 428 autorest.Response `json:"-"` 429 // Value - Results of a list operation. 430 Value *[]Host `json:"value,omitempty"` 431 // NextLink - Link to the next set of results, if any. 432 NextLink *string `json:"nextLink,omitempty"` 433} 434 435// HostListResponseIterator provides access to a complete listing of Host values. 436type HostListResponseIterator struct { 437 i int 438 page HostListResponsePage 439} 440 441// NextWithContext advances to the next value. If there was an error making 442// the request the iterator does not advance and the error is returned. 443func (iter *HostListResponseIterator) NextWithContext(ctx context.Context) (err error) { 444 if tracing.IsEnabled() { 445 ctx = tracing.StartSpan(ctx, fqdn+"/HostListResponseIterator.NextWithContext") 446 defer func() { 447 sc := -1 448 if iter.Response().Response.Response != nil { 449 sc = iter.Response().Response.Response.StatusCode 450 } 451 tracing.EndSpan(ctx, sc, err) 452 }() 453 } 454 iter.i++ 455 if iter.i < len(iter.page.Values()) { 456 return nil 457 } 458 err = iter.page.NextWithContext(ctx) 459 if err != nil { 460 iter.i-- 461 return err 462 } 463 iter.i = 0 464 return nil 465} 466 467// Next advances to the next value. If there was an error making 468// the request the iterator does not advance and the error is returned. 469// Deprecated: Use NextWithContext() instead. 470func (iter *HostListResponseIterator) Next() error { 471 return iter.NextWithContext(context.Background()) 472} 473 474// NotDone returns true if the enumeration should be started or is not yet complete. 475func (iter HostListResponseIterator) NotDone() bool { 476 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 477} 478 479// Response returns the raw server response from the last page request. 480func (iter HostListResponseIterator) Response() HostListResponse { 481 return iter.page.Response() 482} 483 484// Value returns the current value or a zero-initialized value if the 485// iterator has advanced beyond the end of the collection. 486func (iter HostListResponseIterator) Value() Host { 487 if !iter.page.NotDone() { 488 return Host{} 489 } 490 return iter.page.Values()[iter.i] 491} 492 493// Creates a new instance of the HostListResponseIterator type. 494func NewHostListResponseIterator(page HostListResponsePage) HostListResponseIterator { 495 return HostListResponseIterator{page: page} 496} 497 498// IsEmpty returns true if the ListResult contains no values. 499func (hlr HostListResponse) IsEmpty() bool { 500 return hlr.Value == nil || len(*hlr.Value) == 0 501} 502 503// hasNextLink returns true if the NextLink is not empty. 504func (hlr HostListResponse) hasNextLink() bool { 505 return hlr.NextLink != nil && len(*hlr.NextLink) != 0 506} 507 508// hostListResponsePreparer prepares a request to retrieve the next set of results. 509// It returns nil if no more results exist. 510func (hlr HostListResponse) hostListResponsePreparer(ctx context.Context) (*http.Request, error) { 511 if !hlr.hasNextLink() { 512 return nil, nil 513 } 514 return autorest.Prepare((&http.Request{}).WithContext(ctx), 515 autorest.AsJSON(), 516 autorest.AsGet(), 517 autorest.WithBaseURL(to.String(hlr.NextLink))) 518} 519 520// HostListResponsePage contains a page of Host values. 521type HostListResponsePage struct { 522 fn func(context.Context, HostListResponse) (HostListResponse, error) 523 hlr HostListResponse 524} 525 526// NextWithContext advances to the next page of values. If there was an error making 527// the request the page does not advance and the error is returned. 528func (page *HostListResponsePage) NextWithContext(ctx context.Context) (err error) { 529 if tracing.IsEnabled() { 530 ctx = tracing.StartSpan(ctx, fqdn+"/HostListResponsePage.NextWithContext") 531 defer func() { 532 sc := -1 533 if page.Response().Response.Response != nil { 534 sc = page.Response().Response.Response.StatusCode 535 } 536 tracing.EndSpan(ctx, sc, err) 537 }() 538 } 539 for { 540 next, err := page.fn(ctx, page.hlr) 541 if err != nil { 542 return err 543 } 544 page.hlr = next 545 if !next.hasNextLink() || !next.IsEmpty() { 546 break 547 } 548 } 549 return nil 550} 551 552// Next advances to the next page of values. If there was an error making 553// the request the page does not advance and the error is returned. 554// Deprecated: Use NextWithContext() instead. 555func (page *HostListResponsePage) Next() error { 556 return page.NextWithContext(context.Background()) 557} 558 559// NotDone returns true if the page enumeration should be started or is not yet complete. 560func (page HostListResponsePage) NotDone() bool { 561 return !page.hlr.IsEmpty() 562} 563 564// Response returns the raw server response from the last page request. 565func (page HostListResponsePage) Response() HostListResponse { 566 return page.hlr 567} 568 569// Values returns the slice of values for the current page or nil if there are no values. 570func (page HostListResponsePage) Values() []Host { 571 if page.hlr.IsEmpty() { 572 return nil 573 } 574 return *page.hlr.Value 575} 576 577// Creates a new instance of the HostListResponsePage type. 578func NewHostListResponsePage(cur HostListResponse, getNextPage func(context.Context, HostListResponse) (HostListResponse, error)) HostListResponsePage { 579 return HostListResponsePage{ 580 fn: getNextPage, 581 hlr: cur, 582 } 583} 584 585// HostMetadata ... 586type HostMetadata struct { 587 // AgentVersion - The agent version. 588 AgentVersion *string `json:"agentVersion,omitempty"` 589 InstallMethod *InstallMethod `json:"installMethod,omitempty"` 590 LogsAgent *LogsAgent `json:"logsAgent,omitempty"` 591} 592 593// IdentityProperties ... 594type IdentityProperties struct { 595 // PrincipalID - READ-ONLY; The identity ID. 596 PrincipalID *string `json:"principalId,omitempty"` 597 // TenantID - READ-ONLY; The tenant ID of resource. 598 TenantID *string `json:"tenantId,omitempty"` 599 // Type - Possible values include: 'SystemAssigned', 'UserAssigned' 600 Type ManagedIdentityTypes `json:"type,omitempty"` 601} 602 603// MarshalJSON is the custom marshaler for IdentityProperties. 604func (IP IdentityProperties) MarshalJSON() ([]byte, error) { 605 objectMap := make(map[string]interface{}) 606 if IP.Type != "" { 607 objectMap["type"] = IP.Type 608 } 609 return json.Marshal(objectMap) 610} 611 612// InstallMethod ... 613type InstallMethod struct { 614 // Tool - The tool. 615 Tool *string `json:"tool,omitempty"` 616 // ToolVersion - The tool version. 617 ToolVersion *string `json:"toolVersion,omitempty"` 618 // InstallerVersion - The installer version. 619 InstallerVersion *string `json:"installerVersion,omitempty"` 620} 621 622// LinkedResource the definition of a linked resource. 623type LinkedResource struct { 624 // ID - The ARM id of the linked resource. 625 ID *string `json:"id,omitempty"` 626} 627 628// LinkedResourceListResponse response of a list operation. 629type LinkedResourceListResponse struct { 630 autorest.Response `json:"-"` 631 // Value - Results of a list operation. 632 Value *[]LinkedResource `json:"value,omitempty"` 633 // NextLink - Link to the next set of results, if any. 634 NextLink *string `json:"nextLink,omitempty"` 635} 636 637// LinkedResourceListResponseIterator provides access to a complete listing of LinkedResource values. 638type LinkedResourceListResponseIterator struct { 639 i int 640 page LinkedResourceListResponsePage 641} 642 643// NextWithContext advances to the next value. If there was an error making 644// the request the iterator does not advance and the error is returned. 645func (iter *LinkedResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) { 646 if tracing.IsEnabled() { 647 ctx = tracing.StartSpan(ctx, fqdn+"/LinkedResourceListResponseIterator.NextWithContext") 648 defer func() { 649 sc := -1 650 if iter.Response().Response.Response != nil { 651 sc = iter.Response().Response.Response.StatusCode 652 } 653 tracing.EndSpan(ctx, sc, err) 654 }() 655 } 656 iter.i++ 657 if iter.i < len(iter.page.Values()) { 658 return nil 659 } 660 err = iter.page.NextWithContext(ctx) 661 if err != nil { 662 iter.i-- 663 return err 664 } 665 iter.i = 0 666 return nil 667} 668 669// Next advances to the next value. If there was an error making 670// the request the iterator does not advance and the error is returned. 671// Deprecated: Use NextWithContext() instead. 672func (iter *LinkedResourceListResponseIterator) Next() error { 673 return iter.NextWithContext(context.Background()) 674} 675 676// NotDone returns true if the enumeration should be started or is not yet complete. 677func (iter LinkedResourceListResponseIterator) NotDone() bool { 678 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 679} 680 681// Response returns the raw server response from the last page request. 682func (iter LinkedResourceListResponseIterator) Response() LinkedResourceListResponse { 683 return iter.page.Response() 684} 685 686// Value returns the current value or a zero-initialized value if the 687// iterator has advanced beyond the end of the collection. 688func (iter LinkedResourceListResponseIterator) Value() LinkedResource { 689 if !iter.page.NotDone() { 690 return LinkedResource{} 691 } 692 return iter.page.Values()[iter.i] 693} 694 695// Creates a new instance of the LinkedResourceListResponseIterator type. 696func NewLinkedResourceListResponseIterator(page LinkedResourceListResponsePage) LinkedResourceListResponseIterator { 697 return LinkedResourceListResponseIterator{page: page} 698} 699 700// IsEmpty returns true if the ListResult contains no values. 701func (lrlr LinkedResourceListResponse) IsEmpty() bool { 702 return lrlr.Value == nil || len(*lrlr.Value) == 0 703} 704 705// hasNextLink returns true if the NextLink is not empty. 706func (lrlr LinkedResourceListResponse) hasNextLink() bool { 707 return lrlr.NextLink != nil && len(*lrlr.NextLink) != 0 708} 709 710// linkedResourceListResponsePreparer prepares a request to retrieve the next set of results. 711// It returns nil if no more results exist. 712func (lrlr LinkedResourceListResponse) linkedResourceListResponsePreparer(ctx context.Context) (*http.Request, error) { 713 if !lrlr.hasNextLink() { 714 return nil, nil 715 } 716 return autorest.Prepare((&http.Request{}).WithContext(ctx), 717 autorest.AsJSON(), 718 autorest.AsGet(), 719 autorest.WithBaseURL(to.String(lrlr.NextLink))) 720} 721 722// LinkedResourceListResponsePage contains a page of LinkedResource values. 723type LinkedResourceListResponsePage struct { 724 fn func(context.Context, LinkedResourceListResponse) (LinkedResourceListResponse, error) 725 lrlr LinkedResourceListResponse 726} 727 728// NextWithContext advances to the next page of values. If there was an error making 729// the request the page does not advance and the error is returned. 730func (page *LinkedResourceListResponsePage) NextWithContext(ctx context.Context) (err error) { 731 if tracing.IsEnabled() { 732 ctx = tracing.StartSpan(ctx, fqdn+"/LinkedResourceListResponsePage.NextWithContext") 733 defer func() { 734 sc := -1 735 if page.Response().Response.Response != nil { 736 sc = page.Response().Response.Response.StatusCode 737 } 738 tracing.EndSpan(ctx, sc, err) 739 }() 740 } 741 for { 742 next, err := page.fn(ctx, page.lrlr) 743 if err != nil { 744 return err 745 } 746 page.lrlr = next 747 if !next.hasNextLink() || !next.IsEmpty() { 748 break 749 } 750 } 751 return nil 752} 753 754// Next advances to the next page of values. If there was an error making 755// the request the page does not advance and the error is returned. 756// Deprecated: Use NextWithContext() instead. 757func (page *LinkedResourceListResponsePage) Next() error { 758 return page.NextWithContext(context.Background()) 759} 760 761// NotDone returns true if the page enumeration should be started or is not yet complete. 762func (page LinkedResourceListResponsePage) NotDone() bool { 763 return !page.lrlr.IsEmpty() 764} 765 766// Response returns the raw server response from the last page request. 767func (page LinkedResourceListResponsePage) Response() LinkedResourceListResponse { 768 return page.lrlr 769} 770 771// Values returns the slice of values for the current page or nil if there are no values. 772func (page LinkedResourceListResponsePage) Values() []LinkedResource { 773 if page.lrlr.IsEmpty() { 774 return nil 775 } 776 return *page.lrlr.Value 777} 778 779// Creates a new instance of the LinkedResourceListResponsePage type. 780func NewLinkedResourceListResponsePage(cur LinkedResourceListResponse, getNextPage func(context.Context, LinkedResourceListResponse) (LinkedResourceListResponse, error)) LinkedResourceListResponsePage { 781 return LinkedResourceListResponsePage{ 782 fn: getNextPage, 783 lrlr: cur, 784 } 785} 786 787// LogRules set of rules for sending logs for the Monitor resource. 788type LogRules struct { 789 // SendAadLogs - Flag specifying if AAD logs should be sent for the Monitor resource. 790 SendAadLogs *bool `json:"sendAadLogs,omitempty"` 791 // SendSubscriptionLogs - Flag specifying if Azure subscription logs should be sent for the Monitor resource. 792 SendSubscriptionLogs *bool `json:"sendSubscriptionLogs,omitempty"` 793 // SendResourceLogs - Flag specifying if Azure resource logs should be sent for the Monitor resource. 794 SendResourceLogs *bool `json:"sendResourceLogs,omitempty"` 795 // 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. 796 FilteringTags *[]FilteringTag `json:"filteringTags,omitempty"` 797} 798 799// LogsAgent ... 800type LogsAgent struct { 801 // Transport - The transport. 802 Transport *string `json:"transport,omitempty"` 803} 804 805// MetricRules set of rules for sending metrics for the Monitor resource. 806type MetricRules struct { 807 // 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. 808 FilteringTags *[]FilteringTag `json:"filteringTags,omitempty"` 809} 810 811// MonitoredResource the properties of a resource currently being monitored by the Datadog monitor 812// resource. 813type MonitoredResource struct { 814 // ID - The ARM id of the resource. 815 ID *string `json:"id,omitempty"` 816 // SendingMetrics - Flag indicating if resource is sending metrics to Datadog. 817 SendingMetrics *bool `json:"sendingMetrics,omitempty"` 818 // ReasonForMetricsStatus - Reason for why the resource is sending metrics (or why it is not sending). 819 ReasonForMetricsStatus *string `json:"reasonForMetricsStatus,omitempty"` 820 // SendingLogs - Flag indicating if resource is sending logs to Datadog. 821 SendingLogs *bool `json:"sendingLogs,omitempty"` 822 // ReasonForLogsStatus - Reason for why the resource is sending logs (or why it is not sending). 823 ReasonForLogsStatus *string `json:"reasonForLogsStatus,omitempty"` 824} 825 826// MonitoredResourceListResponse response of a list operation. 827type MonitoredResourceListResponse struct { 828 autorest.Response `json:"-"` 829 // Value - Results of a list operation. 830 Value *[]MonitoredResource `json:"value,omitempty"` 831 // NextLink - Link to the next set of results, if any. 832 NextLink *string `json:"nextLink,omitempty"` 833} 834 835// MonitoredResourceListResponseIterator provides access to a complete listing of MonitoredResource values. 836type MonitoredResourceListResponseIterator struct { 837 i int 838 page MonitoredResourceListResponsePage 839} 840 841// NextWithContext advances to the next value. If there was an error making 842// the request the iterator does not advance and the error is returned. 843func (iter *MonitoredResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) { 844 if tracing.IsEnabled() { 845 ctx = tracing.StartSpan(ctx, fqdn+"/MonitoredResourceListResponseIterator.NextWithContext") 846 defer func() { 847 sc := -1 848 if iter.Response().Response.Response != nil { 849 sc = iter.Response().Response.Response.StatusCode 850 } 851 tracing.EndSpan(ctx, sc, err) 852 }() 853 } 854 iter.i++ 855 if iter.i < len(iter.page.Values()) { 856 return nil 857 } 858 err = iter.page.NextWithContext(ctx) 859 if err != nil { 860 iter.i-- 861 return err 862 } 863 iter.i = 0 864 return nil 865} 866 867// Next advances to the next value. If there was an error making 868// the request the iterator does not advance and the error is returned. 869// Deprecated: Use NextWithContext() instead. 870func (iter *MonitoredResourceListResponseIterator) Next() error { 871 return iter.NextWithContext(context.Background()) 872} 873 874// NotDone returns true if the enumeration should be started or is not yet complete. 875func (iter MonitoredResourceListResponseIterator) NotDone() bool { 876 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 877} 878 879// Response returns the raw server response from the last page request. 880func (iter MonitoredResourceListResponseIterator) Response() MonitoredResourceListResponse { 881 return iter.page.Response() 882} 883 884// Value returns the current value or a zero-initialized value if the 885// iterator has advanced beyond the end of the collection. 886func (iter MonitoredResourceListResponseIterator) Value() MonitoredResource { 887 if !iter.page.NotDone() { 888 return MonitoredResource{} 889 } 890 return iter.page.Values()[iter.i] 891} 892 893// Creates a new instance of the MonitoredResourceListResponseIterator type. 894func NewMonitoredResourceListResponseIterator(page MonitoredResourceListResponsePage) MonitoredResourceListResponseIterator { 895 return MonitoredResourceListResponseIterator{page: page} 896} 897 898// IsEmpty returns true if the ListResult contains no values. 899func (mrlr MonitoredResourceListResponse) IsEmpty() bool { 900 return mrlr.Value == nil || len(*mrlr.Value) == 0 901} 902 903// hasNextLink returns true if the NextLink is not empty. 904func (mrlr MonitoredResourceListResponse) hasNextLink() bool { 905 return mrlr.NextLink != nil && len(*mrlr.NextLink) != 0 906} 907 908// monitoredResourceListResponsePreparer prepares a request to retrieve the next set of results. 909// It returns nil if no more results exist. 910func (mrlr MonitoredResourceListResponse) monitoredResourceListResponsePreparer(ctx context.Context) (*http.Request, error) { 911 if !mrlr.hasNextLink() { 912 return nil, nil 913 } 914 return autorest.Prepare((&http.Request{}).WithContext(ctx), 915 autorest.AsJSON(), 916 autorest.AsGet(), 917 autorest.WithBaseURL(to.String(mrlr.NextLink))) 918} 919 920// MonitoredResourceListResponsePage contains a page of MonitoredResource values. 921type MonitoredResourceListResponsePage struct { 922 fn func(context.Context, MonitoredResourceListResponse) (MonitoredResourceListResponse, error) 923 mrlr MonitoredResourceListResponse 924} 925 926// NextWithContext advances to the next page of values. If there was an error making 927// the request the page does not advance and the error is returned. 928func (page *MonitoredResourceListResponsePage) NextWithContext(ctx context.Context) (err error) { 929 if tracing.IsEnabled() { 930 ctx = tracing.StartSpan(ctx, fqdn+"/MonitoredResourceListResponsePage.NextWithContext") 931 defer func() { 932 sc := -1 933 if page.Response().Response.Response != nil { 934 sc = page.Response().Response.Response.StatusCode 935 } 936 tracing.EndSpan(ctx, sc, err) 937 }() 938 } 939 for { 940 next, err := page.fn(ctx, page.mrlr) 941 if err != nil { 942 return err 943 } 944 page.mrlr = next 945 if !next.hasNextLink() || !next.IsEmpty() { 946 break 947 } 948 } 949 return nil 950} 951 952// Next advances to the next page of values. If there was an error making 953// the request the page does not advance and the error is returned. 954// Deprecated: Use NextWithContext() instead. 955func (page *MonitoredResourceListResponsePage) Next() error { 956 return page.NextWithContext(context.Background()) 957} 958 959// NotDone returns true if the page enumeration should be started or is not yet complete. 960func (page MonitoredResourceListResponsePage) NotDone() bool { 961 return !page.mrlr.IsEmpty() 962} 963 964// Response returns the raw server response from the last page request. 965func (page MonitoredResourceListResponsePage) Response() MonitoredResourceListResponse { 966 return page.mrlr 967} 968 969// Values returns the slice of values for the current page or nil if there are no values. 970func (page MonitoredResourceListResponsePage) Values() []MonitoredResource { 971 if page.mrlr.IsEmpty() { 972 return nil 973 } 974 return *page.mrlr.Value 975} 976 977// Creates a new instance of the MonitoredResourceListResponsePage type. 978func NewMonitoredResourceListResponsePage(cur MonitoredResourceListResponse, getNextPage func(context.Context, MonitoredResourceListResponse) (MonitoredResourceListResponse, error)) MonitoredResourceListResponsePage { 979 return MonitoredResourceListResponsePage{ 980 fn: getNextPage, 981 mrlr: cur, 982 } 983} 984 985// MonitoringTagRules capture logs and metrics of Azure resources based on ARM tags. 986type MonitoringTagRules struct { 987 autorest.Response `json:"-"` 988 // Name - READ-ONLY; Name of the rule set. 989 Name *string `json:"name,omitempty"` 990 // ID - READ-ONLY; The id of the rule set. 991 ID *string `json:"id,omitempty"` 992 // Type - READ-ONLY; The type of the rule set. 993 Type *string `json:"type,omitempty"` 994 Properties *MonitoringTagRulesProperties `json:"properties,omitempty"` 995} 996 997// MarshalJSON is the custom marshaler for MonitoringTagRules. 998func (mtr MonitoringTagRules) MarshalJSON() ([]byte, error) { 999 objectMap := make(map[string]interface{}) 1000 if mtr.Properties != nil { 1001 objectMap["properties"] = mtr.Properties 1002 } 1003 return json.Marshal(objectMap) 1004} 1005 1006// MonitoringTagRulesListResponse response of a list operation. 1007type MonitoringTagRulesListResponse struct { 1008 autorest.Response `json:"-"` 1009 // Value - Results of a list operation. 1010 Value *[]MonitoringTagRules `json:"value,omitempty"` 1011 // NextLink - Link to the next set of results, if any. 1012 NextLink *string `json:"nextLink,omitempty"` 1013} 1014 1015// MonitoringTagRulesListResponseIterator provides access to a complete listing of MonitoringTagRules 1016// values. 1017type MonitoringTagRulesListResponseIterator struct { 1018 i int 1019 page MonitoringTagRulesListResponsePage 1020} 1021 1022// NextWithContext advances to the next value. If there was an error making 1023// the request the iterator does not advance and the error is returned. 1024func (iter *MonitoringTagRulesListResponseIterator) NextWithContext(ctx context.Context) (err error) { 1025 if tracing.IsEnabled() { 1026 ctx = tracing.StartSpan(ctx, fqdn+"/MonitoringTagRulesListResponseIterator.NextWithContext") 1027 defer func() { 1028 sc := -1 1029 if iter.Response().Response.Response != nil { 1030 sc = iter.Response().Response.Response.StatusCode 1031 } 1032 tracing.EndSpan(ctx, sc, err) 1033 }() 1034 } 1035 iter.i++ 1036 if iter.i < len(iter.page.Values()) { 1037 return nil 1038 } 1039 err = iter.page.NextWithContext(ctx) 1040 if err != nil { 1041 iter.i-- 1042 return err 1043 } 1044 iter.i = 0 1045 return nil 1046} 1047 1048// Next advances to the next value. If there was an error making 1049// the request the iterator does not advance and the error is returned. 1050// Deprecated: Use NextWithContext() instead. 1051func (iter *MonitoringTagRulesListResponseIterator) Next() error { 1052 return iter.NextWithContext(context.Background()) 1053} 1054 1055// NotDone returns true if the enumeration should be started or is not yet complete. 1056func (iter MonitoringTagRulesListResponseIterator) NotDone() bool { 1057 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1058} 1059 1060// Response returns the raw server response from the last page request. 1061func (iter MonitoringTagRulesListResponseIterator) Response() MonitoringTagRulesListResponse { 1062 return iter.page.Response() 1063} 1064 1065// Value returns the current value or a zero-initialized value if the 1066// iterator has advanced beyond the end of the collection. 1067func (iter MonitoringTagRulesListResponseIterator) Value() MonitoringTagRules { 1068 if !iter.page.NotDone() { 1069 return MonitoringTagRules{} 1070 } 1071 return iter.page.Values()[iter.i] 1072} 1073 1074// Creates a new instance of the MonitoringTagRulesListResponseIterator type. 1075func NewMonitoringTagRulesListResponseIterator(page MonitoringTagRulesListResponsePage) MonitoringTagRulesListResponseIterator { 1076 return MonitoringTagRulesListResponseIterator{page: page} 1077} 1078 1079// IsEmpty returns true if the ListResult contains no values. 1080func (mtrlr MonitoringTagRulesListResponse) IsEmpty() bool { 1081 return mtrlr.Value == nil || len(*mtrlr.Value) == 0 1082} 1083 1084// hasNextLink returns true if the NextLink is not empty. 1085func (mtrlr MonitoringTagRulesListResponse) hasNextLink() bool { 1086 return mtrlr.NextLink != nil && len(*mtrlr.NextLink) != 0 1087} 1088 1089// monitoringTagRulesListResponsePreparer prepares a request to retrieve the next set of results. 1090// It returns nil if no more results exist. 1091func (mtrlr MonitoringTagRulesListResponse) monitoringTagRulesListResponsePreparer(ctx context.Context) (*http.Request, error) { 1092 if !mtrlr.hasNextLink() { 1093 return nil, nil 1094 } 1095 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1096 autorest.AsJSON(), 1097 autorest.AsGet(), 1098 autorest.WithBaseURL(to.String(mtrlr.NextLink))) 1099} 1100 1101// MonitoringTagRulesListResponsePage contains a page of MonitoringTagRules values. 1102type MonitoringTagRulesListResponsePage struct { 1103 fn func(context.Context, MonitoringTagRulesListResponse) (MonitoringTagRulesListResponse, error) 1104 mtrlr MonitoringTagRulesListResponse 1105} 1106 1107// NextWithContext advances to the next page of values. If there was an error making 1108// the request the page does not advance and the error is returned. 1109func (page *MonitoringTagRulesListResponsePage) NextWithContext(ctx context.Context) (err error) { 1110 if tracing.IsEnabled() { 1111 ctx = tracing.StartSpan(ctx, fqdn+"/MonitoringTagRulesListResponsePage.NextWithContext") 1112 defer func() { 1113 sc := -1 1114 if page.Response().Response.Response != nil { 1115 sc = page.Response().Response.Response.StatusCode 1116 } 1117 tracing.EndSpan(ctx, sc, err) 1118 }() 1119 } 1120 for { 1121 next, err := page.fn(ctx, page.mtrlr) 1122 if err != nil { 1123 return err 1124 } 1125 page.mtrlr = next 1126 if !next.hasNextLink() || !next.IsEmpty() { 1127 break 1128 } 1129 } 1130 return nil 1131} 1132 1133// Next advances to the next page of values. If there was an error making 1134// the request the page does not advance and the error is returned. 1135// Deprecated: Use NextWithContext() instead. 1136func (page *MonitoringTagRulesListResponsePage) Next() error { 1137 return page.NextWithContext(context.Background()) 1138} 1139 1140// NotDone returns true if the page enumeration should be started or is not yet complete. 1141func (page MonitoringTagRulesListResponsePage) NotDone() bool { 1142 return !page.mtrlr.IsEmpty() 1143} 1144 1145// Response returns the raw server response from the last page request. 1146func (page MonitoringTagRulesListResponsePage) Response() MonitoringTagRulesListResponse { 1147 return page.mtrlr 1148} 1149 1150// Values returns the slice of values for the current page or nil if there are no values. 1151func (page MonitoringTagRulesListResponsePage) Values() []MonitoringTagRules { 1152 if page.mtrlr.IsEmpty() { 1153 return nil 1154 } 1155 return *page.mtrlr.Value 1156} 1157 1158// Creates a new instance of the MonitoringTagRulesListResponsePage type. 1159func NewMonitoringTagRulesListResponsePage(cur MonitoringTagRulesListResponse, getNextPage func(context.Context, MonitoringTagRulesListResponse) (MonitoringTagRulesListResponse, error)) MonitoringTagRulesListResponsePage { 1160 return MonitoringTagRulesListResponsePage{ 1161 fn: getNextPage, 1162 mtrlr: cur, 1163 } 1164} 1165 1166// MonitoringTagRulesProperties definition of the properties for a TagRules resource. 1167type MonitoringTagRulesProperties struct { 1168 // ProvisioningState - Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' 1169 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1170 LogRules *LogRules `json:"logRules,omitempty"` 1171 MetricRules *MetricRules `json:"metricRules,omitempty"` 1172} 1173 1174// MonitorProperties properties specific to the monitor resource. 1175type MonitorProperties struct { 1176 // ProvisioningState - Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' 1177 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1178 // MonitoringStatus - Possible values include: 'Enabled', 'Disabled' 1179 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"` 1180 // MarketplaceSubscriptionStatus - Possible values include: 'Provisioning', 'Active', 'Suspended', 'Unsubscribed' 1181 MarketplaceSubscriptionStatus MarketplaceSubscriptionStatus `json:"marketplaceSubscriptionStatus,omitempty"` 1182 DatadogOrganizationProperties *OrganizationProperties `json:"datadogOrganizationProperties,omitempty"` 1183 UserInfo *UserInfo `json:"userInfo,omitempty"` 1184 // LiftrResourceCategory - Possible values include: 'Unknown', 'MonitorLogs' 1185 LiftrResourceCategory LiftrResourceCategories `json:"liftrResourceCategory,omitempty"` 1186 // LiftrResourcePreference - READ-ONLY; The priority of the resource. 1187 LiftrResourcePreference *int32 `json:"liftrResourcePreference,omitempty"` 1188} 1189 1190// MarshalJSON is the custom marshaler for MonitorProperties. 1191func (mp MonitorProperties) MarshalJSON() ([]byte, error) { 1192 objectMap := make(map[string]interface{}) 1193 if mp.ProvisioningState != "" { 1194 objectMap["provisioningState"] = mp.ProvisioningState 1195 } 1196 if mp.MonitoringStatus != "" { 1197 objectMap["monitoringStatus"] = mp.MonitoringStatus 1198 } 1199 if mp.MarketplaceSubscriptionStatus != "" { 1200 objectMap["marketplaceSubscriptionStatus"] = mp.MarketplaceSubscriptionStatus 1201 } 1202 if mp.DatadogOrganizationProperties != nil { 1203 objectMap["datadogOrganizationProperties"] = mp.DatadogOrganizationProperties 1204 } 1205 if mp.UserInfo != nil { 1206 objectMap["userInfo"] = mp.UserInfo 1207 } 1208 if mp.LiftrResourceCategory != "" { 1209 objectMap["liftrResourceCategory"] = mp.LiftrResourceCategory 1210 } 1211 return json.Marshal(objectMap) 1212} 1213 1214// MonitorResource ... 1215type MonitorResource struct { 1216 autorest.Response `json:"-"` 1217 // ID - READ-ONLY; ARM id of the monitor resource. 1218 ID *string `json:"id,omitempty"` 1219 // Name - READ-ONLY; Name of the monitor resource. 1220 Name *string `json:"name,omitempty"` 1221 // Type - READ-ONLY; The type of the monitor resource. 1222 Type *string `json:"type,omitempty"` 1223 Sku *ResourceSku `json:"sku,omitempty"` 1224 Properties *MonitorProperties `json:"properties,omitempty"` 1225 Identity *IdentityProperties `json:"identity,omitempty"` 1226 Tags map[string]*string `json:"tags"` 1227 Location *string `json:"location,omitempty"` 1228} 1229 1230// MarshalJSON is the custom marshaler for MonitorResource. 1231func (mr MonitorResource) MarshalJSON() ([]byte, error) { 1232 objectMap := make(map[string]interface{}) 1233 if mr.Sku != nil { 1234 objectMap["sku"] = mr.Sku 1235 } 1236 if mr.Properties != nil { 1237 objectMap["properties"] = mr.Properties 1238 } 1239 if mr.Identity != nil { 1240 objectMap["identity"] = mr.Identity 1241 } 1242 if mr.Tags != nil { 1243 objectMap["tags"] = mr.Tags 1244 } 1245 if mr.Location != nil { 1246 objectMap["location"] = mr.Location 1247 } 1248 return json.Marshal(objectMap) 1249} 1250 1251// MonitorResourceListResponse response of a list operation. 1252type MonitorResourceListResponse struct { 1253 autorest.Response `json:"-"` 1254 // Value - Results of a list operation. 1255 Value *[]MonitorResource `json:"value,omitempty"` 1256 // NextLink - Link to the next set of results, if any. 1257 NextLink *string `json:"nextLink,omitempty"` 1258} 1259 1260// MonitorResourceListResponseIterator provides access to a complete listing of MonitorResource values. 1261type MonitorResourceListResponseIterator struct { 1262 i int 1263 page MonitorResourceListResponsePage 1264} 1265 1266// NextWithContext advances to the next value. If there was an error making 1267// the request the iterator does not advance and the error is returned. 1268func (iter *MonitorResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) { 1269 if tracing.IsEnabled() { 1270 ctx = tracing.StartSpan(ctx, fqdn+"/MonitorResourceListResponseIterator.NextWithContext") 1271 defer func() { 1272 sc := -1 1273 if iter.Response().Response.Response != nil { 1274 sc = iter.Response().Response.Response.StatusCode 1275 } 1276 tracing.EndSpan(ctx, sc, err) 1277 }() 1278 } 1279 iter.i++ 1280 if iter.i < len(iter.page.Values()) { 1281 return nil 1282 } 1283 err = iter.page.NextWithContext(ctx) 1284 if err != nil { 1285 iter.i-- 1286 return err 1287 } 1288 iter.i = 0 1289 return nil 1290} 1291 1292// Next advances to the next value. If there was an error making 1293// the request the iterator does not advance and the error is returned. 1294// Deprecated: Use NextWithContext() instead. 1295func (iter *MonitorResourceListResponseIterator) Next() error { 1296 return iter.NextWithContext(context.Background()) 1297} 1298 1299// NotDone returns true if the enumeration should be started or is not yet complete. 1300func (iter MonitorResourceListResponseIterator) NotDone() bool { 1301 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1302} 1303 1304// Response returns the raw server response from the last page request. 1305func (iter MonitorResourceListResponseIterator) Response() MonitorResourceListResponse { 1306 return iter.page.Response() 1307} 1308 1309// Value returns the current value or a zero-initialized value if the 1310// iterator has advanced beyond the end of the collection. 1311func (iter MonitorResourceListResponseIterator) Value() MonitorResource { 1312 if !iter.page.NotDone() { 1313 return MonitorResource{} 1314 } 1315 return iter.page.Values()[iter.i] 1316} 1317 1318// Creates a new instance of the MonitorResourceListResponseIterator type. 1319func NewMonitorResourceListResponseIterator(page MonitorResourceListResponsePage) MonitorResourceListResponseIterator { 1320 return MonitorResourceListResponseIterator{page: page} 1321} 1322 1323// IsEmpty returns true if the ListResult contains no values. 1324func (mrlr MonitorResourceListResponse) IsEmpty() bool { 1325 return mrlr.Value == nil || len(*mrlr.Value) == 0 1326} 1327 1328// hasNextLink returns true if the NextLink is not empty. 1329func (mrlr MonitorResourceListResponse) hasNextLink() bool { 1330 return mrlr.NextLink != nil && len(*mrlr.NextLink) != 0 1331} 1332 1333// monitorResourceListResponsePreparer prepares a request to retrieve the next set of results. 1334// It returns nil if no more results exist. 1335func (mrlr MonitorResourceListResponse) monitorResourceListResponsePreparer(ctx context.Context) (*http.Request, error) { 1336 if !mrlr.hasNextLink() { 1337 return nil, nil 1338 } 1339 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1340 autorest.AsJSON(), 1341 autorest.AsGet(), 1342 autorest.WithBaseURL(to.String(mrlr.NextLink))) 1343} 1344 1345// MonitorResourceListResponsePage contains a page of MonitorResource values. 1346type MonitorResourceListResponsePage struct { 1347 fn func(context.Context, MonitorResourceListResponse) (MonitorResourceListResponse, error) 1348 mrlr MonitorResourceListResponse 1349} 1350 1351// NextWithContext advances to the next page of values. If there was an error making 1352// the request the page does not advance and the error is returned. 1353func (page *MonitorResourceListResponsePage) NextWithContext(ctx context.Context) (err error) { 1354 if tracing.IsEnabled() { 1355 ctx = tracing.StartSpan(ctx, fqdn+"/MonitorResourceListResponsePage.NextWithContext") 1356 defer func() { 1357 sc := -1 1358 if page.Response().Response.Response != nil { 1359 sc = page.Response().Response.Response.StatusCode 1360 } 1361 tracing.EndSpan(ctx, sc, err) 1362 }() 1363 } 1364 for { 1365 next, err := page.fn(ctx, page.mrlr) 1366 if err != nil { 1367 return err 1368 } 1369 page.mrlr = next 1370 if !next.hasNextLink() || !next.IsEmpty() { 1371 break 1372 } 1373 } 1374 return nil 1375} 1376 1377// Next advances to the next page of values. If there was an error making 1378// the request the page does not advance and the error is returned. 1379// Deprecated: Use NextWithContext() instead. 1380func (page *MonitorResourceListResponsePage) Next() error { 1381 return page.NextWithContext(context.Background()) 1382} 1383 1384// NotDone returns true if the page enumeration should be started or is not yet complete. 1385func (page MonitorResourceListResponsePage) NotDone() bool { 1386 return !page.mrlr.IsEmpty() 1387} 1388 1389// Response returns the raw server response from the last page request. 1390func (page MonitorResourceListResponsePage) Response() MonitorResourceListResponse { 1391 return page.mrlr 1392} 1393 1394// Values returns the slice of values for the current page or nil if there are no values. 1395func (page MonitorResourceListResponsePage) Values() []MonitorResource { 1396 if page.mrlr.IsEmpty() { 1397 return nil 1398 } 1399 return *page.mrlr.Value 1400} 1401 1402// Creates a new instance of the MonitorResourceListResponsePage type. 1403func NewMonitorResourceListResponsePage(cur MonitorResourceListResponse, getNextPage func(context.Context, MonitorResourceListResponse) (MonitorResourceListResponse, error)) MonitorResourceListResponsePage { 1404 return MonitorResourceListResponsePage{ 1405 fn: getNextPage, 1406 mrlr: cur, 1407 } 1408} 1409 1410// MonitorResourceUpdateParameters the parameters for a PATCH request to a monitor resource. 1411type MonitorResourceUpdateParameters struct { 1412 Properties *MonitorUpdateProperties `json:"properties,omitempty"` 1413 // Tags - The new tags of the monitor resource. 1414 Tags map[string]*string `json:"tags"` 1415} 1416 1417// MarshalJSON is the custom marshaler for MonitorResourceUpdateParameters. 1418func (mrup MonitorResourceUpdateParameters) MarshalJSON() ([]byte, error) { 1419 objectMap := make(map[string]interface{}) 1420 if mrup.Properties != nil { 1421 objectMap["properties"] = mrup.Properties 1422 } 1423 if mrup.Tags != nil { 1424 objectMap["tags"] = mrup.Tags 1425 } 1426 return json.Marshal(objectMap) 1427} 1428 1429// MonitorsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1430// operation. 1431type MonitorsCreateFuture struct { 1432 azure.FutureAPI 1433 // Result returns the result of the asynchronous operation. 1434 // If the operation has not completed it will return an error. 1435 Result func(MonitorsClient) (MonitorResource, error) 1436} 1437 1438// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1439func (future *MonitorsCreateFuture) UnmarshalJSON(body []byte) error { 1440 var azFuture azure.Future 1441 if err := json.Unmarshal(body, &azFuture); err != nil { 1442 return err 1443 } 1444 future.FutureAPI = &azFuture 1445 future.Result = future.result 1446 return nil 1447} 1448 1449// result is the default implementation for MonitorsCreateFuture.Result. 1450func (future *MonitorsCreateFuture) result(client MonitorsClient) (mr MonitorResource, err error) { 1451 var done bool 1452 done, err = future.DoneWithContext(context.Background(), client) 1453 if err != nil { 1454 err = autorest.NewErrorWithError(err, "datadog.MonitorsCreateFuture", "Result", future.Response(), "Polling failure") 1455 return 1456 } 1457 if !done { 1458 mr.Response.Response = future.Response() 1459 err = azure.NewAsyncOpIncompleteError("datadog.MonitorsCreateFuture") 1460 return 1461 } 1462 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1463 if mr.Response.Response, err = future.GetResult(sender); err == nil && mr.Response.Response.StatusCode != http.StatusNoContent { 1464 mr, err = client.CreateResponder(mr.Response.Response) 1465 if err != nil { 1466 err = autorest.NewErrorWithError(err, "datadog.MonitorsCreateFuture", "Result", mr.Response.Response, "Failure responding to request") 1467 } 1468 } 1469 return 1470} 1471 1472// MonitorsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1473// operation. 1474type MonitorsDeleteFuture struct { 1475 azure.FutureAPI 1476 // Result returns the result of the asynchronous operation. 1477 // If the operation has not completed it will return an error. 1478 Result func(MonitorsClient) (autorest.Response, error) 1479} 1480 1481// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1482func (future *MonitorsDeleteFuture) UnmarshalJSON(body []byte) error { 1483 var azFuture azure.Future 1484 if err := json.Unmarshal(body, &azFuture); err != nil { 1485 return err 1486 } 1487 future.FutureAPI = &azFuture 1488 future.Result = future.result 1489 return nil 1490} 1491 1492// result is the default implementation for MonitorsDeleteFuture.Result. 1493func (future *MonitorsDeleteFuture) result(client MonitorsClient) (ar autorest.Response, err error) { 1494 var done bool 1495 done, err = future.DoneWithContext(context.Background(), client) 1496 if err != nil { 1497 err = autorest.NewErrorWithError(err, "datadog.MonitorsDeleteFuture", "Result", future.Response(), "Polling failure") 1498 return 1499 } 1500 if !done { 1501 ar.Response = future.Response() 1502 err = azure.NewAsyncOpIncompleteError("datadog.MonitorsDeleteFuture") 1503 return 1504 } 1505 ar.Response = future.Response() 1506 return 1507} 1508 1509// MonitorUpdateProperties the set of properties that can be update in a PATCH request to a monitor 1510// resource. 1511type MonitorUpdateProperties struct { 1512 // MonitoringStatus - Possible values include: 'Enabled', 'Disabled' 1513 MonitoringStatus MonitoringStatus `json:"monitoringStatus,omitempty"` 1514} 1515 1516// OperationDisplay the object that represents the operation. 1517type OperationDisplay struct { 1518 // Provider - Service provider, i.e., Microsoft.Datadog. 1519 Provider *string `json:"provider,omitempty"` 1520 // Resource - Type on which the operation is performed, e.g., 'monitors'. 1521 Resource *string `json:"resource,omitempty"` 1522 // Operation - Operation type, e.g., read, write, delete, etc. 1523 Operation *string `json:"operation,omitempty"` 1524 // Description - Description of the operation, e.g., 'Write monitors'. 1525 Description *string `json:"description,omitempty"` 1526} 1527 1528// OperationListResult result of GET request to list the Microsoft.Datadog operations. 1529type OperationListResult struct { 1530 autorest.Response `json:"-"` 1531 // Value - List of operations supported by the Microsoft.Datadog provider. 1532 Value *[]OperationResult `json:"value,omitempty"` 1533 // NextLink - URL to get the next set of operation list results if there are any. 1534 NextLink *string `json:"nextLink,omitempty"` 1535} 1536 1537// OperationListResultIterator provides access to a complete listing of OperationResult values. 1538type OperationListResultIterator struct { 1539 i int 1540 page OperationListResultPage 1541} 1542 1543// NextWithContext advances to the next value. If there was an error making 1544// the request the iterator does not advance and the error is returned. 1545func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 1546 if tracing.IsEnabled() { 1547 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 1548 defer func() { 1549 sc := -1 1550 if iter.Response().Response.Response != nil { 1551 sc = iter.Response().Response.Response.StatusCode 1552 } 1553 tracing.EndSpan(ctx, sc, err) 1554 }() 1555 } 1556 iter.i++ 1557 if iter.i < len(iter.page.Values()) { 1558 return nil 1559 } 1560 err = iter.page.NextWithContext(ctx) 1561 if err != nil { 1562 iter.i-- 1563 return err 1564 } 1565 iter.i = 0 1566 return nil 1567} 1568 1569// Next advances to the next value. If there was an error making 1570// the request the iterator does not advance and the error is returned. 1571// Deprecated: Use NextWithContext() instead. 1572func (iter *OperationListResultIterator) Next() error { 1573 return iter.NextWithContext(context.Background()) 1574} 1575 1576// NotDone returns true if the enumeration should be started or is not yet complete. 1577func (iter OperationListResultIterator) NotDone() bool { 1578 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1579} 1580 1581// Response returns the raw server response from the last page request. 1582func (iter OperationListResultIterator) Response() OperationListResult { 1583 return iter.page.Response() 1584} 1585 1586// Value returns the current value or a zero-initialized value if the 1587// iterator has advanced beyond the end of the collection. 1588func (iter OperationListResultIterator) Value() OperationResult { 1589 if !iter.page.NotDone() { 1590 return OperationResult{} 1591 } 1592 return iter.page.Values()[iter.i] 1593} 1594 1595// Creates a new instance of the OperationListResultIterator type. 1596func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 1597 return OperationListResultIterator{page: page} 1598} 1599 1600// IsEmpty returns true if the ListResult contains no values. 1601func (olr OperationListResult) IsEmpty() bool { 1602 return olr.Value == nil || len(*olr.Value) == 0 1603} 1604 1605// hasNextLink returns true if the NextLink is not empty. 1606func (olr OperationListResult) hasNextLink() bool { 1607 return olr.NextLink != nil && len(*olr.NextLink) != 0 1608} 1609 1610// operationListResultPreparer prepares a request to retrieve the next set of results. 1611// It returns nil if no more results exist. 1612func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 1613 if !olr.hasNextLink() { 1614 return nil, nil 1615 } 1616 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1617 autorest.AsJSON(), 1618 autorest.AsGet(), 1619 autorest.WithBaseURL(to.String(olr.NextLink))) 1620} 1621 1622// OperationListResultPage contains a page of OperationResult values. 1623type OperationListResultPage struct { 1624 fn func(context.Context, OperationListResult) (OperationListResult, error) 1625 olr OperationListResult 1626} 1627 1628// NextWithContext advances to the next page of values. If there was an error making 1629// the request the page does not advance and the error is returned. 1630func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 1631 if tracing.IsEnabled() { 1632 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 1633 defer func() { 1634 sc := -1 1635 if page.Response().Response.Response != nil { 1636 sc = page.Response().Response.Response.StatusCode 1637 } 1638 tracing.EndSpan(ctx, sc, err) 1639 }() 1640 } 1641 for { 1642 next, err := page.fn(ctx, page.olr) 1643 if err != nil { 1644 return err 1645 } 1646 page.olr = next 1647 if !next.hasNextLink() || !next.IsEmpty() { 1648 break 1649 } 1650 } 1651 return nil 1652} 1653 1654// Next advances to the next page of values. If there was an error making 1655// the request the page does not advance and the error is returned. 1656// Deprecated: Use NextWithContext() instead. 1657func (page *OperationListResultPage) Next() error { 1658 return page.NextWithContext(context.Background()) 1659} 1660 1661// NotDone returns true if the page enumeration should be started or is not yet complete. 1662func (page OperationListResultPage) NotDone() bool { 1663 return !page.olr.IsEmpty() 1664} 1665 1666// Response returns the raw server response from the last page request. 1667func (page OperationListResultPage) Response() OperationListResult { 1668 return page.olr 1669} 1670 1671// Values returns the slice of values for the current page or nil if there are no values. 1672func (page OperationListResultPage) Values() []OperationResult { 1673 if page.olr.IsEmpty() { 1674 return nil 1675 } 1676 return *page.olr.Value 1677} 1678 1679// Creates a new instance of the OperationListResultPage type. 1680func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 1681 return OperationListResultPage{ 1682 fn: getNextPage, 1683 olr: cur, 1684 } 1685} 1686 1687// OperationResult a Microsoft.Datadog REST API operation. 1688type OperationResult struct { 1689 // Name - Operation name, i.e., {provider}/{resource}/{operation}. 1690 Name *string `json:"name,omitempty"` 1691 Display *OperationDisplay `json:"display,omitempty"` 1692 // IsDataAction - Indicates whether the operation is a data action 1693 IsDataAction *bool `json:"isDataAction,omitempty"` 1694} 1695 1696// OrganizationProperties datadog organization properties 1697type OrganizationProperties struct { 1698 // Name - READ-ONLY; Name of the Datadog organization. 1699 Name *string `json:"name,omitempty"` 1700 // ID - READ-ONLY; Id of the Datadog organization. 1701 ID *string `json:"id,omitempty"` 1702 // LinkingAuthCode - The auth code used to linking to an existing datadog organization. 1703 LinkingAuthCode *string `json:"linkingAuthCode,omitempty"` 1704 // LinkingClientID - The client_id from an existing in exchange for an auth token to link organization. 1705 LinkingClientID *string `json:"linkingClientId,omitempty"` 1706 // RedirectURI - The redirect uri for linking. 1707 RedirectURI *string `json:"redirectUri,omitempty"` 1708 // APIKey - Api key associated to the Datadog organization. 1709 APIKey *string `json:"apiKey,omitempty"` 1710 // ApplicationKey - Application key associated to the Datadog organization. 1711 ApplicationKey *string `json:"applicationKey,omitempty"` 1712 // EnterpriseAppID - The Id of the Enterprise App used for Single sign on. 1713 EnterpriseAppID *string `json:"enterpriseAppId,omitempty"` 1714} 1715 1716// MarshalJSON is the custom marshaler for OrganizationProperties. 1717func (op OrganizationProperties) MarshalJSON() ([]byte, error) { 1718 objectMap := make(map[string]interface{}) 1719 if op.LinkingAuthCode != nil { 1720 objectMap["linkingAuthCode"] = op.LinkingAuthCode 1721 } 1722 if op.LinkingClientID != nil { 1723 objectMap["linkingClientId"] = op.LinkingClientID 1724 } 1725 if op.RedirectURI != nil { 1726 objectMap["redirectUri"] = op.RedirectURI 1727 } 1728 if op.APIKey != nil { 1729 objectMap["apiKey"] = op.APIKey 1730 } 1731 if op.ApplicationKey != nil { 1732 objectMap["applicationKey"] = op.ApplicationKey 1733 } 1734 if op.EnterpriseAppID != nil { 1735 objectMap["enterpriseAppId"] = op.EnterpriseAppID 1736 } 1737 return json.Marshal(objectMap) 1738} 1739 1740// ResourceProviderDefaultErrorResponse ... 1741type ResourceProviderDefaultErrorResponse struct { 1742 Error *ErrorResponseBody `json:"error,omitempty"` 1743} 1744 1745// ResourceSku ... 1746type ResourceSku struct { 1747 // Name - Name of the SKU. 1748 Name *string `json:"name,omitempty"` 1749} 1750 1751// SetPasswordLink ... 1752type SetPasswordLink struct { 1753 autorest.Response `json:"-"` 1754 SetPasswordLink *string `json:"setPasswordLink,omitempty"` 1755} 1756 1757// SingleSignOnConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 1758// of a long-running operation. 1759type SingleSignOnConfigurationsCreateOrUpdateFuture struct { 1760 azure.FutureAPI 1761 // Result returns the result of the asynchronous operation. 1762 // If the operation has not completed it will return an error. 1763 Result func(SingleSignOnConfigurationsClient) (SingleSignOnResource, error) 1764} 1765 1766// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1767func (future *SingleSignOnConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1768 var azFuture azure.Future 1769 if err := json.Unmarshal(body, &azFuture); err != nil { 1770 return err 1771 } 1772 future.FutureAPI = &azFuture 1773 future.Result = future.result 1774 return nil 1775} 1776 1777// result is the default implementation for SingleSignOnConfigurationsCreateOrUpdateFuture.Result. 1778func (future *SingleSignOnConfigurationsCreateOrUpdateFuture) result(client SingleSignOnConfigurationsClient) (ssor SingleSignOnResource, err error) { 1779 var done bool 1780 done, err = future.DoneWithContext(context.Background(), client) 1781 if err != nil { 1782 err = autorest.NewErrorWithError(err, "datadog.SingleSignOnConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1783 return 1784 } 1785 if !done { 1786 ssor.Response.Response = future.Response() 1787 err = azure.NewAsyncOpIncompleteError("datadog.SingleSignOnConfigurationsCreateOrUpdateFuture") 1788 return 1789 } 1790 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1791 if ssor.Response.Response, err = future.GetResult(sender); err == nil && ssor.Response.Response.StatusCode != http.StatusNoContent { 1792 ssor, err = client.CreateOrUpdateResponder(ssor.Response.Response) 1793 if err != nil { 1794 err = autorest.NewErrorWithError(err, "datadog.SingleSignOnConfigurationsCreateOrUpdateFuture", "Result", ssor.Response.Response, "Failure responding to request") 1795 } 1796 } 1797 return 1798} 1799 1800// SingleSignOnProperties ... 1801type SingleSignOnProperties struct { 1802 // ProvisioningState - Possible values include: 'Accepted', 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled', 'Deleted', 'NotSpecified' 1803 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1804 // SingleSignOnState - Possible values include: 'Initial', 'Enable', 'Disable', 'Existing' 1805 SingleSignOnState SingleSignOnStates `json:"singleSignOnState,omitempty"` 1806 // EnterpriseAppID - The Id of the Enterprise App used for Single sign-on. 1807 EnterpriseAppID *string `json:"enterpriseAppId,omitempty"` 1808 // SingleSignOnURL - READ-ONLY; The login URL specific to this Datadog Organization. 1809 SingleSignOnURL *string `json:"singleSignOnUrl,omitempty"` 1810} 1811 1812// MarshalJSON is the custom marshaler for SingleSignOnProperties. 1813func (ssop SingleSignOnProperties) MarshalJSON() ([]byte, error) { 1814 objectMap := make(map[string]interface{}) 1815 if ssop.ProvisioningState != "" { 1816 objectMap["provisioningState"] = ssop.ProvisioningState 1817 } 1818 if ssop.SingleSignOnState != "" { 1819 objectMap["singleSignOnState"] = ssop.SingleSignOnState 1820 } 1821 if ssop.EnterpriseAppID != nil { 1822 objectMap["enterpriseAppId"] = ssop.EnterpriseAppID 1823 } 1824 return json.Marshal(objectMap) 1825} 1826 1827// SingleSignOnResource ... 1828type SingleSignOnResource struct { 1829 autorest.Response `json:"-"` 1830 // ID - READ-ONLY; ARM id of the resource. 1831 ID *string `json:"id,omitempty"` 1832 // Name - READ-ONLY; Name of the configuration. 1833 Name *string `json:"name,omitempty"` 1834 // Type - READ-ONLY; The type of the resource. 1835 Type *string `json:"type,omitempty"` 1836 Properties *SingleSignOnProperties `json:"properties,omitempty"` 1837} 1838 1839// MarshalJSON is the custom marshaler for SingleSignOnResource. 1840func (ssor SingleSignOnResource) MarshalJSON() ([]byte, error) { 1841 objectMap := make(map[string]interface{}) 1842 if ssor.Properties != nil { 1843 objectMap["properties"] = ssor.Properties 1844 } 1845 return json.Marshal(objectMap) 1846} 1847 1848// SingleSignOnResourceListResponse response of a list operation. 1849type SingleSignOnResourceListResponse struct { 1850 autorest.Response `json:"-"` 1851 // Value - Results of a list operation. 1852 Value *[]SingleSignOnResource `json:"value,omitempty"` 1853 // NextLink - Link to the next set of results, if any. 1854 NextLink *string `json:"nextLink,omitempty"` 1855} 1856 1857// SingleSignOnResourceListResponseIterator provides access to a complete listing of SingleSignOnResource 1858// values. 1859type SingleSignOnResourceListResponseIterator struct { 1860 i int 1861 page SingleSignOnResourceListResponsePage 1862} 1863 1864// NextWithContext advances to the next value. If there was an error making 1865// the request the iterator does not advance and the error is returned. 1866func (iter *SingleSignOnResourceListResponseIterator) NextWithContext(ctx context.Context) (err error) { 1867 if tracing.IsEnabled() { 1868 ctx = tracing.StartSpan(ctx, fqdn+"/SingleSignOnResourceListResponseIterator.NextWithContext") 1869 defer func() { 1870 sc := -1 1871 if iter.Response().Response.Response != nil { 1872 sc = iter.Response().Response.Response.StatusCode 1873 } 1874 tracing.EndSpan(ctx, sc, err) 1875 }() 1876 } 1877 iter.i++ 1878 if iter.i < len(iter.page.Values()) { 1879 return nil 1880 } 1881 err = iter.page.NextWithContext(ctx) 1882 if err != nil { 1883 iter.i-- 1884 return err 1885 } 1886 iter.i = 0 1887 return nil 1888} 1889 1890// Next advances to the next value. If there was an error making 1891// the request the iterator does not advance and the error is returned. 1892// Deprecated: Use NextWithContext() instead. 1893func (iter *SingleSignOnResourceListResponseIterator) Next() error { 1894 return iter.NextWithContext(context.Background()) 1895} 1896 1897// NotDone returns true if the enumeration should be started or is not yet complete. 1898func (iter SingleSignOnResourceListResponseIterator) NotDone() bool { 1899 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1900} 1901 1902// Response returns the raw server response from the last page request. 1903func (iter SingleSignOnResourceListResponseIterator) Response() SingleSignOnResourceListResponse { 1904 return iter.page.Response() 1905} 1906 1907// Value returns the current value or a zero-initialized value if the 1908// iterator has advanced beyond the end of the collection. 1909func (iter SingleSignOnResourceListResponseIterator) Value() SingleSignOnResource { 1910 if !iter.page.NotDone() { 1911 return SingleSignOnResource{} 1912 } 1913 return iter.page.Values()[iter.i] 1914} 1915 1916// Creates a new instance of the SingleSignOnResourceListResponseIterator type. 1917func NewSingleSignOnResourceListResponseIterator(page SingleSignOnResourceListResponsePage) SingleSignOnResourceListResponseIterator { 1918 return SingleSignOnResourceListResponseIterator{page: page} 1919} 1920 1921// IsEmpty returns true if the ListResult contains no values. 1922func (ssorlr SingleSignOnResourceListResponse) IsEmpty() bool { 1923 return ssorlr.Value == nil || len(*ssorlr.Value) == 0 1924} 1925 1926// hasNextLink returns true if the NextLink is not empty. 1927func (ssorlr SingleSignOnResourceListResponse) hasNextLink() bool { 1928 return ssorlr.NextLink != nil && len(*ssorlr.NextLink) != 0 1929} 1930 1931// singleSignOnResourceListResponsePreparer prepares a request to retrieve the next set of results. 1932// It returns nil if no more results exist. 1933func (ssorlr SingleSignOnResourceListResponse) singleSignOnResourceListResponsePreparer(ctx context.Context) (*http.Request, error) { 1934 if !ssorlr.hasNextLink() { 1935 return nil, nil 1936 } 1937 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1938 autorest.AsJSON(), 1939 autorest.AsGet(), 1940 autorest.WithBaseURL(to.String(ssorlr.NextLink))) 1941} 1942 1943// SingleSignOnResourceListResponsePage contains a page of SingleSignOnResource values. 1944type SingleSignOnResourceListResponsePage struct { 1945 fn func(context.Context, SingleSignOnResourceListResponse) (SingleSignOnResourceListResponse, error) 1946 ssorlr SingleSignOnResourceListResponse 1947} 1948 1949// NextWithContext advances to the next page of values. If there was an error making 1950// the request the page does not advance and the error is returned. 1951func (page *SingleSignOnResourceListResponsePage) NextWithContext(ctx context.Context) (err error) { 1952 if tracing.IsEnabled() { 1953 ctx = tracing.StartSpan(ctx, fqdn+"/SingleSignOnResourceListResponsePage.NextWithContext") 1954 defer func() { 1955 sc := -1 1956 if page.Response().Response.Response != nil { 1957 sc = page.Response().Response.Response.StatusCode 1958 } 1959 tracing.EndSpan(ctx, sc, err) 1960 }() 1961 } 1962 for { 1963 next, err := page.fn(ctx, page.ssorlr) 1964 if err != nil { 1965 return err 1966 } 1967 page.ssorlr = next 1968 if !next.hasNextLink() || !next.IsEmpty() { 1969 break 1970 } 1971 } 1972 return nil 1973} 1974 1975// Next advances to the next page of values. If there was an error making 1976// the request the page does not advance and the error is returned. 1977// Deprecated: Use NextWithContext() instead. 1978func (page *SingleSignOnResourceListResponsePage) Next() error { 1979 return page.NextWithContext(context.Background()) 1980} 1981 1982// NotDone returns true if the page enumeration should be started or is not yet complete. 1983func (page SingleSignOnResourceListResponsePage) NotDone() bool { 1984 return !page.ssorlr.IsEmpty() 1985} 1986 1987// Response returns the raw server response from the last page request. 1988func (page SingleSignOnResourceListResponsePage) Response() SingleSignOnResourceListResponse { 1989 return page.ssorlr 1990} 1991 1992// Values returns the slice of values for the current page or nil if there are no values. 1993func (page SingleSignOnResourceListResponsePage) Values() []SingleSignOnResource { 1994 if page.ssorlr.IsEmpty() { 1995 return nil 1996 } 1997 return *page.ssorlr.Value 1998} 1999 2000// Creates a new instance of the SingleSignOnResourceListResponsePage type. 2001func NewSingleSignOnResourceListResponsePage(cur SingleSignOnResourceListResponse, getNextPage func(context.Context, SingleSignOnResourceListResponse) (SingleSignOnResourceListResponse, error)) SingleSignOnResourceListResponsePage { 2002 return SingleSignOnResourceListResponsePage{ 2003 fn: getNextPage, 2004 ssorlr: cur, 2005 } 2006} 2007 2008// UserInfo user info 2009type UserInfo struct { 2010 // Name - Name of the user 2011 Name *string `json:"name,omitempty"` 2012 // EmailAddress - Email of the user used by Datadog for contacting them if needed 2013 EmailAddress *string `json:"emailAddress,omitempty"` 2014 // PhoneNumber - Phone number of the user used by Datadog for contacting them if needed 2015 PhoneNumber *string `json:"phoneNumber,omitempty"` 2016} 2017