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