1package automation 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 "github.com/gofrs/uuid" 18 "io" 19 "net/http" 20) 21 22// The package's fully qualified name. 23const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/automation/mgmt/2017-05-15-preview/automation" 24 25// Account definition of the automation account type. 26type Account struct { 27 autorest.Response `json:"-"` 28 // AccountProperties - Gets or sets the automation account properties. 29 *AccountProperties `json:"properties,omitempty"` 30 // Etag - Gets or sets the etag of the resource. 31 Etag *string `json:"etag,omitempty"` 32 // Tags - Resource tags. 33 Tags map[string]*string `json:"tags"` 34 // Location - The Azure Region where the resource lives 35 Location *string `json:"location,omitempty"` 36 // ID - READ-ONLY; Fully qualified resource Id for the resource 37 ID *string `json:"id,omitempty"` 38 // Name - READ-ONLY; The name of the resource 39 Name *string `json:"name,omitempty"` 40 // Type - READ-ONLY; The type of the resource. 41 Type *string `json:"type,omitempty"` 42} 43 44// MarshalJSON is the custom marshaler for Account. 45func (a Account) MarshalJSON() ([]byte, error) { 46 objectMap := make(map[string]interface{}) 47 if a.AccountProperties != nil { 48 objectMap["properties"] = a.AccountProperties 49 } 50 if a.Etag != nil { 51 objectMap["etag"] = a.Etag 52 } 53 if a.Tags != nil { 54 objectMap["tags"] = a.Tags 55 } 56 if a.Location != nil { 57 objectMap["location"] = a.Location 58 } 59 return json.Marshal(objectMap) 60} 61 62// UnmarshalJSON is the custom unmarshaler for Account struct. 63func (a *Account) UnmarshalJSON(body []byte) error { 64 var m map[string]*json.RawMessage 65 err := json.Unmarshal(body, &m) 66 if err != nil { 67 return err 68 } 69 for k, v := range m { 70 switch k { 71 case "properties": 72 if v != nil { 73 var accountProperties AccountProperties 74 err = json.Unmarshal(*v, &accountProperties) 75 if err != nil { 76 return err 77 } 78 a.AccountProperties = &accountProperties 79 } 80 case "etag": 81 if v != nil { 82 var etag string 83 err = json.Unmarshal(*v, &etag) 84 if err != nil { 85 return err 86 } 87 a.Etag = &etag 88 } 89 case "tags": 90 if v != nil { 91 var tags map[string]*string 92 err = json.Unmarshal(*v, &tags) 93 if err != nil { 94 return err 95 } 96 a.Tags = tags 97 } 98 case "location": 99 if v != nil { 100 var location string 101 err = json.Unmarshal(*v, &location) 102 if err != nil { 103 return err 104 } 105 a.Location = &location 106 } 107 case "id": 108 if v != nil { 109 var ID string 110 err = json.Unmarshal(*v, &ID) 111 if err != nil { 112 return err 113 } 114 a.ID = &ID 115 } 116 case "name": 117 if v != nil { 118 var name string 119 err = json.Unmarshal(*v, &name) 120 if err != nil { 121 return err 122 } 123 a.Name = &name 124 } 125 case "type": 126 if v != nil { 127 var typeVar string 128 err = json.Unmarshal(*v, &typeVar) 129 if err != nil { 130 return err 131 } 132 a.Type = &typeVar 133 } 134 } 135 } 136 137 return nil 138} 139 140// AccountCreateOrUpdateParameters the parameters supplied to the create or update automation account 141// operation. 142type AccountCreateOrUpdateParameters struct { 143 // AccountCreateOrUpdateProperties - Gets or sets account create or update properties. 144 *AccountCreateOrUpdateProperties `json:"properties,omitempty"` 145 // Name - Gets or sets name of the resource. 146 Name *string `json:"name,omitempty"` 147 // Location - Gets or sets the location of the resource. 148 Location *string `json:"location,omitempty"` 149 // Tags - Gets or sets the tags attached to the resource. 150 Tags map[string]*string `json:"tags"` 151} 152 153// MarshalJSON is the custom marshaler for AccountCreateOrUpdateParameters. 154func (acoup AccountCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 155 objectMap := make(map[string]interface{}) 156 if acoup.AccountCreateOrUpdateProperties != nil { 157 objectMap["properties"] = acoup.AccountCreateOrUpdateProperties 158 } 159 if acoup.Name != nil { 160 objectMap["name"] = acoup.Name 161 } 162 if acoup.Location != nil { 163 objectMap["location"] = acoup.Location 164 } 165 if acoup.Tags != nil { 166 objectMap["tags"] = acoup.Tags 167 } 168 return json.Marshal(objectMap) 169} 170 171// UnmarshalJSON is the custom unmarshaler for AccountCreateOrUpdateParameters struct. 172func (acoup *AccountCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 173 var m map[string]*json.RawMessage 174 err := json.Unmarshal(body, &m) 175 if err != nil { 176 return err 177 } 178 for k, v := range m { 179 switch k { 180 case "properties": 181 if v != nil { 182 var accountCreateOrUpdateProperties AccountCreateOrUpdateProperties 183 err = json.Unmarshal(*v, &accountCreateOrUpdateProperties) 184 if err != nil { 185 return err 186 } 187 acoup.AccountCreateOrUpdateProperties = &accountCreateOrUpdateProperties 188 } 189 case "name": 190 if v != nil { 191 var name string 192 err = json.Unmarshal(*v, &name) 193 if err != nil { 194 return err 195 } 196 acoup.Name = &name 197 } 198 case "location": 199 if v != nil { 200 var location string 201 err = json.Unmarshal(*v, &location) 202 if err != nil { 203 return err 204 } 205 acoup.Location = &location 206 } 207 case "tags": 208 if v != nil { 209 var tags map[string]*string 210 err = json.Unmarshal(*v, &tags) 211 if err != nil { 212 return err 213 } 214 acoup.Tags = tags 215 } 216 } 217 } 218 219 return nil 220} 221 222// AccountCreateOrUpdateProperties the parameters supplied to the create or update account properties. 223type AccountCreateOrUpdateProperties struct { 224 // Sku - Gets or sets account SKU. 225 Sku *Sku `json:"sku,omitempty"` 226} 227 228// AccountListResult the response model for the list account operation. 229type AccountListResult struct { 230 autorest.Response `json:"-"` 231 // Value - Gets or sets list of accounts. 232 Value *[]Account `json:"value,omitempty"` 233 // NextLink - Gets or sets the next link. 234 NextLink *string `json:"nextLink,omitempty"` 235} 236 237// AccountListResultIterator provides access to a complete listing of Account values. 238type AccountListResultIterator struct { 239 i int 240 page AccountListResultPage 241} 242 243// NextWithContext advances to the next value. If there was an error making 244// the request the iterator does not advance and the error is returned. 245func (iter *AccountListResultIterator) NextWithContext(ctx context.Context) (err error) { 246 if tracing.IsEnabled() { 247 ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultIterator.NextWithContext") 248 defer func() { 249 sc := -1 250 if iter.Response().Response.Response != nil { 251 sc = iter.Response().Response.Response.StatusCode 252 } 253 tracing.EndSpan(ctx, sc, err) 254 }() 255 } 256 iter.i++ 257 if iter.i < len(iter.page.Values()) { 258 return nil 259 } 260 err = iter.page.NextWithContext(ctx) 261 if err != nil { 262 iter.i-- 263 return err 264 } 265 iter.i = 0 266 return nil 267} 268 269// Next advances to the next value. If there was an error making 270// the request the iterator does not advance and the error is returned. 271// Deprecated: Use NextWithContext() instead. 272func (iter *AccountListResultIterator) Next() error { 273 return iter.NextWithContext(context.Background()) 274} 275 276// NotDone returns true if the enumeration should be started or is not yet complete. 277func (iter AccountListResultIterator) NotDone() bool { 278 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 279} 280 281// Response returns the raw server response from the last page request. 282func (iter AccountListResultIterator) Response() AccountListResult { 283 return iter.page.Response() 284} 285 286// Value returns the current value or a zero-initialized value if the 287// iterator has advanced beyond the end of the collection. 288func (iter AccountListResultIterator) Value() Account { 289 if !iter.page.NotDone() { 290 return Account{} 291 } 292 return iter.page.Values()[iter.i] 293} 294 295// Creates a new instance of the AccountListResultIterator type. 296func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { 297 return AccountListResultIterator{page: page} 298} 299 300// IsEmpty returns true if the ListResult contains no values. 301func (alr AccountListResult) IsEmpty() bool { 302 return alr.Value == nil || len(*alr.Value) == 0 303} 304 305// hasNextLink returns true if the NextLink is not empty. 306func (alr AccountListResult) hasNextLink() bool { 307 return alr.NextLink != nil && len(*alr.NextLink) != 0 308} 309 310// accountListResultPreparer prepares a request to retrieve the next set of results. 311// It returns nil if no more results exist. 312func (alr AccountListResult) accountListResultPreparer(ctx context.Context) (*http.Request, error) { 313 if !alr.hasNextLink() { 314 return nil, nil 315 } 316 return autorest.Prepare((&http.Request{}).WithContext(ctx), 317 autorest.AsJSON(), 318 autorest.AsGet(), 319 autorest.WithBaseURL(to.String(alr.NextLink))) 320} 321 322// AccountListResultPage contains a page of Account values. 323type AccountListResultPage struct { 324 fn func(context.Context, AccountListResult) (AccountListResult, error) 325 alr AccountListResult 326} 327 328// NextWithContext advances to the next page of values. If there was an error making 329// the request the page does not advance and the error is returned. 330func (page *AccountListResultPage) NextWithContext(ctx context.Context) (err error) { 331 if tracing.IsEnabled() { 332 ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultPage.NextWithContext") 333 defer func() { 334 sc := -1 335 if page.Response().Response.Response != nil { 336 sc = page.Response().Response.Response.StatusCode 337 } 338 tracing.EndSpan(ctx, sc, err) 339 }() 340 } 341 for { 342 next, err := page.fn(ctx, page.alr) 343 if err != nil { 344 return err 345 } 346 page.alr = next 347 if !next.hasNextLink() || !next.IsEmpty() { 348 break 349 } 350 } 351 return nil 352} 353 354// Next advances to the next page of values. If there was an error making 355// the request the page does not advance and the error is returned. 356// Deprecated: Use NextWithContext() instead. 357func (page *AccountListResultPage) Next() error { 358 return page.NextWithContext(context.Background()) 359} 360 361// NotDone returns true if the page enumeration should be started or is not yet complete. 362func (page AccountListResultPage) NotDone() bool { 363 return !page.alr.IsEmpty() 364} 365 366// Response returns the raw server response from the last page request. 367func (page AccountListResultPage) Response() AccountListResult { 368 return page.alr 369} 370 371// Values returns the slice of values for the current page or nil if there are no values. 372func (page AccountListResultPage) Values() []Account { 373 if page.alr.IsEmpty() { 374 return nil 375 } 376 return *page.alr.Value 377} 378 379// Creates a new instance of the AccountListResultPage type. 380func NewAccountListResultPage(cur AccountListResult, getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { 381 return AccountListResultPage{ 382 fn: getNextPage, 383 alr: cur, 384 } 385} 386 387// AccountProperties definition of the account property. 388type AccountProperties struct { 389 // Sku - Gets or sets the SKU of account. 390 Sku *Sku `json:"sku,omitempty"` 391 // LastModifiedBy - Gets or sets the last modified by. 392 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 393 // State - READ-ONLY; Gets status of account. Possible values include: 'Ok', 'Unavailable', 'Suspended' 394 State AccountState `json:"state,omitempty"` 395 // CreationTime - READ-ONLY; Gets the creation time. 396 CreationTime *date.Time `json:"creationTime,omitempty"` 397 // LastModifiedTime - READ-ONLY; Gets the last modified time. 398 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 399 // Description - Gets or sets the description. 400 Description *string `json:"description,omitempty"` 401} 402 403// MarshalJSON is the custom marshaler for AccountProperties. 404func (ap AccountProperties) MarshalJSON() ([]byte, error) { 405 objectMap := make(map[string]interface{}) 406 if ap.Sku != nil { 407 objectMap["sku"] = ap.Sku 408 } 409 if ap.LastModifiedBy != nil { 410 objectMap["lastModifiedBy"] = ap.LastModifiedBy 411 } 412 if ap.Description != nil { 413 objectMap["description"] = ap.Description 414 } 415 return json.Marshal(objectMap) 416} 417 418// AccountUpdateParameters the parameters supplied to the update automation account operation. 419type AccountUpdateParameters struct { 420 // AccountUpdateProperties - Gets or sets account update properties. 421 *AccountUpdateProperties `json:"properties,omitempty"` 422 // Name - Gets or sets the name of the resource. 423 Name *string `json:"name,omitempty"` 424 // Location - Gets or sets the location of the resource. 425 Location *string `json:"location,omitempty"` 426 // Tags - Gets or sets the tags attached to the resource. 427 Tags map[string]*string `json:"tags"` 428} 429 430// MarshalJSON is the custom marshaler for AccountUpdateParameters. 431func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { 432 objectMap := make(map[string]interface{}) 433 if aup.AccountUpdateProperties != nil { 434 objectMap["properties"] = aup.AccountUpdateProperties 435 } 436 if aup.Name != nil { 437 objectMap["name"] = aup.Name 438 } 439 if aup.Location != nil { 440 objectMap["location"] = aup.Location 441 } 442 if aup.Tags != nil { 443 objectMap["tags"] = aup.Tags 444 } 445 return json.Marshal(objectMap) 446} 447 448// UnmarshalJSON is the custom unmarshaler for AccountUpdateParameters struct. 449func (aup *AccountUpdateParameters) UnmarshalJSON(body []byte) error { 450 var m map[string]*json.RawMessage 451 err := json.Unmarshal(body, &m) 452 if err != nil { 453 return err 454 } 455 for k, v := range m { 456 switch k { 457 case "properties": 458 if v != nil { 459 var accountUpdateProperties AccountUpdateProperties 460 err = json.Unmarshal(*v, &accountUpdateProperties) 461 if err != nil { 462 return err 463 } 464 aup.AccountUpdateProperties = &accountUpdateProperties 465 } 466 case "name": 467 if v != nil { 468 var name string 469 err = json.Unmarshal(*v, &name) 470 if err != nil { 471 return err 472 } 473 aup.Name = &name 474 } 475 case "location": 476 if v != nil { 477 var location string 478 err = json.Unmarshal(*v, &location) 479 if err != nil { 480 return err 481 } 482 aup.Location = &location 483 } 484 case "tags": 485 if v != nil { 486 var tags map[string]*string 487 err = json.Unmarshal(*v, &tags) 488 if err != nil { 489 return err 490 } 491 aup.Tags = tags 492 } 493 } 494 } 495 496 return nil 497} 498 499// AccountUpdateProperties the parameters supplied to the update account properties. 500type AccountUpdateProperties struct { 501 // Sku - Gets or sets account SKU. 502 Sku *Sku `json:"sku,omitempty"` 503} 504 505// Activity definition of the activity. 506type Activity struct { 507 autorest.Response `json:"-"` 508 // ID - Gets or sets the id of the resource. 509 ID *string `json:"id,omitempty"` 510 // Name - READ-ONLY; Gets the name of the activity. 511 Name *string `json:"name,omitempty"` 512 // ActivityProperties - Gets or sets the properties of the activity. 513 *ActivityProperties `json:"properties,omitempty"` 514} 515 516// MarshalJSON is the custom marshaler for Activity. 517func (a Activity) MarshalJSON() ([]byte, error) { 518 objectMap := make(map[string]interface{}) 519 if a.ID != nil { 520 objectMap["id"] = a.ID 521 } 522 if a.ActivityProperties != nil { 523 objectMap["properties"] = a.ActivityProperties 524 } 525 return json.Marshal(objectMap) 526} 527 528// UnmarshalJSON is the custom unmarshaler for Activity struct. 529func (a *Activity) UnmarshalJSON(body []byte) error { 530 var m map[string]*json.RawMessage 531 err := json.Unmarshal(body, &m) 532 if err != nil { 533 return err 534 } 535 for k, v := range m { 536 switch k { 537 case "id": 538 if v != nil { 539 var ID string 540 err = json.Unmarshal(*v, &ID) 541 if err != nil { 542 return err 543 } 544 a.ID = &ID 545 } 546 case "name": 547 if v != nil { 548 var name string 549 err = json.Unmarshal(*v, &name) 550 if err != nil { 551 return err 552 } 553 a.Name = &name 554 } 555 case "properties": 556 if v != nil { 557 var activityProperties ActivityProperties 558 err = json.Unmarshal(*v, &activityProperties) 559 if err != nil { 560 return err 561 } 562 a.ActivityProperties = &activityProperties 563 } 564 } 565 } 566 567 return nil 568} 569 570// ActivityListResult the response model for the list activity operation. 571type ActivityListResult struct { 572 autorest.Response `json:"-"` 573 // Value - Gets or sets a list of activities. 574 Value *[]Activity `json:"value,omitempty"` 575 // NextLink - Gets or sets the next link. 576 NextLink *string `json:"nextLink,omitempty"` 577} 578 579// ActivityListResultIterator provides access to a complete listing of Activity values. 580type ActivityListResultIterator struct { 581 i int 582 page ActivityListResultPage 583} 584 585// NextWithContext advances to the next value. If there was an error making 586// the request the iterator does not advance and the error is returned. 587func (iter *ActivityListResultIterator) NextWithContext(ctx context.Context) (err error) { 588 if tracing.IsEnabled() { 589 ctx = tracing.StartSpan(ctx, fqdn+"/ActivityListResultIterator.NextWithContext") 590 defer func() { 591 sc := -1 592 if iter.Response().Response.Response != nil { 593 sc = iter.Response().Response.Response.StatusCode 594 } 595 tracing.EndSpan(ctx, sc, err) 596 }() 597 } 598 iter.i++ 599 if iter.i < len(iter.page.Values()) { 600 return nil 601 } 602 err = iter.page.NextWithContext(ctx) 603 if err != nil { 604 iter.i-- 605 return err 606 } 607 iter.i = 0 608 return nil 609} 610 611// Next advances to the next value. If there was an error making 612// the request the iterator does not advance and the error is returned. 613// Deprecated: Use NextWithContext() instead. 614func (iter *ActivityListResultIterator) Next() error { 615 return iter.NextWithContext(context.Background()) 616} 617 618// NotDone returns true if the enumeration should be started or is not yet complete. 619func (iter ActivityListResultIterator) NotDone() bool { 620 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 621} 622 623// Response returns the raw server response from the last page request. 624func (iter ActivityListResultIterator) Response() ActivityListResult { 625 return iter.page.Response() 626} 627 628// Value returns the current value or a zero-initialized value if the 629// iterator has advanced beyond the end of the collection. 630func (iter ActivityListResultIterator) Value() Activity { 631 if !iter.page.NotDone() { 632 return Activity{} 633 } 634 return iter.page.Values()[iter.i] 635} 636 637// Creates a new instance of the ActivityListResultIterator type. 638func NewActivityListResultIterator(page ActivityListResultPage) ActivityListResultIterator { 639 return ActivityListResultIterator{page: page} 640} 641 642// IsEmpty returns true if the ListResult contains no values. 643func (alr ActivityListResult) IsEmpty() bool { 644 return alr.Value == nil || len(*alr.Value) == 0 645} 646 647// hasNextLink returns true if the NextLink is not empty. 648func (alr ActivityListResult) hasNextLink() bool { 649 return alr.NextLink != nil && len(*alr.NextLink) != 0 650} 651 652// activityListResultPreparer prepares a request to retrieve the next set of results. 653// It returns nil if no more results exist. 654func (alr ActivityListResult) activityListResultPreparer(ctx context.Context) (*http.Request, error) { 655 if !alr.hasNextLink() { 656 return nil, nil 657 } 658 return autorest.Prepare((&http.Request{}).WithContext(ctx), 659 autorest.AsJSON(), 660 autorest.AsGet(), 661 autorest.WithBaseURL(to.String(alr.NextLink))) 662} 663 664// ActivityListResultPage contains a page of Activity values. 665type ActivityListResultPage struct { 666 fn func(context.Context, ActivityListResult) (ActivityListResult, error) 667 alr ActivityListResult 668} 669 670// NextWithContext advances to the next page of values. If there was an error making 671// the request the page does not advance and the error is returned. 672func (page *ActivityListResultPage) NextWithContext(ctx context.Context) (err error) { 673 if tracing.IsEnabled() { 674 ctx = tracing.StartSpan(ctx, fqdn+"/ActivityListResultPage.NextWithContext") 675 defer func() { 676 sc := -1 677 if page.Response().Response.Response != nil { 678 sc = page.Response().Response.Response.StatusCode 679 } 680 tracing.EndSpan(ctx, sc, err) 681 }() 682 } 683 for { 684 next, err := page.fn(ctx, page.alr) 685 if err != nil { 686 return err 687 } 688 page.alr = next 689 if !next.hasNextLink() || !next.IsEmpty() { 690 break 691 } 692 } 693 return nil 694} 695 696// Next advances to the next page of values. If there was an error making 697// the request the page does not advance and the error is returned. 698// Deprecated: Use NextWithContext() instead. 699func (page *ActivityListResultPage) Next() error { 700 return page.NextWithContext(context.Background()) 701} 702 703// NotDone returns true if the page enumeration should be started or is not yet complete. 704func (page ActivityListResultPage) NotDone() bool { 705 return !page.alr.IsEmpty() 706} 707 708// Response returns the raw server response from the last page request. 709func (page ActivityListResultPage) Response() ActivityListResult { 710 return page.alr 711} 712 713// Values returns the slice of values for the current page or nil if there are no values. 714func (page ActivityListResultPage) Values() []Activity { 715 if page.alr.IsEmpty() { 716 return nil 717 } 718 return *page.alr.Value 719} 720 721// Creates a new instance of the ActivityListResultPage type. 722func NewActivityListResultPage(cur ActivityListResult, getNextPage func(context.Context, ActivityListResult) (ActivityListResult, error)) ActivityListResultPage { 723 return ActivityListResultPage{ 724 fn: getNextPage, 725 alr: cur, 726 } 727} 728 729// ActivityOutputType definition of the activity output type. 730type ActivityOutputType struct { 731 // Name - Gets or sets the name of the activity output type. 732 Name *string `json:"name,omitempty"` 733 // Type - Gets or sets the type of the activity output type. 734 Type *string `json:"type,omitempty"` 735} 736 737// ActivityParameter definition of the activity parameter. 738type ActivityParameter struct { 739 // Name - Gets or sets the name of the activity parameter. 740 Name *string `json:"name,omitempty"` 741 // Type - Gets or sets the type of the activity parameter. 742 Type *string `json:"type,omitempty"` 743 // IsMandatory - Gets or sets a Boolean value that indicates true if the parameter is required. If the value is false, the parameter is optional. 744 IsMandatory *bool `json:"isMandatory,omitempty"` 745 // IsDynamic - Gets or sets a Boolean value that indicates true if the parameter is dynamic. 746 IsDynamic *bool `json:"isDynamic,omitempty"` 747 // Position - Gets or sets the position of the activity parameter. 748 Position *int64 `json:"position,omitempty"` 749 // ValueFromPipeline - Gets or sets a Boolean value that indicates true if the parameter can take values from the incoming pipeline objects. This setting is used if the cmdlet must access the complete input object. false indicates that the parameter cannot take values from the complete input object. 750 ValueFromPipeline *bool `json:"valueFromPipeline,omitempty"` 751 // ValueFromPipelineByPropertyName - Gets or sets a Boolean value that indicates true if the parameter can be filled from a property of the incoming pipeline object that has the same name as this parameter. false indicates that the parameter cannot be filled from the incoming pipeline object property with the same name. 752 ValueFromPipelineByPropertyName *bool `json:"valueFromPipelineByPropertyName,omitempty"` 753 // ValueFromRemainingArguments - Gets or sets a Boolean value that indicates true if the cmdlet parameter accepts all the remaining command-line arguments that are associated with this parameter in the form of an array. false if the cmdlet parameter does not accept all the remaining argument values. 754 ValueFromRemainingArguments *bool `json:"valueFromRemainingArguments,omitempty"` 755 // Description - Gets or sets the description of the activity parameter. 756 Description *string `json:"description,omitempty"` 757 // ValidationSet - Gets or sets the validation set of activity parameter. 758 ValidationSet *[]ActivityParameterValidationSet `json:"validationSet,omitempty"` 759} 760 761// ActivityParameterSet definition of the activity parameter set. 762type ActivityParameterSet struct { 763 // Name - Gets or sets the name of the activity parameter set. 764 Name *string `json:"name,omitempty"` 765 // Parameters - Gets or sets the parameters of the activity parameter set. 766 Parameters *[]ActivityParameter `json:"parameters,omitempty"` 767} 768 769// ActivityParameterValidationSet definition of the activity parameter validation set. 770type ActivityParameterValidationSet struct { 771 // MemberValue - Gets or sets the name of the activity parameter validation set member. 772 MemberValue *string `json:"memberValue,omitempty"` 773} 774 775// ActivityProperties properties of the activity. 776type ActivityProperties struct { 777 // Definition - Gets or sets the user name of the activity. 778 Definition *string `json:"definition,omitempty"` 779 // ParameterSets - Gets or sets the parameter sets of the activity. 780 ParameterSets *[]ActivityParameterSet `json:"parameterSets,omitempty"` 781 // OutputTypes - Gets or sets the output types of the activity. 782 OutputTypes *[]ActivityOutputType `json:"outputTypes,omitempty"` 783 // CreationTime - Gets or sets the creation time. 784 CreationTime *date.Time `json:"creationTime,omitempty"` 785 // LastModifiedTime - Gets or sets the last modified time. 786 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 787 // Description - Gets or sets the description. 788 Description *string `json:"description,omitempty"` 789} 790 791// AdvancedSchedule the properties of the create Advanced Schedule. 792type AdvancedSchedule struct { 793 // WeekDays - Days of the week that the job should execute on. 794 WeekDays *[]string `json:"weekDays,omitempty"` 795 // MonthDays - Days of the month that the job should execute on. Must be between 1 and 31. 796 MonthDays *[]int32 `json:"monthDays,omitempty"` 797 // MonthlyOccurrences - Occurrences of days within a month. 798 MonthlyOccurrences *[]AdvancedScheduleMonthlyOccurrence `json:"monthlyOccurrences,omitempty"` 799} 800 801// AdvancedScheduleMonthlyOccurrence the properties of the create advanced schedule monthly occurrence. 802type AdvancedScheduleMonthlyOccurrence struct { 803 // Occurrence - Occurrence of the week within the month. Must be between 1 and 5 804 Occurrence *int32 `json:"occurrence,omitempty"` 805 // Day - Day of the occurrence. Must be one of monday, tuesday, wednesday, thursday, friday, saturday, sunday. Possible values include: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday' 806 Day ScheduleDay `json:"day,omitempty"` 807} 808 809// AgentRegistration definition of the agent registration information type. 810type AgentRegistration struct { 811 autorest.Response `json:"-"` 812 // DscMetaConfiguration - Gets or sets the dsc meta configuration. 813 DscMetaConfiguration *string `json:"dscMetaConfiguration,omitempty"` 814 // Endpoint - Gets or sets the dsc server endpoint. 815 Endpoint *string `json:"endpoint,omitempty"` 816 // Keys - Gets or sets the agent registration keys. 817 Keys *AgentRegistrationKeys `json:"keys,omitempty"` 818 // ID - Gets or sets the id. 819 ID *string `json:"id,omitempty"` 820} 821 822// AgentRegistrationKeys definition of the agent registration keys. 823type AgentRegistrationKeys struct { 824 // Primary - Gets or sets the primary key. 825 Primary *string `json:"primary,omitempty"` 826 // Secondary - Gets or sets the secondary key. 827 Secondary *string `json:"secondary,omitempty"` 828} 829 830// AgentRegistrationRegenerateKeyParameter the parameters supplied to the regenerate keys operation. 831type AgentRegistrationRegenerateKeyParameter struct { 832 // KeyName - Gets or sets the agent registration key name - primary or secondary. Possible values include: 'Primary', 'Secondary' 833 KeyName AgentRegistrationKeyName `json:"keyName,omitempty"` 834 // Name - Gets or sets the name of the resource. 835 Name *string `json:"name,omitempty"` 836 // Location - Gets or sets the location of the resource. 837 Location *string `json:"location,omitempty"` 838 // Tags - Gets or sets the tags attached to the resource. 839 Tags map[string]*string `json:"tags"` 840} 841 842// MarshalJSON is the custom marshaler for AgentRegistrationRegenerateKeyParameter. 843func (arrkp AgentRegistrationRegenerateKeyParameter) MarshalJSON() ([]byte, error) { 844 objectMap := make(map[string]interface{}) 845 if arrkp.KeyName != "" { 846 objectMap["keyName"] = arrkp.KeyName 847 } 848 if arrkp.Name != nil { 849 objectMap["name"] = arrkp.Name 850 } 851 if arrkp.Location != nil { 852 objectMap["location"] = arrkp.Location 853 } 854 if arrkp.Tags != nil { 855 objectMap["tags"] = arrkp.Tags 856 } 857 return json.Marshal(objectMap) 858} 859 860// AzureQueryProperties azure query for the update configuration. 861type AzureQueryProperties struct { 862 // Scope - List of Subscription or Resource Group ARM Ids. 863 Scope *[]string `json:"scope,omitempty"` 864 // Locations - List of locations to scope the query to. 865 Locations *[]string `json:"locations,omitempty"` 866 // TagSettings - Tag settings for the VM. 867 TagSettings *TagSettingsProperties `json:"tagSettings,omitempty"` 868} 869 870// Certificate definition of the certificate. 871type Certificate struct { 872 autorest.Response `json:"-"` 873 // CertificateProperties - Gets or sets the properties of the certificate. 874 *CertificateProperties `json:"properties,omitempty"` 875 // ID - READ-ONLY; Fully qualified resource Id for the resource 876 ID *string `json:"id,omitempty"` 877 // Name - READ-ONLY; The name of the resource 878 Name *string `json:"name,omitempty"` 879 // Type - READ-ONLY; The type of the resource. 880 Type *string `json:"type,omitempty"` 881} 882 883// MarshalJSON is the custom marshaler for Certificate. 884func (c Certificate) MarshalJSON() ([]byte, error) { 885 objectMap := make(map[string]interface{}) 886 if c.CertificateProperties != nil { 887 objectMap["properties"] = c.CertificateProperties 888 } 889 return json.Marshal(objectMap) 890} 891 892// UnmarshalJSON is the custom unmarshaler for Certificate struct. 893func (c *Certificate) UnmarshalJSON(body []byte) error { 894 var m map[string]*json.RawMessage 895 err := json.Unmarshal(body, &m) 896 if err != nil { 897 return err 898 } 899 for k, v := range m { 900 switch k { 901 case "properties": 902 if v != nil { 903 var certificateProperties CertificateProperties 904 err = json.Unmarshal(*v, &certificateProperties) 905 if err != nil { 906 return err 907 } 908 c.CertificateProperties = &certificateProperties 909 } 910 case "id": 911 if v != nil { 912 var ID string 913 err = json.Unmarshal(*v, &ID) 914 if err != nil { 915 return err 916 } 917 c.ID = &ID 918 } 919 case "name": 920 if v != nil { 921 var name string 922 err = json.Unmarshal(*v, &name) 923 if err != nil { 924 return err 925 } 926 c.Name = &name 927 } 928 case "type": 929 if v != nil { 930 var typeVar string 931 err = json.Unmarshal(*v, &typeVar) 932 if err != nil { 933 return err 934 } 935 c.Type = &typeVar 936 } 937 } 938 } 939 940 return nil 941} 942 943// CertificateCreateOrUpdateParameters the parameters supplied to the create or update or replace 944// certificate operation. 945type CertificateCreateOrUpdateParameters struct { 946 // Name - Gets or sets the name of the certificate. 947 Name *string `json:"name,omitempty"` 948 // CertificateCreateOrUpdateProperties - Gets or sets the properties of the certificate. 949 *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` 950} 951 952// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. 953func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 954 objectMap := make(map[string]interface{}) 955 if ccoup.Name != nil { 956 objectMap["name"] = ccoup.Name 957 } 958 if ccoup.CertificateCreateOrUpdateProperties != nil { 959 objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties 960 } 961 return json.Marshal(objectMap) 962} 963 964// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. 965func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 966 var m map[string]*json.RawMessage 967 err := json.Unmarshal(body, &m) 968 if err != nil { 969 return err 970 } 971 for k, v := range m { 972 switch k { 973 case "name": 974 if v != nil { 975 var name string 976 err = json.Unmarshal(*v, &name) 977 if err != nil { 978 return err 979 } 980 ccoup.Name = &name 981 } 982 case "properties": 983 if v != nil { 984 var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties 985 err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) 986 if err != nil { 987 return err 988 } 989 ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties 990 } 991 } 992 } 993 994 return nil 995} 996 997// CertificateCreateOrUpdateProperties the properties of the create certificate operation. 998type CertificateCreateOrUpdateProperties struct { 999 // Base64Value - Gets or sets the base64 encoded value of the certificate. 1000 Base64Value *string `json:"base64Value,omitempty"` 1001 // Description - Gets or sets the description of the certificate. 1002 Description *string `json:"description,omitempty"` 1003 // Thumbprint - Gets or sets the thumbprint of the certificate. 1004 Thumbprint *string `json:"thumbprint,omitempty"` 1005 // IsExportable - Gets or sets the is exportable flag of the certificate. 1006 IsExportable *bool `json:"isExportable,omitempty"` 1007} 1008 1009// CertificateListResult the response model for the list certificate operation. 1010type CertificateListResult struct { 1011 autorest.Response `json:"-"` 1012 // Value - Gets or sets a list of certificates. 1013 Value *[]Certificate `json:"value,omitempty"` 1014 // NextLink - Gets or sets the next link. 1015 NextLink *string `json:"nextLink,omitempty"` 1016} 1017 1018// CertificateListResultIterator provides access to a complete listing of Certificate values. 1019type CertificateListResultIterator struct { 1020 i int 1021 page CertificateListResultPage 1022} 1023 1024// NextWithContext advances to the next value. If there was an error making 1025// the request the iterator does not advance and the error is returned. 1026func (iter *CertificateListResultIterator) NextWithContext(ctx context.Context) (err error) { 1027 if tracing.IsEnabled() { 1028 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultIterator.NextWithContext") 1029 defer func() { 1030 sc := -1 1031 if iter.Response().Response.Response != nil { 1032 sc = iter.Response().Response.Response.StatusCode 1033 } 1034 tracing.EndSpan(ctx, sc, err) 1035 }() 1036 } 1037 iter.i++ 1038 if iter.i < len(iter.page.Values()) { 1039 return nil 1040 } 1041 err = iter.page.NextWithContext(ctx) 1042 if err != nil { 1043 iter.i-- 1044 return err 1045 } 1046 iter.i = 0 1047 return nil 1048} 1049 1050// Next advances to the next value. If there was an error making 1051// the request the iterator does not advance and the error is returned. 1052// Deprecated: Use NextWithContext() instead. 1053func (iter *CertificateListResultIterator) Next() error { 1054 return iter.NextWithContext(context.Background()) 1055} 1056 1057// NotDone returns true if the enumeration should be started or is not yet complete. 1058func (iter CertificateListResultIterator) NotDone() bool { 1059 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1060} 1061 1062// Response returns the raw server response from the last page request. 1063func (iter CertificateListResultIterator) Response() CertificateListResult { 1064 return iter.page.Response() 1065} 1066 1067// Value returns the current value or a zero-initialized value if the 1068// iterator has advanced beyond the end of the collection. 1069func (iter CertificateListResultIterator) Value() Certificate { 1070 if !iter.page.NotDone() { 1071 return Certificate{} 1072 } 1073 return iter.page.Values()[iter.i] 1074} 1075 1076// Creates a new instance of the CertificateListResultIterator type. 1077func NewCertificateListResultIterator(page CertificateListResultPage) CertificateListResultIterator { 1078 return CertificateListResultIterator{page: page} 1079} 1080 1081// IsEmpty returns true if the ListResult contains no values. 1082func (clr CertificateListResult) IsEmpty() bool { 1083 return clr.Value == nil || len(*clr.Value) == 0 1084} 1085 1086// hasNextLink returns true if the NextLink is not empty. 1087func (clr CertificateListResult) hasNextLink() bool { 1088 return clr.NextLink != nil && len(*clr.NextLink) != 0 1089} 1090 1091// certificateListResultPreparer prepares a request to retrieve the next set of results. 1092// It returns nil if no more results exist. 1093func (clr CertificateListResult) certificateListResultPreparer(ctx context.Context) (*http.Request, error) { 1094 if !clr.hasNextLink() { 1095 return nil, nil 1096 } 1097 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1098 autorest.AsJSON(), 1099 autorest.AsGet(), 1100 autorest.WithBaseURL(to.String(clr.NextLink))) 1101} 1102 1103// CertificateListResultPage contains a page of Certificate values. 1104type CertificateListResultPage struct { 1105 fn func(context.Context, CertificateListResult) (CertificateListResult, error) 1106 clr CertificateListResult 1107} 1108 1109// NextWithContext advances to the next page of values. If there was an error making 1110// the request the page does not advance and the error is returned. 1111func (page *CertificateListResultPage) NextWithContext(ctx context.Context) (err error) { 1112 if tracing.IsEnabled() { 1113 ctx = tracing.StartSpan(ctx, fqdn+"/CertificateListResultPage.NextWithContext") 1114 defer func() { 1115 sc := -1 1116 if page.Response().Response.Response != nil { 1117 sc = page.Response().Response.Response.StatusCode 1118 } 1119 tracing.EndSpan(ctx, sc, err) 1120 }() 1121 } 1122 for { 1123 next, err := page.fn(ctx, page.clr) 1124 if err != nil { 1125 return err 1126 } 1127 page.clr = next 1128 if !next.hasNextLink() || !next.IsEmpty() { 1129 break 1130 } 1131 } 1132 return nil 1133} 1134 1135// Next advances to the next page of values. If there was an error making 1136// the request the page does not advance and the error is returned. 1137// Deprecated: Use NextWithContext() instead. 1138func (page *CertificateListResultPage) Next() error { 1139 return page.NextWithContext(context.Background()) 1140} 1141 1142// NotDone returns true if the page enumeration should be started or is not yet complete. 1143func (page CertificateListResultPage) NotDone() bool { 1144 return !page.clr.IsEmpty() 1145} 1146 1147// Response returns the raw server response from the last page request. 1148func (page CertificateListResultPage) Response() CertificateListResult { 1149 return page.clr 1150} 1151 1152// Values returns the slice of values for the current page or nil if there are no values. 1153func (page CertificateListResultPage) Values() []Certificate { 1154 if page.clr.IsEmpty() { 1155 return nil 1156 } 1157 return *page.clr.Value 1158} 1159 1160// Creates a new instance of the CertificateListResultPage type. 1161func NewCertificateListResultPage(cur CertificateListResult, getNextPage func(context.Context, CertificateListResult) (CertificateListResult, error)) CertificateListResultPage { 1162 return CertificateListResultPage{ 1163 fn: getNextPage, 1164 clr: cur, 1165 } 1166} 1167 1168// CertificateProperties properties of the certificate. 1169type CertificateProperties struct { 1170 // Thumbprint - READ-ONLY; Gets the thumbprint of the certificate. 1171 Thumbprint *string `json:"thumbprint,omitempty"` 1172 // ExpiryTime - READ-ONLY; Gets the expiry time of the certificate. 1173 ExpiryTime *date.Time `json:"expiryTime,omitempty"` 1174 // IsExportable - READ-ONLY; Gets the is exportable flag of the certificate. 1175 IsExportable *bool `json:"isExportable,omitempty"` 1176 // CreationTime - READ-ONLY; Gets the creation time. 1177 CreationTime *date.Time `json:"creationTime,omitempty"` 1178 // LastModifiedTime - READ-ONLY; Gets the last modified time. 1179 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 1180 // Description - Gets or sets the description. 1181 Description *string `json:"description,omitempty"` 1182} 1183 1184// MarshalJSON is the custom marshaler for CertificateProperties. 1185func (cp CertificateProperties) MarshalJSON() ([]byte, error) { 1186 objectMap := make(map[string]interface{}) 1187 if cp.Description != nil { 1188 objectMap["description"] = cp.Description 1189 } 1190 return json.Marshal(objectMap) 1191} 1192 1193// CertificateUpdateParameters the parameters supplied to the update certificate operation. 1194type CertificateUpdateParameters struct { 1195 // Name - Gets or sets the name of the certificate. 1196 Name *string `json:"name,omitempty"` 1197 // CertificateUpdateProperties - Gets or sets the properties of the certificate. 1198 *CertificateUpdateProperties `json:"properties,omitempty"` 1199} 1200 1201// MarshalJSON is the custom marshaler for CertificateUpdateParameters. 1202func (cup CertificateUpdateParameters) MarshalJSON() ([]byte, error) { 1203 objectMap := make(map[string]interface{}) 1204 if cup.Name != nil { 1205 objectMap["name"] = cup.Name 1206 } 1207 if cup.CertificateUpdateProperties != nil { 1208 objectMap["properties"] = cup.CertificateUpdateProperties 1209 } 1210 return json.Marshal(objectMap) 1211} 1212 1213// UnmarshalJSON is the custom unmarshaler for CertificateUpdateParameters struct. 1214func (cup *CertificateUpdateParameters) UnmarshalJSON(body []byte) error { 1215 var m map[string]*json.RawMessage 1216 err := json.Unmarshal(body, &m) 1217 if err != nil { 1218 return err 1219 } 1220 for k, v := range m { 1221 switch k { 1222 case "name": 1223 if v != nil { 1224 var name string 1225 err = json.Unmarshal(*v, &name) 1226 if err != nil { 1227 return err 1228 } 1229 cup.Name = &name 1230 } 1231 case "properties": 1232 if v != nil { 1233 var certificateUpdateProperties CertificateUpdateProperties 1234 err = json.Unmarshal(*v, &certificateUpdateProperties) 1235 if err != nil { 1236 return err 1237 } 1238 cup.CertificateUpdateProperties = &certificateUpdateProperties 1239 } 1240 } 1241 } 1242 1243 return nil 1244} 1245 1246// CertificateUpdateProperties the properties of the update certificate operation 1247type CertificateUpdateProperties struct { 1248 // Description - Gets or sets the description of the certificate. 1249 Description *string `json:"description,omitempty"` 1250} 1251 1252// CollectionItemUpdateConfiguration object returned when requesting a collection of software update 1253// configuration 1254type CollectionItemUpdateConfiguration struct { 1255 // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. 1256 AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` 1257 // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 1258 Duration *string `json:"duration,omitempty"` 1259} 1260 1261// Connection definition of the connection. 1262type Connection struct { 1263 autorest.Response `json:"-"` 1264 // ConnectionProperties - Gets or sets the properties of the connection. 1265 *ConnectionProperties `json:"properties,omitempty"` 1266 // ID - READ-ONLY; Fully qualified resource Id for the resource 1267 ID *string `json:"id,omitempty"` 1268 // Name - READ-ONLY; The name of the resource 1269 Name *string `json:"name,omitempty"` 1270 // Type - READ-ONLY; The type of the resource. 1271 Type *string `json:"type,omitempty"` 1272} 1273 1274// MarshalJSON is the custom marshaler for Connection. 1275func (c Connection) MarshalJSON() ([]byte, error) { 1276 objectMap := make(map[string]interface{}) 1277 if c.ConnectionProperties != nil { 1278 objectMap["properties"] = c.ConnectionProperties 1279 } 1280 return json.Marshal(objectMap) 1281} 1282 1283// UnmarshalJSON is the custom unmarshaler for Connection struct. 1284func (c *Connection) UnmarshalJSON(body []byte) error { 1285 var m map[string]*json.RawMessage 1286 err := json.Unmarshal(body, &m) 1287 if err != nil { 1288 return err 1289 } 1290 for k, v := range m { 1291 switch k { 1292 case "properties": 1293 if v != nil { 1294 var connectionProperties ConnectionProperties 1295 err = json.Unmarshal(*v, &connectionProperties) 1296 if err != nil { 1297 return err 1298 } 1299 c.ConnectionProperties = &connectionProperties 1300 } 1301 case "id": 1302 if v != nil { 1303 var ID string 1304 err = json.Unmarshal(*v, &ID) 1305 if err != nil { 1306 return err 1307 } 1308 c.ID = &ID 1309 } 1310 case "name": 1311 if v != nil { 1312 var name string 1313 err = json.Unmarshal(*v, &name) 1314 if err != nil { 1315 return err 1316 } 1317 c.Name = &name 1318 } 1319 case "type": 1320 if v != nil { 1321 var typeVar string 1322 err = json.Unmarshal(*v, &typeVar) 1323 if err != nil { 1324 return err 1325 } 1326 c.Type = &typeVar 1327 } 1328 } 1329 } 1330 1331 return nil 1332} 1333 1334// ConnectionCreateOrUpdateParameters the parameters supplied to the create or update connection operation. 1335type ConnectionCreateOrUpdateParameters struct { 1336 // Name - Gets or sets the name of the connection. 1337 Name *string `json:"name,omitempty"` 1338 // ConnectionCreateOrUpdateProperties - Gets or sets the properties of the connection. 1339 *ConnectionCreateOrUpdateProperties `json:"properties,omitempty"` 1340} 1341 1342// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateParameters. 1343func (ccoup ConnectionCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 1344 objectMap := make(map[string]interface{}) 1345 if ccoup.Name != nil { 1346 objectMap["name"] = ccoup.Name 1347 } 1348 if ccoup.ConnectionCreateOrUpdateProperties != nil { 1349 objectMap["properties"] = ccoup.ConnectionCreateOrUpdateProperties 1350 } 1351 return json.Marshal(objectMap) 1352} 1353 1354// UnmarshalJSON is the custom unmarshaler for ConnectionCreateOrUpdateParameters struct. 1355func (ccoup *ConnectionCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 1356 var m map[string]*json.RawMessage 1357 err := json.Unmarshal(body, &m) 1358 if err != nil { 1359 return err 1360 } 1361 for k, v := range m { 1362 switch k { 1363 case "name": 1364 if v != nil { 1365 var name string 1366 err = json.Unmarshal(*v, &name) 1367 if err != nil { 1368 return err 1369 } 1370 ccoup.Name = &name 1371 } 1372 case "properties": 1373 if v != nil { 1374 var connectionCreateOrUpdateProperties ConnectionCreateOrUpdateProperties 1375 err = json.Unmarshal(*v, &connectionCreateOrUpdateProperties) 1376 if err != nil { 1377 return err 1378 } 1379 ccoup.ConnectionCreateOrUpdateProperties = &connectionCreateOrUpdateProperties 1380 } 1381 } 1382 } 1383 1384 return nil 1385} 1386 1387// ConnectionCreateOrUpdateProperties the properties of the create connection properties 1388type ConnectionCreateOrUpdateProperties struct { 1389 // Description - Gets or sets the description of the connection. 1390 Description *string `json:"description,omitempty"` 1391 // ConnectionType - Gets or sets the connectionType of the connection. 1392 ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` 1393 // FieldDefinitionValues - Gets or sets the field definition properties of the connection. 1394 FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` 1395} 1396 1397// MarshalJSON is the custom marshaler for ConnectionCreateOrUpdateProperties. 1398func (ccoup ConnectionCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 1399 objectMap := make(map[string]interface{}) 1400 if ccoup.Description != nil { 1401 objectMap["description"] = ccoup.Description 1402 } 1403 if ccoup.ConnectionType != nil { 1404 objectMap["connectionType"] = ccoup.ConnectionType 1405 } 1406 if ccoup.FieldDefinitionValues != nil { 1407 objectMap["fieldDefinitionValues"] = ccoup.FieldDefinitionValues 1408 } 1409 return json.Marshal(objectMap) 1410} 1411 1412// ConnectionListResult the response model for the list connection operation. 1413type ConnectionListResult struct { 1414 autorest.Response `json:"-"` 1415 // Value - Gets or sets a list of connection. 1416 Value *[]Connection `json:"value,omitempty"` 1417 // NextLink - Gets or sets the next link. 1418 NextLink *string `json:"nextLink,omitempty"` 1419} 1420 1421// ConnectionListResultIterator provides access to a complete listing of Connection values. 1422type ConnectionListResultIterator struct { 1423 i int 1424 page ConnectionListResultPage 1425} 1426 1427// NextWithContext advances to the next value. If there was an error making 1428// the request the iterator does not advance and the error is returned. 1429func (iter *ConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 1430 if tracing.IsEnabled() { 1431 ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionListResultIterator.NextWithContext") 1432 defer func() { 1433 sc := -1 1434 if iter.Response().Response.Response != nil { 1435 sc = iter.Response().Response.Response.StatusCode 1436 } 1437 tracing.EndSpan(ctx, sc, err) 1438 }() 1439 } 1440 iter.i++ 1441 if iter.i < len(iter.page.Values()) { 1442 return nil 1443 } 1444 err = iter.page.NextWithContext(ctx) 1445 if err != nil { 1446 iter.i-- 1447 return err 1448 } 1449 iter.i = 0 1450 return nil 1451} 1452 1453// Next advances to the next value. If there was an error making 1454// the request the iterator does not advance and the error is returned. 1455// Deprecated: Use NextWithContext() instead. 1456func (iter *ConnectionListResultIterator) Next() error { 1457 return iter.NextWithContext(context.Background()) 1458} 1459 1460// NotDone returns true if the enumeration should be started or is not yet complete. 1461func (iter ConnectionListResultIterator) NotDone() bool { 1462 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1463} 1464 1465// Response returns the raw server response from the last page request. 1466func (iter ConnectionListResultIterator) Response() ConnectionListResult { 1467 return iter.page.Response() 1468} 1469 1470// Value returns the current value or a zero-initialized value if the 1471// iterator has advanced beyond the end of the collection. 1472func (iter ConnectionListResultIterator) Value() Connection { 1473 if !iter.page.NotDone() { 1474 return Connection{} 1475 } 1476 return iter.page.Values()[iter.i] 1477} 1478 1479// Creates a new instance of the ConnectionListResultIterator type. 1480func NewConnectionListResultIterator(page ConnectionListResultPage) ConnectionListResultIterator { 1481 return ConnectionListResultIterator{page: page} 1482} 1483 1484// IsEmpty returns true if the ListResult contains no values. 1485func (clr ConnectionListResult) IsEmpty() bool { 1486 return clr.Value == nil || len(*clr.Value) == 0 1487} 1488 1489// hasNextLink returns true if the NextLink is not empty. 1490func (clr ConnectionListResult) hasNextLink() bool { 1491 return clr.NextLink != nil && len(*clr.NextLink) != 0 1492} 1493 1494// connectionListResultPreparer prepares a request to retrieve the next set of results. 1495// It returns nil if no more results exist. 1496func (clr ConnectionListResult) connectionListResultPreparer(ctx context.Context) (*http.Request, error) { 1497 if !clr.hasNextLink() { 1498 return nil, nil 1499 } 1500 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1501 autorest.AsJSON(), 1502 autorest.AsGet(), 1503 autorest.WithBaseURL(to.String(clr.NextLink))) 1504} 1505 1506// ConnectionListResultPage contains a page of Connection values. 1507type ConnectionListResultPage struct { 1508 fn func(context.Context, ConnectionListResult) (ConnectionListResult, error) 1509 clr ConnectionListResult 1510} 1511 1512// NextWithContext advances to the next page of values. If there was an error making 1513// the request the page does not advance and the error is returned. 1514func (page *ConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 1515 if tracing.IsEnabled() { 1516 ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionListResultPage.NextWithContext") 1517 defer func() { 1518 sc := -1 1519 if page.Response().Response.Response != nil { 1520 sc = page.Response().Response.Response.StatusCode 1521 } 1522 tracing.EndSpan(ctx, sc, err) 1523 }() 1524 } 1525 for { 1526 next, err := page.fn(ctx, page.clr) 1527 if err != nil { 1528 return err 1529 } 1530 page.clr = next 1531 if !next.hasNextLink() || !next.IsEmpty() { 1532 break 1533 } 1534 } 1535 return nil 1536} 1537 1538// Next advances to the next page of values. If there was an error making 1539// the request the page does not advance and the error is returned. 1540// Deprecated: Use NextWithContext() instead. 1541func (page *ConnectionListResultPage) Next() error { 1542 return page.NextWithContext(context.Background()) 1543} 1544 1545// NotDone returns true if the page enumeration should be started or is not yet complete. 1546func (page ConnectionListResultPage) NotDone() bool { 1547 return !page.clr.IsEmpty() 1548} 1549 1550// Response returns the raw server response from the last page request. 1551func (page ConnectionListResultPage) Response() ConnectionListResult { 1552 return page.clr 1553} 1554 1555// Values returns the slice of values for the current page or nil if there are no values. 1556func (page ConnectionListResultPage) Values() []Connection { 1557 if page.clr.IsEmpty() { 1558 return nil 1559 } 1560 return *page.clr.Value 1561} 1562 1563// Creates a new instance of the ConnectionListResultPage type. 1564func NewConnectionListResultPage(cur ConnectionListResult, getNextPage func(context.Context, ConnectionListResult) (ConnectionListResult, error)) ConnectionListResultPage { 1565 return ConnectionListResultPage{ 1566 fn: getNextPage, 1567 clr: cur, 1568 } 1569} 1570 1571// ConnectionProperties definition of the connection properties. 1572type ConnectionProperties struct { 1573 // ConnectionType - Gets or sets the connectionType of the connection. 1574 ConnectionType *ConnectionTypeAssociationProperty `json:"connectionType,omitempty"` 1575 // FieldDefinitionValues - READ-ONLY; Gets the field definition values of the connection. 1576 FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` 1577 // CreationTime - READ-ONLY; Gets the creation time. 1578 CreationTime *date.Time `json:"creationTime,omitempty"` 1579 // LastModifiedTime - READ-ONLY; Gets the last modified time. 1580 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 1581 // Description - Gets or sets the description. 1582 Description *string `json:"description,omitempty"` 1583} 1584 1585// MarshalJSON is the custom marshaler for ConnectionProperties. 1586func (cp ConnectionProperties) MarshalJSON() ([]byte, error) { 1587 objectMap := make(map[string]interface{}) 1588 if cp.ConnectionType != nil { 1589 objectMap["connectionType"] = cp.ConnectionType 1590 } 1591 if cp.Description != nil { 1592 objectMap["description"] = cp.Description 1593 } 1594 return json.Marshal(objectMap) 1595} 1596 1597// ConnectionType definition of the connection type. 1598type ConnectionType struct { 1599 autorest.Response `json:"-"` 1600 // ID - READ-ONLY; Gets the id of the resource. 1601 ID *string `json:"id,omitempty"` 1602 // Name - READ-ONLY; Gets the name of the connection type. 1603 Name *string `json:"name,omitempty"` 1604 // Type - READ-ONLY; Resource type 1605 Type *string `json:"type,omitempty"` 1606 // ConnectionTypeProperties - Gets or sets the properties of the connection type. 1607 *ConnectionTypeProperties `json:"properties,omitempty"` 1608} 1609 1610// MarshalJSON is the custom marshaler for ConnectionType. 1611func (ct ConnectionType) MarshalJSON() ([]byte, error) { 1612 objectMap := make(map[string]interface{}) 1613 if ct.ConnectionTypeProperties != nil { 1614 objectMap["properties"] = ct.ConnectionTypeProperties 1615 } 1616 return json.Marshal(objectMap) 1617} 1618 1619// UnmarshalJSON is the custom unmarshaler for ConnectionType struct. 1620func (ct *ConnectionType) UnmarshalJSON(body []byte) error { 1621 var m map[string]*json.RawMessage 1622 err := json.Unmarshal(body, &m) 1623 if err != nil { 1624 return err 1625 } 1626 for k, v := range m { 1627 switch k { 1628 case "id": 1629 if v != nil { 1630 var ID string 1631 err = json.Unmarshal(*v, &ID) 1632 if err != nil { 1633 return err 1634 } 1635 ct.ID = &ID 1636 } 1637 case "name": 1638 if v != nil { 1639 var name string 1640 err = json.Unmarshal(*v, &name) 1641 if err != nil { 1642 return err 1643 } 1644 ct.Name = &name 1645 } 1646 case "type": 1647 if v != nil { 1648 var typeVar string 1649 err = json.Unmarshal(*v, &typeVar) 1650 if err != nil { 1651 return err 1652 } 1653 ct.Type = &typeVar 1654 } 1655 case "properties": 1656 if v != nil { 1657 var connectionTypeProperties ConnectionTypeProperties 1658 err = json.Unmarshal(*v, &connectionTypeProperties) 1659 if err != nil { 1660 return err 1661 } 1662 ct.ConnectionTypeProperties = &connectionTypeProperties 1663 } 1664 } 1665 } 1666 1667 return nil 1668} 1669 1670// ConnectionTypeAssociationProperty the connection type property associated with the entity. 1671type ConnectionTypeAssociationProperty struct { 1672 // Name - Gets or sets the name of the connection type. 1673 Name *string `json:"name,omitempty"` 1674} 1675 1676// ConnectionTypeCreateOrUpdateParameters the parameters supplied to the create or update connection type 1677// operation. 1678type ConnectionTypeCreateOrUpdateParameters struct { 1679 // Name - Gets or sets the name of the connection type. 1680 Name *string `json:"name,omitempty"` 1681 // ConnectionTypeCreateOrUpdateProperties - Gets or sets the value of the connection type. 1682 *ConnectionTypeCreateOrUpdateProperties `json:"properties,omitempty"` 1683} 1684 1685// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateParameters. 1686func (ctcoup ConnectionTypeCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 1687 objectMap := make(map[string]interface{}) 1688 if ctcoup.Name != nil { 1689 objectMap["name"] = ctcoup.Name 1690 } 1691 if ctcoup.ConnectionTypeCreateOrUpdateProperties != nil { 1692 objectMap["properties"] = ctcoup.ConnectionTypeCreateOrUpdateProperties 1693 } 1694 return json.Marshal(objectMap) 1695} 1696 1697// UnmarshalJSON is the custom unmarshaler for ConnectionTypeCreateOrUpdateParameters struct. 1698func (ctcoup *ConnectionTypeCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 1699 var m map[string]*json.RawMessage 1700 err := json.Unmarshal(body, &m) 1701 if err != nil { 1702 return err 1703 } 1704 for k, v := range m { 1705 switch k { 1706 case "name": 1707 if v != nil { 1708 var name string 1709 err = json.Unmarshal(*v, &name) 1710 if err != nil { 1711 return err 1712 } 1713 ctcoup.Name = &name 1714 } 1715 case "properties": 1716 if v != nil { 1717 var connectionTypeCreateOrUpdateProperties ConnectionTypeCreateOrUpdateProperties 1718 err = json.Unmarshal(*v, &connectionTypeCreateOrUpdateProperties) 1719 if err != nil { 1720 return err 1721 } 1722 ctcoup.ConnectionTypeCreateOrUpdateProperties = &connectionTypeCreateOrUpdateProperties 1723 } 1724 } 1725 } 1726 1727 return nil 1728} 1729 1730// ConnectionTypeCreateOrUpdateProperties the properties of the create connection type. 1731type ConnectionTypeCreateOrUpdateProperties struct { 1732 // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. 1733 IsGlobal *bool `json:"isGlobal,omitempty"` 1734 // FieldDefinitions - Gets or sets the field definitions of the connection type. 1735 FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` 1736} 1737 1738// MarshalJSON is the custom marshaler for ConnectionTypeCreateOrUpdateProperties. 1739func (ctcoup ConnectionTypeCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 1740 objectMap := make(map[string]interface{}) 1741 if ctcoup.IsGlobal != nil { 1742 objectMap["isGlobal"] = ctcoup.IsGlobal 1743 } 1744 if ctcoup.FieldDefinitions != nil { 1745 objectMap["fieldDefinitions"] = ctcoup.FieldDefinitions 1746 } 1747 return json.Marshal(objectMap) 1748} 1749 1750// ConnectionTypeListResult the response model for the list connection type operation. 1751type ConnectionTypeListResult struct { 1752 autorest.Response `json:"-"` 1753 // Value - Gets or sets a list of connection types. 1754 Value *[]ConnectionType `json:"value,omitempty"` 1755 // NextLink - Gets or sets the next link. 1756 NextLink *string `json:"nextLink,omitempty"` 1757} 1758 1759// ConnectionTypeListResultIterator provides access to a complete listing of ConnectionType values. 1760type ConnectionTypeListResultIterator struct { 1761 i int 1762 page ConnectionTypeListResultPage 1763} 1764 1765// NextWithContext advances to the next value. If there was an error making 1766// the request the iterator does not advance and the error is returned. 1767func (iter *ConnectionTypeListResultIterator) NextWithContext(ctx context.Context) (err error) { 1768 if tracing.IsEnabled() { 1769 ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeListResultIterator.NextWithContext") 1770 defer func() { 1771 sc := -1 1772 if iter.Response().Response.Response != nil { 1773 sc = iter.Response().Response.Response.StatusCode 1774 } 1775 tracing.EndSpan(ctx, sc, err) 1776 }() 1777 } 1778 iter.i++ 1779 if iter.i < len(iter.page.Values()) { 1780 return nil 1781 } 1782 err = iter.page.NextWithContext(ctx) 1783 if err != nil { 1784 iter.i-- 1785 return err 1786 } 1787 iter.i = 0 1788 return nil 1789} 1790 1791// Next advances to the next value. If there was an error making 1792// the request the iterator does not advance and the error is returned. 1793// Deprecated: Use NextWithContext() instead. 1794func (iter *ConnectionTypeListResultIterator) Next() error { 1795 return iter.NextWithContext(context.Background()) 1796} 1797 1798// NotDone returns true if the enumeration should be started or is not yet complete. 1799func (iter ConnectionTypeListResultIterator) NotDone() bool { 1800 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1801} 1802 1803// Response returns the raw server response from the last page request. 1804func (iter ConnectionTypeListResultIterator) Response() ConnectionTypeListResult { 1805 return iter.page.Response() 1806} 1807 1808// Value returns the current value or a zero-initialized value if the 1809// iterator has advanced beyond the end of the collection. 1810func (iter ConnectionTypeListResultIterator) Value() ConnectionType { 1811 if !iter.page.NotDone() { 1812 return ConnectionType{} 1813 } 1814 return iter.page.Values()[iter.i] 1815} 1816 1817// Creates a new instance of the ConnectionTypeListResultIterator type. 1818func NewConnectionTypeListResultIterator(page ConnectionTypeListResultPage) ConnectionTypeListResultIterator { 1819 return ConnectionTypeListResultIterator{page: page} 1820} 1821 1822// IsEmpty returns true if the ListResult contains no values. 1823func (ctlr ConnectionTypeListResult) IsEmpty() bool { 1824 return ctlr.Value == nil || len(*ctlr.Value) == 0 1825} 1826 1827// hasNextLink returns true if the NextLink is not empty. 1828func (ctlr ConnectionTypeListResult) hasNextLink() bool { 1829 return ctlr.NextLink != nil && len(*ctlr.NextLink) != 0 1830} 1831 1832// connectionTypeListResultPreparer prepares a request to retrieve the next set of results. 1833// It returns nil if no more results exist. 1834func (ctlr ConnectionTypeListResult) connectionTypeListResultPreparer(ctx context.Context) (*http.Request, error) { 1835 if !ctlr.hasNextLink() { 1836 return nil, nil 1837 } 1838 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1839 autorest.AsJSON(), 1840 autorest.AsGet(), 1841 autorest.WithBaseURL(to.String(ctlr.NextLink))) 1842} 1843 1844// ConnectionTypeListResultPage contains a page of ConnectionType values. 1845type ConnectionTypeListResultPage struct { 1846 fn func(context.Context, ConnectionTypeListResult) (ConnectionTypeListResult, error) 1847 ctlr ConnectionTypeListResult 1848} 1849 1850// NextWithContext advances to the next page of values. If there was an error making 1851// the request the page does not advance and the error is returned. 1852func (page *ConnectionTypeListResultPage) NextWithContext(ctx context.Context) (err error) { 1853 if tracing.IsEnabled() { 1854 ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionTypeListResultPage.NextWithContext") 1855 defer func() { 1856 sc := -1 1857 if page.Response().Response.Response != nil { 1858 sc = page.Response().Response.Response.StatusCode 1859 } 1860 tracing.EndSpan(ctx, sc, err) 1861 }() 1862 } 1863 for { 1864 next, err := page.fn(ctx, page.ctlr) 1865 if err != nil { 1866 return err 1867 } 1868 page.ctlr = next 1869 if !next.hasNextLink() || !next.IsEmpty() { 1870 break 1871 } 1872 } 1873 return nil 1874} 1875 1876// Next advances to the next page of values. If there was an error making 1877// the request the page does not advance and the error is returned. 1878// Deprecated: Use NextWithContext() instead. 1879func (page *ConnectionTypeListResultPage) Next() error { 1880 return page.NextWithContext(context.Background()) 1881} 1882 1883// NotDone returns true if the page enumeration should be started or is not yet complete. 1884func (page ConnectionTypeListResultPage) NotDone() bool { 1885 return !page.ctlr.IsEmpty() 1886} 1887 1888// Response returns the raw server response from the last page request. 1889func (page ConnectionTypeListResultPage) Response() ConnectionTypeListResult { 1890 return page.ctlr 1891} 1892 1893// Values returns the slice of values for the current page or nil if there are no values. 1894func (page ConnectionTypeListResultPage) Values() []ConnectionType { 1895 if page.ctlr.IsEmpty() { 1896 return nil 1897 } 1898 return *page.ctlr.Value 1899} 1900 1901// Creates a new instance of the ConnectionTypeListResultPage type. 1902func NewConnectionTypeListResultPage(cur ConnectionTypeListResult, getNextPage func(context.Context, ConnectionTypeListResult) (ConnectionTypeListResult, error)) ConnectionTypeListResultPage { 1903 return ConnectionTypeListResultPage{ 1904 fn: getNextPage, 1905 ctlr: cur, 1906 } 1907} 1908 1909// ConnectionTypeProperties properties of the connection type. 1910type ConnectionTypeProperties struct { 1911 // IsGlobal - Gets or sets a Boolean value to indicate if the connection type is global. 1912 IsGlobal *bool `json:"isGlobal,omitempty"` 1913 // FieldDefinitions - READ-ONLY; Gets the field definitions of the connection type. 1914 FieldDefinitions map[string]*FieldDefinition `json:"fieldDefinitions"` 1915 // CreationTime - READ-ONLY; Gets the creation time. 1916 CreationTime *date.Time `json:"creationTime,omitempty"` 1917 // LastModifiedTime - Gets or sets the last modified time. 1918 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 1919 // Description - Gets or sets the description. 1920 Description *string `json:"description,omitempty"` 1921} 1922 1923// MarshalJSON is the custom marshaler for ConnectionTypeProperties. 1924func (ctp ConnectionTypeProperties) MarshalJSON() ([]byte, error) { 1925 objectMap := make(map[string]interface{}) 1926 if ctp.IsGlobal != nil { 1927 objectMap["isGlobal"] = ctp.IsGlobal 1928 } 1929 if ctp.LastModifiedTime != nil { 1930 objectMap["lastModifiedTime"] = ctp.LastModifiedTime 1931 } 1932 if ctp.Description != nil { 1933 objectMap["description"] = ctp.Description 1934 } 1935 return json.Marshal(objectMap) 1936} 1937 1938// ConnectionUpdateParameters the parameters supplied to the update connection operation. 1939type ConnectionUpdateParameters struct { 1940 // Name - Gets or sets the name of the connection. 1941 Name *string `json:"name,omitempty"` 1942 // ConnectionUpdateProperties - Gets or sets the properties of the connection. 1943 *ConnectionUpdateProperties `json:"properties,omitempty"` 1944} 1945 1946// MarshalJSON is the custom marshaler for ConnectionUpdateParameters. 1947func (cup ConnectionUpdateParameters) MarshalJSON() ([]byte, error) { 1948 objectMap := make(map[string]interface{}) 1949 if cup.Name != nil { 1950 objectMap["name"] = cup.Name 1951 } 1952 if cup.ConnectionUpdateProperties != nil { 1953 objectMap["properties"] = cup.ConnectionUpdateProperties 1954 } 1955 return json.Marshal(objectMap) 1956} 1957 1958// UnmarshalJSON is the custom unmarshaler for ConnectionUpdateParameters struct. 1959func (cup *ConnectionUpdateParameters) UnmarshalJSON(body []byte) error { 1960 var m map[string]*json.RawMessage 1961 err := json.Unmarshal(body, &m) 1962 if err != nil { 1963 return err 1964 } 1965 for k, v := range m { 1966 switch k { 1967 case "name": 1968 if v != nil { 1969 var name string 1970 err = json.Unmarshal(*v, &name) 1971 if err != nil { 1972 return err 1973 } 1974 cup.Name = &name 1975 } 1976 case "properties": 1977 if v != nil { 1978 var connectionUpdateProperties ConnectionUpdateProperties 1979 err = json.Unmarshal(*v, &connectionUpdateProperties) 1980 if err != nil { 1981 return err 1982 } 1983 cup.ConnectionUpdateProperties = &connectionUpdateProperties 1984 } 1985 } 1986 } 1987 1988 return nil 1989} 1990 1991// ConnectionUpdateProperties the properties of the update connection operation. 1992type ConnectionUpdateProperties struct { 1993 // Description - Gets or sets the description of the connection. 1994 Description *string `json:"description,omitempty"` 1995 // FieldDefinitionValues - Gets or sets the field definition values of the connection. 1996 FieldDefinitionValues map[string]*string `json:"fieldDefinitionValues"` 1997} 1998 1999// MarshalJSON is the custom marshaler for ConnectionUpdateProperties. 2000func (cup ConnectionUpdateProperties) MarshalJSON() ([]byte, error) { 2001 objectMap := make(map[string]interface{}) 2002 if cup.Description != nil { 2003 objectMap["description"] = cup.Description 2004 } 2005 if cup.FieldDefinitionValues != nil { 2006 objectMap["fieldDefinitionValues"] = cup.FieldDefinitionValues 2007 } 2008 return json.Marshal(objectMap) 2009} 2010 2011// ContentHash definition of the runbook property type. 2012type ContentHash struct { 2013 // Algorithm - Gets or sets the content hash algorithm used to hash the content. 2014 Algorithm *string `json:"algorithm,omitempty"` 2015 // Value - Gets or sets expected hash value of the content. 2016 Value *string `json:"value,omitempty"` 2017} 2018 2019// ContentLink definition of the content link. 2020type ContentLink struct { 2021 // URI - Gets or sets the uri of the runbook content. 2022 URI *string `json:"uri,omitempty"` 2023 // ContentHash - Gets or sets the hash. 2024 ContentHash *ContentHash `json:"contentHash,omitempty"` 2025 // Version - Gets or sets the version of the content. 2026 Version *string `json:"version,omitempty"` 2027} 2028 2029// ContentSource definition of the content source. 2030type ContentSource struct { 2031 // Hash - Gets or sets the hash. 2032 Hash *ContentHash `json:"hash,omitempty"` 2033 // Type - Gets or sets the content source type. Possible values include: 'EmbeddedContent', 'URI' 2034 Type ContentSourceType `json:"type,omitempty"` 2035 // Value - Gets or sets the value of the content. This is based on the content source type. 2036 Value *string `json:"value,omitempty"` 2037 // Version - Gets or sets the version of the content. 2038 Version *string `json:"version,omitempty"` 2039} 2040 2041// Credential definition of the credential. 2042type Credential struct { 2043 autorest.Response `json:"-"` 2044 // CredentialProperties - Gets or sets the properties of the credential. 2045 *CredentialProperties `json:"properties,omitempty"` 2046 // ID - READ-ONLY; Fully qualified resource Id for the resource 2047 ID *string `json:"id,omitempty"` 2048 // Name - READ-ONLY; The name of the resource 2049 Name *string `json:"name,omitempty"` 2050 // Type - READ-ONLY; The type of the resource. 2051 Type *string `json:"type,omitempty"` 2052} 2053 2054// MarshalJSON is the custom marshaler for Credential. 2055func (c Credential) MarshalJSON() ([]byte, error) { 2056 objectMap := make(map[string]interface{}) 2057 if c.CredentialProperties != nil { 2058 objectMap["properties"] = c.CredentialProperties 2059 } 2060 return json.Marshal(objectMap) 2061} 2062 2063// UnmarshalJSON is the custom unmarshaler for Credential struct. 2064func (c *Credential) UnmarshalJSON(body []byte) error { 2065 var m map[string]*json.RawMessage 2066 err := json.Unmarshal(body, &m) 2067 if err != nil { 2068 return err 2069 } 2070 for k, v := range m { 2071 switch k { 2072 case "properties": 2073 if v != nil { 2074 var credentialProperties CredentialProperties 2075 err = json.Unmarshal(*v, &credentialProperties) 2076 if err != nil { 2077 return err 2078 } 2079 c.CredentialProperties = &credentialProperties 2080 } 2081 case "id": 2082 if v != nil { 2083 var ID string 2084 err = json.Unmarshal(*v, &ID) 2085 if err != nil { 2086 return err 2087 } 2088 c.ID = &ID 2089 } 2090 case "name": 2091 if v != nil { 2092 var name string 2093 err = json.Unmarshal(*v, &name) 2094 if err != nil { 2095 return err 2096 } 2097 c.Name = &name 2098 } 2099 case "type": 2100 if v != nil { 2101 var typeVar string 2102 err = json.Unmarshal(*v, &typeVar) 2103 if err != nil { 2104 return err 2105 } 2106 c.Type = &typeVar 2107 } 2108 } 2109 } 2110 2111 return nil 2112} 2113 2114// CredentialCreateOrUpdateParameters the parameters supplied to the create or update credential operation. 2115type CredentialCreateOrUpdateParameters struct { 2116 // Name - Gets or sets the name of the credential. 2117 Name *string `json:"name,omitempty"` 2118 // CredentialCreateOrUpdateProperties - Gets or sets the properties of the credential. 2119 *CredentialCreateOrUpdateProperties `json:"properties,omitempty"` 2120} 2121 2122// MarshalJSON is the custom marshaler for CredentialCreateOrUpdateParameters. 2123func (ccoup CredentialCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 2124 objectMap := make(map[string]interface{}) 2125 if ccoup.Name != nil { 2126 objectMap["name"] = ccoup.Name 2127 } 2128 if ccoup.CredentialCreateOrUpdateProperties != nil { 2129 objectMap["properties"] = ccoup.CredentialCreateOrUpdateProperties 2130 } 2131 return json.Marshal(objectMap) 2132} 2133 2134// UnmarshalJSON is the custom unmarshaler for CredentialCreateOrUpdateParameters struct. 2135func (ccoup *CredentialCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 2136 var m map[string]*json.RawMessage 2137 err := json.Unmarshal(body, &m) 2138 if err != nil { 2139 return err 2140 } 2141 for k, v := range m { 2142 switch k { 2143 case "name": 2144 if v != nil { 2145 var name string 2146 err = json.Unmarshal(*v, &name) 2147 if err != nil { 2148 return err 2149 } 2150 ccoup.Name = &name 2151 } 2152 case "properties": 2153 if v != nil { 2154 var credentialCreateOrUpdateProperties CredentialCreateOrUpdateProperties 2155 err = json.Unmarshal(*v, &credentialCreateOrUpdateProperties) 2156 if err != nil { 2157 return err 2158 } 2159 ccoup.CredentialCreateOrUpdateProperties = &credentialCreateOrUpdateProperties 2160 } 2161 } 2162 } 2163 2164 return nil 2165} 2166 2167// CredentialCreateOrUpdateProperties the properties of the create credential operation. 2168type CredentialCreateOrUpdateProperties struct { 2169 // UserName - Gets or sets the user name of the credential. 2170 UserName *string `json:"userName,omitempty"` 2171 // Password - Gets or sets the password of the credential. 2172 Password *string `json:"password,omitempty"` 2173 // Description - Gets or sets the description of the credential. 2174 Description *string `json:"description,omitempty"` 2175} 2176 2177// CredentialListResult the response model for the list credential operation. 2178type CredentialListResult struct { 2179 autorest.Response `json:"-"` 2180 // Value - Gets or sets a list of credentials. 2181 Value *[]Credential `json:"value,omitempty"` 2182 // NextLink - Gets or sets the next link. 2183 NextLink *string `json:"nextLink,omitempty"` 2184} 2185 2186// CredentialListResultIterator provides access to a complete listing of Credential values. 2187type CredentialListResultIterator struct { 2188 i int 2189 page CredentialListResultPage 2190} 2191 2192// NextWithContext advances to the next value. If there was an error making 2193// the request the iterator does not advance and the error is returned. 2194func (iter *CredentialListResultIterator) NextWithContext(ctx context.Context) (err error) { 2195 if tracing.IsEnabled() { 2196 ctx = tracing.StartSpan(ctx, fqdn+"/CredentialListResultIterator.NextWithContext") 2197 defer func() { 2198 sc := -1 2199 if iter.Response().Response.Response != nil { 2200 sc = iter.Response().Response.Response.StatusCode 2201 } 2202 tracing.EndSpan(ctx, sc, err) 2203 }() 2204 } 2205 iter.i++ 2206 if iter.i < len(iter.page.Values()) { 2207 return nil 2208 } 2209 err = iter.page.NextWithContext(ctx) 2210 if err != nil { 2211 iter.i-- 2212 return err 2213 } 2214 iter.i = 0 2215 return nil 2216} 2217 2218// Next advances to the next value. If there was an error making 2219// the request the iterator does not advance and the error is returned. 2220// Deprecated: Use NextWithContext() instead. 2221func (iter *CredentialListResultIterator) Next() error { 2222 return iter.NextWithContext(context.Background()) 2223} 2224 2225// NotDone returns true if the enumeration should be started or is not yet complete. 2226func (iter CredentialListResultIterator) NotDone() bool { 2227 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2228} 2229 2230// Response returns the raw server response from the last page request. 2231func (iter CredentialListResultIterator) Response() CredentialListResult { 2232 return iter.page.Response() 2233} 2234 2235// Value returns the current value or a zero-initialized value if the 2236// iterator has advanced beyond the end of the collection. 2237func (iter CredentialListResultIterator) Value() Credential { 2238 if !iter.page.NotDone() { 2239 return Credential{} 2240 } 2241 return iter.page.Values()[iter.i] 2242} 2243 2244// Creates a new instance of the CredentialListResultIterator type. 2245func NewCredentialListResultIterator(page CredentialListResultPage) CredentialListResultIterator { 2246 return CredentialListResultIterator{page: page} 2247} 2248 2249// IsEmpty returns true if the ListResult contains no values. 2250func (clr CredentialListResult) IsEmpty() bool { 2251 return clr.Value == nil || len(*clr.Value) == 0 2252} 2253 2254// hasNextLink returns true if the NextLink is not empty. 2255func (clr CredentialListResult) hasNextLink() bool { 2256 return clr.NextLink != nil && len(*clr.NextLink) != 0 2257} 2258 2259// credentialListResultPreparer prepares a request to retrieve the next set of results. 2260// It returns nil if no more results exist. 2261func (clr CredentialListResult) credentialListResultPreparer(ctx context.Context) (*http.Request, error) { 2262 if !clr.hasNextLink() { 2263 return nil, nil 2264 } 2265 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2266 autorest.AsJSON(), 2267 autorest.AsGet(), 2268 autorest.WithBaseURL(to.String(clr.NextLink))) 2269} 2270 2271// CredentialListResultPage contains a page of Credential values. 2272type CredentialListResultPage struct { 2273 fn func(context.Context, CredentialListResult) (CredentialListResult, error) 2274 clr CredentialListResult 2275} 2276 2277// NextWithContext advances to the next page of values. If there was an error making 2278// the request the page does not advance and the error is returned. 2279func (page *CredentialListResultPage) NextWithContext(ctx context.Context) (err error) { 2280 if tracing.IsEnabled() { 2281 ctx = tracing.StartSpan(ctx, fqdn+"/CredentialListResultPage.NextWithContext") 2282 defer func() { 2283 sc := -1 2284 if page.Response().Response.Response != nil { 2285 sc = page.Response().Response.Response.StatusCode 2286 } 2287 tracing.EndSpan(ctx, sc, err) 2288 }() 2289 } 2290 for { 2291 next, err := page.fn(ctx, page.clr) 2292 if err != nil { 2293 return err 2294 } 2295 page.clr = next 2296 if !next.hasNextLink() || !next.IsEmpty() { 2297 break 2298 } 2299 } 2300 return nil 2301} 2302 2303// Next advances to the next page of values. If there was an error making 2304// the request the page does not advance and the error is returned. 2305// Deprecated: Use NextWithContext() instead. 2306func (page *CredentialListResultPage) Next() error { 2307 return page.NextWithContext(context.Background()) 2308} 2309 2310// NotDone returns true if the page enumeration should be started or is not yet complete. 2311func (page CredentialListResultPage) NotDone() bool { 2312 return !page.clr.IsEmpty() 2313} 2314 2315// Response returns the raw server response from the last page request. 2316func (page CredentialListResultPage) Response() CredentialListResult { 2317 return page.clr 2318} 2319 2320// Values returns the slice of values for the current page or nil if there are no values. 2321func (page CredentialListResultPage) Values() []Credential { 2322 if page.clr.IsEmpty() { 2323 return nil 2324 } 2325 return *page.clr.Value 2326} 2327 2328// Creates a new instance of the CredentialListResultPage type. 2329func NewCredentialListResultPage(cur CredentialListResult, getNextPage func(context.Context, CredentialListResult) (CredentialListResult, error)) CredentialListResultPage { 2330 return CredentialListResultPage{ 2331 fn: getNextPage, 2332 clr: cur, 2333 } 2334} 2335 2336// CredentialProperties definition of the credential properties 2337type CredentialProperties struct { 2338 // UserName - READ-ONLY; Gets the user name of the credential. 2339 UserName *string `json:"userName,omitempty"` 2340 // CreationTime - READ-ONLY; Gets the creation time. 2341 CreationTime *date.Time `json:"creationTime,omitempty"` 2342 // LastModifiedTime - READ-ONLY; Gets the last modified time. 2343 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 2344 // Description - Gets or sets the description. 2345 Description *string `json:"description,omitempty"` 2346} 2347 2348// MarshalJSON is the custom marshaler for CredentialProperties. 2349func (cp CredentialProperties) MarshalJSON() ([]byte, error) { 2350 objectMap := make(map[string]interface{}) 2351 if cp.Description != nil { 2352 objectMap["description"] = cp.Description 2353 } 2354 return json.Marshal(objectMap) 2355} 2356 2357// CredentialUpdateParameters the parameters supplied to the Update credential operation. 2358type CredentialUpdateParameters struct { 2359 // Name - Gets or sets the name of the credential. 2360 Name *string `json:"name,omitempty"` 2361 // CredentialUpdateProperties - Gets or sets the properties of the variable. 2362 *CredentialUpdateProperties `json:"properties,omitempty"` 2363} 2364 2365// MarshalJSON is the custom marshaler for CredentialUpdateParameters. 2366func (cup CredentialUpdateParameters) MarshalJSON() ([]byte, error) { 2367 objectMap := make(map[string]interface{}) 2368 if cup.Name != nil { 2369 objectMap["name"] = cup.Name 2370 } 2371 if cup.CredentialUpdateProperties != nil { 2372 objectMap["properties"] = cup.CredentialUpdateProperties 2373 } 2374 return json.Marshal(objectMap) 2375} 2376 2377// UnmarshalJSON is the custom unmarshaler for CredentialUpdateParameters struct. 2378func (cup *CredentialUpdateParameters) UnmarshalJSON(body []byte) error { 2379 var m map[string]*json.RawMessage 2380 err := json.Unmarshal(body, &m) 2381 if err != nil { 2382 return err 2383 } 2384 for k, v := range m { 2385 switch k { 2386 case "name": 2387 if v != nil { 2388 var name string 2389 err = json.Unmarshal(*v, &name) 2390 if err != nil { 2391 return err 2392 } 2393 cup.Name = &name 2394 } 2395 case "properties": 2396 if v != nil { 2397 var credentialUpdateProperties CredentialUpdateProperties 2398 err = json.Unmarshal(*v, &credentialUpdateProperties) 2399 if err != nil { 2400 return err 2401 } 2402 cup.CredentialUpdateProperties = &credentialUpdateProperties 2403 } 2404 } 2405 } 2406 2407 return nil 2408} 2409 2410// CredentialUpdateProperties the properties of the Update credential 2411type CredentialUpdateProperties struct { 2412 // UserName - Gets or sets the user name of the credential. 2413 UserName *string `json:"userName,omitempty"` 2414 // Password - Gets or sets the password of the credential. 2415 Password *string `json:"password,omitempty"` 2416 // Description - Gets or sets the description of the credential. 2417 Description *string `json:"description,omitempty"` 2418} 2419 2420// DscCompilationJob definition of the Dsc Compilation job. 2421type DscCompilationJob struct { 2422 autorest.Response `json:"-"` 2423 // DscCompilationJobProperties - Gets or sets the properties of the Dsc Compilation job. 2424 *DscCompilationJobProperties `json:"properties,omitempty"` 2425 // ID - READ-ONLY; Fully qualified resource Id for the resource 2426 ID *string `json:"id,omitempty"` 2427 // Name - READ-ONLY; The name of the resource 2428 Name *string `json:"name,omitempty"` 2429 // Type - READ-ONLY; The type of the resource. 2430 Type *string `json:"type,omitempty"` 2431} 2432 2433// MarshalJSON is the custom marshaler for DscCompilationJob. 2434func (dcj DscCompilationJob) MarshalJSON() ([]byte, error) { 2435 objectMap := make(map[string]interface{}) 2436 if dcj.DscCompilationJobProperties != nil { 2437 objectMap["properties"] = dcj.DscCompilationJobProperties 2438 } 2439 return json.Marshal(objectMap) 2440} 2441 2442// UnmarshalJSON is the custom unmarshaler for DscCompilationJob struct. 2443func (dcj *DscCompilationJob) UnmarshalJSON(body []byte) error { 2444 var m map[string]*json.RawMessage 2445 err := json.Unmarshal(body, &m) 2446 if err != nil { 2447 return err 2448 } 2449 for k, v := range m { 2450 switch k { 2451 case "properties": 2452 if v != nil { 2453 var dscCompilationJobProperties DscCompilationJobProperties 2454 err = json.Unmarshal(*v, &dscCompilationJobProperties) 2455 if err != nil { 2456 return err 2457 } 2458 dcj.DscCompilationJobProperties = &dscCompilationJobProperties 2459 } 2460 case "id": 2461 if v != nil { 2462 var ID string 2463 err = json.Unmarshal(*v, &ID) 2464 if err != nil { 2465 return err 2466 } 2467 dcj.ID = &ID 2468 } 2469 case "name": 2470 if v != nil { 2471 var name string 2472 err = json.Unmarshal(*v, &name) 2473 if err != nil { 2474 return err 2475 } 2476 dcj.Name = &name 2477 } 2478 case "type": 2479 if v != nil { 2480 var typeVar string 2481 err = json.Unmarshal(*v, &typeVar) 2482 if err != nil { 2483 return err 2484 } 2485 dcj.Type = &typeVar 2486 } 2487 } 2488 } 2489 2490 return nil 2491} 2492 2493// DscCompilationJobCreateParameters the parameters supplied to the create compilation job operation. 2494type DscCompilationJobCreateParameters struct { 2495 // DscCompilationJobCreateProperties - Gets or sets the list of compilation job properties. 2496 *DscCompilationJobCreateProperties `json:"properties,omitempty"` 2497 // Name - Gets or sets name of the resource. 2498 Name *string `json:"name,omitempty"` 2499 // Location - Gets or sets the location of the resource. 2500 Location *string `json:"location,omitempty"` 2501 // Tags - Gets or sets the tags attached to the resource. 2502 Tags map[string]*string `json:"tags"` 2503} 2504 2505// MarshalJSON is the custom marshaler for DscCompilationJobCreateParameters. 2506func (dcjcp DscCompilationJobCreateParameters) MarshalJSON() ([]byte, error) { 2507 objectMap := make(map[string]interface{}) 2508 if dcjcp.DscCompilationJobCreateProperties != nil { 2509 objectMap["properties"] = dcjcp.DscCompilationJobCreateProperties 2510 } 2511 if dcjcp.Name != nil { 2512 objectMap["name"] = dcjcp.Name 2513 } 2514 if dcjcp.Location != nil { 2515 objectMap["location"] = dcjcp.Location 2516 } 2517 if dcjcp.Tags != nil { 2518 objectMap["tags"] = dcjcp.Tags 2519 } 2520 return json.Marshal(objectMap) 2521} 2522 2523// UnmarshalJSON is the custom unmarshaler for DscCompilationJobCreateParameters struct. 2524func (dcjcp *DscCompilationJobCreateParameters) UnmarshalJSON(body []byte) error { 2525 var m map[string]*json.RawMessage 2526 err := json.Unmarshal(body, &m) 2527 if err != nil { 2528 return err 2529 } 2530 for k, v := range m { 2531 switch k { 2532 case "properties": 2533 if v != nil { 2534 var dscCompilationJobCreateProperties DscCompilationJobCreateProperties 2535 err = json.Unmarshal(*v, &dscCompilationJobCreateProperties) 2536 if err != nil { 2537 return err 2538 } 2539 dcjcp.DscCompilationJobCreateProperties = &dscCompilationJobCreateProperties 2540 } 2541 case "name": 2542 if v != nil { 2543 var name string 2544 err = json.Unmarshal(*v, &name) 2545 if err != nil { 2546 return err 2547 } 2548 dcjcp.Name = &name 2549 } 2550 case "location": 2551 if v != nil { 2552 var location string 2553 err = json.Unmarshal(*v, &location) 2554 if err != nil { 2555 return err 2556 } 2557 dcjcp.Location = &location 2558 } 2559 case "tags": 2560 if v != nil { 2561 var tags map[string]*string 2562 err = json.Unmarshal(*v, &tags) 2563 if err != nil { 2564 return err 2565 } 2566 dcjcp.Tags = tags 2567 } 2568 } 2569 } 2570 2571 return nil 2572} 2573 2574// DscCompilationJobCreateProperties the parameters supplied to the create compilation job operation. 2575type DscCompilationJobCreateProperties struct { 2576 // Configuration - Gets or sets the configuration. 2577 Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` 2578 // Parameters - Gets or sets the parameters of the job. 2579 Parameters map[string]*string `json:"parameters"` 2580 // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. 2581 IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` 2582} 2583 2584// MarshalJSON is the custom marshaler for DscCompilationJobCreateProperties. 2585func (dcjcp DscCompilationJobCreateProperties) MarshalJSON() ([]byte, error) { 2586 objectMap := make(map[string]interface{}) 2587 if dcjcp.Configuration != nil { 2588 objectMap["configuration"] = dcjcp.Configuration 2589 } 2590 if dcjcp.Parameters != nil { 2591 objectMap["parameters"] = dcjcp.Parameters 2592 } 2593 if dcjcp.IncrementNodeConfigurationBuild != nil { 2594 objectMap["incrementNodeConfigurationBuild"] = dcjcp.IncrementNodeConfigurationBuild 2595 } 2596 return json.Marshal(objectMap) 2597} 2598 2599// DscCompilationJobListResult the response model for the list job operation. 2600type DscCompilationJobListResult struct { 2601 autorest.Response `json:"-"` 2602 // Value - Gets or sets a list of Dsc Compilation jobs. 2603 Value *[]DscCompilationJob `json:"value,omitempty"` 2604 // NextLink - Gets or sets the next link. 2605 NextLink *string `json:"nextLink,omitempty"` 2606} 2607 2608// DscCompilationJobListResultIterator provides access to a complete listing of DscCompilationJob values. 2609type DscCompilationJobListResultIterator struct { 2610 i int 2611 page DscCompilationJobListResultPage 2612} 2613 2614// NextWithContext advances to the next value. If there was an error making 2615// the request the iterator does not advance and the error is returned. 2616func (iter *DscCompilationJobListResultIterator) NextWithContext(ctx context.Context) (err error) { 2617 if tracing.IsEnabled() { 2618 ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobListResultIterator.NextWithContext") 2619 defer func() { 2620 sc := -1 2621 if iter.Response().Response.Response != nil { 2622 sc = iter.Response().Response.Response.StatusCode 2623 } 2624 tracing.EndSpan(ctx, sc, err) 2625 }() 2626 } 2627 iter.i++ 2628 if iter.i < len(iter.page.Values()) { 2629 return nil 2630 } 2631 err = iter.page.NextWithContext(ctx) 2632 if err != nil { 2633 iter.i-- 2634 return err 2635 } 2636 iter.i = 0 2637 return nil 2638} 2639 2640// Next advances to the next value. If there was an error making 2641// the request the iterator does not advance and the error is returned. 2642// Deprecated: Use NextWithContext() instead. 2643func (iter *DscCompilationJobListResultIterator) Next() error { 2644 return iter.NextWithContext(context.Background()) 2645} 2646 2647// NotDone returns true if the enumeration should be started or is not yet complete. 2648func (iter DscCompilationJobListResultIterator) NotDone() bool { 2649 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2650} 2651 2652// Response returns the raw server response from the last page request. 2653func (iter DscCompilationJobListResultIterator) Response() DscCompilationJobListResult { 2654 return iter.page.Response() 2655} 2656 2657// Value returns the current value or a zero-initialized value if the 2658// iterator has advanced beyond the end of the collection. 2659func (iter DscCompilationJobListResultIterator) Value() DscCompilationJob { 2660 if !iter.page.NotDone() { 2661 return DscCompilationJob{} 2662 } 2663 return iter.page.Values()[iter.i] 2664} 2665 2666// Creates a new instance of the DscCompilationJobListResultIterator type. 2667func NewDscCompilationJobListResultIterator(page DscCompilationJobListResultPage) DscCompilationJobListResultIterator { 2668 return DscCompilationJobListResultIterator{page: page} 2669} 2670 2671// IsEmpty returns true if the ListResult contains no values. 2672func (dcjlr DscCompilationJobListResult) IsEmpty() bool { 2673 return dcjlr.Value == nil || len(*dcjlr.Value) == 0 2674} 2675 2676// hasNextLink returns true if the NextLink is not empty. 2677func (dcjlr DscCompilationJobListResult) hasNextLink() bool { 2678 return dcjlr.NextLink != nil && len(*dcjlr.NextLink) != 0 2679} 2680 2681// dscCompilationJobListResultPreparer prepares a request to retrieve the next set of results. 2682// It returns nil if no more results exist. 2683func (dcjlr DscCompilationJobListResult) dscCompilationJobListResultPreparer(ctx context.Context) (*http.Request, error) { 2684 if !dcjlr.hasNextLink() { 2685 return nil, nil 2686 } 2687 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2688 autorest.AsJSON(), 2689 autorest.AsGet(), 2690 autorest.WithBaseURL(to.String(dcjlr.NextLink))) 2691} 2692 2693// DscCompilationJobListResultPage contains a page of DscCompilationJob values. 2694type DscCompilationJobListResultPage struct { 2695 fn func(context.Context, DscCompilationJobListResult) (DscCompilationJobListResult, error) 2696 dcjlr DscCompilationJobListResult 2697} 2698 2699// NextWithContext advances to the next page of values. If there was an error making 2700// the request the page does not advance and the error is returned. 2701func (page *DscCompilationJobListResultPage) NextWithContext(ctx context.Context) (err error) { 2702 if tracing.IsEnabled() { 2703 ctx = tracing.StartSpan(ctx, fqdn+"/DscCompilationJobListResultPage.NextWithContext") 2704 defer func() { 2705 sc := -1 2706 if page.Response().Response.Response != nil { 2707 sc = page.Response().Response.Response.StatusCode 2708 } 2709 tracing.EndSpan(ctx, sc, err) 2710 }() 2711 } 2712 for { 2713 next, err := page.fn(ctx, page.dcjlr) 2714 if err != nil { 2715 return err 2716 } 2717 page.dcjlr = next 2718 if !next.hasNextLink() || !next.IsEmpty() { 2719 break 2720 } 2721 } 2722 return nil 2723} 2724 2725// Next advances to the next page of values. If there was an error making 2726// the request the page does not advance and the error is returned. 2727// Deprecated: Use NextWithContext() instead. 2728func (page *DscCompilationJobListResultPage) Next() error { 2729 return page.NextWithContext(context.Background()) 2730} 2731 2732// NotDone returns true if the page enumeration should be started or is not yet complete. 2733func (page DscCompilationJobListResultPage) NotDone() bool { 2734 return !page.dcjlr.IsEmpty() 2735} 2736 2737// Response returns the raw server response from the last page request. 2738func (page DscCompilationJobListResultPage) Response() DscCompilationJobListResult { 2739 return page.dcjlr 2740} 2741 2742// Values returns the slice of values for the current page or nil if there are no values. 2743func (page DscCompilationJobListResultPage) Values() []DscCompilationJob { 2744 if page.dcjlr.IsEmpty() { 2745 return nil 2746 } 2747 return *page.dcjlr.Value 2748} 2749 2750// Creates a new instance of the DscCompilationJobListResultPage type. 2751func NewDscCompilationJobListResultPage(cur DscCompilationJobListResult, getNextPage func(context.Context, DscCompilationJobListResult) (DscCompilationJobListResult, error)) DscCompilationJobListResultPage { 2752 return DscCompilationJobListResultPage{ 2753 fn: getNextPage, 2754 dcjlr: cur, 2755 } 2756} 2757 2758// DscCompilationJobProperties definition of Dsc Compilation job properties. 2759type DscCompilationJobProperties struct { 2760 // Configuration - Gets or sets the configuration. 2761 Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` 2762 // StartedBy - READ-ONLY; Gets the compilation job started by. 2763 StartedBy *string `json:"startedBy,omitempty"` 2764 // JobID - READ-ONLY; Gets the id of the job. 2765 JobID *uuid.UUID `json:"jobId,omitempty"` 2766 // CreationTime - READ-ONLY; Gets the creation time of the job. 2767 CreationTime *date.Time `json:"creationTime,omitempty"` 2768 // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' 2769 ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` 2770 // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. 2771 RunOn *string `json:"runOn,omitempty"` 2772 // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' 2773 Status JobStatus `json:"status,omitempty"` 2774 // StatusDetails - Gets or sets the status details of the job. 2775 StatusDetails *string `json:"statusDetails,omitempty"` 2776 // StartTime - READ-ONLY; Gets the start time of the job. 2777 StartTime *date.Time `json:"startTime,omitempty"` 2778 // EndTime - READ-ONLY; Gets the end time of the job. 2779 EndTime *date.Time `json:"endTime,omitempty"` 2780 // Exception - READ-ONLY; Gets the exception of the job. 2781 Exception *string `json:"exception,omitempty"` 2782 // LastModifiedTime - READ-ONLY; Gets the last modified time of the job. 2783 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 2784 // LastStatusModifiedTime - READ-ONLY; Gets the last status modified time of the job. 2785 LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` 2786 // Parameters - Gets or sets the parameters of the job. 2787 Parameters map[string]*string `json:"parameters"` 2788} 2789 2790// MarshalJSON is the custom marshaler for DscCompilationJobProperties. 2791func (dcjp DscCompilationJobProperties) MarshalJSON() ([]byte, error) { 2792 objectMap := make(map[string]interface{}) 2793 if dcjp.Configuration != nil { 2794 objectMap["configuration"] = dcjp.Configuration 2795 } 2796 if dcjp.ProvisioningState != "" { 2797 objectMap["provisioningState"] = dcjp.ProvisioningState 2798 } 2799 if dcjp.RunOn != nil { 2800 objectMap["runOn"] = dcjp.RunOn 2801 } 2802 if dcjp.Status != "" { 2803 objectMap["status"] = dcjp.Status 2804 } 2805 if dcjp.StatusDetails != nil { 2806 objectMap["statusDetails"] = dcjp.StatusDetails 2807 } 2808 if dcjp.Parameters != nil { 2809 objectMap["parameters"] = dcjp.Parameters 2810 } 2811 return json.Marshal(objectMap) 2812} 2813 2814// DscConfiguration definition of the configuration type. 2815type DscConfiguration struct { 2816 autorest.Response `json:"-"` 2817 // DscConfigurationProperties - Gets or sets the configuration properties. 2818 *DscConfigurationProperties `json:"properties,omitempty"` 2819 // Etag - Gets or sets the etag of the resource. 2820 Etag *string `json:"etag,omitempty"` 2821 // Tags - Resource tags. 2822 Tags map[string]*string `json:"tags"` 2823 // Location - The Azure Region where the resource lives 2824 Location *string `json:"location,omitempty"` 2825 // ID - READ-ONLY; Fully qualified resource Id for the resource 2826 ID *string `json:"id,omitempty"` 2827 // Name - READ-ONLY; The name of the resource 2828 Name *string `json:"name,omitempty"` 2829 // Type - READ-ONLY; The type of the resource. 2830 Type *string `json:"type,omitempty"` 2831} 2832 2833// MarshalJSON is the custom marshaler for DscConfiguration. 2834func (dc DscConfiguration) MarshalJSON() ([]byte, error) { 2835 objectMap := make(map[string]interface{}) 2836 if dc.DscConfigurationProperties != nil { 2837 objectMap["properties"] = dc.DscConfigurationProperties 2838 } 2839 if dc.Etag != nil { 2840 objectMap["etag"] = dc.Etag 2841 } 2842 if dc.Tags != nil { 2843 objectMap["tags"] = dc.Tags 2844 } 2845 if dc.Location != nil { 2846 objectMap["location"] = dc.Location 2847 } 2848 return json.Marshal(objectMap) 2849} 2850 2851// UnmarshalJSON is the custom unmarshaler for DscConfiguration struct. 2852func (dc *DscConfiguration) UnmarshalJSON(body []byte) error { 2853 var m map[string]*json.RawMessage 2854 err := json.Unmarshal(body, &m) 2855 if err != nil { 2856 return err 2857 } 2858 for k, v := range m { 2859 switch k { 2860 case "properties": 2861 if v != nil { 2862 var dscConfigurationProperties DscConfigurationProperties 2863 err = json.Unmarshal(*v, &dscConfigurationProperties) 2864 if err != nil { 2865 return err 2866 } 2867 dc.DscConfigurationProperties = &dscConfigurationProperties 2868 } 2869 case "etag": 2870 if v != nil { 2871 var etag string 2872 err = json.Unmarshal(*v, &etag) 2873 if err != nil { 2874 return err 2875 } 2876 dc.Etag = &etag 2877 } 2878 case "tags": 2879 if v != nil { 2880 var tags map[string]*string 2881 err = json.Unmarshal(*v, &tags) 2882 if err != nil { 2883 return err 2884 } 2885 dc.Tags = tags 2886 } 2887 case "location": 2888 if v != nil { 2889 var location string 2890 err = json.Unmarshal(*v, &location) 2891 if err != nil { 2892 return err 2893 } 2894 dc.Location = &location 2895 } 2896 case "id": 2897 if v != nil { 2898 var ID string 2899 err = json.Unmarshal(*v, &ID) 2900 if err != nil { 2901 return err 2902 } 2903 dc.ID = &ID 2904 } 2905 case "name": 2906 if v != nil { 2907 var name string 2908 err = json.Unmarshal(*v, &name) 2909 if err != nil { 2910 return err 2911 } 2912 dc.Name = &name 2913 } 2914 case "type": 2915 if v != nil { 2916 var typeVar string 2917 err = json.Unmarshal(*v, &typeVar) 2918 if err != nil { 2919 return err 2920 } 2921 dc.Type = &typeVar 2922 } 2923 } 2924 } 2925 2926 return nil 2927} 2928 2929// DscConfigurationAssociationProperty the Dsc configuration property associated with the entity. 2930type DscConfigurationAssociationProperty struct { 2931 // Name - Gets or sets the name of the Dsc configuration. 2932 Name *string `json:"name,omitempty"` 2933} 2934 2935// DscConfigurationCreateOrUpdateParameters the parameters supplied to the create or update configuration 2936// operation. 2937type DscConfigurationCreateOrUpdateParameters struct { 2938 // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. 2939 *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` 2940 // Name - Gets or sets name of the resource. 2941 Name *string `json:"name,omitempty"` 2942 // Location - Gets or sets the location of the resource. 2943 Location *string `json:"location,omitempty"` 2944 // Tags - Gets or sets the tags attached to the resource. 2945 Tags map[string]*string `json:"tags"` 2946} 2947 2948// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateParameters. 2949func (dccoup DscConfigurationCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 2950 objectMap := make(map[string]interface{}) 2951 if dccoup.DscConfigurationCreateOrUpdateProperties != nil { 2952 objectMap["properties"] = dccoup.DscConfigurationCreateOrUpdateProperties 2953 } 2954 if dccoup.Name != nil { 2955 objectMap["name"] = dccoup.Name 2956 } 2957 if dccoup.Location != nil { 2958 objectMap["location"] = dccoup.Location 2959 } 2960 if dccoup.Tags != nil { 2961 objectMap["tags"] = dccoup.Tags 2962 } 2963 return json.Marshal(objectMap) 2964} 2965 2966// UnmarshalJSON is the custom unmarshaler for DscConfigurationCreateOrUpdateParameters struct. 2967func (dccoup *DscConfigurationCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 2968 var m map[string]*json.RawMessage 2969 err := json.Unmarshal(body, &m) 2970 if err != nil { 2971 return err 2972 } 2973 for k, v := range m { 2974 switch k { 2975 case "properties": 2976 if v != nil { 2977 var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties 2978 err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) 2979 if err != nil { 2980 return err 2981 } 2982 dccoup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties 2983 } 2984 case "name": 2985 if v != nil { 2986 var name string 2987 err = json.Unmarshal(*v, &name) 2988 if err != nil { 2989 return err 2990 } 2991 dccoup.Name = &name 2992 } 2993 case "location": 2994 if v != nil { 2995 var location string 2996 err = json.Unmarshal(*v, &location) 2997 if err != nil { 2998 return err 2999 } 3000 dccoup.Location = &location 3001 } 3002 case "tags": 3003 if v != nil { 3004 var tags map[string]*string 3005 err = json.Unmarshal(*v, &tags) 3006 if err != nil { 3007 return err 3008 } 3009 dccoup.Tags = tags 3010 } 3011 } 3012 } 3013 3014 return nil 3015} 3016 3017// DscConfigurationCreateOrUpdateProperties the properties to create or update configuration. 3018type DscConfigurationCreateOrUpdateProperties struct { 3019 // LogVerbose - Gets or sets verbose log option. 3020 LogVerbose *bool `json:"logVerbose,omitempty"` 3021 // LogProgress - Gets or sets progress log option. 3022 LogProgress *bool `json:"logProgress,omitempty"` 3023 // Source - Gets or sets the source. 3024 Source *ContentSource `json:"source,omitempty"` 3025 // Parameters - Gets or sets the configuration parameters. 3026 Parameters map[string]*DscConfigurationParameter `json:"parameters"` 3027 // Description - Gets or sets the description of the configuration. 3028 Description *string `json:"description,omitempty"` 3029} 3030 3031// MarshalJSON is the custom marshaler for DscConfigurationCreateOrUpdateProperties. 3032func (dccoup DscConfigurationCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 3033 objectMap := make(map[string]interface{}) 3034 if dccoup.LogVerbose != nil { 3035 objectMap["logVerbose"] = dccoup.LogVerbose 3036 } 3037 if dccoup.LogProgress != nil { 3038 objectMap["logProgress"] = dccoup.LogProgress 3039 } 3040 if dccoup.Source != nil { 3041 objectMap["source"] = dccoup.Source 3042 } 3043 if dccoup.Parameters != nil { 3044 objectMap["parameters"] = dccoup.Parameters 3045 } 3046 if dccoup.Description != nil { 3047 objectMap["description"] = dccoup.Description 3048 } 3049 return json.Marshal(objectMap) 3050} 3051 3052// DscConfigurationListResult the response model for the list configuration operation. 3053type DscConfigurationListResult struct { 3054 autorest.Response `json:"-"` 3055 // Value - Gets or sets a list of configurations. 3056 Value *[]DscConfiguration `json:"value,omitempty"` 3057 // NextLink - Gets or sets the next link. 3058 NextLink *string `json:"nextLink,omitempty"` 3059 // TotalCount - Gets the total number of configurations matching filter criteria. 3060 TotalCount *int32 `json:"totalCount,omitempty"` 3061} 3062 3063// DscConfigurationListResultIterator provides access to a complete listing of DscConfiguration values. 3064type DscConfigurationListResultIterator struct { 3065 i int 3066 page DscConfigurationListResultPage 3067} 3068 3069// NextWithContext advances to the next value. If there was an error making 3070// the request the iterator does not advance and the error is returned. 3071func (iter *DscConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { 3072 if tracing.IsEnabled() { 3073 ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationListResultIterator.NextWithContext") 3074 defer func() { 3075 sc := -1 3076 if iter.Response().Response.Response != nil { 3077 sc = iter.Response().Response.Response.StatusCode 3078 } 3079 tracing.EndSpan(ctx, sc, err) 3080 }() 3081 } 3082 iter.i++ 3083 if iter.i < len(iter.page.Values()) { 3084 return nil 3085 } 3086 err = iter.page.NextWithContext(ctx) 3087 if err != nil { 3088 iter.i-- 3089 return err 3090 } 3091 iter.i = 0 3092 return nil 3093} 3094 3095// Next advances to the next value. If there was an error making 3096// the request the iterator does not advance and the error is returned. 3097// Deprecated: Use NextWithContext() instead. 3098func (iter *DscConfigurationListResultIterator) Next() error { 3099 return iter.NextWithContext(context.Background()) 3100} 3101 3102// NotDone returns true if the enumeration should be started or is not yet complete. 3103func (iter DscConfigurationListResultIterator) NotDone() bool { 3104 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3105} 3106 3107// Response returns the raw server response from the last page request. 3108func (iter DscConfigurationListResultIterator) Response() DscConfigurationListResult { 3109 return iter.page.Response() 3110} 3111 3112// Value returns the current value or a zero-initialized value if the 3113// iterator has advanced beyond the end of the collection. 3114func (iter DscConfigurationListResultIterator) Value() DscConfiguration { 3115 if !iter.page.NotDone() { 3116 return DscConfiguration{} 3117 } 3118 return iter.page.Values()[iter.i] 3119} 3120 3121// Creates a new instance of the DscConfigurationListResultIterator type. 3122func NewDscConfigurationListResultIterator(page DscConfigurationListResultPage) DscConfigurationListResultIterator { 3123 return DscConfigurationListResultIterator{page: page} 3124} 3125 3126// IsEmpty returns true if the ListResult contains no values. 3127func (dclr DscConfigurationListResult) IsEmpty() bool { 3128 return dclr.Value == nil || len(*dclr.Value) == 0 3129} 3130 3131// hasNextLink returns true if the NextLink is not empty. 3132func (dclr DscConfigurationListResult) hasNextLink() bool { 3133 return dclr.NextLink != nil && len(*dclr.NextLink) != 0 3134} 3135 3136// dscConfigurationListResultPreparer prepares a request to retrieve the next set of results. 3137// It returns nil if no more results exist. 3138func (dclr DscConfigurationListResult) dscConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { 3139 if !dclr.hasNextLink() { 3140 return nil, nil 3141 } 3142 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3143 autorest.AsJSON(), 3144 autorest.AsGet(), 3145 autorest.WithBaseURL(to.String(dclr.NextLink))) 3146} 3147 3148// DscConfigurationListResultPage contains a page of DscConfiguration values. 3149type DscConfigurationListResultPage struct { 3150 fn func(context.Context, DscConfigurationListResult) (DscConfigurationListResult, error) 3151 dclr DscConfigurationListResult 3152} 3153 3154// NextWithContext advances to the next page of values. If there was an error making 3155// the request the page does not advance and the error is returned. 3156func (page *DscConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { 3157 if tracing.IsEnabled() { 3158 ctx = tracing.StartSpan(ctx, fqdn+"/DscConfigurationListResultPage.NextWithContext") 3159 defer func() { 3160 sc := -1 3161 if page.Response().Response.Response != nil { 3162 sc = page.Response().Response.Response.StatusCode 3163 } 3164 tracing.EndSpan(ctx, sc, err) 3165 }() 3166 } 3167 for { 3168 next, err := page.fn(ctx, page.dclr) 3169 if err != nil { 3170 return err 3171 } 3172 page.dclr = next 3173 if !next.hasNextLink() || !next.IsEmpty() { 3174 break 3175 } 3176 } 3177 return nil 3178} 3179 3180// Next advances to the next page of values. If there was an error making 3181// the request the page does not advance and the error is returned. 3182// Deprecated: Use NextWithContext() instead. 3183func (page *DscConfigurationListResultPage) Next() error { 3184 return page.NextWithContext(context.Background()) 3185} 3186 3187// NotDone returns true if the page enumeration should be started or is not yet complete. 3188func (page DscConfigurationListResultPage) NotDone() bool { 3189 return !page.dclr.IsEmpty() 3190} 3191 3192// Response returns the raw server response from the last page request. 3193func (page DscConfigurationListResultPage) Response() DscConfigurationListResult { 3194 return page.dclr 3195} 3196 3197// Values returns the slice of values for the current page or nil if there are no values. 3198func (page DscConfigurationListResultPage) Values() []DscConfiguration { 3199 if page.dclr.IsEmpty() { 3200 return nil 3201 } 3202 return *page.dclr.Value 3203} 3204 3205// Creates a new instance of the DscConfigurationListResultPage type. 3206func NewDscConfigurationListResultPage(cur DscConfigurationListResult, getNextPage func(context.Context, DscConfigurationListResult) (DscConfigurationListResult, error)) DscConfigurationListResultPage { 3207 return DscConfigurationListResultPage{ 3208 fn: getNextPage, 3209 dclr: cur, 3210 } 3211} 3212 3213// DscConfigurationParameter definition of the configuration parameter type. 3214type DscConfigurationParameter struct { 3215 // Type - Gets or sets the type of the parameter. 3216 Type *string `json:"type,omitempty"` 3217 // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. 3218 IsMandatory *bool `json:"isMandatory,omitempty"` 3219 // Position - Get or sets the position of the parameter. 3220 Position *int32 `json:"position,omitempty"` 3221 // DefaultValue - Gets or sets the default value of parameter. 3222 DefaultValue *string `json:"defaultValue,omitempty"` 3223} 3224 3225// DscConfigurationProperties definition of the configuration property type. 3226type DscConfigurationProperties struct { 3227 // ProvisioningState - Gets or sets the provisioning state of the configuration. Possible values include: 'Succeeded' 3228 ProvisioningState DscConfigurationProvisioningState `json:"provisioningState,omitempty"` 3229 // JobCount - Gets or sets the job count of the configuration. 3230 JobCount *int32 `json:"jobCount,omitempty"` 3231 // Parameters - Gets or sets the configuration parameters. 3232 Parameters map[string]*DscConfigurationParameter `json:"parameters"` 3233 // Source - Gets or sets the source. 3234 Source *ContentSource `json:"source,omitempty"` 3235 // State - Gets or sets the state of the configuration. Possible values include: 'DscConfigurationStateNew', 'DscConfigurationStateEdit', 'DscConfigurationStatePublished' 3236 State DscConfigurationState `json:"state,omitempty"` 3237 // LogVerbose - Gets or sets verbose log option. 3238 LogVerbose *bool `json:"logVerbose,omitempty"` 3239 // CreationTime - Gets or sets the creation time. 3240 CreationTime *date.Time `json:"creationTime,omitempty"` 3241 // LastModifiedTime - Gets or sets the last modified time. 3242 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 3243 // NodeConfigurationCount - Gets the number of compiled node configurations. 3244 NodeConfigurationCount *int32 `json:"nodeConfigurationCount,omitempty"` 3245 // Description - Gets or sets the description. 3246 Description *string `json:"description,omitempty"` 3247} 3248 3249// MarshalJSON is the custom marshaler for DscConfigurationProperties. 3250func (dcp DscConfigurationProperties) MarshalJSON() ([]byte, error) { 3251 objectMap := make(map[string]interface{}) 3252 if dcp.ProvisioningState != "" { 3253 objectMap["provisioningState"] = dcp.ProvisioningState 3254 } 3255 if dcp.JobCount != nil { 3256 objectMap["jobCount"] = dcp.JobCount 3257 } 3258 if dcp.Parameters != nil { 3259 objectMap["parameters"] = dcp.Parameters 3260 } 3261 if dcp.Source != nil { 3262 objectMap["source"] = dcp.Source 3263 } 3264 if dcp.State != "" { 3265 objectMap["state"] = dcp.State 3266 } 3267 if dcp.LogVerbose != nil { 3268 objectMap["logVerbose"] = dcp.LogVerbose 3269 } 3270 if dcp.CreationTime != nil { 3271 objectMap["creationTime"] = dcp.CreationTime 3272 } 3273 if dcp.LastModifiedTime != nil { 3274 objectMap["lastModifiedTime"] = dcp.LastModifiedTime 3275 } 3276 if dcp.NodeConfigurationCount != nil { 3277 objectMap["nodeConfigurationCount"] = dcp.NodeConfigurationCount 3278 } 3279 if dcp.Description != nil { 3280 objectMap["description"] = dcp.Description 3281 } 3282 return json.Marshal(objectMap) 3283} 3284 3285// DscConfigurationUpdateParameters the parameters supplied to the create or update configuration 3286// operation. 3287type DscConfigurationUpdateParameters struct { 3288 // DscConfigurationCreateOrUpdateProperties - Gets or sets configuration create or update properties. 3289 *DscConfigurationCreateOrUpdateProperties `json:"properties,omitempty"` 3290 // Name - Gets or sets name of the resource. 3291 Name *string `json:"name,omitempty"` 3292 // Tags - Gets or sets the tags attached to the resource. 3293 Tags map[string]*string `json:"tags"` 3294} 3295 3296// MarshalJSON is the custom marshaler for DscConfigurationUpdateParameters. 3297func (dcup DscConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { 3298 objectMap := make(map[string]interface{}) 3299 if dcup.DscConfigurationCreateOrUpdateProperties != nil { 3300 objectMap["properties"] = dcup.DscConfigurationCreateOrUpdateProperties 3301 } 3302 if dcup.Name != nil { 3303 objectMap["name"] = dcup.Name 3304 } 3305 if dcup.Tags != nil { 3306 objectMap["tags"] = dcup.Tags 3307 } 3308 return json.Marshal(objectMap) 3309} 3310 3311// UnmarshalJSON is the custom unmarshaler for DscConfigurationUpdateParameters struct. 3312func (dcup *DscConfigurationUpdateParameters) UnmarshalJSON(body []byte) error { 3313 var m map[string]*json.RawMessage 3314 err := json.Unmarshal(body, &m) 3315 if err != nil { 3316 return err 3317 } 3318 for k, v := range m { 3319 switch k { 3320 case "properties": 3321 if v != nil { 3322 var dscConfigurationCreateOrUpdateProperties DscConfigurationCreateOrUpdateProperties 3323 err = json.Unmarshal(*v, &dscConfigurationCreateOrUpdateProperties) 3324 if err != nil { 3325 return err 3326 } 3327 dcup.DscConfigurationCreateOrUpdateProperties = &dscConfigurationCreateOrUpdateProperties 3328 } 3329 case "name": 3330 if v != nil { 3331 var name string 3332 err = json.Unmarshal(*v, &name) 3333 if err != nil { 3334 return err 3335 } 3336 dcup.Name = &name 3337 } 3338 case "tags": 3339 if v != nil { 3340 var tags map[string]*string 3341 err = json.Unmarshal(*v, &tags) 3342 if err != nil { 3343 return err 3344 } 3345 dcup.Tags = tags 3346 } 3347 } 3348 } 3349 3350 return nil 3351} 3352 3353// DscMetaConfiguration definition of the DSC Meta Configuration. 3354type DscMetaConfiguration struct { 3355 // ConfigurationModeFrequencyMins - Gets or sets the ConfigurationModeFrequencyMins value of the meta configuration. 3356 ConfigurationModeFrequencyMins *int32 `json:"configurationModeFrequencyMins,omitempty"` 3357 // RebootNodeIfNeeded - Gets or sets the RebootNodeIfNeeded value of the meta configuration. 3358 RebootNodeIfNeeded *bool `json:"rebootNodeIfNeeded,omitempty"` 3359 // ConfigurationMode - Gets or sets the ConfigurationMode value of the meta configuration. 3360 ConfigurationMode *string `json:"configurationMode,omitempty"` 3361 // ActionAfterReboot - Gets or sets the ActionAfterReboot value of the meta configuration. 3362 ActionAfterReboot *string `json:"actionAfterReboot,omitempty"` 3363 // CertificateID - Gets or sets the CertificateId value of the meta configuration. 3364 CertificateID *string `json:"certificateId,omitempty"` 3365 // RefreshFrequencyMins - Gets or sets the RefreshFrequencyMins value of the meta configuration. 3366 RefreshFrequencyMins *int32 `json:"refreshFrequencyMins,omitempty"` 3367 // AllowModuleOverwrite - Gets or sets the AllowModuleOverwrite value of the meta configuration. 3368 AllowModuleOverwrite *bool `json:"allowModuleOverwrite,omitempty"` 3369} 3370 3371// DscNode definition of the dsc node type. 3372type DscNode struct { 3373 autorest.Response `json:"-"` 3374 // LastSeen - Gets or sets the last seen time of the node. 3375 LastSeen *date.Time `json:"lastSeen,omitempty"` 3376 // RegistrationTime - Gets or sets the registration time of the node. 3377 RegistrationTime *date.Time `json:"registrationTime,omitempty"` 3378 // IP - Gets or sets the ip of the node. 3379 IP *string `json:"ip,omitempty"` 3380 // AccountID - Gets or sets the account id of the node. 3381 AccountID *string `json:"accountId,omitempty"` 3382 // NodeConfiguration - Gets or sets the configuration of the node. 3383 NodeConfiguration *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` 3384 // Status - Gets or sets the status of the node. 3385 Status *string `json:"status,omitempty"` 3386 // NodeID - Gets or sets the node id. 3387 NodeID *string `json:"nodeId,omitempty"` 3388 // Etag - Gets or sets the etag of the resource. 3389 Etag *string `json:"etag,omitempty"` 3390 // ExtensionHandler - Gets or sets the list of extensionHandler properties for a Node. 3391 ExtensionHandler *[]DscNodeExtensionHandlerAssociationProperty `json:"extensionHandler,omitempty"` 3392 // ID - READ-ONLY; Fully qualified resource Id for the resource 3393 ID *string `json:"id,omitempty"` 3394 // Name - READ-ONLY; The name of the resource 3395 Name *string `json:"name,omitempty"` 3396 // Type - READ-ONLY; The type of the resource. 3397 Type *string `json:"type,omitempty"` 3398} 3399 3400// MarshalJSON is the custom marshaler for DscNode. 3401func (dn DscNode) MarshalJSON() ([]byte, error) { 3402 objectMap := make(map[string]interface{}) 3403 if dn.LastSeen != nil { 3404 objectMap["lastSeen"] = dn.LastSeen 3405 } 3406 if dn.RegistrationTime != nil { 3407 objectMap["registrationTime"] = dn.RegistrationTime 3408 } 3409 if dn.IP != nil { 3410 objectMap["ip"] = dn.IP 3411 } 3412 if dn.AccountID != nil { 3413 objectMap["accountId"] = dn.AccountID 3414 } 3415 if dn.NodeConfiguration != nil { 3416 objectMap["nodeConfiguration"] = dn.NodeConfiguration 3417 } 3418 if dn.Status != nil { 3419 objectMap["status"] = dn.Status 3420 } 3421 if dn.NodeID != nil { 3422 objectMap["nodeId"] = dn.NodeID 3423 } 3424 if dn.Etag != nil { 3425 objectMap["etag"] = dn.Etag 3426 } 3427 if dn.ExtensionHandler != nil { 3428 objectMap["extensionHandler"] = dn.ExtensionHandler 3429 } 3430 return json.Marshal(objectMap) 3431} 3432 3433// DscNodeConfiguration definition of the dsc node configuration. 3434type DscNodeConfiguration struct { 3435 autorest.Response `json:"-"` 3436 // LastModifiedTime - Gets or sets the last modified time. 3437 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 3438 // CreationTime - Gets or sets creation time. 3439 CreationTime *date.Time `json:"creationTime,omitempty"` 3440 // Configuration - Gets or sets the configuration of the node. 3441 Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` 3442 // ID - READ-ONLY; Fully qualified resource Id for the resource 3443 ID *string `json:"id,omitempty"` 3444 // Name - READ-ONLY; The name of the resource 3445 Name *string `json:"name,omitempty"` 3446 // Type - READ-ONLY; The type of the resource. 3447 Type *string `json:"type,omitempty"` 3448} 3449 3450// MarshalJSON is the custom marshaler for DscNodeConfiguration. 3451func (dnc DscNodeConfiguration) MarshalJSON() ([]byte, error) { 3452 objectMap := make(map[string]interface{}) 3453 if dnc.LastModifiedTime != nil { 3454 objectMap["lastModifiedTime"] = dnc.LastModifiedTime 3455 } 3456 if dnc.CreationTime != nil { 3457 objectMap["creationTime"] = dnc.CreationTime 3458 } 3459 if dnc.Configuration != nil { 3460 objectMap["configuration"] = dnc.Configuration 3461 } 3462 return json.Marshal(objectMap) 3463} 3464 3465// DscNodeConfigurationAssociationProperty the dsc node configuration property associated with the entity. 3466type DscNodeConfigurationAssociationProperty struct { 3467 // Name - Gets or sets the name of the dsc node configuration. 3468 Name *string `json:"name,omitempty"` 3469} 3470 3471// DscNodeConfigurationCreateOrUpdateParameters the parameters supplied to the create or update node 3472// configuration operation. 3473type DscNodeConfigurationCreateOrUpdateParameters struct { 3474 // Source - Gets or sets the source. 3475 Source *ContentSource `json:"source,omitempty"` 3476 // Name - Name of the node configuration. 3477 Name *string `json:"name,omitempty"` 3478 // Configuration - Gets or sets the configuration of the node. 3479 Configuration *DscConfigurationAssociationProperty `json:"configuration,omitempty"` 3480 // IncrementNodeConfigurationBuild - If a new build version of NodeConfiguration is required. 3481 IncrementNodeConfigurationBuild *bool `json:"incrementNodeConfigurationBuild,omitempty"` 3482} 3483 3484// DscNodeConfigurationListResult the response model for the list job operation. 3485type DscNodeConfigurationListResult struct { 3486 autorest.Response `json:"-"` 3487 // Value - Gets or sets a list of Dsc node configurations. 3488 Value *[]DscNodeConfiguration `json:"value,omitempty"` 3489 // NextLink - Gets or sets the next link. 3490 NextLink *string `json:"nextLink,omitempty"` 3491} 3492 3493// DscNodeConfigurationListResultIterator provides access to a complete listing of DscNodeConfiguration 3494// values. 3495type DscNodeConfigurationListResultIterator struct { 3496 i int 3497 page DscNodeConfigurationListResultPage 3498} 3499 3500// NextWithContext advances to the next value. If there was an error making 3501// the request the iterator does not advance and the error is returned. 3502func (iter *DscNodeConfigurationListResultIterator) NextWithContext(ctx context.Context) (err error) { 3503 if tracing.IsEnabled() { 3504 ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationListResultIterator.NextWithContext") 3505 defer func() { 3506 sc := -1 3507 if iter.Response().Response.Response != nil { 3508 sc = iter.Response().Response.Response.StatusCode 3509 } 3510 tracing.EndSpan(ctx, sc, err) 3511 }() 3512 } 3513 iter.i++ 3514 if iter.i < len(iter.page.Values()) { 3515 return nil 3516 } 3517 err = iter.page.NextWithContext(ctx) 3518 if err != nil { 3519 iter.i-- 3520 return err 3521 } 3522 iter.i = 0 3523 return nil 3524} 3525 3526// Next advances to the next value. If there was an error making 3527// the request the iterator does not advance and the error is returned. 3528// Deprecated: Use NextWithContext() instead. 3529func (iter *DscNodeConfigurationListResultIterator) Next() error { 3530 return iter.NextWithContext(context.Background()) 3531} 3532 3533// NotDone returns true if the enumeration should be started or is not yet complete. 3534func (iter DscNodeConfigurationListResultIterator) NotDone() bool { 3535 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3536} 3537 3538// Response returns the raw server response from the last page request. 3539func (iter DscNodeConfigurationListResultIterator) Response() DscNodeConfigurationListResult { 3540 return iter.page.Response() 3541} 3542 3543// Value returns the current value or a zero-initialized value if the 3544// iterator has advanced beyond the end of the collection. 3545func (iter DscNodeConfigurationListResultIterator) Value() DscNodeConfiguration { 3546 if !iter.page.NotDone() { 3547 return DscNodeConfiguration{} 3548 } 3549 return iter.page.Values()[iter.i] 3550} 3551 3552// Creates a new instance of the DscNodeConfigurationListResultIterator type. 3553func NewDscNodeConfigurationListResultIterator(page DscNodeConfigurationListResultPage) DscNodeConfigurationListResultIterator { 3554 return DscNodeConfigurationListResultIterator{page: page} 3555} 3556 3557// IsEmpty returns true if the ListResult contains no values. 3558func (dnclr DscNodeConfigurationListResult) IsEmpty() bool { 3559 return dnclr.Value == nil || len(*dnclr.Value) == 0 3560} 3561 3562// hasNextLink returns true if the NextLink is not empty. 3563func (dnclr DscNodeConfigurationListResult) hasNextLink() bool { 3564 return dnclr.NextLink != nil && len(*dnclr.NextLink) != 0 3565} 3566 3567// dscNodeConfigurationListResultPreparer prepares a request to retrieve the next set of results. 3568// It returns nil if no more results exist. 3569func (dnclr DscNodeConfigurationListResult) dscNodeConfigurationListResultPreparer(ctx context.Context) (*http.Request, error) { 3570 if !dnclr.hasNextLink() { 3571 return nil, nil 3572 } 3573 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3574 autorest.AsJSON(), 3575 autorest.AsGet(), 3576 autorest.WithBaseURL(to.String(dnclr.NextLink))) 3577} 3578 3579// DscNodeConfigurationListResultPage contains a page of DscNodeConfiguration values. 3580type DscNodeConfigurationListResultPage struct { 3581 fn func(context.Context, DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error) 3582 dnclr DscNodeConfigurationListResult 3583} 3584 3585// NextWithContext advances to the next page of values. If there was an error making 3586// the request the page does not advance and the error is returned. 3587func (page *DscNodeConfigurationListResultPage) NextWithContext(ctx context.Context) (err error) { 3588 if tracing.IsEnabled() { 3589 ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeConfigurationListResultPage.NextWithContext") 3590 defer func() { 3591 sc := -1 3592 if page.Response().Response.Response != nil { 3593 sc = page.Response().Response.Response.StatusCode 3594 } 3595 tracing.EndSpan(ctx, sc, err) 3596 }() 3597 } 3598 for { 3599 next, err := page.fn(ctx, page.dnclr) 3600 if err != nil { 3601 return err 3602 } 3603 page.dnclr = next 3604 if !next.hasNextLink() || !next.IsEmpty() { 3605 break 3606 } 3607 } 3608 return nil 3609} 3610 3611// Next advances to the next page of values. If there was an error making 3612// the request the page does not advance and the error is returned. 3613// Deprecated: Use NextWithContext() instead. 3614func (page *DscNodeConfigurationListResultPage) Next() error { 3615 return page.NextWithContext(context.Background()) 3616} 3617 3618// NotDone returns true if the page enumeration should be started or is not yet complete. 3619func (page DscNodeConfigurationListResultPage) NotDone() bool { 3620 return !page.dnclr.IsEmpty() 3621} 3622 3623// Response returns the raw server response from the last page request. 3624func (page DscNodeConfigurationListResultPage) Response() DscNodeConfigurationListResult { 3625 return page.dnclr 3626} 3627 3628// Values returns the slice of values for the current page or nil if there are no values. 3629func (page DscNodeConfigurationListResultPage) Values() []DscNodeConfiguration { 3630 if page.dnclr.IsEmpty() { 3631 return nil 3632 } 3633 return *page.dnclr.Value 3634} 3635 3636// Creates a new instance of the DscNodeConfigurationListResultPage type. 3637func NewDscNodeConfigurationListResultPage(cur DscNodeConfigurationListResult, getNextPage func(context.Context, DscNodeConfigurationListResult) (DscNodeConfigurationListResult, error)) DscNodeConfigurationListResultPage { 3638 return DscNodeConfigurationListResultPage{ 3639 fn: getNextPage, 3640 dnclr: cur, 3641 } 3642} 3643 3644// DscNodeExtensionHandlerAssociationProperty the dsc extensionHandler property associated with the node 3645type DscNodeExtensionHandlerAssociationProperty struct { 3646 // Name - Gets or sets the name of the extension handler. 3647 Name *string `json:"name,omitempty"` 3648 // Version - Gets or sets the version of the extension handler. 3649 Version *string `json:"version,omitempty"` 3650} 3651 3652// DscNodeListResult the response model for the list dsc nodes operation. 3653type DscNodeListResult struct { 3654 autorest.Response `json:"-"` 3655 // Value - Gets or sets a list of dsc nodes. 3656 Value *[]DscNode `json:"value,omitempty"` 3657 // NextLink - Gets or sets the next link. 3658 NextLink *string `json:"nextLink,omitempty"` 3659} 3660 3661// DscNodeListResultIterator provides access to a complete listing of DscNode values. 3662type DscNodeListResultIterator struct { 3663 i int 3664 page DscNodeListResultPage 3665} 3666 3667// NextWithContext advances to the next value. If there was an error making 3668// the request the iterator does not advance and the error is returned. 3669func (iter *DscNodeListResultIterator) NextWithContext(ctx context.Context) (err error) { 3670 if tracing.IsEnabled() { 3671 ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeListResultIterator.NextWithContext") 3672 defer func() { 3673 sc := -1 3674 if iter.Response().Response.Response != nil { 3675 sc = iter.Response().Response.Response.StatusCode 3676 } 3677 tracing.EndSpan(ctx, sc, err) 3678 }() 3679 } 3680 iter.i++ 3681 if iter.i < len(iter.page.Values()) { 3682 return nil 3683 } 3684 err = iter.page.NextWithContext(ctx) 3685 if err != nil { 3686 iter.i-- 3687 return err 3688 } 3689 iter.i = 0 3690 return nil 3691} 3692 3693// Next advances to the next value. If there was an error making 3694// the request the iterator does not advance and the error is returned. 3695// Deprecated: Use NextWithContext() instead. 3696func (iter *DscNodeListResultIterator) Next() error { 3697 return iter.NextWithContext(context.Background()) 3698} 3699 3700// NotDone returns true if the enumeration should be started or is not yet complete. 3701func (iter DscNodeListResultIterator) NotDone() bool { 3702 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3703} 3704 3705// Response returns the raw server response from the last page request. 3706func (iter DscNodeListResultIterator) Response() DscNodeListResult { 3707 return iter.page.Response() 3708} 3709 3710// Value returns the current value or a zero-initialized value if the 3711// iterator has advanced beyond the end of the collection. 3712func (iter DscNodeListResultIterator) Value() DscNode { 3713 if !iter.page.NotDone() { 3714 return DscNode{} 3715 } 3716 return iter.page.Values()[iter.i] 3717} 3718 3719// Creates a new instance of the DscNodeListResultIterator type. 3720func NewDscNodeListResultIterator(page DscNodeListResultPage) DscNodeListResultIterator { 3721 return DscNodeListResultIterator{page: page} 3722} 3723 3724// IsEmpty returns true if the ListResult contains no values. 3725func (dnlr DscNodeListResult) IsEmpty() bool { 3726 return dnlr.Value == nil || len(*dnlr.Value) == 0 3727} 3728 3729// hasNextLink returns true if the NextLink is not empty. 3730func (dnlr DscNodeListResult) hasNextLink() bool { 3731 return dnlr.NextLink != nil && len(*dnlr.NextLink) != 0 3732} 3733 3734// dscNodeListResultPreparer prepares a request to retrieve the next set of results. 3735// It returns nil if no more results exist. 3736func (dnlr DscNodeListResult) dscNodeListResultPreparer(ctx context.Context) (*http.Request, error) { 3737 if !dnlr.hasNextLink() { 3738 return nil, nil 3739 } 3740 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3741 autorest.AsJSON(), 3742 autorest.AsGet(), 3743 autorest.WithBaseURL(to.String(dnlr.NextLink))) 3744} 3745 3746// DscNodeListResultPage contains a page of DscNode values. 3747type DscNodeListResultPage struct { 3748 fn func(context.Context, DscNodeListResult) (DscNodeListResult, error) 3749 dnlr DscNodeListResult 3750} 3751 3752// NextWithContext advances to the next page of values. If there was an error making 3753// the request the page does not advance and the error is returned. 3754func (page *DscNodeListResultPage) NextWithContext(ctx context.Context) (err error) { 3755 if tracing.IsEnabled() { 3756 ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeListResultPage.NextWithContext") 3757 defer func() { 3758 sc := -1 3759 if page.Response().Response.Response != nil { 3760 sc = page.Response().Response.Response.StatusCode 3761 } 3762 tracing.EndSpan(ctx, sc, err) 3763 }() 3764 } 3765 for { 3766 next, err := page.fn(ctx, page.dnlr) 3767 if err != nil { 3768 return err 3769 } 3770 page.dnlr = next 3771 if !next.hasNextLink() || !next.IsEmpty() { 3772 break 3773 } 3774 } 3775 return nil 3776} 3777 3778// Next advances to the next page of values. If there was an error making 3779// the request the page does not advance and the error is returned. 3780// Deprecated: Use NextWithContext() instead. 3781func (page *DscNodeListResultPage) Next() error { 3782 return page.NextWithContext(context.Background()) 3783} 3784 3785// NotDone returns true if the page enumeration should be started or is not yet complete. 3786func (page DscNodeListResultPage) NotDone() bool { 3787 return !page.dnlr.IsEmpty() 3788} 3789 3790// Response returns the raw server response from the last page request. 3791func (page DscNodeListResultPage) Response() DscNodeListResult { 3792 return page.dnlr 3793} 3794 3795// Values returns the slice of values for the current page or nil if there are no values. 3796func (page DscNodeListResultPage) Values() []DscNode { 3797 if page.dnlr.IsEmpty() { 3798 return nil 3799 } 3800 return *page.dnlr.Value 3801} 3802 3803// Creates a new instance of the DscNodeListResultPage type. 3804func NewDscNodeListResultPage(cur DscNodeListResult, getNextPage func(context.Context, DscNodeListResult) (DscNodeListResult, error)) DscNodeListResultPage { 3805 return DscNodeListResultPage{ 3806 fn: getNextPage, 3807 dnlr: cur, 3808 } 3809} 3810 3811// DscNodeReport definition of the dsc node report type. 3812type DscNodeReport struct { 3813 autorest.Response `json:"-"` 3814 // EndTime - Gets or sets the end time of the node report. 3815 EndTime *date.Time `json:"endTime,omitempty"` 3816 // LastModifiedTime - Gets or sets the lastModifiedTime of the node report. 3817 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 3818 // StartTime - Gets or sets the start time of the node report. 3819 StartTime *date.Time `json:"startTime,omitempty"` 3820 // Type - Gets or sets the type of the node report. 3821 Type *string `json:"type,omitempty"` 3822 // ReportID - Gets or sets the id of the node report. 3823 ReportID *string `json:"reportId,omitempty"` 3824 // Status - Gets or sets the status of the node report. 3825 Status *string `json:"status,omitempty"` 3826 // RefreshMode - Gets or sets the refreshMode of the node report. 3827 RefreshMode *string `json:"refreshMode,omitempty"` 3828 // RebootRequested - Gets or sets the rebootRequested of the node report. 3829 RebootRequested *string `json:"rebootRequested,omitempty"` 3830 // ReportFormatVersion - Gets or sets the reportFormatVersion of the node report. 3831 ReportFormatVersion *string `json:"reportFormatVersion,omitempty"` 3832 // ConfigurationVersion - Gets or sets the configurationVersion of the node report. 3833 ConfigurationVersion *string `json:"configurationVersion,omitempty"` 3834 // ID - Gets or sets the id. 3835 ID *string `json:"id,omitempty"` 3836 // Errors - Gets or sets the errors for the node report. 3837 Errors *[]DscReportError `json:"errors,omitempty"` 3838 // Resources - Gets or sets the resource for the node report. 3839 Resources *[]DscReportResource `json:"resources,omitempty"` 3840 // MetaConfiguration - Gets or sets the metaConfiguration of the node at the time of the report. 3841 MetaConfiguration *DscMetaConfiguration `json:"metaConfiguration,omitempty"` 3842 // HostName - Gets or sets the hostname of the node that sent the report. 3843 HostName *string `json:"hostName,omitempty"` 3844 // IPV4Addresses - Gets or sets the IPv4 address of the node that sent the report. 3845 IPV4Addresses *[]string `json:"iPV4Addresses,omitempty"` 3846 // IPV6Addresses - Gets or sets the IPv6 address of the node that sent the report. 3847 IPV6Addresses *[]string `json:"iPV6Addresses,omitempty"` 3848 // NumberOfResources - Gets or sets the number of resource in the node report. 3849 NumberOfResources *int32 `json:"numberOfResources,omitempty"` 3850 // RawErrors - Gets or sets the unparsed errors for the node report. 3851 RawErrors *string `json:"rawErrors,omitempty"` 3852} 3853 3854// DscNodeReportListResult the response model for the list dsc nodes operation. 3855type DscNodeReportListResult struct { 3856 autorest.Response `json:"-"` 3857 // Value - Gets or sets a list of dsc node reports. 3858 Value *[]DscNodeReport `json:"value,omitempty"` 3859 // NextLink - Gets or sets the next link. 3860 NextLink *string `json:"nextLink,omitempty"` 3861} 3862 3863// DscNodeReportListResultIterator provides access to a complete listing of DscNodeReport values. 3864type DscNodeReportListResultIterator struct { 3865 i int 3866 page DscNodeReportListResultPage 3867} 3868 3869// NextWithContext advances to the next value. If there was an error making 3870// the request the iterator does not advance and the error is returned. 3871func (iter *DscNodeReportListResultIterator) NextWithContext(ctx context.Context) (err error) { 3872 if tracing.IsEnabled() { 3873 ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeReportListResultIterator.NextWithContext") 3874 defer func() { 3875 sc := -1 3876 if iter.Response().Response.Response != nil { 3877 sc = iter.Response().Response.Response.StatusCode 3878 } 3879 tracing.EndSpan(ctx, sc, err) 3880 }() 3881 } 3882 iter.i++ 3883 if iter.i < len(iter.page.Values()) { 3884 return nil 3885 } 3886 err = iter.page.NextWithContext(ctx) 3887 if err != nil { 3888 iter.i-- 3889 return err 3890 } 3891 iter.i = 0 3892 return nil 3893} 3894 3895// Next advances to the next value. If there was an error making 3896// the request the iterator does not advance and the error is returned. 3897// Deprecated: Use NextWithContext() instead. 3898func (iter *DscNodeReportListResultIterator) Next() error { 3899 return iter.NextWithContext(context.Background()) 3900} 3901 3902// NotDone returns true if the enumeration should be started or is not yet complete. 3903func (iter DscNodeReportListResultIterator) NotDone() bool { 3904 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3905} 3906 3907// Response returns the raw server response from the last page request. 3908func (iter DscNodeReportListResultIterator) Response() DscNodeReportListResult { 3909 return iter.page.Response() 3910} 3911 3912// Value returns the current value or a zero-initialized value if the 3913// iterator has advanced beyond the end of the collection. 3914func (iter DscNodeReportListResultIterator) Value() DscNodeReport { 3915 if !iter.page.NotDone() { 3916 return DscNodeReport{} 3917 } 3918 return iter.page.Values()[iter.i] 3919} 3920 3921// Creates a new instance of the DscNodeReportListResultIterator type. 3922func NewDscNodeReportListResultIterator(page DscNodeReportListResultPage) DscNodeReportListResultIterator { 3923 return DscNodeReportListResultIterator{page: page} 3924} 3925 3926// IsEmpty returns true if the ListResult contains no values. 3927func (dnrlr DscNodeReportListResult) IsEmpty() bool { 3928 return dnrlr.Value == nil || len(*dnrlr.Value) == 0 3929} 3930 3931// hasNextLink returns true if the NextLink is not empty. 3932func (dnrlr DscNodeReportListResult) hasNextLink() bool { 3933 return dnrlr.NextLink != nil && len(*dnrlr.NextLink) != 0 3934} 3935 3936// dscNodeReportListResultPreparer prepares a request to retrieve the next set of results. 3937// It returns nil if no more results exist. 3938func (dnrlr DscNodeReportListResult) dscNodeReportListResultPreparer(ctx context.Context) (*http.Request, error) { 3939 if !dnrlr.hasNextLink() { 3940 return nil, nil 3941 } 3942 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3943 autorest.AsJSON(), 3944 autorest.AsGet(), 3945 autorest.WithBaseURL(to.String(dnrlr.NextLink))) 3946} 3947 3948// DscNodeReportListResultPage contains a page of DscNodeReport values. 3949type DscNodeReportListResultPage struct { 3950 fn func(context.Context, DscNodeReportListResult) (DscNodeReportListResult, error) 3951 dnrlr DscNodeReportListResult 3952} 3953 3954// NextWithContext advances to the next page of values. If there was an error making 3955// the request the page does not advance and the error is returned. 3956func (page *DscNodeReportListResultPage) NextWithContext(ctx context.Context) (err error) { 3957 if tracing.IsEnabled() { 3958 ctx = tracing.StartSpan(ctx, fqdn+"/DscNodeReportListResultPage.NextWithContext") 3959 defer func() { 3960 sc := -1 3961 if page.Response().Response.Response != nil { 3962 sc = page.Response().Response.Response.StatusCode 3963 } 3964 tracing.EndSpan(ctx, sc, err) 3965 }() 3966 } 3967 for { 3968 next, err := page.fn(ctx, page.dnrlr) 3969 if err != nil { 3970 return err 3971 } 3972 page.dnrlr = next 3973 if !next.hasNextLink() || !next.IsEmpty() { 3974 break 3975 } 3976 } 3977 return nil 3978} 3979 3980// Next advances to the next page of values. If there was an error making 3981// the request the page does not advance and the error is returned. 3982// Deprecated: Use NextWithContext() instead. 3983func (page *DscNodeReportListResultPage) Next() error { 3984 return page.NextWithContext(context.Background()) 3985} 3986 3987// NotDone returns true if the page enumeration should be started or is not yet complete. 3988func (page DscNodeReportListResultPage) NotDone() bool { 3989 return !page.dnrlr.IsEmpty() 3990} 3991 3992// Response returns the raw server response from the last page request. 3993func (page DscNodeReportListResultPage) Response() DscNodeReportListResult { 3994 return page.dnrlr 3995} 3996 3997// Values returns the slice of values for the current page or nil if there are no values. 3998func (page DscNodeReportListResultPage) Values() []DscNodeReport { 3999 if page.dnrlr.IsEmpty() { 4000 return nil 4001 } 4002 return *page.dnrlr.Value 4003} 4004 4005// Creates a new instance of the DscNodeReportListResultPage type. 4006func NewDscNodeReportListResultPage(cur DscNodeReportListResult, getNextPage func(context.Context, DscNodeReportListResult) (DscNodeReportListResult, error)) DscNodeReportListResultPage { 4007 return DscNodeReportListResultPage{ 4008 fn: getNextPage, 4009 dnrlr: cur, 4010 } 4011} 4012 4013// DscNodeUpdateParameters the parameters supplied to the update dsc node operation. 4014type DscNodeUpdateParameters struct { 4015 // NodeID - Gets or sets the id of the dsc node. 4016 NodeID *string `json:"nodeId,omitempty"` 4017 // NodeConfiguration - Gets or sets the configuration of the node. 4018 NodeConfiguration *DscNodeConfigurationAssociationProperty `json:"nodeConfiguration,omitempty"` 4019} 4020 4021// DscReportError definition of the dsc node report error type. 4022type DscReportError struct { 4023 // ErrorSource - Gets or sets the source of the error. 4024 ErrorSource *string `json:"errorSource,omitempty"` 4025 // ResourceID - Gets or sets the resource ID which generated the error. 4026 ResourceID *string `json:"resourceId,omitempty"` 4027 // ErrorCode - Gets or sets the error code. 4028 ErrorCode *string `json:"errorCode,omitempty"` 4029 // ErrorMessage - Gets or sets the error message. 4030 ErrorMessage *string `json:"errorMessage,omitempty"` 4031 // Locale - Gets or sets the locale of the error. 4032 Locale *string `json:"locale,omitempty"` 4033 // ErrorDetails - Gets or sets the error details. 4034 ErrorDetails *string `json:"errorDetails,omitempty"` 4035} 4036 4037// DscReportResource definition of the DSC Report Resource. 4038type DscReportResource struct { 4039 // ResourceID - Gets or sets the ID of the resource. 4040 ResourceID *string `json:"resourceId,omitempty"` 4041 // SourceInfo - Gets or sets the source info of the resource. 4042 SourceInfo *string `json:"sourceInfo,omitempty"` 4043 // DependsOn - Gets or sets the Resource Navigation values for resources the resource depends on. 4044 DependsOn *[]DscReportResourceNavigation `json:"dependsOn,omitempty"` 4045 // ModuleName - Gets or sets the module name of the resource. 4046 ModuleName *string `json:"moduleName,omitempty"` 4047 // ModuleVersion - Gets or sets the module version of the resource. 4048 ModuleVersion *string `json:"moduleVersion,omitempty"` 4049 // ResourceName - Gets or sets the name of the resource. 4050 ResourceName *string `json:"resourceName,omitempty"` 4051 // Error - Gets or sets the error of the resource. 4052 Error *string `json:"error,omitempty"` 4053 // Status - Gets or sets the status of the resource. 4054 Status *string `json:"status,omitempty"` 4055 // DurationInSeconds - Gets or sets the duration in seconds for the resource. 4056 DurationInSeconds *float64 `json:"durationInSeconds,omitempty"` 4057 // StartDate - Gets or sets the start date of the resource. 4058 StartDate *date.Time `json:"startDate,omitempty"` 4059} 4060 4061// DscReportResourceNavigation navigation for DSC Report Resource. 4062type DscReportResourceNavigation struct { 4063 // ResourceID - Gets or sets the ID of the resource to navigate to. 4064 ResourceID *string `json:"resourceId,omitempty"` 4065} 4066 4067// ErrorResponse error response of an operation failure 4068type ErrorResponse struct { 4069 // Code - Error code 4070 Code *string `json:"code,omitempty"` 4071 // Message - Error message indicating why the operation failed. 4072 Message *string `json:"message,omitempty"` 4073} 4074 4075// FieldDefinition definition of the connection fields. 4076type FieldDefinition struct { 4077 // IsEncrypted - Gets or sets the isEncrypted flag of the connection field definition. 4078 IsEncrypted *bool `json:"isEncrypted,omitempty"` 4079 // IsOptional - Gets or sets the isOptional flag of the connection field definition. 4080 IsOptional *bool `json:"isOptional,omitempty"` 4081 // Type - Gets or sets the type of the connection field definition. 4082 Type *string `json:"type,omitempty"` 4083} 4084 4085// HybridRunbookWorker definition of hybrid runbook worker. 4086type HybridRunbookWorker struct { 4087 // Name - Gets or sets the worker machine name. 4088 Name *string `json:"name,omitempty"` 4089 // IP - Gets or sets the assigned machine IP address. 4090 IP *string `json:"ip,omitempty"` 4091 // RegistrationTime - Gets or sets the registration time of the worker machine. 4092 RegistrationTime *date.Time `json:"registrationTime,omitempty"` 4093 // LastSeenDateTime - Last Heartbeat from the Worker 4094 LastSeenDateTime *date.Time `json:"lastSeenDateTime,omitempty"` 4095} 4096 4097// HybridRunbookWorkerGroup definition of hybrid runbook worker group. 4098type HybridRunbookWorkerGroup struct { 4099 autorest.Response `json:"-"` 4100 // ID - Gets or sets the id of the resource. 4101 ID *string `json:"id,omitempty"` 4102 // Name - Gets or sets the name of the group. 4103 Name *string `json:"name,omitempty"` 4104 // HybridRunbookWorkers - Gets or sets the list of hybrid runbook workers. 4105 HybridRunbookWorkers *[]HybridRunbookWorker `json:"hybridRunbookWorkers,omitempty"` 4106 // Credential - Sets the credential of a worker group. 4107 Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` 4108 // GroupType - Type of the HybridWorkerGroup. Possible values include: 'User', 'System' 4109 GroupType GroupTypeEnum `json:"groupType,omitempty"` 4110} 4111 4112// HybridRunbookWorkerGroupsListResult the response model for the list hybrid runbook worker groups. 4113type HybridRunbookWorkerGroupsListResult struct { 4114 autorest.Response `json:"-"` 4115 // Value - Gets or sets a list of hybrid runbook worker groups. 4116 Value *[]HybridRunbookWorkerGroup `json:"value,omitempty"` 4117 // NextLink - Gets or sets the next link. 4118 NextLink *string `json:"nextLink,omitempty"` 4119} 4120 4121// HybridRunbookWorkerGroupsListResultIterator provides access to a complete listing of 4122// HybridRunbookWorkerGroup values. 4123type HybridRunbookWorkerGroupsListResultIterator struct { 4124 i int 4125 page HybridRunbookWorkerGroupsListResultPage 4126} 4127 4128// NextWithContext advances to the next value. If there was an error making 4129// the request the iterator does not advance and the error is returned. 4130func (iter *HybridRunbookWorkerGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) { 4131 if tracing.IsEnabled() { 4132 ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupsListResultIterator.NextWithContext") 4133 defer func() { 4134 sc := -1 4135 if iter.Response().Response.Response != nil { 4136 sc = iter.Response().Response.Response.StatusCode 4137 } 4138 tracing.EndSpan(ctx, sc, err) 4139 }() 4140 } 4141 iter.i++ 4142 if iter.i < len(iter.page.Values()) { 4143 return nil 4144 } 4145 err = iter.page.NextWithContext(ctx) 4146 if err != nil { 4147 iter.i-- 4148 return err 4149 } 4150 iter.i = 0 4151 return nil 4152} 4153 4154// Next advances to the next value. If there was an error making 4155// the request the iterator does not advance and the error is returned. 4156// Deprecated: Use NextWithContext() instead. 4157func (iter *HybridRunbookWorkerGroupsListResultIterator) Next() error { 4158 return iter.NextWithContext(context.Background()) 4159} 4160 4161// NotDone returns true if the enumeration should be started or is not yet complete. 4162func (iter HybridRunbookWorkerGroupsListResultIterator) NotDone() bool { 4163 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4164} 4165 4166// Response returns the raw server response from the last page request. 4167func (iter HybridRunbookWorkerGroupsListResultIterator) Response() HybridRunbookWorkerGroupsListResult { 4168 return iter.page.Response() 4169} 4170 4171// Value returns the current value or a zero-initialized value if the 4172// iterator has advanced beyond the end of the collection. 4173func (iter HybridRunbookWorkerGroupsListResultIterator) Value() HybridRunbookWorkerGroup { 4174 if !iter.page.NotDone() { 4175 return HybridRunbookWorkerGroup{} 4176 } 4177 return iter.page.Values()[iter.i] 4178} 4179 4180// Creates a new instance of the HybridRunbookWorkerGroupsListResultIterator type. 4181func NewHybridRunbookWorkerGroupsListResultIterator(page HybridRunbookWorkerGroupsListResultPage) HybridRunbookWorkerGroupsListResultIterator { 4182 return HybridRunbookWorkerGroupsListResultIterator{page: page} 4183} 4184 4185// IsEmpty returns true if the ListResult contains no values. 4186func (hrwglr HybridRunbookWorkerGroupsListResult) IsEmpty() bool { 4187 return hrwglr.Value == nil || len(*hrwglr.Value) == 0 4188} 4189 4190// hasNextLink returns true if the NextLink is not empty. 4191func (hrwglr HybridRunbookWorkerGroupsListResult) hasNextLink() bool { 4192 return hrwglr.NextLink != nil && len(*hrwglr.NextLink) != 0 4193} 4194 4195// hybridRunbookWorkerGroupsListResultPreparer prepares a request to retrieve the next set of results. 4196// It returns nil if no more results exist. 4197func (hrwglr HybridRunbookWorkerGroupsListResult) hybridRunbookWorkerGroupsListResultPreparer(ctx context.Context) (*http.Request, error) { 4198 if !hrwglr.hasNextLink() { 4199 return nil, nil 4200 } 4201 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4202 autorest.AsJSON(), 4203 autorest.AsGet(), 4204 autorest.WithBaseURL(to.String(hrwglr.NextLink))) 4205} 4206 4207// HybridRunbookWorkerGroupsListResultPage contains a page of HybridRunbookWorkerGroup values. 4208type HybridRunbookWorkerGroupsListResultPage struct { 4209 fn func(context.Context, HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error) 4210 hrwglr HybridRunbookWorkerGroupsListResult 4211} 4212 4213// NextWithContext advances to the next page of values. If there was an error making 4214// the request the page does not advance and the error is returned. 4215func (page *HybridRunbookWorkerGroupsListResultPage) NextWithContext(ctx context.Context) (err error) { 4216 if tracing.IsEnabled() { 4217 ctx = tracing.StartSpan(ctx, fqdn+"/HybridRunbookWorkerGroupsListResultPage.NextWithContext") 4218 defer func() { 4219 sc := -1 4220 if page.Response().Response.Response != nil { 4221 sc = page.Response().Response.Response.StatusCode 4222 } 4223 tracing.EndSpan(ctx, sc, err) 4224 }() 4225 } 4226 for { 4227 next, err := page.fn(ctx, page.hrwglr) 4228 if err != nil { 4229 return err 4230 } 4231 page.hrwglr = next 4232 if !next.hasNextLink() || !next.IsEmpty() { 4233 break 4234 } 4235 } 4236 return nil 4237} 4238 4239// Next advances to the next page of values. If there was an error making 4240// the request the page does not advance and the error is returned. 4241// Deprecated: Use NextWithContext() instead. 4242func (page *HybridRunbookWorkerGroupsListResultPage) Next() error { 4243 return page.NextWithContext(context.Background()) 4244} 4245 4246// NotDone returns true if the page enumeration should be started or is not yet complete. 4247func (page HybridRunbookWorkerGroupsListResultPage) NotDone() bool { 4248 return !page.hrwglr.IsEmpty() 4249} 4250 4251// Response returns the raw server response from the last page request. 4252func (page HybridRunbookWorkerGroupsListResultPage) Response() HybridRunbookWorkerGroupsListResult { 4253 return page.hrwglr 4254} 4255 4256// Values returns the slice of values for the current page or nil if there are no values. 4257func (page HybridRunbookWorkerGroupsListResultPage) Values() []HybridRunbookWorkerGroup { 4258 if page.hrwglr.IsEmpty() { 4259 return nil 4260 } 4261 return *page.hrwglr.Value 4262} 4263 4264// Creates a new instance of the HybridRunbookWorkerGroupsListResultPage type. 4265func NewHybridRunbookWorkerGroupsListResultPage(cur HybridRunbookWorkerGroupsListResult, getNextPage func(context.Context, HybridRunbookWorkerGroupsListResult) (HybridRunbookWorkerGroupsListResult, error)) HybridRunbookWorkerGroupsListResultPage { 4266 return HybridRunbookWorkerGroupsListResultPage{ 4267 fn: getNextPage, 4268 hrwglr: cur, 4269 } 4270} 4271 4272// HybridRunbookWorkerGroupUpdateParameters parameters supplied to the update operation. 4273type HybridRunbookWorkerGroupUpdateParameters struct { 4274 // Credential - Sets the credential of a worker group. 4275 Credential *RunAsCredentialAssociationProperty `json:"credential,omitempty"` 4276} 4277 4278// Job definition of the job. 4279type Job struct { 4280 autorest.Response `json:"-"` 4281 // JobProperties - The properties of the job. 4282 *JobProperties `json:"properties,omitempty"` 4283 // ID - READ-ONLY; Fully qualified resource Id for the resource 4284 ID *string `json:"id,omitempty"` 4285 // Name - READ-ONLY; The name of the resource 4286 Name *string `json:"name,omitempty"` 4287 // Type - READ-ONLY; The type of the resource. 4288 Type *string `json:"type,omitempty"` 4289} 4290 4291// MarshalJSON is the custom marshaler for Job. 4292func (j Job) MarshalJSON() ([]byte, error) { 4293 objectMap := make(map[string]interface{}) 4294 if j.JobProperties != nil { 4295 objectMap["properties"] = j.JobProperties 4296 } 4297 return json.Marshal(objectMap) 4298} 4299 4300// UnmarshalJSON is the custom unmarshaler for Job struct. 4301func (j *Job) UnmarshalJSON(body []byte) error { 4302 var m map[string]*json.RawMessage 4303 err := json.Unmarshal(body, &m) 4304 if err != nil { 4305 return err 4306 } 4307 for k, v := range m { 4308 switch k { 4309 case "properties": 4310 if v != nil { 4311 var jobProperties JobProperties 4312 err = json.Unmarshal(*v, &jobProperties) 4313 if err != nil { 4314 return err 4315 } 4316 j.JobProperties = &jobProperties 4317 } 4318 case "id": 4319 if v != nil { 4320 var ID string 4321 err = json.Unmarshal(*v, &ID) 4322 if err != nil { 4323 return err 4324 } 4325 j.ID = &ID 4326 } 4327 case "name": 4328 if v != nil { 4329 var name string 4330 err = json.Unmarshal(*v, &name) 4331 if err != nil { 4332 return err 4333 } 4334 j.Name = &name 4335 } 4336 case "type": 4337 if v != nil { 4338 var typeVar string 4339 err = json.Unmarshal(*v, &typeVar) 4340 if err != nil { 4341 return err 4342 } 4343 j.Type = &typeVar 4344 } 4345 } 4346 } 4347 4348 return nil 4349} 4350 4351// JobCollectionItem job collection item properties. 4352type JobCollectionItem struct { 4353 // JobCollectionItemProperties - Job properties. 4354 *JobCollectionItemProperties `json:"properties,omitempty"` 4355 // ID - READ-ONLY; Fully qualified resource Id for the resource 4356 ID *string `json:"id,omitempty"` 4357 // Name - READ-ONLY; The name of the resource 4358 Name *string `json:"name,omitempty"` 4359 // Type - READ-ONLY; The type of the resource. 4360 Type *string `json:"type,omitempty"` 4361} 4362 4363// MarshalJSON is the custom marshaler for JobCollectionItem. 4364func (jci JobCollectionItem) MarshalJSON() ([]byte, error) { 4365 objectMap := make(map[string]interface{}) 4366 if jci.JobCollectionItemProperties != nil { 4367 objectMap["properties"] = jci.JobCollectionItemProperties 4368 } 4369 return json.Marshal(objectMap) 4370} 4371 4372// UnmarshalJSON is the custom unmarshaler for JobCollectionItem struct. 4373func (jci *JobCollectionItem) UnmarshalJSON(body []byte) error { 4374 var m map[string]*json.RawMessage 4375 err := json.Unmarshal(body, &m) 4376 if err != nil { 4377 return err 4378 } 4379 for k, v := range m { 4380 switch k { 4381 case "properties": 4382 if v != nil { 4383 var jobCollectionItemProperties JobCollectionItemProperties 4384 err = json.Unmarshal(*v, &jobCollectionItemProperties) 4385 if err != nil { 4386 return err 4387 } 4388 jci.JobCollectionItemProperties = &jobCollectionItemProperties 4389 } 4390 case "id": 4391 if v != nil { 4392 var ID string 4393 err = json.Unmarshal(*v, &ID) 4394 if err != nil { 4395 return err 4396 } 4397 jci.ID = &ID 4398 } 4399 case "name": 4400 if v != nil { 4401 var name string 4402 err = json.Unmarshal(*v, &name) 4403 if err != nil { 4404 return err 4405 } 4406 jci.Name = &name 4407 } 4408 case "type": 4409 if v != nil { 4410 var typeVar string 4411 err = json.Unmarshal(*v, &typeVar) 4412 if err != nil { 4413 return err 4414 } 4415 jci.Type = &typeVar 4416 } 4417 } 4418 } 4419 4420 return nil 4421} 4422 4423// JobCollectionItemProperties job collection item properties. 4424type JobCollectionItemProperties struct { 4425 // Runbook - READ-ONLY; The runbook association. 4426 Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` 4427 // JobID - READ-ONLY; The id of the job. 4428 JobID *uuid.UUID `json:"jobId,omitempty"` 4429 // CreationTime - READ-ONLY; The creation time of the job. 4430 CreationTime *date.Time `json:"creationTime,omitempty"` 4431 // Status - READ-ONLY; The status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' 4432 Status JobStatus `json:"status,omitempty"` 4433 // StartTime - READ-ONLY; The start time of the job. 4434 StartTime *date.Time `json:"startTime,omitempty"` 4435 // EndTime - READ-ONLY; The end time of the job. 4436 EndTime *date.Time `json:"endTime,omitempty"` 4437 // LastModifiedTime - READ-ONLY; The last modified time of the job. 4438 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 4439 // ProvisioningState - READ-ONLY; The provisioning state of a resource. 4440 ProvisioningState *string `json:"provisioningState,omitempty"` 4441 // RunOn - Specifies the runOn group name where the job was executed. 4442 RunOn *string `json:"runOn,omitempty"` 4443} 4444 4445// MarshalJSON is the custom marshaler for JobCollectionItemProperties. 4446func (jcip JobCollectionItemProperties) MarshalJSON() ([]byte, error) { 4447 objectMap := make(map[string]interface{}) 4448 if jcip.RunOn != nil { 4449 objectMap["runOn"] = jcip.RunOn 4450 } 4451 return json.Marshal(objectMap) 4452} 4453 4454// JobCreateParameters the parameters supplied to the create job operation. 4455type JobCreateParameters struct { 4456 // JobCreateProperties - Gets or sets the list of job properties. 4457 *JobCreateProperties `json:"properties,omitempty"` 4458} 4459 4460// MarshalJSON is the custom marshaler for JobCreateParameters. 4461func (jcp JobCreateParameters) MarshalJSON() ([]byte, error) { 4462 objectMap := make(map[string]interface{}) 4463 if jcp.JobCreateProperties != nil { 4464 objectMap["properties"] = jcp.JobCreateProperties 4465 } 4466 return json.Marshal(objectMap) 4467} 4468 4469// UnmarshalJSON is the custom unmarshaler for JobCreateParameters struct. 4470func (jcp *JobCreateParameters) UnmarshalJSON(body []byte) error { 4471 var m map[string]*json.RawMessage 4472 err := json.Unmarshal(body, &m) 4473 if err != nil { 4474 return err 4475 } 4476 for k, v := range m { 4477 switch k { 4478 case "properties": 4479 if v != nil { 4480 var jobCreateProperties JobCreateProperties 4481 err = json.Unmarshal(*v, &jobCreateProperties) 4482 if err != nil { 4483 return err 4484 } 4485 jcp.JobCreateProperties = &jobCreateProperties 4486 } 4487 } 4488 } 4489 4490 return nil 4491} 4492 4493// JobCreateProperties ... 4494type JobCreateProperties struct { 4495 // Runbook - Gets or sets the runbook. 4496 Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` 4497 // Parameters - Gets or sets the parameters of the job. 4498 Parameters map[string]*string `json:"parameters"` 4499 // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. 4500 RunOn *string `json:"runOn,omitempty"` 4501} 4502 4503// MarshalJSON is the custom marshaler for JobCreateProperties. 4504func (jcp JobCreateProperties) MarshalJSON() ([]byte, error) { 4505 objectMap := make(map[string]interface{}) 4506 if jcp.Runbook != nil { 4507 objectMap["runbook"] = jcp.Runbook 4508 } 4509 if jcp.Parameters != nil { 4510 objectMap["parameters"] = jcp.Parameters 4511 } 4512 if jcp.RunOn != nil { 4513 objectMap["runOn"] = jcp.RunOn 4514 } 4515 return json.Marshal(objectMap) 4516} 4517 4518// JobListResultV2 the response model for the list job operation. 4519type JobListResultV2 struct { 4520 autorest.Response `json:"-"` 4521 // Value - List of jobs. 4522 Value *[]JobCollectionItem `json:"value,omitempty"` 4523 // NextLink - READ-ONLY; The link to the next page. 4524 NextLink *string `json:"nextLink,omitempty"` 4525} 4526 4527// MarshalJSON is the custom marshaler for JobListResultV2. 4528func (jlrv JobListResultV2) MarshalJSON() ([]byte, error) { 4529 objectMap := make(map[string]interface{}) 4530 if jlrv.Value != nil { 4531 objectMap["value"] = jlrv.Value 4532 } 4533 return json.Marshal(objectMap) 4534} 4535 4536// JobListResultV2Iterator provides access to a complete listing of JobCollectionItem values. 4537type JobListResultV2Iterator struct { 4538 i int 4539 page JobListResultV2Page 4540} 4541 4542// NextWithContext advances to the next value. If there was an error making 4543// the request the iterator does not advance and the error is returned. 4544func (iter *JobListResultV2Iterator) NextWithContext(ctx context.Context) (err error) { 4545 if tracing.IsEnabled() { 4546 ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultV2Iterator.NextWithContext") 4547 defer func() { 4548 sc := -1 4549 if iter.Response().Response.Response != nil { 4550 sc = iter.Response().Response.Response.StatusCode 4551 } 4552 tracing.EndSpan(ctx, sc, err) 4553 }() 4554 } 4555 iter.i++ 4556 if iter.i < len(iter.page.Values()) { 4557 return nil 4558 } 4559 err = iter.page.NextWithContext(ctx) 4560 if err != nil { 4561 iter.i-- 4562 return err 4563 } 4564 iter.i = 0 4565 return nil 4566} 4567 4568// Next advances to the next value. If there was an error making 4569// the request the iterator does not advance and the error is returned. 4570// Deprecated: Use NextWithContext() instead. 4571func (iter *JobListResultV2Iterator) Next() error { 4572 return iter.NextWithContext(context.Background()) 4573} 4574 4575// NotDone returns true if the enumeration should be started or is not yet complete. 4576func (iter JobListResultV2Iterator) NotDone() bool { 4577 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4578} 4579 4580// Response returns the raw server response from the last page request. 4581func (iter JobListResultV2Iterator) Response() JobListResultV2 { 4582 return iter.page.Response() 4583} 4584 4585// Value returns the current value or a zero-initialized value if the 4586// iterator has advanced beyond the end of the collection. 4587func (iter JobListResultV2Iterator) Value() JobCollectionItem { 4588 if !iter.page.NotDone() { 4589 return JobCollectionItem{} 4590 } 4591 return iter.page.Values()[iter.i] 4592} 4593 4594// Creates a new instance of the JobListResultV2Iterator type. 4595func NewJobListResultV2Iterator(page JobListResultV2Page) JobListResultV2Iterator { 4596 return JobListResultV2Iterator{page: page} 4597} 4598 4599// IsEmpty returns true if the ListResult contains no values. 4600func (jlrv JobListResultV2) IsEmpty() bool { 4601 return jlrv.Value == nil || len(*jlrv.Value) == 0 4602} 4603 4604// hasNextLink returns true if the NextLink is not empty. 4605func (jlrv JobListResultV2) hasNextLink() bool { 4606 return jlrv.NextLink != nil && len(*jlrv.NextLink) != 0 4607} 4608 4609// jobListResultV2Preparer prepares a request to retrieve the next set of results. 4610// It returns nil if no more results exist. 4611func (jlrv JobListResultV2) jobListResultV2Preparer(ctx context.Context) (*http.Request, error) { 4612 if !jlrv.hasNextLink() { 4613 return nil, nil 4614 } 4615 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4616 autorest.AsJSON(), 4617 autorest.AsGet(), 4618 autorest.WithBaseURL(to.String(jlrv.NextLink))) 4619} 4620 4621// JobListResultV2Page contains a page of JobCollectionItem values. 4622type JobListResultV2Page struct { 4623 fn func(context.Context, JobListResultV2) (JobListResultV2, error) 4624 jlrv JobListResultV2 4625} 4626 4627// NextWithContext advances to the next page of values. If there was an error making 4628// the request the page does not advance and the error is returned. 4629func (page *JobListResultV2Page) NextWithContext(ctx context.Context) (err error) { 4630 if tracing.IsEnabled() { 4631 ctx = tracing.StartSpan(ctx, fqdn+"/JobListResultV2Page.NextWithContext") 4632 defer func() { 4633 sc := -1 4634 if page.Response().Response.Response != nil { 4635 sc = page.Response().Response.Response.StatusCode 4636 } 4637 tracing.EndSpan(ctx, sc, err) 4638 }() 4639 } 4640 for { 4641 next, err := page.fn(ctx, page.jlrv) 4642 if err != nil { 4643 return err 4644 } 4645 page.jlrv = next 4646 if !next.hasNextLink() || !next.IsEmpty() { 4647 break 4648 } 4649 } 4650 return nil 4651} 4652 4653// Next advances to the next page of values. If there was an error making 4654// the request the page does not advance and the error is returned. 4655// Deprecated: Use NextWithContext() instead. 4656func (page *JobListResultV2Page) Next() error { 4657 return page.NextWithContext(context.Background()) 4658} 4659 4660// NotDone returns true if the page enumeration should be started or is not yet complete. 4661func (page JobListResultV2Page) NotDone() bool { 4662 return !page.jlrv.IsEmpty() 4663} 4664 4665// Response returns the raw server response from the last page request. 4666func (page JobListResultV2Page) Response() JobListResultV2 { 4667 return page.jlrv 4668} 4669 4670// Values returns the slice of values for the current page or nil if there are no values. 4671func (page JobListResultV2Page) Values() []JobCollectionItem { 4672 if page.jlrv.IsEmpty() { 4673 return nil 4674 } 4675 return *page.jlrv.Value 4676} 4677 4678// Creates a new instance of the JobListResultV2Page type. 4679func NewJobListResultV2Page(cur JobListResultV2, getNextPage func(context.Context, JobListResultV2) (JobListResultV2, error)) JobListResultV2Page { 4680 return JobListResultV2Page{ 4681 fn: getNextPage, 4682 jlrv: cur, 4683 } 4684} 4685 4686// JobNavigation software update configuration machine run job navigation properties. 4687type JobNavigation struct { 4688 // ID - READ-ONLY; Id of the job associated with the software update configuration run 4689 ID *string `json:"id,omitempty"` 4690} 4691 4692// MarshalJSON is the custom marshaler for JobNavigation. 4693func (jn JobNavigation) MarshalJSON() ([]byte, error) { 4694 objectMap := make(map[string]interface{}) 4695 return json.Marshal(objectMap) 4696} 4697 4698// JobProperties definition of job properties. 4699type JobProperties struct { 4700 // Runbook - Gets or sets the runbook. 4701 Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` 4702 // StartedBy - Gets or sets the job started by. 4703 StartedBy *string `json:"startedBy,omitempty"` 4704 // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. 4705 RunOn *string `json:"runOn,omitempty"` 4706 // JobID - Gets or sets the id of the job. 4707 JobID *uuid.UUID `json:"jobId,omitempty"` 4708 // CreationTime - Gets or sets the creation time of the job. 4709 CreationTime *date.Time `json:"creationTime,omitempty"` 4710 // Status - Gets or sets the status of the job. Possible values include: 'JobStatusNew', 'JobStatusActivating', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusStopped', 'JobStatusBlocked', 'JobStatusSuspended', 'JobStatusDisconnected', 'JobStatusSuspending', 'JobStatusStopping', 'JobStatusResuming', 'JobStatusRemoving' 4711 Status JobStatus `json:"status,omitempty"` 4712 // StatusDetails - Gets or sets the status details of the job. 4713 StatusDetails *string `json:"statusDetails,omitempty"` 4714 // StartTime - Gets or sets the start time of the job. 4715 StartTime *date.Time `json:"startTime,omitempty"` 4716 // EndTime - Gets or sets the end time of the job. 4717 EndTime *date.Time `json:"endTime,omitempty"` 4718 // Exception - Gets or sets the exception of the job. 4719 Exception *string `json:"exception,omitempty"` 4720 // LastModifiedTime - Gets or sets the last modified time of the job. 4721 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 4722 // LastStatusModifiedTime - Gets or sets the last status modified time of the job. 4723 LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` 4724 // Parameters - Gets or sets the parameters of the job. 4725 Parameters map[string]*string `json:"parameters"` 4726 // ProvisioningState - The current provisioning state of the job. Possible values include: 'JobProvisioningStateFailed', 'JobProvisioningStateSucceeded', 'JobProvisioningStateSuspended', 'JobProvisioningStateProcessing' 4727 ProvisioningState JobProvisioningState `json:"provisioningState,omitempty"` 4728} 4729 4730// MarshalJSON is the custom marshaler for JobProperties. 4731func (jp JobProperties) MarshalJSON() ([]byte, error) { 4732 objectMap := make(map[string]interface{}) 4733 if jp.Runbook != nil { 4734 objectMap["runbook"] = jp.Runbook 4735 } 4736 if jp.StartedBy != nil { 4737 objectMap["startedBy"] = jp.StartedBy 4738 } 4739 if jp.RunOn != nil { 4740 objectMap["runOn"] = jp.RunOn 4741 } 4742 if jp.JobID != nil { 4743 objectMap["jobId"] = jp.JobID 4744 } 4745 if jp.CreationTime != nil { 4746 objectMap["creationTime"] = jp.CreationTime 4747 } 4748 if jp.Status != "" { 4749 objectMap["status"] = jp.Status 4750 } 4751 if jp.StatusDetails != nil { 4752 objectMap["statusDetails"] = jp.StatusDetails 4753 } 4754 if jp.StartTime != nil { 4755 objectMap["startTime"] = jp.StartTime 4756 } 4757 if jp.EndTime != nil { 4758 objectMap["endTime"] = jp.EndTime 4759 } 4760 if jp.Exception != nil { 4761 objectMap["exception"] = jp.Exception 4762 } 4763 if jp.LastModifiedTime != nil { 4764 objectMap["lastModifiedTime"] = jp.LastModifiedTime 4765 } 4766 if jp.LastStatusModifiedTime != nil { 4767 objectMap["lastStatusModifiedTime"] = jp.LastStatusModifiedTime 4768 } 4769 if jp.Parameters != nil { 4770 objectMap["parameters"] = jp.Parameters 4771 } 4772 if jp.ProvisioningState != "" { 4773 objectMap["provisioningState"] = jp.ProvisioningState 4774 } 4775 return json.Marshal(objectMap) 4776} 4777 4778// JobSchedule definition of the job schedule. 4779type JobSchedule struct { 4780 autorest.Response `json:"-"` 4781 // ID - READ-ONLY; Gets the id of the resource. 4782 ID *string `json:"id,omitempty"` 4783 // Name - READ-ONLY; Gets the name of the variable. 4784 Name *string `json:"name,omitempty"` 4785 // Type - READ-ONLY; Resource type 4786 Type *string `json:"type,omitempty"` 4787 // JobScheduleProperties - Gets or sets the properties of the job schedule. 4788 *JobScheduleProperties `json:"properties,omitempty"` 4789} 4790 4791// MarshalJSON is the custom marshaler for JobSchedule. 4792func (js JobSchedule) MarshalJSON() ([]byte, error) { 4793 objectMap := make(map[string]interface{}) 4794 if js.JobScheduleProperties != nil { 4795 objectMap["properties"] = js.JobScheduleProperties 4796 } 4797 return json.Marshal(objectMap) 4798} 4799 4800// UnmarshalJSON is the custom unmarshaler for JobSchedule struct. 4801func (js *JobSchedule) UnmarshalJSON(body []byte) error { 4802 var m map[string]*json.RawMessage 4803 err := json.Unmarshal(body, &m) 4804 if err != nil { 4805 return err 4806 } 4807 for k, v := range m { 4808 switch k { 4809 case "id": 4810 if v != nil { 4811 var ID string 4812 err = json.Unmarshal(*v, &ID) 4813 if err != nil { 4814 return err 4815 } 4816 js.ID = &ID 4817 } 4818 case "name": 4819 if v != nil { 4820 var name string 4821 err = json.Unmarshal(*v, &name) 4822 if err != nil { 4823 return err 4824 } 4825 js.Name = &name 4826 } 4827 case "type": 4828 if v != nil { 4829 var typeVar string 4830 err = json.Unmarshal(*v, &typeVar) 4831 if err != nil { 4832 return err 4833 } 4834 js.Type = &typeVar 4835 } 4836 case "properties": 4837 if v != nil { 4838 var jobScheduleProperties JobScheduleProperties 4839 err = json.Unmarshal(*v, &jobScheduleProperties) 4840 if err != nil { 4841 return err 4842 } 4843 js.JobScheduleProperties = &jobScheduleProperties 4844 } 4845 } 4846 } 4847 4848 return nil 4849} 4850 4851// JobScheduleCreateParameters the parameters supplied to the create job schedule operation. 4852type JobScheduleCreateParameters struct { 4853 // JobScheduleCreateProperties - Gets or sets the list of job schedule properties. 4854 *JobScheduleCreateProperties `json:"properties,omitempty"` 4855} 4856 4857// MarshalJSON is the custom marshaler for JobScheduleCreateParameters. 4858func (jscp JobScheduleCreateParameters) MarshalJSON() ([]byte, error) { 4859 objectMap := make(map[string]interface{}) 4860 if jscp.JobScheduleCreateProperties != nil { 4861 objectMap["properties"] = jscp.JobScheduleCreateProperties 4862 } 4863 return json.Marshal(objectMap) 4864} 4865 4866// UnmarshalJSON is the custom unmarshaler for JobScheduleCreateParameters struct. 4867func (jscp *JobScheduleCreateParameters) UnmarshalJSON(body []byte) error { 4868 var m map[string]*json.RawMessage 4869 err := json.Unmarshal(body, &m) 4870 if err != nil { 4871 return err 4872 } 4873 for k, v := range m { 4874 switch k { 4875 case "properties": 4876 if v != nil { 4877 var jobScheduleCreateProperties JobScheduleCreateProperties 4878 err = json.Unmarshal(*v, &jobScheduleCreateProperties) 4879 if err != nil { 4880 return err 4881 } 4882 jscp.JobScheduleCreateProperties = &jobScheduleCreateProperties 4883 } 4884 } 4885 } 4886 4887 return nil 4888} 4889 4890// JobScheduleCreateProperties the parameters supplied to the create job schedule operation. 4891type JobScheduleCreateProperties struct { 4892 // Schedule - Gets or sets the schedule. 4893 Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` 4894 // Runbook - Gets or sets the runbook. 4895 Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` 4896 // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. 4897 RunOn *string `json:"runOn,omitempty"` 4898 // Parameters - Gets or sets a list of job properties. 4899 Parameters map[string]*string `json:"parameters"` 4900} 4901 4902// MarshalJSON is the custom marshaler for JobScheduleCreateProperties. 4903func (jscp JobScheduleCreateProperties) MarshalJSON() ([]byte, error) { 4904 objectMap := make(map[string]interface{}) 4905 if jscp.Schedule != nil { 4906 objectMap["schedule"] = jscp.Schedule 4907 } 4908 if jscp.Runbook != nil { 4909 objectMap["runbook"] = jscp.Runbook 4910 } 4911 if jscp.RunOn != nil { 4912 objectMap["runOn"] = jscp.RunOn 4913 } 4914 if jscp.Parameters != nil { 4915 objectMap["parameters"] = jscp.Parameters 4916 } 4917 return json.Marshal(objectMap) 4918} 4919 4920// JobScheduleListResult the response model for the list job schedule operation. 4921type JobScheduleListResult struct { 4922 autorest.Response `json:"-"` 4923 // Value - Gets or sets a list of job schedules. 4924 Value *[]JobSchedule `json:"value,omitempty"` 4925 // NextLink - Gets or sets the next link. 4926 NextLink *string `json:"nextLink,omitempty"` 4927} 4928 4929// JobScheduleListResultIterator provides access to a complete listing of JobSchedule values. 4930type JobScheduleListResultIterator struct { 4931 i int 4932 page JobScheduleListResultPage 4933} 4934 4935// NextWithContext advances to the next value. If there was an error making 4936// the request the iterator does not advance and the error is returned. 4937func (iter *JobScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) { 4938 if tracing.IsEnabled() { 4939 ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleListResultIterator.NextWithContext") 4940 defer func() { 4941 sc := -1 4942 if iter.Response().Response.Response != nil { 4943 sc = iter.Response().Response.Response.StatusCode 4944 } 4945 tracing.EndSpan(ctx, sc, err) 4946 }() 4947 } 4948 iter.i++ 4949 if iter.i < len(iter.page.Values()) { 4950 return nil 4951 } 4952 err = iter.page.NextWithContext(ctx) 4953 if err != nil { 4954 iter.i-- 4955 return err 4956 } 4957 iter.i = 0 4958 return nil 4959} 4960 4961// Next advances to the next value. If there was an error making 4962// the request the iterator does not advance and the error is returned. 4963// Deprecated: Use NextWithContext() instead. 4964func (iter *JobScheduleListResultIterator) Next() error { 4965 return iter.NextWithContext(context.Background()) 4966} 4967 4968// NotDone returns true if the enumeration should be started or is not yet complete. 4969func (iter JobScheduleListResultIterator) NotDone() bool { 4970 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4971} 4972 4973// Response returns the raw server response from the last page request. 4974func (iter JobScheduleListResultIterator) Response() JobScheduleListResult { 4975 return iter.page.Response() 4976} 4977 4978// Value returns the current value or a zero-initialized value if the 4979// iterator has advanced beyond the end of the collection. 4980func (iter JobScheduleListResultIterator) Value() JobSchedule { 4981 if !iter.page.NotDone() { 4982 return JobSchedule{} 4983 } 4984 return iter.page.Values()[iter.i] 4985} 4986 4987// Creates a new instance of the JobScheduleListResultIterator type. 4988func NewJobScheduleListResultIterator(page JobScheduleListResultPage) JobScheduleListResultIterator { 4989 return JobScheduleListResultIterator{page: page} 4990} 4991 4992// IsEmpty returns true if the ListResult contains no values. 4993func (jslr JobScheduleListResult) IsEmpty() bool { 4994 return jslr.Value == nil || len(*jslr.Value) == 0 4995} 4996 4997// hasNextLink returns true if the NextLink is not empty. 4998func (jslr JobScheduleListResult) hasNextLink() bool { 4999 return jslr.NextLink != nil && len(*jslr.NextLink) != 0 5000} 5001 5002// jobScheduleListResultPreparer prepares a request to retrieve the next set of results. 5003// It returns nil if no more results exist. 5004func (jslr JobScheduleListResult) jobScheduleListResultPreparer(ctx context.Context) (*http.Request, error) { 5005 if !jslr.hasNextLink() { 5006 return nil, nil 5007 } 5008 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5009 autorest.AsJSON(), 5010 autorest.AsGet(), 5011 autorest.WithBaseURL(to.String(jslr.NextLink))) 5012} 5013 5014// JobScheduleListResultPage contains a page of JobSchedule values. 5015type JobScheduleListResultPage struct { 5016 fn func(context.Context, JobScheduleListResult) (JobScheduleListResult, error) 5017 jslr JobScheduleListResult 5018} 5019 5020// NextWithContext advances to the next page of values. If there was an error making 5021// the request the page does not advance and the error is returned. 5022func (page *JobScheduleListResultPage) NextWithContext(ctx context.Context) (err error) { 5023 if tracing.IsEnabled() { 5024 ctx = tracing.StartSpan(ctx, fqdn+"/JobScheduleListResultPage.NextWithContext") 5025 defer func() { 5026 sc := -1 5027 if page.Response().Response.Response != nil { 5028 sc = page.Response().Response.Response.StatusCode 5029 } 5030 tracing.EndSpan(ctx, sc, err) 5031 }() 5032 } 5033 for { 5034 next, err := page.fn(ctx, page.jslr) 5035 if err != nil { 5036 return err 5037 } 5038 page.jslr = next 5039 if !next.hasNextLink() || !next.IsEmpty() { 5040 break 5041 } 5042 } 5043 return nil 5044} 5045 5046// Next advances to the next page of values. If there was an error making 5047// the request the page does not advance and the error is returned. 5048// Deprecated: Use NextWithContext() instead. 5049func (page *JobScheduleListResultPage) Next() error { 5050 return page.NextWithContext(context.Background()) 5051} 5052 5053// NotDone returns true if the page enumeration should be started or is not yet complete. 5054func (page JobScheduleListResultPage) NotDone() bool { 5055 return !page.jslr.IsEmpty() 5056} 5057 5058// Response returns the raw server response from the last page request. 5059func (page JobScheduleListResultPage) Response() JobScheduleListResult { 5060 return page.jslr 5061} 5062 5063// Values returns the slice of values for the current page or nil if there are no values. 5064func (page JobScheduleListResultPage) Values() []JobSchedule { 5065 if page.jslr.IsEmpty() { 5066 return nil 5067 } 5068 return *page.jslr.Value 5069} 5070 5071// Creates a new instance of the JobScheduleListResultPage type. 5072func NewJobScheduleListResultPage(cur JobScheduleListResult, getNextPage func(context.Context, JobScheduleListResult) (JobScheduleListResult, error)) JobScheduleListResultPage { 5073 return JobScheduleListResultPage{ 5074 fn: getNextPage, 5075 jslr: cur, 5076 } 5077} 5078 5079// JobScheduleProperties definition of job schedule parameters. 5080type JobScheduleProperties struct { 5081 // JobScheduleID - Gets or sets the id of job schedule. 5082 JobScheduleID *string `json:"jobScheduleId,omitempty"` 5083 // Schedule - Gets or sets the schedule. 5084 Schedule *ScheduleAssociationProperty `json:"schedule,omitempty"` 5085 // Runbook - Gets or sets the runbook. 5086 Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` 5087 // RunOn - Gets or sets the hybrid worker group that the scheduled job should run on. 5088 RunOn *string `json:"runOn,omitempty"` 5089 // Parameters - Gets or sets the parameters of the job schedule. 5090 Parameters map[string]*string `json:"parameters"` 5091} 5092 5093// MarshalJSON is the custom marshaler for JobScheduleProperties. 5094func (jsp JobScheduleProperties) MarshalJSON() ([]byte, error) { 5095 objectMap := make(map[string]interface{}) 5096 if jsp.JobScheduleID != nil { 5097 objectMap["jobScheduleId"] = jsp.JobScheduleID 5098 } 5099 if jsp.Schedule != nil { 5100 objectMap["schedule"] = jsp.Schedule 5101 } 5102 if jsp.Runbook != nil { 5103 objectMap["runbook"] = jsp.Runbook 5104 } 5105 if jsp.RunOn != nil { 5106 objectMap["runOn"] = jsp.RunOn 5107 } 5108 if jsp.Parameters != nil { 5109 objectMap["parameters"] = jsp.Parameters 5110 } 5111 return json.Marshal(objectMap) 5112} 5113 5114// JobStream definition of the job stream. 5115type JobStream struct { 5116 autorest.Response `json:"-"` 5117 // ID - Gets or sets the id of the resource. 5118 ID *string `json:"id,omitempty"` 5119 // JobStreamProperties - Gets or sets the id of the job stream. 5120 *JobStreamProperties `json:"properties,omitempty"` 5121} 5122 5123// MarshalJSON is the custom marshaler for JobStream. 5124func (js JobStream) MarshalJSON() ([]byte, error) { 5125 objectMap := make(map[string]interface{}) 5126 if js.ID != nil { 5127 objectMap["id"] = js.ID 5128 } 5129 if js.JobStreamProperties != nil { 5130 objectMap["properties"] = js.JobStreamProperties 5131 } 5132 return json.Marshal(objectMap) 5133} 5134 5135// UnmarshalJSON is the custom unmarshaler for JobStream struct. 5136func (js *JobStream) UnmarshalJSON(body []byte) error { 5137 var m map[string]*json.RawMessage 5138 err := json.Unmarshal(body, &m) 5139 if err != nil { 5140 return err 5141 } 5142 for k, v := range m { 5143 switch k { 5144 case "id": 5145 if v != nil { 5146 var ID string 5147 err = json.Unmarshal(*v, &ID) 5148 if err != nil { 5149 return err 5150 } 5151 js.ID = &ID 5152 } 5153 case "properties": 5154 if v != nil { 5155 var jobStreamProperties JobStreamProperties 5156 err = json.Unmarshal(*v, &jobStreamProperties) 5157 if err != nil { 5158 return err 5159 } 5160 js.JobStreamProperties = &jobStreamProperties 5161 } 5162 } 5163 } 5164 5165 return nil 5166} 5167 5168// JobStreamListResult the response model for the list job stream operation. 5169type JobStreamListResult struct { 5170 autorest.Response `json:"-"` 5171 // Value - A list of job streams. 5172 Value *[]JobStream `json:"value,omitempty"` 5173 // NextLink - Gets or sets the next link. 5174 NextLink *string `json:"nextLink,omitempty"` 5175} 5176 5177// JobStreamListResultIterator provides access to a complete listing of JobStream values. 5178type JobStreamListResultIterator struct { 5179 i int 5180 page JobStreamListResultPage 5181} 5182 5183// NextWithContext advances to the next value. If there was an error making 5184// the request the iterator does not advance and the error is returned. 5185func (iter *JobStreamListResultIterator) NextWithContext(ctx context.Context) (err error) { 5186 if tracing.IsEnabled() { 5187 ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamListResultIterator.NextWithContext") 5188 defer func() { 5189 sc := -1 5190 if iter.Response().Response.Response != nil { 5191 sc = iter.Response().Response.Response.StatusCode 5192 } 5193 tracing.EndSpan(ctx, sc, err) 5194 }() 5195 } 5196 iter.i++ 5197 if iter.i < len(iter.page.Values()) { 5198 return nil 5199 } 5200 err = iter.page.NextWithContext(ctx) 5201 if err != nil { 5202 iter.i-- 5203 return err 5204 } 5205 iter.i = 0 5206 return nil 5207} 5208 5209// Next advances to the next value. If there was an error making 5210// the request the iterator does not advance and the error is returned. 5211// Deprecated: Use NextWithContext() instead. 5212func (iter *JobStreamListResultIterator) Next() error { 5213 return iter.NextWithContext(context.Background()) 5214} 5215 5216// NotDone returns true if the enumeration should be started or is not yet complete. 5217func (iter JobStreamListResultIterator) NotDone() bool { 5218 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5219} 5220 5221// Response returns the raw server response from the last page request. 5222func (iter JobStreamListResultIterator) Response() JobStreamListResult { 5223 return iter.page.Response() 5224} 5225 5226// Value returns the current value or a zero-initialized value if the 5227// iterator has advanced beyond the end of the collection. 5228func (iter JobStreamListResultIterator) Value() JobStream { 5229 if !iter.page.NotDone() { 5230 return JobStream{} 5231 } 5232 return iter.page.Values()[iter.i] 5233} 5234 5235// Creates a new instance of the JobStreamListResultIterator type. 5236func NewJobStreamListResultIterator(page JobStreamListResultPage) JobStreamListResultIterator { 5237 return JobStreamListResultIterator{page: page} 5238} 5239 5240// IsEmpty returns true if the ListResult contains no values. 5241func (jslr JobStreamListResult) IsEmpty() bool { 5242 return jslr.Value == nil || len(*jslr.Value) == 0 5243} 5244 5245// hasNextLink returns true if the NextLink is not empty. 5246func (jslr JobStreamListResult) hasNextLink() bool { 5247 return jslr.NextLink != nil && len(*jslr.NextLink) != 0 5248} 5249 5250// jobStreamListResultPreparer prepares a request to retrieve the next set of results. 5251// It returns nil if no more results exist. 5252func (jslr JobStreamListResult) jobStreamListResultPreparer(ctx context.Context) (*http.Request, error) { 5253 if !jslr.hasNextLink() { 5254 return nil, nil 5255 } 5256 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5257 autorest.AsJSON(), 5258 autorest.AsGet(), 5259 autorest.WithBaseURL(to.String(jslr.NextLink))) 5260} 5261 5262// JobStreamListResultPage contains a page of JobStream values. 5263type JobStreamListResultPage struct { 5264 fn func(context.Context, JobStreamListResult) (JobStreamListResult, error) 5265 jslr JobStreamListResult 5266} 5267 5268// NextWithContext advances to the next page of values. If there was an error making 5269// the request the page does not advance and the error is returned. 5270func (page *JobStreamListResultPage) NextWithContext(ctx context.Context) (err error) { 5271 if tracing.IsEnabled() { 5272 ctx = tracing.StartSpan(ctx, fqdn+"/JobStreamListResultPage.NextWithContext") 5273 defer func() { 5274 sc := -1 5275 if page.Response().Response.Response != nil { 5276 sc = page.Response().Response.Response.StatusCode 5277 } 5278 tracing.EndSpan(ctx, sc, err) 5279 }() 5280 } 5281 for { 5282 next, err := page.fn(ctx, page.jslr) 5283 if err != nil { 5284 return err 5285 } 5286 page.jslr = next 5287 if !next.hasNextLink() || !next.IsEmpty() { 5288 break 5289 } 5290 } 5291 return nil 5292} 5293 5294// Next advances to the next page of values. If there was an error making 5295// the request the page does not advance and the error is returned. 5296// Deprecated: Use NextWithContext() instead. 5297func (page *JobStreamListResultPage) Next() error { 5298 return page.NextWithContext(context.Background()) 5299} 5300 5301// NotDone returns true if the page enumeration should be started or is not yet complete. 5302func (page JobStreamListResultPage) NotDone() bool { 5303 return !page.jslr.IsEmpty() 5304} 5305 5306// Response returns the raw server response from the last page request. 5307func (page JobStreamListResultPage) Response() JobStreamListResult { 5308 return page.jslr 5309} 5310 5311// Values returns the slice of values for the current page or nil if there are no values. 5312func (page JobStreamListResultPage) Values() []JobStream { 5313 if page.jslr.IsEmpty() { 5314 return nil 5315 } 5316 return *page.jslr.Value 5317} 5318 5319// Creates a new instance of the JobStreamListResultPage type. 5320func NewJobStreamListResultPage(cur JobStreamListResult, getNextPage func(context.Context, JobStreamListResult) (JobStreamListResult, error)) JobStreamListResultPage { 5321 return JobStreamListResultPage{ 5322 fn: getNextPage, 5323 jslr: cur, 5324 } 5325} 5326 5327// JobStreamProperties definition of the job stream. 5328type JobStreamProperties struct { 5329 // JobStreamID - Gets or sets the id of the job stream. 5330 JobStreamID *string `json:"jobStreamId,omitempty"` 5331 // Time - Gets or sets the creation time of the job. 5332 Time *date.Time `json:"time,omitempty"` 5333 // StreamType - Gets or sets the stream type. Possible values include: 'Progress', 'Output', 'Warning', 'Error', 'Debug', 'Verbose', 'Any' 5334 StreamType JobStreamType `json:"streamType,omitempty"` 5335 // StreamText - Gets or sets the stream text. 5336 StreamText *string `json:"streamText,omitempty"` 5337 // Summary - Gets or sets the summary. 5338 Summary *string `json:"summary,omitempty"` 5339 // Value - Gets or sets the values of the job stream. 5340 Value map[string]interface{} `json:"value"` 5341} 5342 5343// MarshalJSON is the custom marshaler for JobStreamProperties. 5344func (jsp JobStreamProperties) MarshalJSON() ([]byte, error) { 5345 objectMap := make(map[string]interface{}) 5346 if jsp.JobStreamID != nil { 5347 objectMap["jobStreamId"] = jsp.JobStreamID 5348 } 5349 if jsp.Time != nil { 5350 objectMap["time"] = jsp.Time 5351 } 5352 if jsp.StreamType != "" { 5353 objectMap["streamType"] = jsp.StreamType 5354 } 5355 if jsp.StreamText != nil { 5356 objectMap["streamText"] = jsp.StreamText 5357 } 5358 if jsp.Summary != nil { 5359 objectMap["summary"] = jsp.Summary 5360 } 5361 if jsp.Value != nil { 5362 objectMap["value"] = jsp.Value 5363 } 5364 return json.Marshal(objectMap) 5365} 5366 5367// Key automation key which is used to register a DSC Node 5368type Key struct { 5369 // KeyName - READ-ONLY; Automation key name. Possible values include: 'KeyNamePrimary', 'KeyNameSecondary' 5370 KeyName KeyName `json:"KeyName,omitempty"` 5371 // Permissions - READ-ONLY; Automation key permissions. Possible values include: 'Read', 'Full' 5372 Permissions KeyPermissions `json:"Permissions,omitempty"` 5373 // Value - READ-ONLY; Value of the Automation Key used for registration. 5374 Value *string `json:"Value,omitempty"` 5375} 5376 5377// MarshalJSON is the custom marshaler for Key. 5378func (kVar Key) MarshalJSON() ([]byte, error) { 5379 objectMap := make(map[string]interface{}) 5380 return json.Marshal(objectMap) 5381} 5382 5383// KeyListResult ... 5384type KeyListResult struct { 5385 autorest.Response `json:"-"` 5386 // Keys - Lists the automation keys. 5387 Keys *[]Key `json:"keys,omitempty"` 5388} 5389 5390// LinkedWorkspace definition of the linked workspace. 5391type LinkedWorkspace struct { 5392 autorest.Response `json:"-"` 5393 // ID - READ-ONLY; Gets the id of the linked workspace. 5394 ID *string `json:"id,omitempty"` 5395} 5396 5397// MarshalJSON is the custom marshaler for LinkedWorkspace. 5398func (lw LinkedWorkspace) MarshalJSON() ([]byte, error) { 5399 objectMap := make(map[string]interface{}) 5400 return json.Marshal(objectMap) 5401} 5402 5403// LinuxProperties linux specific update configuration. 5404type LinuxProperties struct { 5405 // IncludedPackageClassifications - Update classifications included in the software update configuration. Possible values include: 'Unclassified', 'Critical', 'Security', 'Other' 5406 IncludedPackageClassifications LinuxUpdateClasses `json:"includedPackageClassifications,omitempty"` 5407 // ExcludedPackageNameMasks - packages excluded from the software update configuration. 5408 ExcludedPackageNameMasks *[]string `json:"excludedPackageNameMasks,omitempty"` 5409 // IncludedPackageNameMasks - packages included from the software update configuration. 5410 IncludedPackageNameMasks *[]string `json:"includedPackageNameMasks,omitempty"` 5411 // RebootSetting - Reboot setting for the software update configuration. 5412 RebootSetting *string `json:"rebootSetting,omitempty"` 5413} 5414 5415// Module definition of the module type. 5416type Module struct { 5417 autorest.Response `json:"-"` 5418 // ModuleProperties - Gets or sets the module properties. 5419 *ModuleProperties `json:"properties,omitempty"` 5420 // Etag - Gets or sets the etag of the resource. 5421 Etag *string `json:"etag,omitempty"` 5422 // Tags - Resource tags. 5423 Tags map[string]*string `json:"tags"` 5424 // Location - The Azure Region where the resource lives 5425 Location *string `json:"location,omitempty"` 5426 // ID - READ-ONLY; Fully qualified resource Id for the resource 5427 ID *string `json:"id,omitempty"` 5428 // Name - READ-ONLY; The name of the resource 5429 Name *string `json:"name,omitempty"` 5430 // Type - READ-ONLY; The type of the resource. 5431 Type *string `json:"type,omitempty"` 5432} 5433 5434// MarshalJSON is the custom marshaler for Module. 5435func (mVar Module) MarshalJSON() ([]byte, error) { 5436 objectMap := make(map[string]interface{}) 5437 if mVar.ModuleProperties != nil { 5438 objectMap["properties"] = mVar.ModuleProperties 5439 } 5440 if mVar.Etag != nil { 5441 objectMap["etag"] = mVar.Etag 5442 } 5443 if mVar.Tags != nil { 5444 objectMap["tags"] = mVar.Tags 5445 } 5446 if mVar.Location != nil { 5447 objectMap["location"] = mVar.Location 5448 } 5449 return json.Marshal(objectMap) 5450} 5451 5452// UnmarshalJSON is the custom unmarshaler for Module struct. 5453func (mVar *Module) UnmarshalJSON(body []byte) error { 5454 var m map[string]*json.RawMessage 5455 err := json.Unmarshal(body, &m) 5456 if err != nil { 5457 return err 5458 } 5459 for k, v := range m { 5460 switch k { 5461 case "properties": 5462 if v != nil { 5463 var moduleProperties ModuleProperties 5464 err = json.Unmarshal(*v, &moduleProperties) 5465 if err != nil { 5466 return err 5467 } 5468 mVar.ModuleProperties = &moduleProperties 5469 } 5470 case "etag": 5471 if v != nil { 5472 var etag string 5473 err = json.Unmarshal(*v, &etag) 5474 if err != nil { 5475 return err 5476 } 5477 mVar.Etag = &etag 5478 } 5479 case "tags": 5480 if v != nil { 5481 var tags map[string]*string 5482 err = json.Unmarshal(*v, &tags) 5483 if err != nil { 5484 return err 5485 } 5486 mVar.Tags = tags 5487 } 5488 case "location": 5489 if v != nil { 5490 var location string 5491 err = json.Unmarshal(*v, &location) 5492 if err != nil { 5493 return err 5494 } 5495 mVar.Location = &location 5496 } 5497 case "id": 5498 if v != nil { 5499 var ID string 5500 err = json.Unmarshal(*v, &ID) 5501 if err != nil { 5502 return err 5503 } 5504 mVar.ID = &ID 5505 } 5506 case "name": 5507 if v != nil { 5508 var name string 5509 err = json.Unmarshal(*v, &name) 5510 if err != nil { 5511 return err 5512 } 5513 mVar.Name = &name 5514 } 5515 case "type": 5516 if v != nil { 5517 var typeVar string 5518 err = json.Unmarshal(*v, &typeVar) 5519 if err != nil { 5520 return err 5521 } 5522 mVar.Type = &typeVar 5523 } 5524 } 5525 } 5526 5527 return nil 5528} 5529 5530// ModuleCreateOrUpdateParameters the parameters supplied to the create or update module operation. 5531type ModuleCreateOrUpdateParameters struct { 5532 // ModuleCreateOrUpdateProperties - Gets or sets the module create properties. 5533 *ModuleCreateOrUpdateProperties `json:"properties,omitempty"` 5534 // Name - Gets or sets name of the resource. 5535 Name *string `json:"name,omitempty"` 5536 // Location - Gets or sets the location of the resource. 5537 Location *string `json:"location,omitempty"` 5538 // Tags - Gets or sets the tags attached to the resource. 5539 Tags map[string]*string `json:"tags"` 5540} 5541 5542// MarshalJSON is the custom marshaler for ModuleCreateOrUpdateParameters. 5543func (mcoup ModuleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 5544 objectMap := make(map[string]interface{}) 5545 if mcoup.ModuleCreateOrUpdateProperties != nil { 5546 objectMap["properties"] = mcoup.ModuleCreateOrUpdateProperties 5547 } 5548 if mcoup.Name != nil { 5549 objectMap["name"] = mcoup.Name 5550 } 5551 if mcoup.Location != nil { 5552 objectMap["location"] = mcoup.Location 5553 } 5554 if mcoup.Tags != nil { 5555 objectMap["tags"] = mcoup.Tags 5556 } 5557 return json.Marshal(objectMap) 5558} 5559 5560// UnmarshalJSON is the custom unmarshaler for ModuleCreateOrUpdateParameters struct. 5561func (mcoup *ModuleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 5562 var m map[string]*json.RawMessage 5563 err := json.Unmarshal(body, &m) 5564 if err != nil { 5565 return err 5566 } 5567 for k, v := range m { 5568 switch k { 5569 case "properties": 5570 if v != nil { 5571 var moduleCreateOrUpdateProperties ModuleCreateOrUpdateProperties 5572 err = json.Unmarshal(*v, &moduleCreateOrUpdateProperties) 5573 if err != nil { 5574 return err 5575 } 5576 mcoup.ModuleCreateOrUpdateProperties = &moduleCreateOrUpdateProperties 5577 } 5578 case "name": 5579 if v != nil { 5580 var name string 5581 err = json.Unmarshal(*v, &name) 5582 if err != nil { 5583 return err 5584 } 5585 mcoup.Name = &name 5586 } 5587 case "location": 5588 if v != nil { 5589 var location string 5590 err = json.Unmarshal(*v, &location) 5591 if err != nil { 5592 return err 5593 } 5594 mcoup.Location = &location 5595 } 5596 case "tags": 5597 if v != nil { 5598 var tags map[string]*string 5599 err = json.Unmarshal(*v, &tags) 5600 if err != nil { 5601 return err 5602 } 5603 mcoup.Tags = tags 5604 } 5605 } 5606 } 5607 5608 return nil 5609} 5610 5611// ModuleCreateOrUpdateProperties the parameters supplied to the create or update module properties. 5612type ModuleCreateOrUpdateProperties struct { 5613 // ContentLink - Gets or sets the module content link. 5614 ContentLink *ContentLink `json:"contentLink,omitempty"` 5615} 5616 5617// ModuleErrorInfo definition of the module error info type. 5618type ModuleErrorInfo struct { 5619 // Code - Gets or sets the error code. 5620 Code *string `json:"code,omitempty"` 5621 // Message - Gets or sets the error message. 5622 Message *string `json:"message,omitempty"` 5623} 5624 5625// ModuleListResult the response model for the list module operation. 5626type ModuleListResult struct { 5627 autorest.Response `json:"-"` 5628 // Value - Gets or sets a list of modules. 5629 Value *[]Module `json:"value,omitempty"` 5630 // NextLink - Gets or sets the next link. 5631 NextLink *string `json:"nextLink,omitempty"` 5632} 5633 5634// ModuleListResultIterator provides access to a complete listing of Module values. 5635type ModuleListResultIterator struct { 5636 i int 5637 page ModuleListResultPage 5638} 5639 5640// NextWithContext advances to the next value. If there was an error making 5641// the request the iterator does not advance and the error is returned. 5642func (iter *ModuleListResultIterator) NextWithContext(ctx context.Context) (err error) { 5643 if tracing.IsEnabled() { 5644 ctx = tracing.StartSpan(ctx, fqdn+"/ModuleListResultIterator.NextWithContext") 5645 defer func() { 5646 sc := -1 5647 if iter.Response().Response.Response != nil { 5648 sc = iter.Response().Response.Response.StatusCode 5649 } 5650 tracing.EndSpan(ctx, sc, err) 5651 }() 5652 } 5653 iter.i++ 5654 if iter.i < len(iter.page.Values()) { 5655 return nil 5656 } 5657 err = iter.page.NextWithContext(ctx) 5658 if err != nil { 5659 iter.i-- 5660 return err 5661 } 5662 iter.i = 0 5663 return nil 5664} 5665 5666// Next advances to the next value. If there was an error making 5667// the request the iterator does not advance and the error is returned. 5668// Deprecated: Use NextWithContext() instead. 5669func (iter *ModuleListResultIterator) Next() error { 5670 return iter.NextWithContext(context.Background()) 5671} 5672 5673// NotDone returns true if the enumeration should be started or is not yet complete. 5674func (iter ModuleListResultIterator) NotDone() bool { 5675 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5676} 5677 5678// Response returns the raw server response from the last page request. 5679func (iter ModuleListResultIterator) Response() ModuleListResult { 5680 return iter.page.Response() 5681} 5682 5683// Value returns the current value or a zero-initialized value if the 5684// iterator has advanced beyond the end of the collection. 5685func (iter ModuleListResultIterator) Value() Module { 5686 if !iter.page.NotDone() { 5687 return Module{} 5688 } 5689 return iter.page.Values()[iter.i] 5690} 5691 5692// Creates a new instance of the ModuleListResultIterator type. 5693func NewModuleListResultIterator(page ModuleListResultPage) ModuleListResultIterator { 5694 return ModuleListResultIterator{page: page} 5695} 5696 5697// IsEmpty returns true if the ListResult contains no values. 5698func (mlr ModuleListResult) IsEmpty() bool { 5699 return mlr.Value == nil || len(*mlr.Value) == 0 5700} 5701 5702// hasNextLink returns true if the NextLink is not empty. 5703func (mlr ModuleListResult) hasNextLink() bool { 5704 return mlr.NextLink != nil && len(*mlr.NextLink) != 0 5705} 5706 5707// moduleListResultPreparer prepares a request to retrieve the next set of results. 5708// It returns nil if no more results exist. 5709func (mlr ModuleListResult) moduleListResultPreparer(ctx context.Context) (*http.Request, error) { 5710 if !mlr.hasNextLink() { 5711 return nil, nil 5712 } 5713 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5714 autorest.AsJSON(), 5715 autorest.AsGet(), 5716 autorest.WithBaseURL(to.String(mlr.NextLink))) 5717} 5718 5719// ModuleListResultPage contains a page of Module values. 5720type ModuleListResultPage struct { 5721 fn func(context.Context, ModuleListResult) (ModuleListResult, error) 5722 mlr ModuleListResult 5723} 5724 5725// NextWithContext advances to the next page of values. If there was an error making 5726// the request the page does not advance and the error is returned. 5727func (page *ModuleListResultPage) NextWithContext(ctx context.Context) (err error) { 5728 if tracing.IsEnabled() { 5729 ctx = tracing.StartSpan(ctx, fqdn+"/ModuleListResultPage.NextWithContext") 5730 defer func() { 5731 sc := -1 5732 if page.Response().Response.Response != nil { 5733 sc = page.Response().Response.Response.StatusCode 5734 } 5735 tracing.EndSpan(ctx, sc, err) 5736 }() 5737 } 5738 for { 5739 next, err := page.fn(ctx, page.mlr) 5740 if err != nil { 5741 return err 5742 } 5743 page.mlr = next 5744 if !next.hasNextLink() || !next.IsEmpty() { 5745 break 5746 } 5747 } 5748 return nil 5749} 5750 5751// Next advances to the next page of values. If there was an error making 5752// the request the page does not advance and the error is returned. 5753// Deprecated: Use NextWithContext() instead. 5754func (page *ModuleListResultPage) Next() error { 5755 return page.NextWithContext(context.Background()) 5756} 5757 5758// NotDone returns true if the page enumeration should be started or is not yet complete. 5759func (page ModuleListResultPage) NotDone() bool { 5760 return !page.mlr.IsEmpty() 5761} 5762 5763// Response returns the raw server response from the last page request. 5764func (page ModuleListResultPage) Response() ModuleListResult { 5765 return page.mlr 5766} 5767 5768// Values returns the slice of values for the current page or nil if there are no values. 5769func (page ModuleListResultPage) Values() []Module { 5770 if page.mlr.IsEmpty() { 5771 return nil 5772 } 5773 return *page.mlr.Value 5774} 5775 5776// Creates a new instance of the ModuleListResultPage type. 5777func NewModuleListResultPage(cur ModuleListResult, getNextPage func(context.Context, ModuleListResult) (ModuleListResult, error)) ModuleListResultPage { 5778 return ModuleListResultPage{ 5779 fn: getNextPage, 5780 mlr: cur, 5781 } 5782} 5783 5784// ModuleProperties definition of the module property type. 5785type ModuleProperties struct { 5786 // IsGlobal - Gets or sets the isGlobal flag of the module. 5787 IsGlobal *bool `json:"isGlobal,omitempty"` 5788 // Version - Gets or sets the version of the module. 5789 Version *string `json:"version,omitempty"` 5790 // SizeInBytes - Gets or sets the size in bytes of the module. 5791 SizeInBytes *int64 `json:"sizeInBytes,omitempty"` 5792 // ActivityCount - Gets or sets the activity count of the module. 5793 ActivityCount *int32 `json:"activityCount,omitempty"` 5794 // ProvisioningState - Gets or sets the provisioning state of the module. Possible values include: 'ModuleProvisioningStateCreated', 'ModuleProvisioningStateCreating', 'ModuleProvisioningStateStartingImportModuleRunbook', 'ModuleProvisioningStateRunningImportModuleRunbook', 'ModuleProvisioningStateContentRetrieved', 'ModuleProvisioningStateContentDownloaded', 'ModuleProvisioningStateContentValidated', 'ModuleProvisioningStateConnectionTypeImported', 'ModuleProvisioningStateContentStored', 'ModuleProvisioningStateModuleDataStored', 'ModuleProvisioningStateActivitiesStored', 'ModuleProvisioningStateModuleImportRunbookComplete', 'ModuleProvisioningStateSucceeded', 'ModuleProvisioningStateFailed', 'ModuleProvisioningStateCancelled', 'ModuleProvisioningStateUpdating' 5795 ProvisioningState ModuleProvisioningState `json:"provisioningState,omitempty"` 5796 // ContentLink - Gets or sets the contentLink of the module. 5797 ContentLink *ContentLink `json:"contentLink,omitempty"` 5798 // Error - Gets or sets the error info of the module. 5799 Error *ModuleErrorInfo `json:"error,omitempty"` 5800 // CreationTime - Gets or sets the creation time. 5801 CreationTime *date.Time `json:"creationTime,omitempty"` 5802 // LastModifiedTime - Gets or sets the last modified time. 5803 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 5804 // Description - Gets or sets the description. 5805 Description *string `json:"description,omitempty"` 5806 // IsComposite - Gets or sets type of module, if its composite or not. 5807 IsComposite *bool `json:"isComposite,omitempty"` 5808} 5809 5810// ModuleUpdateParameters the parameters supplied to the update module operation. 5811type ModuleUpdateParameters struct { 5812 // ModuleUpdateProperties - Gets or sets the module update properties. 5813 *ModuleUpdateProperties `json:"properties,omitempty"` 5814 // Name - Gets or sets name of the resource. 5815 Name *string `json:"name,omitempty"` 5816 // Location - Gets or sets the location of the resource. 5817 Location *string `json:"location,omitempty"` 5818 // Tags - Gets or sets the tags attached to the resource. 5819 Tags map[string]*string `json:"tags"` 5820} 5821 5822// MarshalJSON is the custom marshaler for ModuleUpdateParameters. 5823func (mup ModuleUpdateParameters) MarshalJSON() ([]byte, error) { 5824 objectMap := make(map[string]interface{}) 5825 if mup.ModuleUpdateProperties != nil { 5826 objectMap["properties"] = mup.ModuleUpdateProperties 5827 } 5828 if mup.Name != nil { 5829 objectMap["name"] = mup.Name 5830 } 5831 if mup.Location != nil { 5832 objectMap["location"] = mup.Location 5833 } 5834 if mup.Tags != nil { 5835 objectMap["tags"] = mup.Tags 5836 } 5837 return json.Marshal(objectMap) 5838} 5839 5840// UnmarshalJSON is the custom unmarshaler for ModuleUpdateParameters struct. 5841func (mup *ModuleUpdateParameters) UnmarshalJSON(body []byte) error { 5842 var m map[string]*json.RawMessage 5843 err := json.Unmarshal(body, &m) 5844 if err != nil { 5845 return err 5846 } 5847 for k, v := range m { 5848 switch k { 5849 case "properties": 5850 if v != nil { 5851 var moduleUpdateProperties ModuleUpdateProperties 5852 err = json.Unmarshal(*v, &moduleUpdateProperties) 5853 if err != nil { 5854 return err 5855 } 5856 mup.ModuleUpdateProperties = &moduleUpdateProperties 5857 } 5858 case "name": 5859 if v != nil { 5860 var name string 5861 err = json.Unmarshal(*v, &name) 5862 if err != nil { 5863 return err 5864 } 5865 mup.Name = &name 5866 } 5867 case "location": 5868 if v != nil { 5869 var location string 5870 err = json.Unmarshal(*v, &location) 5871 if err != nil { 5872 return err 5873 } 5874 mup.Location = &location 5875 } 5876 case "tags": 5877 if v != nil { 5878 var tags map[string]*string 5879 err = json.Unmarshal(*v, &tags) 5880 if err != nil { 5881 return err 5882 } 5883 mup.Tags = tags 5884 } 5885 } 5886 } 5887 5888 return nil 5889} 5890 5891// ModuleUpdateProperties the parameters supplied to the update properties. 5892type ModuleUpdateProperties struct { 5893 // ContentLink - Gets or sets the module content link. 5894 ContentLink *ContentLink `json:"contentLink,omitempty"` 5895} 5896 5897// NonAzureQueryProperties non Azure query for the update configuration. 5898type NonAzureQueryProperties struct { 5899 // FunctionAlias - Log Analytics Saved Search name. 5900 FunctionAlias *string `json:"functionAlias,omitempty"` 5901 // WorkspaceID - Workspace Id for Log Analytics in which the saved Search is resided. 5902 WorkspaceID *string `json:"workspaceId,omitempty"` 5903} 5904 5905// Operation automation REST API operation 5906type Operation struct { 5907 // Name - Operation name: {provider}/{resource}/{operation} 5908 Name *string `json:"name,omitempty"` 5909 // Display - Provider, Resource and Operation values 5910 Display *OperationDisplay `json:"display,omitempty"` 5911} 5912 5913// OperationDisplay provider, Resource and Operation values 5914type OperationDisplay struct { 5915 // Provider - Service provider: Microsoft.Automation 5916 Provider *string `json:"provider,omitempty"` 5917 // Resource - Resource on which the operation is performed: Runbooks, Jobs etc. 5918 Resource *string `json:"resource,omitempty"` 5919 // Operation - Operation type: Read, write, delete, etc. 5920 Operation *string `json:"operation,omitempty"` 5921} 5922 5923// OperationListResult the response model for the list of Automation operations 5924type OperationListResult struct { 5925 autorest.Response `json:"-"` 5926 // Value - List of Automation operations supported by the Automation resource provider. 5927 Value *[]Operation `json:"value,omitempty"` 5928} 5929 5930// ProxyResource ARM proxy resource. 5931type ProxyResource struct { 5932 // ID - READ-ONLY; Fully qualified resource Id for the resource 5933 ID *string `json:"id,omitempty"` 5934 // Name - READ-ONLY; The name of the resource 5935 Name *string `json:"name,omitempty"` 5936 // Type - READ-ONLY; The type of the resource. 5937 Type *string `json:"type,omitempty"` 5938} 5939 5940// MarshalJSON is the custom marshaler for ProxyResource. 5941func (pr ProxyResource) MarshalJSON() ([]byte, error) { 5942 objectMap := make(map[string]interface{}) 5943 return json.Marshal(objectMap) 5944} 5945 5946// ReadCloser ... 5947type ReadCloser struct { 5948 autorest.Response `json:"-"` 5949 Value *io.ReadCloser `json:"value,omitempty"` 5950} 5951 5952// Resource the core properties of ARM resources 5953type Resource struct { 5954 // ID - READ-ONLY; Fully qualified resource Id for the resource 5955 ID *string `json:"id,omitempty"` 5956 // Name - READ-ONLY; The name of the resource 5957 Name *string `json:"name,omitempty"` 5958 // Type - READ-ONLY; The type of the resource. 5959 Type *string `json:"type,omitempty"` 5960} 5961 5962// MarshalJSON is the custom marshaler for Resource. 5963func (r Resource) MarshalJSON() ([]byte, error) { 5964 objectMap := make(map[string]interface{}) 5965 return json.Marshal(objectMap) 5966} 5967 5968// RunAsCredentialAssociationProperty definition of RunAs credential to use for hybrid worker. 5969type RunAsCredentialAssociationProperty struct { 5970 // Name - Gets or sets the name of the credential. 5971 Name *string `json:"name,omitempty"` 5972} 5973 5974// Runbook definition of the runbook type. 5975type Runbook struct { 5976 autorest.Response `json:"-"` 5977 // RunbookProperties - Gets or sets the runbook properties. 5978 *RunbookProperties `json:"properties,omitempty"` 5979 // Etag - Gets or sets the etag of the resource. 5980 Etag *string `json:"etag,omitempty"` 5981 // Tags - Resource tags. 5982 Tags map[string]*string `json:"tags"` 5983 // Location - The Azure Region where the resource lives 5984 Location *string `json:"location,omitempty"` 5985 // ID - READ-ONLY; Fully qualified resource Id for the resource 5986 ID *string `json:"id,omitempty"` 5987 // Name - READ-ONLY; The name of the resource 5988 Name *string `json:"name,omitempty"` 5989 // Type - READ-ONLY; The type of the resource. 5990 Type *string `json:"type,omitempty"` 5991} 5992 5993// MarshalJSON is the custom marshaler for Runbook. 5994func (r Runbook) MarshalJSON() ([]byte, error) { 5995 objectMap := make(map[string]interface{}) 5996 if r.RunbookProperties != nil { 5997 objectMap["properties"] = r.RunbookProperties 5998 } 5999 if r.Etag != nil { 6000 objectMap["etag"] = r.Etag 6001 } 6002 if r.Tags != nil { 6003 objectMap["tags"] = r.Tags 6004 } 6005 if r.Location != nil { 6006 objectMap["location"] = r.Location 6007 } 6008 return json.Marshal(objectMap) 6009} 6010 6011// UnmarshalJSON is the custom unmarshaler for Runbook struct. 6012func (r *Runbook) UnmarshalJSON(body []byte) error { 6013 var m map[string]*json.RawMessage 6014 err := json.Unmarshal(body, &m) 6015 if err != nil { 6016 return err 6017 } 6018 for k, v := range m { 6019 switch k { 6020 case "properties": 6021 if v != nil { 6022 var runbookProperties RunbookProperties 6023 err = json.Unmarshal(*v, &runbookProperties) 6024 if err != nil { 6025 return err 6026 } 6027 r.RunbookProperties = &runbookProperties 6028 } 6029 case "etag": 6030 if v != nil { 6031 var etag string 6032 err = json.Unmarshal(*v, &etag) 6033 if err != nil { 6034 return err 6035 } 6036 r.Etag = &etag 6037 } 6038 case "tags": 6039 if v != nil { 6040 var tags map[string]*string 6041 err = json.Unmarshal(*v, &tags) 6042 if err != nil { 6043 return err 6044 } 6045 r.Tags = tags 6046 } 6047 case "location": 6048 if v != nil { 6049 var location string 6050 err = json.Unmarshal(*v, &location) 6051 if err != nil { 6052 return err 6053 } 6054 r.Location = &location 6055 } 6056 case "id": 6057 if v != nil { 6058 var ID string 6059 err = json.Unmarshal(*v, &ID) 6060 if err != nil { 6061 return err 6062 } 6063 r.ID = &ID 6064 } 6065 case "name": 6066 if v != nil { 6067 var name string 6068 err = json.Unmarshal(*v, &name) 6069 if err != nil { 6070 return err 6071 } 6072 r.Name = &name 6073 } 6074 case "type": 6075 if v != nil { 6076 var typeVar string 6077 err = json.Unmarshal(*v, &typeVar) 6078 if err != nil { 6079 return err 6080 } 6081 r.Type = &typeVar 6082 } 6083 } 6084 } 6085 6086 return nil 6087} 6088 6089// RunbookAssociationProperty the runbook property associated with the entity. 6090type RunbookAssociationProperty struct { 6091 // Name - Gets or sets the name of the runbook. 6092 Name *string `json:"name,omitempty"` 6093} 6094 6095// RunbookCreateOrUpdateDraftParameters the parameters supplied to the create or update runbook operation. 6096type RunbookCreateOrUpdateDraftParameters struct { 6097 // RunbookContent - Content of the Runbook. 6098 RunbookContent *string `json:"runbookContent,omitempty"` 6099} 6100 6101// RunbookCreateOrUpdateDraftProperties the parameters supplied to the create or update draft runbook 6102// properties. 6103type RunbookCreateOrUpdateDraftProperties struct { 6104 // LogVerbose - Gets or sets verbose log option. 6105 LogVerbose *bool `json:"logVerbose,omitempty"` 6106 // LogProgress - Gets or sets progress log option. 6107 LogProgress *bool `json:"logProgress,omitempty"` 6108 // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' 6109 RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` 6110 // Draft - Gets or sets the draft runbook properties. 6111 Draft *RunbookDraft `json:"draft,omitempty"` 6112 // Description - Gets or sets the description of the runbook. 6113 Description *string `json:"description,omitempty"` 6114 // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. 6115 LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` 6116} 6117 6118// RunbookCreateOrUpdateParameters the parameters supplied to the create or update runbook operation. 6119type RunbookCreateOrUpdateParameters struct { 6120 // RunbookCreateOrUpdateProperties - Gets or sets runbook create or update properties. 6121 *RunbookCreateOrUpdateProperties `json:"properties,omitempty"` 6122 // Name - Gets or sets the name of the resource. 6123 Name *string `json:"name,omitempty"` 6124 // Location - Gets or sets the location of the resource. 6125 Location *string `json:"location,omitempty"` 6126 // Tags - Gets or sets the tags attached to the resource. 6127 Tags map[string]*string `json:"tags"` 6128} 6129 6130// MarshalJSON is the custom marshaler for RunbookCreateOrUpdateParameters. 6131func (rcoup RunbookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 6132 objectMap := make(map[string]interface{}) 6133 if rcoup.RunbookCreateOrUpdateProperties != nil { 6134 objectMap["properties"] = rcoup.RunbookCreateOrUpdateProperties 6135 } 6136 if rcoup.Name != nil { 6137 objectMap["name"] = rcoup.Name 6138 } 6139 if rcoup.Location != nil { 6140 objectMap["location"] = rcoup.Location 6141 } 6142 if rcoup.Tags != nil { 6143 objectMap["tags"] = rcoup.Tags 6144 } 6145 return json.Marshal(objectMap) 6146} 6147 6148// UnmarshalJSON is the custom unmarshaler for RunbookCreateOrUpdateParameters struct. 6149func (rcoup *RunbookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 6150 var m map[string]*json.RawMessage 6151 err := json.Unmarshal(body, &m) 6152 if err != nil { 6153 return err 6154 } 6155 for k, v := range m { 6156 switch k { 6157 case "properties": 6158 if v != nil { 6159 var runbookCreateOrUpdateProperties RunbookCreateOrUpdateProperties 6160 err = json.Unmarshal(*v, &runbookCreateOrUpdateProperties) 6161 if err != nil { 6162 return err 6163 } 6164 rcoup.RunbookCreateOrUpdateProperties = &runbookCreateOrUpdateProperties 6165 } 6166 case "name": 6167 if v != nil { 6168 var name string 6169 err = json.Unmarshal(*v, &name) 6170 if err != nil { 6171 return err 6172 } 6173 rcoup.Name = &name 6174 } 6175 case "location": 6176 if v != nil { 6177 var location string 6178 err = json.Unmarshal(*v, &location) 6179 if err != nil { 6180 return err 6181 } 6182 rcoup.Location = &location 6183 } 6184 case "tags": 6185 if v != nil { 6186 var tags map[string]*string 6187 err = json.Unmarshal(*v, &tags) 6188 if err != nil { 6189 return err 6190 } 6191 rcoup.Tags = tags 6192 } 6193 } 6194 } 6195 6196 return nil 6197} 6198 6199// RunbookCreateOrUpdateProperties the parameters supplied to the create or update runbook properties. 6200type RunbookCreateOrUpdateProperties struct { 6201 // LogVerbose - Gets or sets verbose log option. 6202 LogVerbose *bool `json:"logVerbose,omitempty"` 6203 // LogProgress - Gets or sets progress log option. 6204 LogProgress *bool `json:"logProgress,omitempty"` 6205 // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' 6206 RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` 6207 // Draft - Gets or sets the draft runbook properties. 6208 Draft *RunbookDraft `json:"draft,omitempty"` 6209 // PublishContentLink - Gets or sets the published runbook content link. 6210 PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` 6211 // Description - Gets or sets the description of the runbook. 6212 Description *string `json:"description,omitempty"` 6213 // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. 6214 LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` 6215} 6216 6217// RunbookDraft ... 6218type RunbookDraft struct { 6219 autorest.Response `json:"-"` 6220 // InEdit - Gets or sets whether runbook is in edit mode. 6221 InEdit *bool `json:"inEdit,omitempty"` 6222 // DraftContentLink - Gets or sets the draft runbook content link. 6223 DraftContentLink *ContentLink `json:"draftContentLink,omitempty"` 6224 // CreationTime - Gets or sets the creation time of the runbook draft. 6225 CreationTime *date.Time `json:"creationTime,omitempty"` 6226 // LastModifiedTime - Gets or sets the last modified time of the runbook draft. 6227 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 6228 // Parameters - Gets or sets the runbook draft parameters. 6229 Parameters map[string]*RunbookParameter `json:"parameters"` 6230 // OutputTypes - Gets or sets the runbook output types. 6231 OutputTypes *[]string `json:"outputTypes,omitempty"` 6232} 6233 6234// MarshalJSON is the custom marshaler for RunbookDraft. 6235func (rd RunbookDraft) MarshalJSON() ([]byte, error) { 6236 objectMap := make(map[string]interface{}) 6237 if rd.InEdit != nil { 6238 objectMap["inEdit"] = rd.InEdit 6239 } 6240 if rd.DraftContentLink != nil { 6241 objectMap["draftContentLink"] = rd.DraftContentLink 6242 } 6243 if rd.CreationTime != nil { 6244 objectMap["creationTime"] = rd.CreationTime 6245 } 6246 if rd.LastModifiedTime != nil { 6247 objectMap["lastModifiedTime"] = rd.LastModifiedTime 6248 } 6249 if rd.Parameters != nil { 6250 objectMap["parameters"] = rd.Parameters 6251 } 6252 if rd.OutputTypes != nil { 6253 objectMap["outputTypes"] = rd.OutputTypes 6254 } 6255 return json.Marshal(objectMap) 6256} 6257 6258// RunbookDraftPublishFuture an abstraction for monitoring and retrieving the results of a long-running 6259// operation. 6260type RunbookDraftPublishFuture struct { 6261 azure.FutureAPI 6262 // Result returns the result of the asynchronous operation. 6263 // If the operation has not completed it will return an error. 6264 Result func(RunbookDraftClient) (autorest.Response, error) 6265} 6266 6267// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6268func (future *RunbookDraftPublishFuture) UnmarshalJSON(body []byte) error { 6269 var azFuture azure.Future 6270 if err := json.Unmarshal(body, &azFuture); err != nil { 6271 return err 6272 } 6273 future.FutureAPI = &azFuture 6274 future.Result = future.result 6275 return nil 6276} 6277 6278// result is the default implementation for RunbookDraftPublishFuture.Result. 6279func (future *RunbookDraftPublishFuture) result(client RunbookDraftClient) (ar autorest.Response, err error) { 6280 var done bool 6281 done, err = future.DoneWithContext(context.Background(), client) 6282 if err != nil { 6283 err = autorest.NewErrorWithError(err, "automation.RunbookDraftPublishFuture", "Result", future.Response(), "Polling failure") 6284 return 6285 } 6286 if !done { 6287 ar.Response = future.Response() 6288 err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftPublishFuture") 6289 return 6290 } 6291 ar.Response = future.Response() 6292 return 6293} 6294 6295// RunbookDraftReplaceContentFuture an abstraction for monitoring and retrieving the results of a 6296// long-running operation. 6297type RunbookDraftReplaceContentFuture struct { 6298 azure.FutureAPI 6299 // Result returns the result of the asynchronous operation. 6300 // If the operation has not completed it will return an error. 6301 Result func(RunbookDraftClient) (ReadCloser, error) 6302} 6303 6304// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6305func (future *RunbookDraftReplaceContentFuture) UnmarshalJSON(body []byte) error { 6306 var azFuture azure.Future 6307 if err := json.Unmarshal(body, &azFuture); err != nil { 6308 return err 6309 } 6310 future.FutureAPI = &azFuture 6311 future.Result = future.result 6312 return nil 6313} 6314 6315// result is the default implementation for RunbookDraftReplaceContentFuture.Result. 6316func (future *RunbookDraftReplaceContentFuture) result(client RunbookDraftClient) (rc ReadCloser, err error) { 6317 var done bool 6318 done, err = future.DoneWithContext(context.Background(), client) 6319 if err != nil { 6320 err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", future.Response(), "Polling failure") 6321 return 6322 } 6323 if !done { 6324 rc.Response.Response = future.Response() 6325 err = azure.NewAsyncOpIncompleteError("automation.RunbookDraftReplaceContentFuture") 6326 return 6327 } 6328 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6329 if rc.Response.Response, err = future.GetResult(sender); err == nil && rc.Response.Response.StatusCode != http.StatusNoContent { 6330 rc, err = client.ReplaceContentResponder(rc.Response.Response) 6331 if err != nil { 6332 err = autorest.NewErrorWithError(err, "automation.RunbookDraftReplaceContentFuture", "Result", rc.Response.Response, "Failure responding to request") 6333 } 6334 } 6335 return 6336} 6337 6338// RunbookDraftUndoEditResult the response model for the undo edit runbook operation. 6339type RunbookDraftUndoEditResult struct { 6340 autorest.Response `json:"-"` 6341 // StatusCode - Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'Ambiguous', 'MovedPermanently', 'Moved', 'Found', 'Redirect', 'SeeOther', 'RedirectMethod', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'RedirectKeepVerb', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported' 6342 StatusCode HTTPStatusCode `json:"statusCode,omitempty"` 6343 RequestID *string `json:"requestId,omitempty"` 6344} 6345 6346// RunbookListResult the response model for the list runbook operation. 6347type RunbookListResult struct { 6348 autorest.Response `json:"-"` 6349 // Value - Gets or sets a list of runbooks. 6350 Value *[]Runbook `json:"value,omitempty"` 6351 // NextLink - Gets or sets the next link. 6352 NextLink *string `json:"nextLink,omitempty"` 6353} 6354 6355// RunbookListResultIterator provides access to a complete listing of Runbook values. 6356type RunbookListResultIterator struct { 6357 i int 6358 page RunbookListResultPage 6359} 6360 6361// NextWithContext advances to the next value. If there was an error making 6362// the request the iterator does not advance and the error is returned. 6363func (iter *RunbookListResultIterator) NextWithContext(ctx context.Context) (err error) { 6364 if tracing.IsEnabled() { 6365 ctx = tracing.StartSpan(ctx, fqdn+"/RunbookListResultIterator.NextWithContext") 6366 defer func() { 6367 sc := -1 6368 if iter.Response().Response.Response != nil { 6369 sc = iter.Response().Response.Response.StatusCode 6370 } 6371 tracing.EndSpan(ctx, sc, err) 6372 }() 6373 } 6374 iter.i++ 6375 if iter.i < len(iter.page.Values()) { 6376 return nil 6377 } 6378 err = iter.page.NextWithContext(ctx) 6379 if err != nil { 6380 iter.i-- 6381 return err 6382 } 6383 iter.i = 0 6384 return nil 6385} 6386 6387// Next advances to the next value. If there was an error making 6388// the request the iterator does not advance and the error is returned. 6389// Deprecated: Use NextWithContext() instead. 6390func (iter *RunbookListResultIterator) Next() error { 6391 return iter.NextWithContext(context.Background()) 6392} 6393 6394// NotDone returns true if the enumeration should be started or is not yet complete. 6395func (iter RunbookListResultIterator) NotDone() bool { 6396 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6397} 6398 6399// Response returns the raw server response from the last page request. 6400func (iter RunbookListResultIterator) Response() RunbookListResult { 6401 return iter.page.Response() 6402} 6403 6404// Value returns the current value or a zero-initialized value if the 6405// iterator has advanced beyond the end of the collection. 6406func (iter RunbookListResultIterator) Value() Runbook { 6407 if !iter.page.NotDone() { 6408 return Runbook{} 6409 } 6410 return iter.page.Values()[iter.i] 6411} 6412 6413// Creates a new instance of the RunbookListResultIterator type. 6414func NewRunbookListResultIterator(page RunbookListResultPage) RunbookListResultIterator { 6415 return RunbookListResultIterator{page: page} 6416} 6417 6418// IsEmpty returns true if the ListResult contains no values. 6419func (rlr RunbookListResult) IsEmpty() bool { 6420 return rlr.Value == nil || len(*rlr.Value) == 0 6421} 6422 6423// hasNextLink returns true if the NextLink is not empty. 6424func (rlr RunbookListResult) hasNextLink() bool { 6425 return rlr.NextLink != nil && len(*rlr.NextLink) != 0 6426} 6427 6428// runbookListResultPreparer prepares a request to retrieve the next set of results. 6429// It returns nil if no more results exist. 6430func (rlr RunbookListResult) runbookListResultPreparer(ctx context.Context) (*http.Request, error) { 6431 if !rlr.hasNextLink() { 6432 return nil, nil 6433 } 6434 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6435 autorest.AsJSON(), 6436 autorest.AsGet(), 6437 autorest.WithBaseURL(to.String(rlr.NextLink))) 6438} 6439 6440// RunbookListResultPage contains a page of Runbook values. 6441type RunbookListResultPage struct { 6442 fn func(context.Context, RunbookListResult) (RunbookListResult, error) 6443 rlr RunbookListResult 6444} 6445 6446// NextWithContext advances to the next page of values. If there was an error making 6447// the request the page does not advance and the error is returned. 6448func (page *RunbookListResultPage) NextWithContext(ctx context.Context) (err error) { 6449 if tracing.IsEnabled() { 6450 ctx = tracing.StartSpan(ctx, fqdn+"/RunbookListResultPage.NextWithContext") 6451 defer func() { 6452 sc := -1 6453 if page.Response().Response.Response != nil { 6454 sc = page.Response().Response.Response.StatusCode 6455 } 6456 tracing.EndSpan(ctx, sc, err) 6457 }() 6458 } 6459 for { 6460 next, err := page.fn(ctx, page.rlr) 6461 if err != nil { 6462 return err 6463 } 6464 page.rlr = next 6465 if !next.hasNextLink() || !next.IsEmpty() { 6466 break 6467 } 6468 } 6469 return nil 6470} 6471 6472// Next advances to the next page of values. If there was an error making 6473// the request the page does not advance and the error is returned. 6474// Deprecated: Use NextWithContext() instead. 6475func (page *RunbookListResultPage) Next() error { 6476 return page.NextWithContext(context.Background()) 6477} 6478 6479// NotDone returns true if the page enumeration should be started or is not yet complete. 6480func (page RunbookListResultPage) NotDone() bool { 6481 return !page.rlr.IsEmpty() 6482} 6483 6484// Response returns the raw server response from the last page request. 6485func (page RunbookListResultPage) Response() RunbookListResult { 6486 return page.rlr 6487} 6488 6489// Values returns the slice of values for the current page or nil if there are no values. 6490func (page RunbookListResultPage) Values() []Runbook { 6491 if page.rlr.IsEmpty() { 6492 return nil 6493 } 6494 return *page.rlr.Value 6495} 6496 6497// Creates a new instance of the RunbookListResultPage type. 6498func NewRunbookListResultPage(cur RunbookListResult, getNextPage func(context.Context, RunbookListResult) (RunbookListResult, error)) RunbookListResultPage { 6499 return RunbookListResultPage{ 6500 fn: getNextPage, 6501 rlr: cur, 6502 } 6503} 6504 6505// RunbookParameter definition of the runbook parameter type. 6506type RunbookParameter struct { 6507 // Type - Gets or sets the type of the parameter. 6508 Type *string `json:"type,omitempty"` 6509 // IsMandatory - Gets or sets a Boolean value to indicate whether the parameter is mandatory or not. 6510 IsMandatory *bool `json:"isMandatory,omitempty"` 6511 // Position - Get or sets the position of the parameter. 6512 Position *int32 `json:"position,omitempty"` 6513 // DefaultValue - Gets or sets the default value of parameter. 6514 DefaultValue *string `json:"defaultValue,omitempty"` 6515} 6516 6517// RunbookProperties definition of the runbook property type. 6518type RunbookProperties struct { 6519 // RunbookType - Gets or sets the type of the runbook. Possible values include: 'Script', 'Graph', 'PowerShellWorkflow', 'PowerShell', 'GraphPowerShellWorkflow', 'GraphPowerShell' 6520 RunbookType RunbookTypeEnum `json:"runbookType,omitempty"` 6521 // PublishContentLink - Gets or sets the published runbook content link. 6522 PublishContentLink *ContentLink `json:"publishContentLink,omitempty"` 6523 // State - Gets or sets the state of the runbook. Possible values include: 'RunbookStateNew', 'RunbookStateEdit', 'RunbookStatePublished' 6524 State RunbookState `json:"state,omitempty"` 6525 // LogVerbose - Gets or sets verbose log option. 6526 LogVerbose *bool `json:"logVerbose,omitempty"` 6527 // LogProgress - Gets or sets progress log option. 6528 LogProgress *bool `json:"logProgress,omitempty"` 6529 // LogActivityTrace - Gets or sets the option to log activity trace of the runbook. 6530 LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` 6531 // JobCount - Gets or sets the job count of the runbook. 6532 JobCount *int32 `json:"jobCount,omitempty"` 6533 // Parameters - Gets or sets the runbook parameters. 6534 Parameters map[string]*RunbookParameter `json:"parameters"` 6535 // OutputTypes - Gets or sets the runbook output types. 6536 OutputTypes *[]string `json:"outputTypes,omitempty"` 6537 // Draft - Gets or sets the draft runbook properties. 6538 Draft *RunbookDraft `json:"draft,omitempty"` 6539 // ProvisioningState - Gets or sets the provisioning state of the runbook. Possible values include: 'RunbookProvisioningStateSucceeded' 6540 ProvisioningState RunbookProvisioningState `json:"provisioningState,omitempty"` 6541 // LastModifiedBy - Gets or sets the last modified by. 6542 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 6543 // CreationTime - Gets or sets the creation time. 6544 CreationTime *date.Time `json:"creationTime,omitempty"` 6545 // LastModifiedTime - Gets or sets the last modified time. 6546 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 6547 // Description - Gets or sets the description. 6548 Description *string `json:"description,omitempty"` 6549} 6550 6551// MarshalJSON is the custom marshaler for RunbookProperties. 6552func (rp RunbookProperties) MarshalJSON() ([]byte, error) { 6553 objectMap := make(map[string]interface{}) 6554 if rp.RunbookType != "" { 6555 objectMap["runbookType"] = rp.RunbookType 6556 } 6557 if rp.PublishContentLink != nil { 6558 objectMap["publishContentLink"] = rp.PublishContentLink 6559 } 6560 if rp.State != "" { 6561 objectMap["state"] = rp.State 6562 } 6563 if rp.LogVerbose != nil { 6564 objectMap["logVerbose"] = rp.LogVerbose 6565 } 6566 if rp.LogProgress != nil { 6567 objectMap["logProgress"] = rp.LogProgress 6568 } 6569 if rp.LogActivityTrace != nil { 6570 objectMap["logActivityTrace"] = rp.LogActivityTrace 6571 } 6572 if rp.JobCount != nil { 6573 objectMap["jobCount"] = rp.JobCount 6574 } 6575 if rp.Parameters != nil { 6576 objectMap["parameters"] = rp.Parameters 6577 } 6578 if rp.OutputTypes != nil { 6579 objectMap["outputTypes"] = rp.OutputTypes 6580 } 6581 if rp.Draft != nil { 6582 objectMap["draft"] = rp.Draft 6583 } 6584 if rp.ProvisioningState != "" { 6585 objectMap["provisioningState"] = rp.ProvisioningState 6586 } 6587 if rp.LastModifiedBy != nil { 6588 objectMap["lastModifiedBy"] = rp.LastModifiedBy 6589 } 6590 if rp.CreationTime != nil { 6591 objectMap["creationTime"] = rp.CreationTime 6592 } 6593 if rp.LastModifiedTime != nil { 6594 objectMap["lastModifiedTime"] = rp.LastModifiedTime 6595 } 6596 if rp.Description != nil { 6597 objectMap["description"] = rp.Description 6598 } 6599 return json.Marshal(objectMap) 6600} 6601 6602// RunbookUpdateParameters the parameters supplied to the update runbook operation. 6603type RunbookUpdateParameters struct { 6604 // RunbookUpdateProperties - Gets or sets the runbook update properties. 6605 *RunbookUpdateProperties `json:"properties,omitempty"` 6606 // Name - Gets or sets the name of the resource. 6607 Name *string `json:"name,omitempty"` 6608 // Location - Gets or sets the location of the resource. 6609 Location *string `json:"location,omitempty"` 6610 // Tags - Gets or sets the tags attached to the resource. 6611 Tags map[string]*string `json:"tags"` 6612} 6613 6614// MarshalJSON is the custom marshaler for RunbookUpdateParameters. 6615func (rup RunbookUpdateParameters) MarshalJSON() ([]byte, error) { 6616 objectMap := make(map[string]interface{}) 6617 if rup.RunbookUpdateProperties != nil { 6618 objectMap["properties"] = rup.RunbookUpdateProperties 6619 } 6620 if rup.Name != nil { 6621 objectMap["name"] = rup.Name 6622 } 6623 if rup.Location != nil { 6624 objectMap["location"] = rup.Location 6625 } 6626 if rup.Tags != nil { 6627 objectMap["tags"] = rup.Tags 6628 } 6629 return json.Marshal(objectMap) 6630} 6631 6632// UnmarshalJSON is the custom unmarshaler for RunbookUpdateParameters struct. 6633func (rup *RunbookUpdateParameters) UnmarshalJSON(body []byte) error { 6634 var m map[string]*json.RawMessage 6635 err := json.Unmarshal(body, &m) 6636 if err != nil { 6637 return err 6638 } 6639 for k, v := range m { 6640 switch k { 6641 case "properties": 6642 if v != nil { 6643 var runbookUpdateProperties RunbookUpdateProperties 6644 err = json.Unmarshal(*v, &runbookUpdateProperties) 6645 if err != nil { 6646 return err 6647 } 6648 rup.RunbookUpdateProperties = &runbookUpdateProperties 6649 } 6650 case "name": 6651 if v != nil { 6652 var name string 6653 err = json.Unmarshal(*v, &name) 6654 if err != nil { 6655 return err 6656 } 6657 rup.Name = &name 6658 } 6659 case "location": 6660 if v != nil { 6661 var location string 6662 err = json.Unmarshal(*v, &location) 6663 if err != nil { 6664 return err 6665 } 6666 rup.Location = &location 6667 } 6668 case "tags": 6669 if v != nil { 6670 var tags map[string]*string 6671 err = json.Unmarshal(*v, &tags) 6672 if err != nil { 6673 return err 6674 } 6675 rup.Tags = tags 6676 } 6677 } 6678 } 6679 6680 return nil 6681} 6682 6683// RunbookUpdateProperties the parameters supplied to the update runbook properties. 6684type RunbookUpdateProperties struct { 6685 // Description - Gets or sets the description of the runbook. 6686 Description *string `json:"description,omitempty"` 6687 // LogVerbose - Gets or sets verbose log option. 6688 LogVerbose *bool `json:"logVerbose,omitempty"` 6689 // LogProgress - Gets or sets progress log option. 6690 LogProgress *bool `json:"logProgress,omitempty"` 6691 // LogActivityTrace - Gets or sets the activity-level tracing options of the runbook. 6692 LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` 6693} 6694 6695// Schedule definition of the schedule. 6696type Schedule struct { 6697 autorest.Response `json:"-"` 6698 // ScheduleProperties - Gets or sets the properties of the schedule. 6699 *ScheduleProperties `json:"properties,omitempty"` 6700 // ID - READ-ONLY; Fully qualified resource Id for the resource 6701 ID *string `json:"id,omitempty"` 6702 // Name - READ-ONLY; The name of the resource 6703 Name *string `json:"name,omitempty"` 6704 // Type - READ-ONLY; The type of the resource. 6705 Type *string `json:"type,omitempty"` 6706} 6707 6708// MarshalJSON is the custom marshaler for Schedule. 6709func (s Schedule) MarshalJSON() ([]byte, error) { 6710 objectMap := make(map[string]interface{}) 6711 if s.ScheduleProperties != nil { 6712 objectMap["properties"] = s.ScheduleProperties 6713 } 6714 return json.Marshal(objectMap) 6715} 6716 6717// UnmarshalJSON is the custom unmarshaler for Schedule struct. 6718func (s *Schedule) UnmarshalJSON(body []byte) error { 6719 var m map[string]*json.RawMessage 6720 err := json.Unmarshal(body, &m) 6721 if err != nil { 6722 return err 6723 } 6724 for k, v := range m { 6725 switch k { 6726 case "properties": 6727 if v != nil { 6728 var scheduleProperties ScheduleProperties 6729 err = json.Unmarshal(*v, &scheduleProperties) 6730 if err != nil { 6731 return err 6732 } 6733 s.ScheduleProperties = &scheduleProperties 6734 } 6735 case "id": 6736 if v != nil { 6737 var ID string 6738 err = json.Unmarshal(*v, &ID) 6739 if err != nil { 6740 return err 6741 } 6742 s.ID = &ID 6743 } 6744 case "name": 6745 if v != nil { 6746 var name string 6747 err = json.Unmarshal(*v, &name) 6748 if err != nil { 6749 return err 6750 } 6751 s.Name = &name 6752 } 6753 case "type": 6754 if v != nil { 6755 var typeVar string 6756 err = json.Unmarshal(*v, &typeVar) 6757 if err != nil { 6758 return err 6759 } 6760 s.Type = &typeVar 6761 } 6762 } 6763 } 6764 6765 return nil 6766} 6767 6768// ScheduleAssociationProperty the schedule property associated with the entity. 6769type ScheduleAssociationProperty struct { 6770 // Name - Gets or sets the name of the Schedule. 6771 Name *string `json:"name,omitempty"` 6772} 6773 6774// ScheduleCreateOrUpdateParameters the parameters supplied to the create or update schedule operation. 6775type ScheduleCreateOrUpdateParameters struct { 6776 // Name - Gets or sets the name of the Schedule. 6777 Name *string `json:"name,omitempty"` 6778 // ScheduleCreateOrUpdateProperties - Gets or sets the list of schedule properties. 6779 *ScheduleCreateOrUpdateProperties `json:"properties,omitempty"` 6780} 6781 6782// MarshalJSON is the custom marshaler for ScheduleCreateOrUpdateParameters. 6783func (scoup ScheduleCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 6784 objectMap := make(map[string]interface{}) 6785 if scoup.Name != nil { 6786 objectMap["name"] = scoup.Name 6787 } 6788 if scoup.ScheduleCreateOrUpdateProperties != nil { 6789 objectMap["properties"] = scoup.ScheduleCreateOrUpdateProperties 6790 } 6791 return json.Marshal(objectMap) 6792} 6793 6794// UnmarshalJSON is the custom unmarshaler for ScheduleCreateOrUpdateParameters struct. 6795func (scoup *ScheduleCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 6796 var m map[string]*json.RawMessage 6797 err := json.Unmarshal(body, &m) 6798 if err != nil { 6799 return err 6800 } 6801 for k, v := range m { 6802 switch k { 6803 case "name": 6804 if v != nil { 6805 var name string 6806 err = json.Unmarshal(*v, &name) 6807 if err != nil { 6808 return err 6809 } 6810 scoup.Name = &name 6811 } 6812 case "properties": 6813 if v != nil { 6814 var scheduleCreateOrUpdateProperties ScheduleCreateOrUpdateProperties 6815 err = json.Unmarshal(*v, &scheduleCreateOrUpdateProperties) 6816 if err != nil { 6817 return err 6818 } 6819 scoup.ScheduleCreateOrUpdateProperties = &scheduleCreateOrUpdateProperties 6820 } 6821 } 6822 } 6823 6824 return nil 6825} 6826 6827// ScheduleCreateOrUpdateProperties the parameters supplied to the create or update schedule operation. 6828type ScheduleCreateOrUpdateProperties struct { 6829 // Description - Gets or sets the description of the schedule. 6830 Description *string `json:"description,omitempty"` 6831 // StartTime - Gets or sets the start time of the schedule. 6832 StartTime *date.Time `json:"startTime,omitempty"` 6833 // ExpiryTime - Gets or sets the end time of the schedule. 6834 ExpiryTime *date.Time `json:"expiryTime,omitempty"` 6835 // Interval - Gets or sets the interval of the schedule. 6836 Interval interface{} `json:"interval,omitempty"` 6837 // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute' 6838 Frequency ScheduleFrequency `json:"frequency,omitempty"` 6839 // TimeZone - Gets or sets the time zone of the schedule. 6840 TimeZone *string `json:"timeZone,omitempty"` 6841 // AdvancedSchedule - Gets or sets the AdvancedSchedule. 6842 AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` 6843} 6844 6845// ScheduleListResult the response model for the list schedule operation. 6846type ScheduleListResult struct { 6847 autorest.Response `json:"-"` 6848 // Value - Gets or sets a list of schedules. 6849 Value *[]Schedule `json:"value,omitempty"` 6850 // NextLink - Gets or sets the next link. 6851 NextLink *string `json:"nextLink,omitempty"` 6852} 6853 6854// ScheduleListResultIterator provides access to a complete listing of Schedule values. 6855type ScheduleListResultIterator struct { 6856 i int 6857 page ScheduleListResultPage 6858} 6859 6860// NextWithContext advances to the next value. If there was an error making 6861// the request the iterator does not advance and the error is returned. 6862func (iter *ScheduleListResultIterator) NextWithContext(ctx context.Context) (err error) { 6863 if tracing.IsEnabled() { 6864 ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListResultIterator.NextWithContext") 6865 defer func() { 6866 sc := -1 6867 if iter.Response().Response.Response != nil { 6868 sc = iter.Response().Response.Response.StatusCode 6869 } 6870 tracing.EndSpan(ctx, sc, err) 6871 }() 6872 } 6873 iter.i++ 6874 if iter.i < len(iter.page.Values()) { 6875 return nil 6876 } 6877 err = iter.page.NextWithContext(ctx) 6878 if err != nil { 6879 iter.i-- 6880 return err 6881 } 6882 iter.i = 0 6883 return nil 6884} 6885 6886// Next advances to the next value. If there was an error making 6887// the request the iterator does not advance and the error is returned. 6888// Deprecated: Use NextWithContext() instead. 6889func (iter *ScheduleListResultIterator) Next() error { 6890 return iter.NextWithContext(context.Background()) 6891} 6892 6893// NotDone returns true if the enumeration should be started or is not yet complete. 6894func (iter ScheduleListResultIterator) NotDone() bool { 6895 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6896} 6897 6898// Response returns the raw server response from the last page request. 6899func (iter ScheduleListResultIterator) Response() ScheduleListResult { 6900 return iter.page.Response() 6901} 6902 6903// Value returns the current value or a zero-initialized value if the 6904// iterator has advanced beyond the end of the collection. 6905func (iter ScheduleListResultIterator) Value() Schedule { 6906 if !iter.page.NotDone() { 6907 return Schedule{} 6908 } 6909 return iter.page.Values()[iter.i] 6910} 6911 6912// Creates a new instance of the ScheduleListResultIterator type. 6913func NewScheduleListResultIterator(page ScheduleListResultPage) ScheduleListResultIterator { 6914 return ScheduleListResultIterator{page: page} 6915} 6916 6917// IsEmpty returns true if the ListResult contains no values. 6918func (slr ScheduleListResult) IsEmpty() bool { 6919 return slr.Value == nil || len(*slr.Value) == 0 6920} 6921 6922// hasNextLink returns true if the NextLink is not empty. 6923func (slr ScheduleListResult) hasNextLink() bool { 6924 return slr.NextLink != nil && len(*slr.NextLink) != 0 6925} 6926 6927// scheduleListResultPreparer prepares a request to retrieve the next set of results. 6928// It returns nil if no more results exist. 6929func (slr ScheduleListResult) scheduleListResultPreparer(ctx context.Context) (*http.Request, error) { 6930 if !slr.hasNextLink() { 6931 return nil, nil 6932 } 6933 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6934 autorest.AsJSON(), 6935 autorest.AsGet(), 6936 autorest.WithBaseURL(to.String(slr.NextLink))) 6937} 6938 6939// ScheduleListResultPage contains a page of Schedule values. 6940type ScheduleListResultPage struct { 6941 fn func(context.Context, ScheduleListResult) (ScheduleListResult, error) 6942 slr ScheduleListResult 6943} 6944 6945// NextWithContext advances to the next page of values. If there was an error making 6946// the request the page does not advance and the error is returned. 6947func (page *ScheduleListResultPage) NextWithContext(ctx context.Context) (err error) { 6948 if tracing.IsEnabled() { 6949 ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListResultPage.NextWithContext") 6950 defer func() { 6951 sc := -1 6952 if page.Response().Response.Response != nil { 6953 sc = page.Response().Response.Response.StatusCode 6954 } 6955 tracing.EndSpan(ctx, sc, err) 6956 }() 6957 } 6958 for { 6959 next, err := page.fn(ctx, page.slr) 6960 if err != nil { 6961 return err 6962 } 6963 page.slr = next 6964 if !next.hasNextLink() || !next.IsEmpty() { 6965 break 6966 } 6967 } 6968 return nil 6969} 6970 6971// Next advances to the next page of values. If there was an error making 6972// the request the page does not advance and the error is returned. 6973// Deprecated: Use NextWithContext() instead. 6974func (page *ScheduleListResultPage) Next() error { 6975 return page.NextWithContext(context.Background()) 6976} 6977 6978// NotDone returns true if the page enumeration should be started or is not yet complete. 6979func (page ScheduleListResultPage) NotDone() bool { 6980 return !page.slr.IsEmpty() 6981} 6982 6983// Response returns the raw server response from the last page request. 6984func (page ScheduleListResultPage) Response() ScheduleListResult { 6985 return page.slr 6986} 6987 6988// Values returns the slice of values for the current page or nil if there are no values. 6989func (page ScheduleListResultPage) Values() []Schedule { 6990 if page.slr.IsEmpty() { 6991 return nil 6992 } 6993 return *page.slr.Value 6994} 6995 6996// Creates a new instance of the ScheduleListResultPage type. 6997func NewScheduleListResultPage(cur ScheduleListResult, getNextPage func(context.Context, ScheduleListResult) (ScheduleListResult, error)) ScheduleListResultPage { 6998 return ScheduleListResultPage{ 6999 fn: getNextPage, 7000 slr: cur, 7001 } 7002} 7003 7004// ScheduleProperties definition of schedule parameters. 7005type ScheduleProperties struct { 7006 // StartTime - Gets or sets the start time of the schedule. 7007 StartTime *date.Time `json:"startTime,omitempty"` 7008 // StartTimeOffsetMinutes - READ-ONLY; Gets the start time's offset in minutes. 7009 StartTimeOffsetMinutes *float64 `json:"startTimeOffsetMinutes,omitempty"` 7010 // ExpiryTime - Gets or sets the end time of the schedule. 7011 ExpiryTime *date.Time `json:"expiryTime,omitempty"` 7012 // ExpiryTimeOffsetMinutes - Gets or sets the expiry time's offset in minutes. 7013 ExpiryTimeOffsetMinutes *float64 `json:"expiryTimeOffsetMinutes,omitempty"` 7014 // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. 7015 IsEnabled *bool `json:"isEnabled,omitempty"` 7016 // NextRun - Gets or sets the next run time of the schedule. 7017 NextRun *date.Time `json:"nextRun,omitempty"` 7018 // NextRunOffsetMinutes - Gets or sets the next run time's offset in minutes. 7019 NextRunOffsetMinutes *float64 `json:"nextRunOffsetMinutes,omitempty"` 7020 // Interval - Gets or sets the interval of the schedule. 7021 Interval *int32 `json:"interval,omitempty"` 7022 // Frequency - Gets or sets the frequency of the schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute' 7023 Frequency ScheduleFrequency `json:"frequency,omitempty"` 7024 // TimeZone - Gets or sets the time zone of the schedule. 7025 TimeZone *string `json:"timeZone,omitempty"` 7026 // AdvancedSchedule - Gets or sets the advanced schedule. 7027 AdvancedSchedule *AdvancedSchedule `json:"advancedSchedule,omitempty"` 7028 // CreationTime - Gets or sets the creation time. 7029 CreationTime *date.Time `json:"creationTime,omitempty"` 7030 // LastModifiedTime - Gets or sets the last modified time. 7031 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 7032 // Description - Gets or sets the description. 7033 Description *string `json:"description,omitempty"` 7034} 7035 7036// MarshalJSON is the custom marshaler for ScheduleProperties. 7037func (sp ScheduleProperties) MarshalJSON() ([]byte, error) { 7038 objectMap := make(map[string]interface{}) 7039 if sp.StartTime != nil { 7040 objectMap["startTime"] = sp.StartTime 7041 } 7042 if sp.ExpiryTime != nil { 7043 objectMap["expiryTime"] = sp.ExpiryTime 7044 } 7045 if sp.ExpiryTimeOffsetMinutes != nil { 7046 objectMap["expiryTimeOffsetMinutes"] = sp.ExpiryTimeOffsetMinutes 7047 } 7048 if sp.IsEnabled != nil { 7049 objectMap["isEnabled"] = sp.IsEnabled 7050 } 7051 if sp.NextRun != nil { 7052 objectMap["nextRun"] = sp.NextRun 7053 } 7054 if sp.NextRunOffsetMinutes != nil { 7055 objectMap["nextRunOffsetMinutes"] = sp.NextRunOffsetMinutes 7056 } 7057 if sp.Interval != nil { 7058 objectMap["interval"] = sp.Interval 7059 } 7060 if sp.Frequency != "" { 7061 objectMap["frequency"] = sp.Frequency 7062 } 7063 if sp.TimeZone != nil { 7064 objectMap["timeZone"] = sp.TimeZone 7065 } 7066 if sp.AdvancedSchedule != nil { 7067 objectMap["advancedSchedule"] = sp.AdvancedSchedule 7068 } 7069 if sp.CreationTime != nil { 7070 objectMap["creationTime"] = sp.CreationTime 7071 } 7072 if sp.LastModifiedTime != nil { 7073 objectMap["lastModifiedTime"] = sp.LastModifiedTime 7074 } 7075 if sp.Description != nil { 7076 objectMap["description"] = sp.Description 7077 } 7078 return json.Marshal(objectMap) 7079} 7080 7081// ScheduleUpdateParameters the parameters supplied to the update schedule operation. 7082type ScheduleUpdateParameters struct { 7083 // Name - Gets or sets the name of the Schedule. 7084 Name *string `json:"name,omitempty"` 7085 // ScheduleUpdateProperties - Gets or sets the list of schedule properties. 7086 *ScheduleUpdateProperties `json:"properties,omitempty"` 7087} 7088 7089// MarshalJSON is the custom marshaler for ScheduleUpdateParameters. 7090func (sup ScheduleUpdateParameters) MarshalJSON() ([]byte, error) { 7091 objectMap := make(map[string]interface{}) 7092 if sup.Name != nil { 7093 objectMap["name"] = sup.Name 7094 } 7095 if sup.ScheduleUpdateProperties != nil { 7096 objectMap["properties"] = sup.ScheduleUpdateProperties 7097 } 7098 return json.Marshal(objectMap) 7099} 7100 7101// UnmarshalJSON is the custom unmarshaler for ScheduleUpdateParameters struct. 7102func (sup *ScheduleUpdateParameters) UnmarshalJSON(body []byte) error { 7103 var m map[string]*json.RawMessage 7104 err := json.Unmarshal(body, &m) 7105 if err != nil { 7106 return err 7107 } 7108 for k, v := range m { 7109 switch k { 7110 case "name": 7111 if v != nil { 7112 var name string 7113 err = json.Unmarshal(*v, &name) 7114 if err != nil { 7115 return err 7116 } 7117 sup.Name = &name 7118 } 7119 case "properties": 7120 if v != nil { 7121 var scheduleUpdateProperties ScheduleUpdateProperties 7122 err = json.Unmarshal(*v, &scheduleUpdateProperties) 7123 if err != nil { 7124 return err 7125 } 7126 sup.ScheduleUpdateProperties = &scheduleUpdateProperties 7127 } 7128 } 7129 } 7130 7131 return nil 7132} 7133 7134// ScheduleUpdateProperties the parameters supplied to the update schedule operation. 7135type ScheduleUpdateProperties struct { 7136 // Description - Gets or sets the description of the schedule. 7137 Description *string `json:"description,omitempty"` 7138 // IsEnabled - Gets or sets a value indicating whether this schedule is enabled. 7139 IsEnabled *bool `json:"isEnabled,omitempty"` 7140} 7141 7142// SetObject ... 7143type SetObject struct { 7144 autorest.Response `json:"-"` 7145 Value interface{} `json:"value,omitempty"` 7146} 7147 7148// Sku the account SKU. 7149type Sku struct { 7150 // Name - Gets or sets the SKU name of the account. Possible values include: 'Free', 'Basic' 7151 Name SkuNameEnum `json:"name,omitempty"` 7152 // Family - Gets or sets the SKU family. 7153 Family *string `json:"family,omitempty"` 7154 // Capacity - Gets or sets the SKU capacity. 7155 Capacity *int32 `json:"capacity,omitempty"` 7156} 7157 7158// SoftareUpdateConfigurationRunTaskProperties task properties of the software update configuration. 7159type SoftareUpdateConfigurationRunTaskProperties struct { 7160 // Status - The status of the task. 7161 Status *string `json:"status,omitempty"` 7162 // Source - The name of the source of the task. 7163 Source *string `json:"source,omitempty"` 7164 // JobID - The job id of the task. 7165 JobID *string `json:"jobId,omitempty"` 7166} 7167 7168// SoftareUpdateConfigurationRunTasks software update configuration run tasks model. 7169type SoftareUpdateConfigurationRunTasks struct { 7170 // PreTask - Pre task properties. 7171 PreTask *SoftareUpdateConfigurationRunTaskProperties `json:"preTask,omitempty"` 7172 // PostTask - Post task properties. 7173 PostTask *SoftareUpdateConfigurationRunTaskProperties `json:"postTask,omitempty"` 7174} 7175 7176// SoftwareUpdateConfiguration software update configuration properties. 7177type SoftwareUpdateConfiguration struct { 7178 autorest.Response `json:"-"` 7179 // Name - READ-ONLY; Resource name. 7180 Name *string `json:"name,omitempty"` 7181 // ID - READ-ONLY; Resource Id. 7182 ID *string `json:"id,omitempty"` 7183 // Type - READ-ONLY; Resource type 7184 Type *string `json:"type,omitempty"` 7185 // SoftwareUpdateConfigurationProperties - Software update configuration properties. 7186 *SoftwareUpdateConfigurationProperties `json:"properties,omitempty"` 7187} 7188 7189// MarshalJSON is the custom marshaler for SoftwareUpdateConfiguration. 7190func (suc SoftwareUpdateConfiguration) MarshalJSON() ([]byte, error) { 7191 objectMap := make(map[string]interface{}) 7192 if suc.SoftwareUpdateConfigurationProperties != nil { 7193 objectMap["properties"] = suc.SoftwareUpdateConfigurationProperties 7194 } 7195 return json.Marshal(objectMap) 7196} 7197 7198// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfiguration struct. 7199func (suc *SoftwareUpdateConfiguration) UnmarshalJSON(body []byte) error { 7200 var m map[string]*json.RawMessage 7201 err := json.Unmarshal(body, &m) 7202 if err != nil { 7203 return err 7204 } 7205 for k, v := range m { 7206 switch k { 7207 case "name": 7208 if v != nil { 7209 var name string 7210 err = json.Unmarshal(*v, &name) 7211 if err != nil { 7212 return err 7213 } 7214 suc.Name = &name 7215 } 7216 case "id": 7217 if v != nil { 7218 var ID string 7219 err = json.Unmarshal(*v, &ID) 7220 if err != nil { 7221 return err 7222 } 7223 suc.ID = &ID 7224 } 7225 case "type": 7226 if v != nil { 7227 var typeVar string 7228 err = json.Unmarshal(*v, &typeVar) 7229 if err != nil { 7230 return err 7231 } 7232 suc.Type = &typeVar 7233 } 7234 case "properties": 7235 if v != nil { 7236 var softwareUpdateConfigurationProperties SoftwareUpdateConfigurationProperties 7237 err = json.Unmarshal(*v, &softwareUpdateConfigurationProperties) 7238 if err != nil { 7239 return err 7240 } 7241 suc.SoftwareUpdateConfigurationProperties = &softwareUpdateConfigurationProperties 7242 } 7243 } 7244 } 7245 7246 return nil 7247} 7248 7249// SoftwareUpdateConfigurationCollectionItem software update configuration collection item properties. 7250type SoftwareUpdateConfigurationCollectionItem struct { 7251 // Name - READ-ONLY; Name of the software update configuration. 7252 Name *string `json:"name,omitempty"` 7253 // ID - READ-ONLY; Resource Id of the software update configuration 7254 ID *string `json:"id,omitempty"` 7255 // SoftwareUpdateConfigurationCollectionItemProperties - Software update configuration properties. 7256 *SoftwareUpdateConfigurationCollectionItemProperties `json:"properties,omitempty"` 7257} 7258 7259// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItem. 7260func (succi SoftwareUpdateConfigurationCollectionItem) MarshalJSON() ([]byte, error) { 7261 objectMap := make(map[string]interface{}) 7262 if succi.SoftwareUpdateConfigurationCollectionItemProperties != nil { 7263 objectMap["properties"] = succi.SoftwareUpdateConfigurationCollectionItemProperties 7264 } 7265 return json.Marshal(objectMap) 7266} 7267 7268// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationCollectionItem struct. 7269func (succi *SoftwareUpdateConfigurationCollectionItem) UnmarshalJSON(body []byte) error { 7270 var m map[string]*json.RawMessage 7271 err := json.Unmarshal(body, &m) 7272 if err != nil { 7273 return err 7274 } 7275 for k, v := range m { 7276 switch k { 7277 case "name": 7278 if v != nil { 7279 var name string 7280 err = json.Unmarshal(*v, &name) 7281 if err != nil { 7282 return err 7283 } 7284 succi.Name = &name 7285 } 7286 case "id": 7287 if v != nil { 7288 var ID string 7289 err = json.Unmarshal(*v, &ID) 7290 if err != nil { 7291 return err 7292 } 7293 succi.ID = &ID 7294 } 7295 case "properties": 7296 if v != nil { 7297 var softwareUpdateConfigurationCollectionItemProperties SoftwareUpdateConfigurationCollectionItemProperties 7298 err = json.Unmarshal(*v, &softwareUpdateConfigurationCollectionItemProperties) 7299 if err != nil { 7300 return err 7301 } 7302 succi.SoftwareUpdateConfigurationCollectionItemProperties = &softwareUpdateConfigurationCollectionItemProperties 7303 } 7304 } 7305 } 7306 7307 return nil 7308} 7309 7310// SoftwareUpdateConfigurationCollectionItemProperties software update configuration collection item 7311// properties. 7312type SoftwareUpdateConfigurationCollectionItemProperties struct { 7313 // UpdateConfiguration - Update specific properties of the software update configuration. 7314 UpdateConfiguration *CollectionItemUpdateConfiguration `json:"updateConfiguration,omitempty"` 7315 // Frequency - execution frequency of the schedule associated with the software update configuration. Possible values include: 'OneTime', 'Day', 'Hour', 'Week', 'Month', 'Minute' 7316 Frequency ScheduleFrequency `json:"frequency,omitempty"` 7317 // StartTime - the start time of the update. 7318 StartTime *date.Time `json:"startTime,omitempty"` 7319 // CreationTime - READ-ONLY; Creation time of the software update configuration, which only appears in the response. 7320 CreationTime *date.Time `json:"creationTime,omitempty"` 7321 // LastModifiedTime - READ-ONLY; Last time software update configuration was modified, which only appears in the response. 7322 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 7323 // ProvisioningState - READ-ONLY; Provisioning state for the software update configuration, which only appears in the response. 7324 ProvisioningState *string `json:"provisioningState,omitempty"` 7325 // NextRun - ext run time of the update. 7326 NextRun *date.Time `json:"nextRun,omitempty"` 7327} 7328 7329// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationCollectionItemProperties. 7330func (succip SoftwareUpdateConfigurationCollectionItemProperties) MarshalJSON() ([]byte, error) { 7331 objectMap := make(map[string]interface{}) 7332 if succip.UpdateConfiguration != nil { 7333 objectMap["updateConfiguration"] = succip.UpdateConfiguration 7334 } 7335 if succip.Frequency != "" { 7336 objectMap["frequency"] = succip.Frequency 7337 } 7338 if succip.StartTime != nil { 7339 objectMap["startTime"] = succip.StartTime 7340 } 7341 if succip.NextRun != nil { 7342 objectMap["nextRun"] = succip.NextRun 7343 } 7344 return json.Marshal(objectMap) 7345} 7346 7347// SoftwareUpdateConfigurationListResult result of listing all software update configuration 7348type SoftwareUpdateConfigurationListResult struct { 7349 autorest.Response `json:"-"` 7350 // Value - outer object returned when listing all software update configurations 7351 Value *[]SoftwareUpdateConfigurationCollectionItem `json:"value,omitempty"` 7352} 7353 7354// SoftwareUpdateConfigurationMachineRun software update configuration machine run model. 7355type SoftwareUpdateConfigurationMachineRun struct { 7356 autorest.Response `json:"-"` 7357 // Name - READ-ONLY; Name of the software update configuration machine run 7358 Name *string `json:"name,omitempty"` 7359 // ID - READ-ONLY; Resource Id of the software update configuration machine run 7360 ID *string `json:"id,omitempty"` 7361 // UpdateConfigurationMachineRunProperties - Software update configuration machine run properties. 7362 *UpdateConfigurationMachineRunProperties `json:"properties,omitempty"` 7363} 7364 7365// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationMachineRun. 7366func (sucmr SoftwareUpdateConfigurationMachineRun) MarshalJSON() ([]byte, error) { 7367 objectMap := make(map[string]interface{}) 7368 if sucmr.UpdateConfigurationMachineRunProperties != nil { 7369 objectMap["properties"] = sucmr.UpdateConfigurationMachineRunProperties 7370 } 7371 return json.Marshal(objectMap) 7372} 7373 7374// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationMachineRun struct. 7375func (sucmr *SoftwareUpdateConfigurationMachineRun) UnmarshalJSON(body []byte) error { 7376 var m map[string]*json.RawMessage 7377 err := json.Unmarshal(body, &m) 7378 if err != nil { 7379 return err 7380 } 7381 for k, v := range m { 7382 switch k { 7383 case "name": 7384 if v != nil { 7385 var name string 7386 err = json.Unmarshal(*v, &name) 7387 if err != nil { 7388 return err 7389 } 7390 sucmr.Name = &name 7391 } 7392 case "id": 7393 if v != nil { 7394 var ID string 7395 err = json.Unmarshal(*v, &ID) 7396 if err != nil { 7397 return err 7398 } 7399 sucmr.ID = &ID 7400 } 7401 case "properties": 7402 if v != nil { 7403 var updateConfigurationMachineRunProperties UpdateConfigurationMachineRunProperties 7404 err = json.Unmarshal(*v, &updateConfigurationMachineRunProperties) 7405 if err != nil { 7406 return err 7407 } 7408 sucmr.UpdateConfigurationMachineRunProperties = &updateConfigurationMachineRunProperties 7409 } 7410 } 7411 } 7412 7413 return nil 7414} 7415 7416// SoftwareUpdateConfigurationMachineRunListResult result of listing all software update configuration 7417// machine runs 7418type SoftwareUpdateConfigurationMachineRunListResult struct { 7419 autorest.Response `json:"-"` 7420 // Value - outer object returned when listing all software update configuration machine runs 7421 Value *[]SoftwareUpdateConfigurationMachineRun `json:"value,omitempty"` 7422 // NextLink - link to next page of results. 7423 NextLink *string `json:"nextLink,omitempty"` 7424} 7425 7426// SoftwareUpdateConfigurationProperties software update configuration properties. 7427type SoftwareUpdateConfigurationProperties struct { 7428 // UpdateConfiguration - update specific properties for the Software update configuration 7429 UpdateConfiguration *UpdateConfiguration `json:"updateConfiguration,omitempty"` 7430 // ScheduleInfo - Schedule information for the Software update configuration 7431 ScheduleInfo *ScheduleProperties `json:"scheduleInfo,omitempty"` 7432 // ProvisioningState - READ-ONLY; Provisioning state for the software update configuration, which only appears in the response. 7433 ProvisioningState *string `json:"provisioningState,omitempty"` 7434 // Error - Details of provisioning error 7435 Error *ErrorResponse `json:"error,omitempty"` 7436 // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. 7437 CreationTime *date.Time `json:"creationTime,omitempty"` 7438 // CreatedBy - READ-ONLY; CreatedBy property, which only appears in the response. 7439 CreatedBy *string `json:"createdBy,omitempty"` 7440 // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. 7441 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 7442 // LastModifiedBy - READ-ONLY; LastModifiedBy property, which only appears in the response. 7443 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 7444 // Tasks - Tasks information for the Software update configuration. 7445 Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` 7446} 7447 7448// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationProperties. 7449func (sucp SoftwareUpdateConfigurationProperties) MarshalJSON() ([]byte, error) { 7450 objectMap := make(map[string]interface{}) 7451 if sucp.UpdateConfiguration != nil { 7452 objectMap["updateConfiguration"] = sucp.UpdateConfiguration 7453 } 7454 if sucp.ScheduleInfo != nil { 7455 objectMap["scheduleInfo"] = sucp.ScheduleInfo 7456 } 7457 if sucp.Error != nil { 7458 objectMap["error"] = sucp.Error 7459 } 7460 if sucp.Tasks != nil { 7461 objectMap["tasks"] = sucp.Tasks 7462 } 7463 return json.Marshal(objectMap) 7464} 7465 7466// SoftwareUpdateConfigurationRun software update configuration Run properties. 7467type SoftwareUpdateConfigurationRun struct { 7468 autorest.Response `json:"-"` 7469 // Name - READ-ONLY; Name of the software update configuration run. 7470 Name *string `json:"name,omitempty"` 7471 // ID - READ-ONLY; Resource Id of the software update configuration run 7472 ID *string `json:"id,omitempty"` 7473 // SoftwareUpdateConfigurationRunProperties - Software update configuration Run properties. 7474 *SoftwareUpdateConfigurationRunProperties `json:"properties,omitempty"` 7475} 7476 7477// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRun. 7478func (sucr SoftwareUpdateConfigurationRun) MarshalJSON() ([]byte, error) { 7479 objectMap := make(map[string]interface{}) 7480 if sucr.SoftwareUpdateConfigurationRunProperties != nil { 7481 objectMap["properties"] = sucr.SoftwareUpdateConfigurationRunProperties 7482 } 7483 return json.Marshal(objectMap) 7484} 7485 7486// UnmarshalJSON is the custom unmarshaler for SoftwareUpdateConfigurationRun struct. 7487func (sucr *SoftwareUpdateConfigurationRun) UnmarshalJSON(body []byte) error { 7488 var m map[string]*json.RawMessage 7489 err := json.Unmarshal(body, &m) 7490 if err != nil { 7491 return err 7492 } 7493 for k, v := range m { 7494 switch k { 7495 case "name": 7496 if v != nil { 7497 var name string 7498 err = json.Unmarshal(*v, &name) 7499 if err != nil { 7500 return err 7501 } 7502 sucr.Name = &name 7503 } 7504 case "id": 7505 if v != nil { 7506 var ID string 7507 err = json.Unmarshal(*v, &ID) 7508 if err != nil { 7509 return err 7510 } 7511 sucr.ID = &ID 7512 } 7513 case "properties": 7514 if v != nil { 7515 var softwareUpdateConfigurationRunProperties SoftwareUpdateConfigurationRunProperties 7516 err = json.Unmarshal(*v, &softwareUpdateConfigurationRunProperties) 7517 if err != nil { 7518 return err 7519 } 7520 sucr.SoftwareUpdateConfigurationRunProperties = &softwareUpdateConfigurationRunProperties 7521 } 7522 } 7523 } 7524 7525 return nil 7526} 7527 7528// SoftwareUpdateConfigurationRunListResult result of listing all software update configuration runs 7529type SoftwareUpdateConfigurationRunListResult struct { 7530 autorest.Response `json:"-"` 7531 // Value - outer object returned when listing all software update configuration runs 7532 Value *[]SoftwareUpdateConfigurationRun `json:"value,omitempty"` 7533 // NextLink - link to next page of results. 7534 NextLink *string `json:"nextLink,omitempty"` 7535} 7536 7537// SoftwareUpdateConfigurationRunProperties software update configuration properties. 7538type SoftwareUpdateConfigurationRunProperties struct { 7539 // SoftwareUpdateConfiguration - software update configuration triggered this run 7540 SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` 7541 // Status - READ-ONLY; Status of the software update configuration run. 7542 Status *string `json:"status,omitempty"` 7543 // ConfiguredDuration - READ-ONLY; Configured duration for the software update configuration run. 7544 ConfiguredDuration *string `json:"configuredDuration,omitempty"` 7545 // OsType - READ-ONLY; Operating system target of the software update configuration triggered this run 7546 OsType *string `json:"osType,omitempty"` 7547 // StartTime - READ-ONLY; Start time of the software update configuration run. 7548 StartTime *date.Time `json:"startTime,omitempty"` 7549 // EndTime - READ-ONLY; End time of the software update configuration run. 7550 EndTime *date.Time `json:"endTime,omitempty"` 7551 // ComputerCount - READ-ONLY; Number of computers in the software update configuration run. 7552 ComputerCount *int32 `json:"computerCount,omitempty"` 7553 // FailedCount - READ-ONLY; Number of computers with failed status. 7554 FailedCount *int32 `json:"failedCount,omitempty"` 7555 // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. 7556 CreationTime *date.Time `json:"creationTime,omitempty"` 7557 // CreatedBy - READ-ONLY; CreatedBy property, which only appears in the response. 7558 CreatedBy *string `json:"createdBy,omitempty"` 7559 // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. 7560 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 7561 // LastModifiedBy - READ-ONLY; LastModifiedBy property, which only appears in the response. 7562 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 7563 // Tasks - Software update configuration tasks triggered in this run 7564 Tasks *SoftareUpdateConfigurationRunTasks `json:"tasks,omitempty"` 7565} 7566 7567// MarshalJSON is the custom marshaler for SoftwareUpdateConfigurationRunProperties. 7568func (sucrp SoftwareUpdateConfigurationRunProperties) MarshalJSON() ([]byte, error) { 7569 objectMap := make(map[string]interface{}) 7570 if sucrp.SoftwareUpdateConfiguration != nil { 7571 objectMap["softwareUpdateConfiguration"] = sucrp.SoftwareUpdateConfiguration 7572 } 7573 if sucrp.Tasks != nil { 7574 objectMap["tasks"] = sucrp.Tasks 7575 } 7576 return json.Marshal(objectMap) 7577} 7578 7579// SoftwareUpdateConfigurationTasks task properties of the software update configuration. 7580type SoftwareUpdateConfigurationTasks struct { 7581 // PreTask - Pre task properties. 7582 PreTask *TaskProperties `json:"preTask,omitempty"` 7583 // PostTask - Post task properties. 7584 PostTask *TaskProperties `json:"postTask,omitempty"` 7585} 7586 7587// SourceControl definition of the source control. 7588type SourceControl struct { 7589 autorest.Response `json:"-"` 7590 // SourceControlProperties - The properties of the source control. 7591 *SourceControlProperties `json:"properties,omitempty"` 7592 // ID - READ-ONLY; Fully qualified resource Id for the resource 7593 ID *string `json:"id,omitempty"` 7594 // Name - READ-ONLY; The name of the resource 7595 Name *string `json:"name,omitempty"` 7596 // Type - READ-ONLY; The type of the resource. 7597 Type *string `json:"type,omitempty"` 7598} 7599 7600// MarshalJSON is the custom marshaler for SourceControl. 7601func (sc SourceControl) MarshalJSON() ([]byte, error) { 7602 objectMap := make(map[string]interface{}) 7603 if sc.SourceControlProperties != nil { 7604 objectMap["properties"] = sc.SourceControlProperties 7605 } 7606 return json.Marshal(objectMap) 7607} 7608 7609// UnmarshalJSON is the custom unmarshaler for SourceControl struct. 7610func (sc *SourceControl) UnmarshalJSON(body []byte) error { 7611 var m map[string]*json.RawMessage 7612 err := json.Unmarshal(body, &m) 7613 if err != nil { 7614 return err 7615 } 7616 for k, v := range m { 7617 switch k { 7618 case "properties": 7619 if v != nil { 7620 var sourceControlProperties SourceControlProperties 7621 err = json.Unmarshal(*v, &sourceControlProperties) 7622 if err != nil { 7623 return err 7624 } 7625 sc.SourceControlProperties = &sourceControlProperties 7626 } 7627 case "id": 7628 if v != nil { 7629 var ID string 7630 err = json.Unmarshal(*v, &ID) 7631 if err != nil { 7632 return err 7633 } 7634 sc.ID = &ID 7635 } 7636 case "name": 7637 if v != nil { 7638 var name string 7639 err = json.Unmarshal(*v, &name) 7640 if err != nil { 7641 return err 7642 } 7643 sc.Name = &name 7644 } 7645 case "type": 7646 if v != nil { 7647 var typeVar string 7648 err = json.Unmarshal(*v, &typeVar) 7649 if err != nil { 7650 return err 7651 } 7652 sc.Type = &typeVar 7653 } 7654 } 7655 } 7656 7657 return nil 7658} 7659 7660// SourceControlCreateOrUpdateParameters the parameters supplied to the create or update source control 7661// operation. 7662type SourceControlCreateOrUpdateParameters struct { 7663 // SourceControlCreateOrUpdateProperties - The properties of the source control. 7664 *SourceControlCreateOrUpdateProperties `json:"properties,omitempty"` 7665} 7666 7667// MarshalJSON is the custom marshaler for SourceControlCreateOrUpdateParameters. 7668func (sccoup SourceControlCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 7669 objectMap := make(map[string]interface{}) 7670 if sccoup.SourceControlCreateOrUpdateProperties != nil { 7671 objectMap["properties"] = sccoup.SourceControlCreateOrUpdateProperties 7672 } 7673 return json.Marshal(objectMap) 7674} 7675 7676// UnmarshalJSON is the custom unmarshaler for SourceControlCreateOrUpdateParameters struct. 7677func (sccoup *SourceControlCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 7678 var m map[string]*json.RawMessage 7679 err := json.Unmarshal(body, &m) 7680 if err != nil { 7681 return err 7682 } 7683 for k, v := range m { 7684 switch k { 7685 case "properties": 7686 if v != nil { 7687 var sourceControlCreateOrUpdateProperties SourceControlCreateOrUpdateProperties 7688 err = json.Unmarshal(*v, &sourceControlCreateOrUpdateProperties) 7689 if err != nil { 7690 return err 7691 } 7692 sccoup.SourceControlCreateOrUpdateProperties = &sourceControlCreateOrUpdateProperties 7693 } 7694 } 7695 } 7696 7697 return nil 7698} 7699 7700// SourceControlCreateOrUpdateProperties the properties of the create source control operation. 7701type SourceControlCreateOrUpdateProperties struct { 7702 // RepoURL - The repo url of the source control. 7703 RepoURL *string `json:"repoUrl,omitempty"` 7704 // Branch - The repo branch of the source control. Include branch as empty string for VsoTfvc. 7705 Branch *string `json:"branch,omitempty"` 7706 // FolderPath - The folder path of the source control. Path must be relative. 7707 FolderPath *string `json:"folderPath,omitempty"` 7708 // AutoSync - The auto async of the source control. Default is false. 7709 AutoSync *bool `json:"autoSync,omitempty"` 7710 // PublishRunbook - The auto publish of the source control. Default is true. 7711 PublishRunbook *bool `json:"publishRunbook,omitempty"` 7712 // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' 7713 SourceType SourceType `json:"sourceType,omitempty"` 7714 // SecurityToken - The authorization token for the repo of the source control. 7715 SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` 7716 // Description - The user description of the source control. 7717 Description *string `json:"description,omitempty"` 7718} 7719 7720// SourceControlListResult the response model for the list source controls operation. 7721type SourceControlListResult struct { 7722 autorest.Response `json:"-"` 7723 // Value - The list of source controls. 7724 Value *[]SourceControl `json:"value,omitempty"` 7725 // NextLink - The next link. 7726 NextLink *string `json:"nextLink,omitempty"` 7727} 7728 7729// SourceControlListResultIterator provides access to a complete listing of SourceControl values. 7730type SourceControlListResultIterator struct { 7731 i int 7732 page SourceControlListResultPage 7733} 7734 7735// NextWithContext advances to the next value. If there was an error making 7736// the request the iterator does not advance and the error is returned. 7737func (iter *SourceControlListResultIterator) NextWithContext(ctx context.Context) (err error) { 7738 if tracing.IsEnabled() { 7739 ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlListResultIterator.NextWithContext") 7740 defer func() { 7741 sc := -1 7742 if iter.Response().Response.Response != nil { 7743 sc = iter.Response().Response.Response.StatusCode 7744 } 7745 tracing.EndSpan(ctx, sc, err) 7746 }() 7747 } 7748 iter.i++ 7749 if iter.i < len(iter.page.Values()) { 7750 return nil 7751 } 7752 err = iter.page.NextWithContext(ctx) 7753 if err != nil { 7754 iter.i-- 7755 return err 7756 } 7757 iter.i = 0 7758 return nil 7759} 7760 7761// Next advances to the next value. If there was an error making 7762// the request the iterator does not advance and the error is returned. 7763// Deprecated: Use NextWithContext() instead. 7764func (iter *SourceControlListResultIterator) Next() error { 7765 return iter.NextWithContext(context.Background()) 7766} 7767 7768// NotDone returns true if the enumeration should be started or is not yet complete. 7769func (iter SourceControlListResultIterator) NotDone() bool { 7770 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7771} 7772 7773// Response returns the raw server response from the last page request. 7774func (iter SourceControlListResultIterator) Response() SourceControlListResult { 7775 return iter.page.Response() 7776} 7777 7778// Value returns the current value or a zero-initialized value if the 7779// iterator has advanced beyond the end of the collection. 7780func (iter SourceControlListResultIterator) Value() SourceControl { 7781 if !iter.page.NotDone() { 7782 return SourceControl{} 7783 } 7784 return iter.page.Values()[iter.i] 7785} 7786 7787// Creates a new instance of the SourceControlListResultIterator type. 7788func NewSourceControlListResultIterator(page SourceControlListResultPage) SourceControlListResultIterator { 7789 return SourceControlListResultIterator{page: page} 7790} 7791 7792// IsEmpty returns true if the ListResult contains no values. 7793func (sclr SourceControlListResult) IsEmpty() bool { 7794 return sclr.Value == nil || len(*sclr.Value) == 0 7795} 7796 7797// hasNextLink returns true if the NextLink is not empty. 7798func (sclr SourceControlListResult) hasNextLink() bool { 7799 return sclr.NextLink != nil && len(*sclr.NextLink) != 0 7800} 7801 7802// sourceControlListResultPreparer prepares a request to retrieve the next set of results. 7803// It returns nil if no more results exist. 7804func (sclr SourceControlListResult) sourceControlListResultPreparer(ctx context.Context) (*http.Request, error) { 7805 if !sclr.hasNextLink() { 7806 return nil, nil 7807 } 7808 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7809 autorest.AsJSON(), 7810 autorest.AsGet(), 7811 autorest.WithBaseURL(to.String(sclr.NextLink))) 7812} 7813 7814// SourceControlListResultPage contains a page of SourceControl values. 7815type SourceControlListResultPage struct { 7816 fn func(context.Context, SourceControlListResult) (SourceControlListResult, error) 7817 sclr SourceControlListResult 7818} 7819 7820// NextWithContext advances to the next page of values. If there was an error making 7821// the request the page does not advance and the error is returned. 7822func (page *SourceControlListResultPage) NextWithContext(ctx context.Context) (err error) { 7823 if tracing.IsEnabled() { 7824 ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlListResultPage.NextWithContext") 7825 defer func() { 7826 sc := -1 7827 if page.Response().Response.Response != nil { 7828 sc = page.Response().Response.Response.StatusCode 7829 } 7830 tracing.EndSpan(ctx, sc, err) 7831 }() 7832 } 7833 for { 7834 next, err := page.fn(ctx, page.sclr) 7835 if err != nil { 7836 return err 7837 } 7838 page.sclr = next 7839 if !next.hasNextLink() || !next.IsEmpty() { 7840 break 7841 } 7842 } 7843 return nil 7844} 7845 7846// Next advances to the next page of values. If there was an error making 7847// the request the page does not advance and the error is returned. 7848// Deprecated: Use NextWithContext() instead. 7849func (page *SourceControlListResultPage) Next() error { 7850 return page.NextWithContext(context.Background()) 7851} 7852 7853// NotDone returns true if the page enumeration should be started or is not yet complete. 7854func (page SourceControlListResultPage) NotDone() bool { 7855 return !page.sclr.IsEmpty() 7856} 7857 7858// Response returns the raw server response from the last page request. 7859func (page SourceControlListResultPage) Response() SourceControlListResult { 7860 return page.sclr 7861} 7862 7863// Values returns the slice of values for the current page or nil if there are no values. 7864func (page SourceControlListResultPage) Values() []SourceControl { 7865 if page.sclr.IsEmpty() { 7866 return nil 7867 } 7868 return *page.sclr.Value 7869} 7870 7871// Creates a new instance of the SourceControlListResultPage type. 7872func NewSourceControlListResultPage(cur SourceControlListResult, getNextPage func(context.Context, SourceControlListResult) (SourceControlListResult, error)) SourceControlListResultPage { 7873 return SourceControlListResultPage{ 7874 fn: getNextPage, 7875 sclr: cur, 7876 } 7877} 7878 7879// SourceControlProperties definition of the source control properties 7880type SourceControlProperties struct { 7881 // RepoURL - The repo url of the source control. 7882 RepoURL *string `json:"repoUrl,omitempty"` 7883 // Branch - The repo branch of the source control. Include branch as empty string for VsoTfvc. 7884 Branch *string `json:"branch,omitempty"` 7885 // FolderPath - The folder path of the source control. 7886 FolderPath *string `json:"folderPath,omitempty"` 7887 // AutoSync - The auto sync of the source control. Default is false. 7888 AutoSync *bool `json:"autoSync,omitempty"` 7889 // PublishRunbook - The auto publish of the source control. Default is true. 7890 PublishRunbook *bool `json:"publishRunbook,omitempty"` 7891 // SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub. Possible values include: 'VsoGit', 'VsoTfvc', 'GitHub' 7892 SourceType SourceType `json:"sourceType,omitempty"` 7893 // Description - The description. 7894 Description *string `json:"description,omitempty"` 7895 // CreationTime - The creation time. 7896 CreationTime *date.Time `json:"creationTime,omitempty"` 7897 // LastModifiedTime - The last modified time. 7898 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 7899} 7900 7901// SourceControlSecurityTokenProperties ... 7902type SourceControlSecurityTokenProperties struct { 7903 // AccessToken - The access token. 7904 AccessToken *string `json:"accessToken,omitempty"` 7905 // RefreshToken - The refresh token. 7906 RefreshToken *string `json:"refreshToken,omitempty"` 7907 // TokenType - The token type. Must be either PersonalAccessToken or Oauth. Possible values include: 'PersonalAccessToken', 'Oauth' 7908 TokenType TokenType `json:"tokenType,omitempty"` 7909} 7910 7911// SourceControlSyncJob definition of the source control sync job. 7912type SourceControlSyncJob struct { 7913 autorest.Response `json:"-"` 7914 // Name - READ-ONLY; Resource name. 7915 Name *string `json:"name,omitempty"` 7916 // Type - READ-ONLY; Resource type. 7917 Type *string `json:"type,omitempty"` 7918 // ID - READ-ONLY; Resource id. 7919 ID *string `json:"id,omitempty"` 7920 // SourceControlSyncJobProperties - The properties of the source control sync job. 7921 *SourceControlSyncJobProperties `json:"properties,omitempty"` 7922} 7923 7924// MarshalJSON is the custom marshaler for SourceControlSyncJob. 7925func (scsj SourceControlSyncJob) MarshalJSON() ([]byte, error) { 7926 objectMap := make(map[string]interface{}) 7927 if scsj.SourceControlSyncJobProperties != nil { 7928 objectMap["properties"] = scsj.SourceControlSyncJobProperties 7929 } 7930 return json.Marshal(objectMap) 7931} 7932 7933// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJob struct. 7934func (scsj *SourceControlSyncJob) UnmarshalJSON(body []byte) error { 7935 var m map[string]*json.RawMessage 7936 err := json.Unmarshal(body, &m) 7937 if err != nil { 7938 return err 7939 } 7940 for k, v := range m { 7941 switch k { 7942 case "name": 7943 if v != nil { 7944 var name string 7945 err = json.Unmarshal(*v, &name) 7946 if err != nil { 7947 return err 7948 } 7949 scsj.Name = &name 7950 } 7951 case "type": 7952 if v != nil { 7953 var typeVar string 7954 err = json.Unmarshal(*v, &typeVar) 7955 if err != nil { 7956 return err 7957 } 7958 scsj.Type = &typeVar 7959 } 7960 case "id": 7961 if v != nil { 7962 var ID string 7963 err = json.Unmarshal(*v, &ID) 7964 if err != nil { 7965 return err 7966 } 7967 scsj.ID = &ID 7968 } 7969 case "properties": 7970 if v != nil { 7971 var sourceControlSyncJobProperties SourceControlSyncJobProperties 7972 err = json.Unmarshal(*v, &sourceControlSyncJobProperties) 7973 if err != nil { 7974 return err 7975 } 7976 scsj.SourceControlSyncJobProperties = &sourceControlSyncJobProperties 7977 } 7978 } 7979 } 7980 7981 return nil 7982} 7983 7984// SourceControlSyncJobByID definition of the source control sync job. 7985type SourceControlSyncJobByID struct { 7986 autorest.Response `json:"-"` 7987 // ID - The id of the job. 7988 ID *string `json:"id,omitempty"` 7989 // SourceControlSyncJobByIDProperties - The properties of the source control sync job. 7990 *SourceControlSyncJobByIDProperties `json:"properties,omitempty"` 7991} 7992 7993// MarshalJSON is the custom marshaler for SourceControlSyncJobByID. 7994func (scsjbi SourceControlSyncJobByID) MarshalJSON() ([]byte, error) { 7995 objectMap := make(map[string]interface{}) 7996 if scsjbi.ID != nil { 7997 objectMap["id"] = scsjbi.ID 7998 } 7999 if scsjbi.SourceControlSyncJobByIDProperties != nil { 8000 objectMap["properties"] = scsjbi.SourceControlSyncJobByIDProperties 8001 } 8002 return json.Marshal(objectMap) 8003} 8004 8005// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobByID struct. 8006func (scsjbi *SourceControlSyncJobByID) UnmarshalJSON(body []byte) error { 8007 var m map[string]*json.RawMessage 8008 err := json.Unmarshal(body, &m) 8009 if err != nil { 8010 return err 8011 } 8012 for k, v := range m { 8013 switch k { 8014 case "id": 8015 if v != nil { 8016 var ID string 8017 err = json.Unmarshal(*v, &ID) 8018 if err != nil { 8019 return err 8020 } 8021 scsjbi.ID = &ID 8022 } 8023 case "properties": 8024 if v != nil { 8025 var sourceControlSyncJobByIDProperties SourceControlSyncJobByIDProperties 8026 err = json.Unmarshal(*v, &sourceControlSyncJobByIDProperties) 8027 if err != nil { 8028 return err 8029 } 8030 scsjbi.SourceControlSyncJobByIDProperties = &sourceControlSyncJobByIDProperties 8031 } 8032 } 8033 } 8034 8035 return nil 8036} 8037 8038// SourceControlSyncJobByIDProperties definition of source control sync job properties. 8039type SourceControlSyncJobByIDProperties struct { 8040 // SourceControlSyncJobID - The source control sync job id. 8041 SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` 8042 // CreationTime - READ-ONLY; The creation time of the job. 8043 CreationTime *date.Time `json:"creationTime,omitempty"` 8044 // ProvisioningState - The provisioning state of the job. Possible values include: 'Completed', 'Failed', 'Running' 8045 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 8046 // StartTime - READ-ONLY; The start time of the job. 8047 StartTime *date.Time `json:"startTime,omitempty"` 8048 // EndTime - READ-ONLY; The end time of the job. 8049 EndTime *date.Time `json:"endTime,omitempty"` 8050 // SyncType - The sync type. Possible values include: 'PartialSync', 'FullSync' 8051 SyncType SyncType `json:"syncType,omitempty"` 8052 // Exception - The exceptions that occurred while running the sync job. 8053 Exception *string `json:"exception,omitempty"` 8054} 8055 8056// MarshalJSON is the custom marshaler for SourceControlSyncJobByIDProperties. 8057func (scsjbip SourceControlSyncJobByIDProperties) MarshalJSON() ([]byte, error) { 8058 objectMap := make(map[string]interface{}) 8059 if scsjbip.SourceControlSyncJobID != nil { 8060 objectMap["sourceControlSyncJobId"] = scsjbip.SourceControlSyncJobID 8061 } 8062 if scsjbip.ProvisioningState != "" { 8063 objectMap["provisioningState"] = scsjbip.ProvisioningState 8064 } 8065 if scsjbip.SyncType != "" { 8066 objectMap["syncType"] = scsjbip.SyncType 8067 } 8068 if scsjbip.Exception != nil { 8069 objectMap["exception"] = scsjbip.Exception 8070 } 8071 return json.Marshal(objectMap) 8072} 8073 8074// SourceControlSyncJobCreateParameters the parameters supplied to the create source control sync job 8075// operation. 8076type SourceControlSyncJobCreateParameters struct { 8077 // SourceControlSyncJobCreateProperties - The properties of the source control sync job. 8078 *SourceControlSyncJobCreateProperties `json:"properties,omitempty"` 8079} 8080 8081// MarshalJSON is the custom marshaler for SourceControlSyncJobCreateParameters. 8082func (scsjcp SourceControlSyncJobCreateParameters) MarshalJSON() ([]byte, error) { 8083 objectMap := make(map[string]interface{}) 8084 if scsjcp.SourceControlSyncJobCreateProperties != nil { 8085 objectMap["properties"] = scsjcp.SourceControlSyncJobCreateProperties 8086 } 8087 return json.Marshal(objectMap) 8088} 8089 8090// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobCreateParameters struct. 8091func (scsjcp *SourceControlSyncJobCreateParameters) UnmarshalJSON(body []byte) error { 8092 var m map[string]*json.RawMessage 8093 err := json.Unmarshal(body, &m) 8094 if err != nil { 8095 return err 8096 } 8097 for k, v := range m { 8098 switch k { 8099 case "properties": 8100 if v != nil { 8101 var sourceControlSyncJobCreateProperties SourceControlSyncJobCreateProperties 8102 err = json.Unmarshal(*v, &sourceControlSyncJobCreateProperties) 8103 if err != nil { 8104 return err 8105 } 8106 scsjcp.SourceControlSyncJobCreateProperties = &sourceControlSyncJobCreateProperties 8107 } 8108 } 8109 } 8110 8111 return nil 8112} 8113 8114// SourceControlSyncJobCreateProperties definition of create source control sync job properties. 8115type SourceControlSyncJobCreateProperties struct { 8116 // CommitID - The commit id of the source control sync job. If not syncing to a commitId, enter an empty string. 8117 CommitID *string `json:"commitId,omitempty"` 8118} 8119 8120// SourceControlSyncJobListResult the response model for the list source control sync jobs operation. 8121type SourceControlSyncJobListResult struct { 8122 autorest.Response `json:"-"` 8123 // Value - The list of source control sync jobs. 8124 Value *[]SourceControlSyncJob `json:"value,omitempty"` 8125 // NextLink - The next link. 8126 NextLink *string `json:"nextLink,omitempty"` 8127} 8128 8129// SourceControlSyncJobListResultIterator provides access to a complete listing of SourceControlSyncJob 8130// values. 8131type SourceControlSyncJobListResultIterator struct { 8132 i int 8133 page SourceControlSyncJobListResultPage 8134} 8135 8136// NextWithContext advances to the next value. If there was an error making 8137// the request the iterator does not advance and the error is returned. 8138func (iter *SourceControlSyncJobListResultIterator) NextWithContext(ctx context.Context) (err error) { 8139 if tracing.IsEnabled() { 8140 ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobListResultIterator.NextWithContext") 8141 defer func() { 8142 sc := -1 8143 if iter.Response().Response.Response != nil { 8144 sc = iter.Response().Response.Response.StatusCode 8145 } 8146 tracing.EndSpan(ctx, sc, err) 8147 }() 8148 } 8149 iter.i++ 8150 if iter.i < len(iter.page.Values()) { 8151 return nil 8152 } 8153 err = iter.page.NextWithContext(ctx) 8154 if err != nil { 8155 iter.i-- 8156 return err 8157 } 8158 iter.i = 0 8159 return nil 8160} 8161 8162// Next advances to the next value. If there was an error making 8163// the request the iterator does not advance and the error is returned. 8164// Deprecated: Use NextWithContext() instead. 8165func (iter *SourceControlSyncJobListResultIterator) Next() error { 8166 return iter.NextWithContext(context.Background()) 8167} 8168 8169// NotDone returns true if the enumeration should be started or is not yet complete. 8170func (iter SourceControlSyncJobListResultIterator) NotDone() bool { 8171 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8172} 8173 8174// Response returns the raw server response from the last page request. 8175func (iter SourceControlSyncJobListResultIterator) Response() SourceControlSyncJobListResult { 8176 return iter.page.Response() 8177} 8178 8179// Value returns the current value or a zero-initialized value if the 8180// iterator has advanced beyond the end of the collection. 8181func (iter SourceControlSyncJobListResultIterator) Value() SourceControlSyncJob { 8182 if !iter.page.NotDone() { 8183 return SourceControlSyncJob{} 8184 } 8185 return iter.page.Values()[iter.i] 8186} 8187 8188// Creates a new instance of the SourceControlSyncJobListResultIterator type. 8189func NewSourceControlSyncJobListResultIterator(page SourceControlSyncJobListResultPage) SourceControlSyncJobListResultIterator { 8190 return SourceControlSyncJobListResultIterator{page: page} 8191} 8192 8193// IsEmpty returns true if the ListResult contains no values. 8194func (scsjlr SourceControlSyncJobListResult) IsEmpty() bool { 8195 return scsjlr.Value == nil || len(*scsjlr.Value) == 0 8196} 8197 8198// hasNextLink returns true if the NextLink is not empty. 8199func (scsjlr SourceControlSyncJobListResult) hasNextLink() bool { 8200 return scsjlr.NextLink != nil && len(*scsjlr.NextLink) != 0 8201} 8202 8203// sourceControlSyncJobListResultPreparer prepares a request to retrieve the next set of results. 8204// It returns nil if no more results exist. 8205func (scsjlr SourceControlSyncJobListResult) sourceControlSyncJobListResultPreparer(ctx context.Context) (*http.Request, error) { 8206 if !scsjlr.hasNextLink() { 8207 return nil, nil 8208 } 8209 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8210 autorest.AsJSON(), 8211 autorest.AsGet(), 8212 autorest.WithBaseURL(to.String(scsjlr.NextLink))) 8213} 8214 8215// SourceControlSyncJobListResultPage contains a page of SourceControlSyncJob values. 8216type SourceControlSyncJobListResultPage struct { 8217 fn func(context.Context, SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error) 8218 scsjlr SourceControlSyncJobListResult 8219} 8220 8221// NextWithContext advances to the next page of values. If there was an error making 8222// the request the page does not advance and the error is returned. 8223func (page *SourceControlSyncJobListResultPage) NextWithContext(ctx context.Context) (err error) { 8224 if tracing.IsEnabled() { 8225 ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobListResultPage.NextWithContext") 8226 defer func() { 8227 sc := -1 8228 if page.Response().Response.Response != nil { 8229 sc = page.Response().Response.Response.StatusCode 8230 } 8231 tracing.EndSpan(ctx, sc, err) 8232 }() 8233 } 8234 for { 8235 next, err := page.fn(ctx, page.scsjlr) 8236 if err != nil { 8237 return err 8238 } 8239 page.scsjlr = next 8240 if !next.hasNextLink() || !next.IsEmpty() { 8241 break 8242 } 8243 } 8244 return nil 8245} 8246 8247// Next advances to the next page of values. If there was an error making 8248// the request the page does not advance and the error is returned. 8249// Deprecated: Use NextWithContext() instead. 8250func (page *SourceControlSyncJobListResultPage) Next() error { 8251 return page.NextWithContext(context.Background()) 8252} 8253 8254// NotDone returns true if the page enumeration should be started or is not yet complete. 8255func (page SourceControlSyncJobListResultPage) NotDone() bool { 8256 return !page.scsjlr.IsEmpty() 8257} 8258 8259// Response returns the raw server response from the last page request. 8260func (page SourceControlSyncJobListResultPage) Response() SourceControlSyncJobListResult { 8261 return page.scsjlr 8262} 8263 8264// Values returns the slice of values for the current page or nil if there are no values. 8265func (page SourceControlSyncJobListResultPage) Values() []SourceControlSyncJob { 8266 if page.scsjlr.IsEmpty() { 8267 return nil 8268 } 8269 return *page.scsjlr.Value 8270} 8271 8272// Creates a new instance of the SourceControlSyncJobListResultPage type. 8273func NewSourceControlSyncJobListResultPage(cur SourceControlSyncJobListResult, getNextPage func(context.Context, SourceControlSyncJobListResult) (SourceControlSyncJobListResult, error)) SourceControlSyncJobListResultPage { 8274 return SourceControlSyncJobListResultPage{ 8275 fn: getNextPage, 8276 scsjlr: cur, 8277 } 8278} 8279 8280// SourceControlSyncJobProperties definition of source control sync job properties. 8281type SourceControlSyncJobProperties struct { 8282 // SourceControlSyncJobID - The source control sync job id. 8283 SourceControlSyncJobID *string `json:"sourceControlSyncJobId,omitempty"` 8284 // CreationTime - READ-ONLY; The creation time of the job. 8285 CreationTime *date.Time `json:"creationTime,omitempty"` 8286 // ProvisioningState - The provisioning state of the job. Possible values include: 'Completed', 'Failed', 'Running' 8287 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 8288 // StartTime - READ-ONLY; The start time of the job. 8289 StartTime *date.Time `json:"startTime,omitempty"` 8290 // EndTime - READ-ONLY; The end time of the job. 8291 EndTime *date.Time `json:"endTime,omitempty"` 8292 // SyncType - The sync type. Possible values include: 'PartialSync', 'FullSync' 8293 SyncType SyncType `json:"syncType,omitempty"` 8294} 8295 8296// MarshalJSON is the custom marshaler for SourceControlSyncJobProperties. 8297func (scsjp SourceControlSyncJobProperties) MarshalJSON() ([]byte, error) { 8298 objectMap := make(map[string]interface{}) 8299 if scsjp.SourceControlSyncJobID != nil { 8300 objectMap["sourceControlSyncJobId"] = scsjp.SourceControlSyncJobID 8301 } 8302 if scsjp.ProvisioningState != "" { 8303 objectMap["provisioningState"] = scsjp.ProvisioningState 8304 } 8305 if scsjp.SyncType != "" { 8306 objectMap["syncType"] = scsjp.SyncType 8307 } 8308 return json.Marshal(objectMap) 8309} 8310 8311// SourceControlSyncJobStream definition of the source control sync job stream. 8312type SourceControlSyncJobStream struct { 8313 // ID - READ-ONLY; Resource id. 8314 ID *string `json:"id,omitempty"` 8315 // SourceControlSyncJobStreamProperties - The properties of the source control sync job stream. 8316 *SourceControlSyncJobStreamProperties `json:"properties,omitempty"` 8317} 8318 8319// MarshalJSON is the custom marshaler for SourceControlSyncJobStream. 8320func (scsjs SourceControlSyncJobStream) MarshalJSON() ([]byte, error) { 8321 objectMap := make(map[string]interface{}) 8322 if scsjs.SourceControlSyncJobStreamProperties != nil { 8323 objectMap["properties"] = scsjs.SourceControlSyncJobStreamProperties 8324 } 8325 return json.Marshal(objectMap) 8326} 8327 8328// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStream struct. 8329func (scsjs *SourceControlSyncJobStream) UnmarshalJSON(body []byte) error { 8330 var m map[string]*json.RawMessage 8331 err := json.Unmarshal(body, &m) 8332 if err != nil { 8333 return err 8334 } 8335 for k, v := range m { 8336 switch k { 8337 case "id": 8338 if v != nil { 8339 var ID string 8340 err = json.Unmarshal(*v, &ID) 8341 if err != nil { 8342 return err 8343 } 8344 scsjs.ID = &ID 8345 } 8346 case "properties": 8347 if v != nil { 8348 var sourceControlSyncJobStreamProperties SourceControlSyncJobStreamProperties 8349 err = json.Unmarshal(*v, &sourceControlSyncJobStreamProperties) 8350 if err != nil { 8351 return err 8352 } 8353 scsjs.SourceControlSyncJobStreamProperties = &sourceControlSyncJobStreamProperties 8354 } 8355 } 8356 } 8357 8358 return nil 8359} 8360 8361// SourceControlSyncJobStreamByID definition of the source control sync job stream by id. 8362type SourceControlSyncJobStreamByID struct { 8363 autorest.Response `json:"-"` 8364 // ID - READ-ONLY; Resource id. 8365 ID *string `json:"id,omitempty"` 8366 // SourceControlSyncJobStreamByIDProperties - The properties of the source control sync job stream. 8367 *SourceControlSyncJobStreamByIDProperties `json:"properties,omitempty"` 8368} 8369 8370// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByID. 8371func (scsjsbi SourceControlSyncJobStreamByID) MarshalJSON() ([]byte, error) { 8372 objectMap := make(map[string]interface{}) 8373 if scsjsbi.SourceControlSyncJobStreamByIDProperties != nil { 8374 objectMap["properties"] = scsjsbi.SourceControlSyncJobStreamByIDProperties 8375 } 8376 return json.Marshal(objectMap) 8377} 8378 8379// UnmarshalJSON is the custom unmarshaler for SourceControlSyncJobStreamByID struct. 8380func (scsjsbi *SourceControlSyncJobStreamByID) UnmarshalJSON(body []byte) error { 8381 var m map[string]*json.RawMessage 8382 err := json.Unmarshal(body, &m) 8383 if err != nil { 8384 return err 8385 } 8386 for k, v := range m { 8387 switch k { 8388 case "id": 8389 if v != nil { 8390 var ID string 8391 err = json.Unmarshal(*v, &ID) 8392 if err != nil { 8393 return err 8394 } 8395 scsjsbi.ID = &ID 8396 } 8397 case "properties": 8398 if v != nil { 8399 var sourceControlSyncJobStreamByIDProperties SourceControlSyncJobStreamByIDProperties 8400 err = json.Unmarshal(*v, &sourceControlSyncJobStreamByIDProperties) 8401 if err != nil { 8402 return err 8403 } 8404 scsjsbi.SourceControlSyncJobStreamByIDProperties = &sourceControlSyncJobStreamByIDProperties 8405 } 8406 } 8407 } 8408 8409 return nil 8410} 8411 8412// SourceControlSyncJobStreamByIDProperties definition of source control sync job stream by id properties. 8413type SourceControlSyncJobStreamByIDProperties struct { 8414 // SourceControlSyncJobStreamID - The sync job stream id. 8415 SourceControlSyncJobStreamID *string `json:"sourceControlSyncJobStreamId,omitempty"` 8416 // Summary - The summary of the sync job stream. 8417 Summary *string `json:"summary,omitempty"` 8418 // Time - READ-ONLY; The time of the sync job stream. 8419 Time *date.Time `json:"time,omitempty"` 8420 // StreamType - The type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' 8421 StreamType StreamType `json:"streamType,omitempty"` 8422 // StreamText - The text of the sync job stream. 8423 StreamText *string `json:"streamText,omitempty"` 8424 // Value - The values of the job stream. 8425 Value map[string]interface{} `json:"value"` 8426} 8427 8428// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamByIDProperties. 8429func (scsjsbip SourceControlSyncJobStreamByIDProperties) MarshalJSON() ([]byte, error) { 8430 objectMap := make(map[string]interface{}) 8431 if scsjsbip.SourceControlSyncJobStreamID != nil { 8432 objectMap["sourceControlSyncJobStreamId"] = scsjsbip.SourceControlSyncJobStreamID 8433 } 8434 if scsjsbip.Summary != nil { 8435 objectMap["summary"] = scsjsbip.Summary 8436 } 8437 if scsjsbip.StreamType != "" { 8438 objectMap["streamType"] = scsjsbip.StreamType 8439 } 8440 if scsjsbip.StreamText != nil { 8441 objectMap["streamText"] = scsjsbip.StreamText 8442 } 8443 if scsjsbip.Value != nil { 8444 objectMap["value"] = scsjsbip.Value 8445 } 8446 return json.Marshal(objectMap) 8447} 8448 8449// SourceControlSyncJobStreamProperties definition of source control sync job stream properties. 8450type SourceControlSyncJobStreamProperties struct { 8451 // SourceControlSyncJobStreamID - The sync job stream id. 8452 SourceControlSyncJobStreamID *string `json:"sourceControlSyncJobStreamId,omitempty"` 8453 // Summary - The summary of the sync job stream. 8454 Summary *string `json:"summary,omitempty"` 8455 // Time - READ-ONLY; The time of the sync job stream. 8456 Time *date.Time `json:"time,omitempty"` 8457 // StreamType - The type of the sync job stream. Possible values include: 'StreamTypeError', 'StreamTypeOutput' 8458 StreamType StreamType `json:"streamType,omitempty"` 8459} 8460 8461// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamProperties. 8462func (scsjsp SourceControlSyncJobStreamProperties) MarshalJSON() ([]byte, error) { 8463 objectMap := make(map[string]interface{}) 8464 if scsjsp.SourceControlSyncJobStreamID != nil { 8465 objectMap["sourceControlSyncJobStreamId"] = scsjsp.SourceControlSyncJobStreamID 8466 } 8467 if scsjsp.Summary != nil { 8468 objectMap["summary"] = scsjsp.Summary 8469 } 8470 if scsjsp.StreamType != "" { 8471 objectMap["streamType"] = scsjsp.StreamType 8472 } 8473 return json.Marshal(objectMap) 8474} 8475 8476// SourceControlSyncJobStreamsListBySyncJob the response model for the list source control sync job streams 8477// operation. 8478type SourceControlSyncJobStreamsListBySyncJob struct { 8479 autorest.Response `json:"-"` 8480 // Value - The list of source control sync job streams. 8481 Value *[]SourceControlSyncJobStream `json:"value,omitempty"` 8482 // NextLink - READ-ONLY; The next link. 8483 NextLink *string `json:"nextLink,omitempty"` 8484} 8485 8486// MarshalJSON is the custom marshaler for SourceControlSyncJobStreamsListBySyncJob. 8487func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) MarshalJSON() ([]byte, error) { 8488 objectMap := make(map[string]interface{}) 8489 if scsjslbsj.Value != nil { 8490 objectMap["value"] = scsjslbsj.Value 8491 } 8492 return json.Marshal(objectMap) 8493} 8494 8495// SourceControlSyncJobStreamsListBySyncJobIterator provides access to a complete listing of 8496// SourceControlSyncJobStream values. 8497type SourceControlSyncJobStreamsListBySyncJobIterator struct { 8498 i int 8499 page SourceControlSyncJobStreamsListBySyncJobPage 8500} 8501 8502// NextWithContext advances to the next value. If there was an error making 8503// the request the iterator does not advance and the error is returned. 8504func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) NextWithContext(ctx context.Context) (err error) { 8505 if tracing.IsEnabled() { 8506 ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsListBySyncJobIterator.NextWithContext") 8507 defer func() { 8508 sc := -1 8509 if iter.Response().Response.Response != nil { 8510 sc = iter.Response().Response.Response.StatusCode 8511 } 8512 tracing.EndSpan(ctx, sc, err) 8513 }() 8514 } 8515 iter.i++ 8516 if iter.i < len(iter.page.Values()) { 8517 return nil 8518 } 8519 err = iter.page.NextWithContext(ctx) 8520 if err != nil { 8521 iter.i-- 8522 return err 8523 } 8524 iter.i = 0 8525 return nil 8526} 8527 8528// Next advances to the next value. If there was an error making 8529// the request the iterator does not advance and the error is returned. 8530// Deprecated: Use NextWithContext() instead. 8531func (iter *SourceControlSyncJobStreamsListBySyncJobIterator) Next() error { 8532 return iter.NextWithContext(context.Background()) 8533} 8534 8535// NotDone returns true if the enumeration should be started or is not yet complete. 8536func (iter SourceControlSyncJobStreamsListBySyncJobIterator) NotDone() bool { 8537 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8538} 8539 8540// Response returns the raw server response from the last page request. 8541func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Response() SourceControlSyncJobStreamsListBySyncJob { 8542 return iter.page.Response() 8543} 8544 8545// Value returns the current value or a zero-initialized value if the 8546// iterator has advanced beyond the end of the collection. 8547func (iter SourceControlSyncJobStreamsListBySyncJobIterator) Value() SourceControlSyncJobStream { 8548 if !iter.page.NotDone() { 8549 return SourceControlSyncJobStream{} 8550 } 8551 return iter.page.Values()[iter.i] 8552} 8553 8554// Creates a new instance of the SourceControlSyncJobStreamsListBySyncJobIterator type. 8555func NewSourceControlSyncJobStreamsListBySyncJobIterator(page SourceControlSyncJobStreamsListBySyncJobPage) SourceControlSyncJobStreamsListBySyncJobIterator { 8556 return SourceControlSyncJobStreamsListBySyncJobIterator{page: page} 8557} 8558 8559// IsEmpty returns true if the ListResult contains no values. 8560func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) IsEmpty() bool { 8561 return scsjslbsj.Value == nil || len(*scsjslbsj.Value) == 0 8562} 8563 8564// hasNextLink returns true if the NextLink is not empty. 8565func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) hasNextLink() bool { 8566 return scsjslbsj.NextLink != nil && len(*scsjslbsj.NextLink) != 0 8567} 8568 8569// sourceControlSyncJobStreamsListBySyncJobPreparer prepares a request to retrieve the next set of results. 8570// It returns nil if no more results exist. 8571func (scsjslbsj SourceControlSyncJobStreamsListBySyncJob) sourceControlSyncJobStreamsListBySyncJobPreparer(ctx context.Context) (*http.Request, error) { 8572 if !scsjslbsj.hasNextLink() { 8573 return nil, nil 8574 } 8575 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8576 autorest.AsJSON(), 8577 autorest.AsGet(), 8578 autorest.WithBaseURL(to.String(scsjslbsj.NextLink))) 8579} 8580 8581// SourceControlSyncJobStreamsListBySyncJobPage contains a page of SourceControlSyncJobStream values. 8582type SourceControlSyncJobStreamsListBySyncJobPage struct { 8583 fn func(context.Context, SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error) 8584 scsjslbsj SourceControlSyncJobStreamsListBySyncJob 8585} 8586 8587// NextWithContext advances to the next page of values. If there was an error making 8588// the request the page does not advance and the error is returned. 8589func (page *SourceControlSyncJobStreamsListBySyncJobPage) NextWithContext(ctx context.Context) (err error) { 8590 if tracing.IsEnabled() { 8591 ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlSyncJobStreamsListBySyncJobPage.NextWithContext") 8592 defer func() { 8593 sc := -1 8594 if page.Response().Response.Response != nil { 8595 sc = page.Response().Response.Response.StatusCode 8596 } 8597 tracing.EndSpan(ctx, sc, err) 8598 }() 8599 } 8600 for { 8601 next, err := page.fn(ctx, page.scsjslbsj) 8602 if err != nil { 8603 return err 8604 } 8605 page.scsjslbsj = next 8606 if !next.hasNextLink() || !next.IsEmpty() { 8607 break 8608 } 8609 } 8610 return nil 8611} 8612 8613// Next advances to the next page of values. If there was an error making 8614// the request the page does not advance and the error is returned. 8615// Deprecated: Use NextWithContext() instead. 8616func (page *SourceControlSyncJobStreamsListBySyncJobPage) Next() error { 8617 return page.NextWithContext(context.Background()) 8618} 8619 8620// NotDone returns true if the page enumeration should be started or is not yet complete. 8621func (page SourceControlSyncJobStreamsListBySyncJobPage) NotDone() bool { 8622 return !page.scsjslbsj.IsEmpty() 8623} 8624 8625// Response returns the raw server response from the last page request. 8626func (page SourceControlSyncJobStreamsListBySyncJobPage) Response() SourceControlSyncJobStreamsListBySyncJob { 8627 return page.scsjslbsj 8628} 8629 8630// Values returns the slice of values for the current page or nil if there are no values. 8631func (page SourceControlSyncJobStreamsListBySyncJobPage) Values() []SourceControlSyncJobStream { 8632 if page.scsjslbsj.IsEmpty() { 8633 return nil 8634 } 8635 return *page.scsjslbsj.Value 8636} 8637 8638// Creates a new instance of the SourceControlSyncJobStreamsListBySyncJobPage type. 8639func NewSourceControlSyncJobStreamsListBySyncJobPage(cur SourceControlSyncJobStreamsListBySyncJob, getNextPage func(context.Context, SourceControlSyncJobStreamsListBySyncJob) (SourceControlSyncJobStreamsListBySyncJob, error)) SourceControlSyncJobStreamsListBySyncJobPage { 8640 return SourceControlSyncJobStreamsListBySyncJobPage{ 8641 fn: getNextPage, 8642 scsjslbsj: cur, 8643 } 8644} 8645 8646// SourceControlUpdateParameters the parameters supplied to the update source control operation. 8647type SourceControlUpdateParameters struct { 8648 // SourceControlUpdateProperties - The value of the source control. 8649 *SourceControlUpdateProperties `json:"properties,omitempty"` 8650} 8651 8652// MarshalJSON is the custom marshaler for SourceControlUpdateParameters. 8653func (scup SourceControlUpdateParameters) MarshalJSON() ([]byte, error) { 8654 objectMap := make(map[string]interface{}) 8655 if scup.SourceControlUpdateProperties != nil { 8656 objectMap["properties"] = scup.SourceControlUpdateProperties 8657 } 8658 return json.Marshal(objectMap) 8659} 8660 8661// UnmarshalJSON is the custom unmarshaler for SourceControlUpdateParameters struct. 8662func (scup *SourceControlUpdateParameters) UnmarshalJSON(body []byte) error { 8663 var m map[string]*json.RawMessage 8664 err := json.Unmarshal(body, &m) 8665 if err != nil { 8666 return err 8667 } 8668 for k, v := range m { 8669 switch k { 8670 case "properties": 8671 if v != nil { 8672 var sourceControlUpdateProperties SourceControlUpdateProperties 8673 err = json.Unmarshal(*v, &sourceControlUpdateProperties) 8674 if err != nil { 8675 return err 8676 } 8677 scup.SourceControlUpdateProperties = &sourceControlUpdateProperties 8678 } 8679 } 8680 } 8681 8682 return nil 8683} 8684 8685// SourceControlUpdateProperties the properties of the update source control 8686type SourceControlUpdateProperties struct { 8687 // Branch - The repo branch of the source control. 8688 Branch *string `json:"branch,omitempty"` 8689 // FolderPath - The folder path of the source control. Path must be relative. 8690 FolderPath *string `json:"folderPath,omitempty"` 8691 // AutoSync - The auto sync of the source control. Default is false. 8692 AutoSync *bool `json:"autoSync,omitempty"` 8693 // PublishRunbook - The auto publish of the source control. Default is true. 8694 PublishRunbook *bool `json:"publishRunbook,omitempty"` 8695 // SecurityToken - The authorization token for the repo of the source control. 8696 SecurityToken *SourceControlSecurityTokenProperties `json:"securityToken,omitempty"` 8697 // Description - The user description of the source control. 8698 Description *string `json:"description,omitempty"` 8699} 8700 8701// Statistics definition of the statistic. 8702type Statistics struct { 8703 // CounterProperty - READ-ONLY; Gets the property value of the statistic. 8704 CounterProperty *string `json:"counterProperty,omitempty"` 8705 // CounterValue - READ-ONLY; Gets the value of the statistic. 8706 CounterValue *int64 `json:"counterValue,omitempty"` 8707 // StartTime - READ-ONLY; Gets the startTime of the statistic. 8708 StartTime *date.Time `json:"startTime,omitempty"` 8709 // EndTime - READ-ONLY; Gets the endTime of the statistic. 8710 EndTime *date.Time `json:"endTime,omitempty"` 8711 // ID - READ-ONLY; Gets the id. 8712 ID *string `json:"id,omitempty"` 8713} 8714 8715// MarshalJSON is the custom marshaler for Statistics. 8716func (s Statistics) MarshalJSON() ([]byte, error) { 8717 objectMap := make(map[string]interface{}) 8718 return json.Marshal(objectMap) 8719} 8720 8721// StatisticsListResult the response model for the list statistics operation. 8722type StatisticsListResult struct { 8723 autorest.Response `json:"-"` 8724 // Value - Gets or sets a list of statistics. 8725 Value *[]Statistics `json:"value,omitempty"` 8726} 8727 8728// String ... 8729type String struct { 8730 autorest.Response `json:"-"` 8731 Value *string `json:"value,omitempty"` 8732} 8733 8734// TagSettingsProperties tag filter information for the VM. 8735type TagSettingsProperties struct { 8736 // Tags - Dictionary of tags with its list of values. 8737 Tags map[string][]string `json:"tags"` 8738 // FilterOperator - Filter VMs by Any or All specified tags. Possible values include: 'TagOperatorsAll', 'TagOperatorsAny' 8739 FilterOperator TagOperators `json:"filterOperator,omitempty"` 8740} 8741 8742// MarshalJSON is the custom marshaler for TagSettingsProperties. 8743func (tsp TagSettingsProperties) MarshalJSON() ([]byte, error) { 8744 objectMap := make(map[string]interface{}) 8745 if tsp.Tags != nil { 8746 objectMap["tags"] = tsp.Tags 8747 } 8748 if tsp.FilterOperator != "" { 8749 objectMap["filterOperator"] = tsp.FilterOperator 8750 } 8751 return json.Marshal(objectMap) 8752} 8753 8754// TargetProperties group specific to the update configuration. 8755type TargetProperties struct { 8756 // AzureQueries - List of Azure queries in the software update configuration. 8757 AzureQueries *[]AzureQueryProperties `json:"azureQueries,omitempty"` 8758 // NonAzureQueries - List of non Azure queries in the software update configuration. 8759 NonAzureQueries *[]NonAzureQueryProperties `json:"nonAzureQueries,omitempty"` 8760} 8761 8762// TaskProperties task properties of the software update configuration. 8763type TaskProperties struct { 8764 // Parameters - Gets or sets the parameters of the task. 8765 Parameters map[string]*string `json:"parameters"` 8766 // Source - Gets or sets the name of the runbook. 8767 Source *string `json:"source,omitempty"` 8768} 8769 8770// MarshalJSON is the custom marshaler for TaskProperties. 8771func (tp TaskProperties) MarshalJSON() ([]byte, error) { 8772 objectMap := make(map[string]interface{}) 8773 if tp.Parameters != nil { 8774 objectMap["parameters"] = tp.Parameters 8775 } 8776 if tp.Source != nil { 8777 objectMap["source"] = tp.Source 8778 } 8779 return json.Marshal(objectMap) 8780} 8781 8782// TestJob definition of the test job. 8783type TestJob struct { 8784 autorest.Response `json:"-"` 8785 // CreationTime - Gets or sets the creation time of the test job. 8786 CreationTime *date.Time `json:"creationTime,omitempty"` 8787 // Status - Gets or sets the status of the test job. 8788 Status *string `json:"status,omitempty"` 8789 // StatusDetails - Gets or sets the status details of the test job. 8790 StatusDetails *string `json:"statusDetails,omitempty"` 8791 // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. 8792 RunOn *string `json:"runOn,omitempty"` 8793 // StartTime - Gets or sets the start time of the test job. 8794 StartTime *date.Time `json:"startTime,omitempty"` 8795 // EndTime - Gets or sets the end time of the test job. 8796 EndTime *date.Time `json:"endTime,omitempty"` 8797 // Exception - Gets or sets the exception of the test job. 8798 Exception *string `json:"exception,omitempty"` 8799 // LastModifiedTime - Gets or sets the last modified time of the test job. 8800 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 8801 // LastStatusModifiedTime - Gets or sets the last status modified time of the test job. 8802 LastStatusModifiedTime *date.Time `json:"lastStatusModifiedTime,omitempty"` 8803 // Parameters - Gets or sets the parameters of the test job. 8804 Parameters map[string]*string `json:"parameters"` 8805 // LogActivityTrace - The activity-level tracing options of the runbook. 8806 LogActivityTrace *int32 `json:"logActivityTrace,omitempty"` 8807} 8808 8809// MarshalJSON is the custom marshaler for TestJob. 8810func (tj TestJob) MarshalJSON() ([]byte, error) { 8811 objectMap := make(map[string]interface{}) 8812 if tj.CreationTime != nil { 8813 objectMap["creationTime"] = tj.CreationTime 8814 } 8815 if tj.Status != nil { 8816 objectMap["status"] = tj.Status 8817 } 8818 if tj.StatusDetails != nil { 8819 objectMap["statusDetails"] = tj.StatusDetails 8820 } 8821 if tj.RunOn != nil { 8822 objectMap["runOn"] = tj.RunOn 8823 } 8824 if tj.StartTime != nil { 8825 objectMap["startTime"] = tj.StartTime 8826 } 8827 if tj.EndTime != nil { 8828 objectMap["endTime"] = tj.EndTime 8829 } 8830 if tj.Exception != nil { 8831 objectMap["exception"] = tj.Exception 8832 } 8833 if tj.LastModifiedTime != nil { 8834 objectMap["lastModifiedTime"] = tj.LastModifiedTime 8835 } 8836 if tj.LastStatusModifiedTime != nil { 8837 objectMap["lastStatusModifiedTime"] = tj.LastStatusModifiedTime 8838 } 8839 if tj.Parameters != nil { 8840 objectMap["parameters"] = tj.Parameters 8841 } 8842 if tj.LogActivityTrace != nil { 8843 objectMap["logActivityTrace"] = tj.LogActivityTrace 8844 } 8845 return json.Marshal(objectMap) 8846} 8847 8848// TestJobCreateParameters the parameters supplied to the create test job operation. 8849type TestJobCreateParameters struct { 8850 // Parameters - Gets or sets the parameters of the test job. 8851 Parameters map[string]*string `json:"parameters"` 8852 // RunOn - Gets or sets the runOn which specifies the group name where the job is to be executed. 8853 RunOn *string `json:"runOn,omitempty"` 8854} 8855 8856// MarshalJSON is the custom marshaler for TestJobCreateParameters. 8857func (tjcp TestJobCreateParameters) MarshalJSON() ([]byte, error) { 8858 objectMap := make(map[string]interface{}) 8859 if tjcp.Parameters != nil { 8860 objectMap["parameters"] = tjcp.Parameters 8861 } 8862 if tjcp.RunOn != nil { 8863 objectMap["runOn"] = tjcp.RunOn 8864 } 8865 return json.Marshal(objectMap) 8866} 8867 8868// TrackedResource the resource model definition for a ARM tracked top level resource 8869type TrackedResource struct { 8870 // Tags - Resource tags. 8871 Tags map[string]*string `json:"tags"` 8872 // Location - The Azure Region where the resource lives 8873 Location *string `json:"location,omitempty"` 8874 // ID - READ-ONLY; Fully qualified resource Id for the resource 8875 ID *string `json:"id,omitempty"` 8876 // Name - READ-ONLY; The name of the resource 8877 Name *string `json:"name,omitempty"` 8878 // Type - READ-ONLY; The type of the resource. 8879 Type *string `json:"type,omitempty"` 8880} 8881 8882// MarshalJSON is the custom marshaler for TrackedResource. 8883func (tr TrackedResource) MarshalJSON() ([]byte, error) { 8884 objectMap := make(map[string]interface{}) 8885 if tr.Tags != nil { 8886 objectMap["tags"] = tr.Tags 8887 } 8888 if tr.Location != nil { 8889 objectMap["location"] = tr.Location 8890 } 8891 return json.Marshal(objectMap) 8892} 8893 8894// TypeField information about a field of a type. 8895type TypeField struct { 8896 // Name - Gets or sets the name of the field. 8897 Name *string `json:"name,omitempty"` 8898 // Type - Gets or sets the type of the field. 8899 Type *string `json:"type,omitempty"` 8900} 8901 8902// TypeFieldListResult the response model for the list fields operation. 8903type TypeFieldListResult struct { 8904 autorest.Response `json:"-"` 8905 // Value - Gets or sets a list of fields. 8906 Value *[]TypeField `json:"value,omitempty"` 8907} 8908 8909// UpdateConfiguration update specific properties of the software update configuration. 8910type UpdateConfiguration struct { 8911 // OperatingSystem - operating system of target machines. Possible values include: 'Windows', 'Linux' 8912 OperatingSystem OperatingSystemType `json:"operatingSystem,omitempty"` 8913 // Windows - Windows specific update configuration. 8914 Windows *WindowsProperties `json:"windows,omitempty"` 8915 // Linux - Linux specific update configuration. 8916 Linux *LinuxProperties `json:"linux,omitempty"` 8917 // Duration - Maximum time allowed for the software update configuration run. Duration needs to be specified using the format PT[n]H[n]M[n]S as per ISO8601 8918 Duration *string `json:"duration,omitempty"` 8919 // AzureVirtualMachines - List of azure resource Ids for azure virtual machines targeted by the software update configuration. 8920 AzureVirtualMachines *[]string `json:"azureVirtualMachines,omitempty"` 8921 // NonAzureComputerNames - List of names of non-azure machines targeted by the software update configuration. 8922 NonAzureComputerNames *[]string `json:"nonAzureComputerNames,omitempty"` 8923 // Targets - Group targets for the software update configuration. 8924 Targets *TargetProperties `json:"targets,omitempty"` 8925} 8926 8927// UpdateConfigurationMachineRunProperties software update configuration machine run properties. 8928type UpdateConfigurationMachineRunProperties struct { 8929 // TargetComputer - READ-ONLY; name of the updated computer 8930 TargetComputer *string `json:"targetComputer,omitempty"` 8931 // TargetComputerType - READ-ONLY; type of the updated computer. 8932 TargetComputerType *string `json:"targetComputerType,omitempty"` 8933 // SoftwareUpdateConfiguration - software update configuration triggered this run 8934 SoftwareUpdateConfiguration *UpdateConfigurationNavigation `json:"softwareUpdateConfiguration,omitempty"` 8935 // Status - READ-ONLY; Status of the software update configuration machine run. 8936 Status *string `json:"status,omitempty"` 8937 // OsType - READ-ONLY; Operating system target of the software update configuration triggered this run 8938 OsType *string `json:"osType,omitempty"` 8939 // CorrelationID - READ-ONLY; correlation id of the software update configuration machine run 8940 CorrelationID *uuid.UUID `json:"correlationId,omitempty"` 8941 // SourceComputerID - READ-ONLY; source computer id of the software update configuration machine run 8942 SourceComputerID *uuid.UUID `json:"sourceComputerId,omitempty"` 8943 // StartTime - READ-ONLY; Start time of the software update configuration machine run. 8944 StartTime *date.Time `json:"startTime,omitempty"` 8945 // EndTime - READ-ONLY; End time of the software update configuration machine run. 8946 EndTime *date.Time `json:"endTime,omitempty"` 8947 // ConfiguredDuration - READ-ONLY; configured duration for the software update configuration run. 8948 ConfiguredDuration *string `json:"configuredDuration,omitempty"` 8949 // Job - Job associated with the software update configuration machine run 8950 Job *JobNavigation `json:"job,omitempty"` 8951 // CreationTime - READ-ONLY; Creation time of the resource, which only appears in the response. 8952 CreationTime *date.Time `json:"creationTime,omitempty"` 8953 // CreatedBy - READ-ONLY; createdBy property, which only appears in the response. 8954 CreatedBy *string `json:"createdBy,omitempty"` 8955 // LastModifiedTime - READ-ONLY; Last time resource was modified, which only appears in the response. 8956 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 8957 // LastModifiedBy - READ-ONLY; lastModifiedBy property, which only appears in the response. 8958 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 8959 // Error - Details of provisioning error 8960 Error *ErrorResponse `json:"error,omitempty"` 8961} 8962 8963// MarshalJSON is the custom marshaler for UpdateConfigurationMachineRunProperties. 8964func (ucmrp UpdateConfigurationMachineRunProperties) MarshalJSON() ([]byte, error) { 8965 objectMap := make(map[string]interface{}) 8966 if ucmrp.SoftwareUpdateConfiguration != nil { 8967 objectMap["softwareUpdateConfiguration"] = ucmrp.SoftwareUpdateConfiguration 8968 } 8969 if ucmrp.Job != nil { 8970 objectMap["job"] = ucmrp.Job 8971 } 8972 if ucmrp.Error != nil { 8973 objectMap["error"] = ucmrp.Error 8974 } 8975 return json.Marshal(objectMap) 8976} 8977 8978// UpdateConfigurationNavigation software update configuration Run Navigation model. 8979type UpdateConfigurationNavigation struct { 8980 // Name - READ-ONLY; Name of the software update configuration triggered the software update configuration run 8981 Name *string `json:"name,omitempty"` 8982} 8983 8984// MarshalJSON is the custom marshaler for UpdateConfigurationNavigation. 8985func (ucn UpdateConfigurationNavigation) MarshalJSON() ([]byte, error) { 8986 objectMap := make(map[string]interface{}) 8987 return json.Marshal(objectMap) 8988} 8989 8990// Usage definition of Usage. 8991type Usage struct { 8992 // ID - Gets or sets the id of the resource. 8993 ID *string `json:"id,omitempty"` 8994 // Name - Gets or sets the usage counter name. 8995 Name *UsageCounterName `json:"name,omitempty"` 8996 // Unit - Gets or sets the usage unit name. 8997 Unit *string `json:"unit,omitempty"` 8998 // CurrentValue - Gets or sets the current usage value. 8999 CurrentValue *float64 `json:"currentValue,omitempty"` 9000 // Limit - Gets or sets max limit. -1 for unlimited 9001 Limit *int64 `json:"limit,omitempty"` 9002 // ThrottleStatus - Gets or sets the throttle status. 9003 ThrottleStatus *string `json:"throttleStatus,omitempty"` 9004} 9005 9006// UsageCounterName definition of usage counter name. 9007type UsageCounterName struct { 9008 // Value - Gets or sets the usage counter name. 9009 Value *string `json:"value,omitempty"` 9010 // LocalizedValue - Gets or sets the localized usage counter name. 9011 LocalizedValue *string `json:"localizedValue,omitempty"` 9012} 9013 9014// UsageListResult the response model for the get usage operation. 9015type UsageListResult struct { 9016 autorest.Response `json:"-"` 9017 // Value - Gets or sets usage. 9018 Value *[]Usage `json:"value,omitempty"` 9019} 9020 9021// Variable definition of the variable. 9022type Variable struct { 9023 autorest.Response `json:"-"` 9024 // VariableProperties - Gets or sets the properties of the variable. 9025 *VariableProperties `json:"properties,omitempty"` 9026 // ID - READ-ONLY; Fully qualified resource Id for the resource 9027 ID *string `json:"id,omitempty"` 9028 // Name - READ-ONLY; The name of the resource 9029 Name *string `json:"name,omitempty"` 9030 // Type - READ-ONLY; The type of the resource. 9031 Type *string `json:"type,omitempty"` 9032} 9033 9034// MarshalJSON is the custom marshaler for Variable. 9035func (vVar Variable) MarshalJSON() ([]byte, error) { 9036 objectMap := make(map[string]interface{}) 9037 if vVar.VariableProperties != nil { 9038 objectMap["properties"] = vVar.VariableProperties 9039 } 9040 return json.Marshal(objectMap) 9041} 9042 9043// UnmarshalJSON is the custom unmarshaler for Variable struct. 9044func (vVar *Variable) UnmarshalJSON(body []byte) error { 9045 var m map[string]*json.RawMessage 9046 err := json.Unmarshal(body, &m) 9047 if err != nil { 9048 return err 9049 } 9050 for k, v := range m { 9051 switch k { 9052 case "properties": 9053 if v != nil { 9054 var variableProperties VariableProperties 9055 err = json.Unmarshal(*v, &variableProperties) 9056 if err != nil { 9057 return err 9058 } 9059 vVar.VariableProperties = &variableProperties 9060 } 9061 case "id": 9062 if v != nil { 9063 var ID string 9064 err = json.Unmarshal(*v, &ID) 9065 if err != nil { 9066 return err 9067 } 9068 vVar.ID = &ID 9069 } 9070 case "name": 9071 if v != nil { 9072 var name string 9073 err = json.Unmarshal(*v, &name) 9074 if err != nil { 9075 return err 9076 } 9077 vVar.Name = &name 9078 } 9079 case "type": 9080 if v != nil { 9081 var typeVar string 9082 err = json.Unmarshal(*v, &typeVar) 9083 if err != nil { 9084 return err 9085 } 9086 vVar.Type = &typeVar 9087 } 9088 } 9089 } 9090 9091 return nil 9092} 9093 9094// VariableCreateOrUpdateParameters the parameters supplied to the create or update variable operation. 9095type VariableCreateOrUpdateParameters struct { 9096 // Name - Gets or sets the name of the variable. 9097 Name *string `json:"name,omitempty"` 9098 // VariableCreateOrUpdateProperties - Gets or sets the properties of the variable. 9099 *VariableCreateOrUpdateProperties `json:"properties,omitempty"` 9100} 9101 9102// MarshalJSON is the custom marshaler for VariableCreateOrUpdateParameters. 9103func (vcoup VariableCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 9104 objectMap := make(map[string]interface{}) 9105 if vcoup.Name != nil { 9106 objectMap["name"] = vcoup.Name 9107 } 9108 if vcoup.VariableCreateOrUpdateProperties != nil { 9109 objectMap["properties"] = vcoup.VariableCreateOrUpdateProperties 9110 } 9111 return json.Marshal(objectMap) 9112} 9113 9114// UnmarshalJSON is the custom unmarshaler for VariableCreateOrUpdateParameters struct. 9115func (vcoup *VariableCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 9116 var m map[string]*json.RawMessage 9117 err := json.Unmarshal(body, &m) 9118 if err != nil { 9119 return err 9120 } 9121 for k, v := range m { 9122 switch k { 9123 case "name": 9124 if v != nil { 9125 var name string 9126 err = json.Unmarshal(*v, &name) 9127 if err != nil { 9128 return err 9129 } 9130 vcoup.Name = &name 9131 } 9132 case "properties": 9133 if v != nil { 9134 var variableCreateOrUpdateProperties VariableCreateOrUpdateProperties 9135 err = json.Unmarshal(*v, &variableCreateOrUpdateProperties) 9136 if err != nil { 9137 return err 9138 } 9139 vcoup.VariableCreateOrUpdateProperties = &variableCreateOrUpdateProperties 9140 } 9141 } 9142 } 9143 9144 return nil 9145} 9146 9147// VariableCreateOrUpdateProperties the properties of the create variable operation. 9148type VariableCreateOrUpdateProperties struct { 9149 // Value - Gets or sets the value of the variable. 9150 Value *string `json:"value,omitempty"` 9151 // Description - Gets or sets the description of the variable. 9152 Description *string `json:"description,omitempty"` 9153 // IsEncrypted - Gets or sets the encrypted flag of the variable. 9154 IsEncrypted *bool `json:"isEncrypted,omitempty"` 9155} 9156 9157// VariableListResult the response model for the list variables operation. 9158type VariableListResult struct { 9159 autorest.Response `json:"-"` 9160 // Value - Gets or sets a list of variables. 9161 Value *[]Variable `json:"value,omitempty"` 9162 // NextLink - Gets or sets the next link. 9163 NextLink *string `json:"nextLink,omitempty"` 9164} 9165 9166// VariableListResultIterator provides access to a complete listing of Variable values. 9167type VariableListResultIterator struct { 9168 i int 9169 page VariableListResultPage 9170} 9171 9172// NextWithContext advances to the next value. If there was an error making 9173// the request the iterator does not advance and the error is returned. 9174func (iter *VariableListResultIterator) NextWithContext(ctx context.Context) (err error) { 9175 if tracing.IsEnabled() { 9176 ctx = tracing.StartSpan(ctx, fqdn+"/VariableListResultIterator.NextWithContext") 9177 defer func() { 9178 sc := -1 9179 if iter.Response().Response.Response != nil { 9180 sc = iter.Response().Response.Response.StatusCode 9181 } 9182 tracing.EndSpan(ctx, sc, err) 9183 }() 9184 } 9185 iter.i++ 9186 if iter.i < len(iter.page.Values()) { 9187 return nil 9188 } 9189 err = iter.page.NextWithContext(ctx) 9190 if err != nil { 9191 iter.i-- 9192 return err 9193 } 9194 iter.i = 0 9195 return nil 9196} 9197 9198// Next advances to the next value. If there was an error making 9199// the request the iterator does not advance and the error is returned. 9200// Deprecated: Use NextWithContext() instead. 9201func (iter *VariableListResultIterator) Next() error { 9202 return iter.NextWithContext(context.Background()) 9203} 9204 9205// NotDone returns true if the enumeration should be started or is not yet complete. 9206func (iter VariableListResultIterator) NotDone() bool { 9207 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9208} 9209 9210// Response returns the raw server response from the last page request. 9211func (iter VariableListResultIterator) Response() VariableListResult { 9212 return iter.page.Response() 9213} 9214 9215// Value returns the current value or a zero-initialized value if the 9216// iterator has advanced beyond the end of the collection. 9217func (iter VariableListResultIterator) Value() Variable { 9218 if !iter.page.NotDone() { 9219 return Variable{} 9220 } 9221 return iter.page.Values()[iter.i] 9222} 9223 9224// Creates a new instance of the VariableListResultIterator type. 9225func NewVariableListResultIterator(page VariableListResultPage) VariableListResultIterator { 9226 return VariableListResultIterator{page: page} 9227} 9228 9229// IsEmpty returns true if the ListResult contains no values. 9230func (vlr VariableListResult) IsEmpty() bool { 9231 return vlr.Value == nil || len(*vlr.Value) == 0 9232} 9233 9234// hasNextLink returns true if the NextLink is not empty. 9235func (vlr VariableListResult) hasNextLink() bool { 9236 return vlr.NextLink != nil && len(*vlr.NextLink) != 0 9237} 9238 9239// variableListResultPreparer prepares a request to retrieve the next set of results. 9240// It returns nil if no more results exist. 9241func (vlr VariableListResult) variableListResultPreparer(ctx context.Context) (*http.Request, error) { 9242 if !vlr.hasNextLink() { 9243 return nil, nil 9244 } 9245 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9246 autorest.AsJSON(), 9247 autorest.AsGet(), 9248 autorest.WithBaseURL(to.String(vlr.NextLink))) 9249} 9250 9251// VariableListResultPage contains a page of Variable values. 9252type VariableListResultPage struct { 9253 fn func(context.Context, VariableListResult) (VariableListResult, error) 9254 vlr VariableListResult 9255} 9256 9257// NextWithContext advances to the next page of values. If there was an error making 9258// the request the page does not advance and the error is returned. 9259func (page *VariableListResultPage) NextWithContext(ctx context.Context) (err error) { 9260 if tracing.IsEnabled() { 9261 ctx = tracing.StartSpan(ctx, fqdn+"/VariableListResultPage.NextWithContext") 9262 defer func() { 9263 sc := -1 9264 if page.Response().Response.Response != nil { 9265 sc = page.Response().Response.Response.StatusCode 9266 } 9267 tracing.EndSpan(ctx, sc, err) 9268 }() 9269 } 9270 for { 9271 next, err := page.fn(ctx, page.vlr) 9272 if err != nil { 9273 return err 9274 } 9275 page.vlr = next 9276 if !next.hasNextLink() || !next.IsEmpty() { 9277 break 9278 } 9279 } 9280 return nil 9281} 9282 9283// Next advances to the next page of values. If there was an error making 9284// the request the page does not advance and the error is returned. 9285// Deprecated: Use NextWithContext() instead. 9286func (page *VariableListResultPage) Next() error { 9287 return page.NextWithContext(context.Background()) 9288} 9289 9290// NotDone returns true if the page enumeration should be started or is not yet complete. 9291func (page VariableListResultPage) NotDone() bool { 9292 return !page.vlr.IsEmpty() 9293} 9294 9295// Response returns the raw server response from the last page request. 9296func (page VariableListResultPage) Response() VariableListResult { 9297 return page.vlr 9298} 9299 9300// Values returns the slice of values for the current page or nil if there are no values. 9301func (page VariableListResultPage) Values() []Variable { 9302 if page.vlr.IsEmpty() { 9303 return nil 9304 } 9305 return *page.vlr.Value 9306} 9307 9308// Creates a new instance of the VariableListResultPage type. 9309func NewVariableListResultPage(cur VariableListResult, getNextPage func(context.Context, VariableListResult) (VariableListResult, error)) VariableListResultPage { 9310 return VariableListResultPage{ 9311 fn: getNextPage, 9312 vlr: cur, 9313 } 9314} 9315 9316// VariableProperties definition of the variable properties 9317type VariableProperties struct { 9318 // Value - Gets or sets the value of the variable. 9319 Value *string `json:"value,omitempty"` 9320 // IsEncrypted - Gets or sets the encrypted flag of the variable. 9321 IsEncrypted *bool `json:"isEncrypted,omitempty"` 9322 // CreationTime - Gets or sets the creation time. 9323 CreationTime *date.Time `json:"creationTime,omitempty"` 9324 // LastModifiedTime - Gets or sets the last modified time. 9325 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 9326 // Description - Gets or sets the description. 9327 Description *string `json:"description,omitempty"` 9328} 9329 9330// VariableUpdateParameters the parameters supplied to the update variable operation. 9331type VariableUpdateParameters struct { 9332 // Name - Gets or sets the name of the variable. 9333 Name *string `json:"name,omitempty"` 9334 // VariableUpdateProperties - Gets or sets the value of the variable. 9335 *VariableUpdateProperties `json:"properties,omitempty"` 9336} 9337 9338// MarshalJSON is the custom marshaler for VariableUpdateParameters. 9339func (vup VariableUpdateParameters) MarshalJSON() ([]byte, error) { 9340 objectMap := make(map[string]interface{}) 9341 if vup.Name != nil { 9342 objectMap["name"] = vup.Name 9343 } 9344 if vup.VariableUpdateProperties != nil { 9345 objectMap["properties"] = vup.VariableUpdateProperties 9346 } 9347 return json.Marshal(objectMap) 9348} 9349 9350// UnmarshalJSON is the custom unmarshaler for VariableUpdateParameters struct. 9351func (vup *VariableUpdateParameters) UnmarshalJSON(body []byte) error { 9352 var m map[string]*json.RawMessage 9353 err := json.Unmarshal(body, &m) 9354 if err != nil { 9355 return err 9356 } 9357 for k, v := range m { 9358 switch k { 9359 case "name": 9360 if v != nil { 9361 var name string 9362 err = json.Unmarshal(*v, &name) 9363 if err != nil { 9364 return err 9365 } 9366 vup.Name = &name 9367 } 9368 case "properties": 9369 if v != nil { 9370 var variableUpdateProperties VariableUpdateProperties 9371 err = json.Unmarshal(*v, &variableUpdateProperties) 9372 if err != nil { 9373 return err 9374 } 9375 vup.VariableUpdateProperties = &variableUpdateProperties 9376 } 9377 } 9378 } 9379 9380 return nil 9381} 9382 9383// VariableUpdateProperties the properties of the update variable 9384type VariableUpdateProperties struct { 9385 // Value - Gets or sets the value of the variable. 9386 Value *string `json:"value,omitempty"` 9387 // Description - Gets or sets the description of the variable. 9388 Description *string `json:"description,omitempty"` 9389} 9390 9391// Webhook definition of the webhook type. 9392type Webhook struct { 9393 autorest.Response `json:"-"` 9394 // WebhookProperties - Gets or sets the webhook properties. 9395 *WebhookProperties `json:"properties,omitempty"` 9396 // ID - READ-ONLY; Fully qualified resource Id for the resource 9397 ID *string `json:"id,omitempty"` 9398 // Name - READ-ONLY; The name of the resource 9399 Name *string `json:"name,omitempty"` 9400 // Type - READ-ONLY; The type of the resource. 9401 Type *string `json:"type,omitempty"` 9402} 9403 9404// MarshalJSON is the custom marshaler for Webhook. 9405func (w Webhook) MarshalJSON() ([]byte, error) { 9406 objectMap := make(map[string]interface{}) 9407 if w.WebhookProperties != nil { 9408 objectMap["properties"] = w.WebhookProperties 9409 } 9410 return json.Marshal(objectMap) 9411} 9412 9413// UnmarshalJSON is the custom unmarshaler for Webhook struct. 9414func (w *Webhook) UnmarshalJSON(body []byte) error { 9415 var m map[string]*json.RawMessage 9416 err := json.Unmarshal(body, &m) 9417 if err != nil { 9418 return err 9419 } 9420 for k, v := range m { 9421 switch k { 9422 case "properties": 9423 if v != nil { 9424 var webhookProperties WebhookProperties 9425 err = json.Unmarshal(*v, &webhookProperties) 9426 if err != nil { 9427 return err 9428 } 9429 w.WebhookProperties = &webhookProperties 9430 } 9431 case "id": 9432 if v != nil { 9433 var ID string 9434 err = json.Unmarshal(*v, &ID) 9435 if err != nil { 9436 return err 9437 } 9438 w.ID = &ID 9439 } 9440 case "name": 9441 if v != nil { 9442 var name string 9443 err = json.Unmarshal(*v, &name) 9444 if err != nil { 9445 return err 9446 } 9447 w.Name = &name 9448 } 9449 case "type": 9450 if v != nil { 9451 var typeVar string 9452 err = json.Unmarshal(*v, &typeVar) 9453 if err != nil { 9454 return err 9455 } 9456 w.Type = &typeVar 9457 } 9458 } 9459 } 9460 9461 return nil 9462} 9463 9464// WebhookCreateOrUpdateParameters the parameters supplied to the create or update webhook operation. 9465type WebhookCreateOrUpdateParameters struct { 9466 // Name - Gets or sets the name of the webhook. 9467 Name *string `json:"name,omitempty"` 9468 // WebhookCreateOrUpdateProperties - Gets or sets the properties of the webhook. 9469 *WebhookCreateOrUpdateProperties `json:"properties,omitempty"` 9470} 9471 9472// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateParameters. 9473func (wcoup WebhookCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { 9474 objectMap := make(map[string]interface{}) 9475 if wcoup.Name != nil { 9476 objectMap["name"] = wcoup.Name 9477 } 9478 if wcoup.WebhookCreateOrUpdateProperties != nil { 9479 objectMap["properties"] = wcoup.WebhookCreateOrUpdateProperties 9480 } 9481 return json.Marshal(objectMap) 9482} 9483 9484// UnmarshalJSON is the custom unmarshaler for WebhookCreateOrUpdateParameters struct. 9485func (wcoup *WebhookCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { 9486 var m map[string]*json.RawMessage 9487 err := json.Unmarshal(body, &m) 9488 if err != nil { 9489 return err 9490 } 9491 for k, v := range m { 9492 switch k { 9493 case "name": 9494 if v != nil { 9495 var name string 9496 err = json.Unmarshal(*v, &name) 9497 if err != nil { 9498 return err 9499 } 9500 wcoup.Name = &name 9501 } 9502 case "properties": 9503 if v != nil { 9504 var webhookCreateOrUpdateProperties WebhookCreateOrUpdateProperties 9505 err = json.Unmarshal(*v, &webhookCreateOrUpdateProperties) 9506 if err != nil { 9507 return err 9508 } 9509 wcoup.WebhookCreateOrUpdateProperties = &webhookCreateOrUpdateProperties 9510 } 9511 } 9512 } 9513 9514 return nil 9515} 9516 9517// WebhookCreateOrUpdateProperties the properties of the create webhook operation. 9518type WebhookCreateOrUpdateProperties struct { 9519 // IsEnabled - Gets or sets the value of the enabled flag of webhook. 9520 IsEnabled *bool `json:"isEnabled,omitempty"` 9521 // URI - Gets or sets the uri. 9522 URI *string `json:"uri,omitempty"` 9523 // ExpiryTime - Gets or sets the expiry time. 9524 ExpiryTime *date.Time `json:"expiryTime,omitempty"` 9525 // Parameters - Gets or sets the parameters of the job. 9526 Parameters map[string]*string `json:"parameters"` 9527 // Runbook - Gets or sets the runbook. 9528 Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` 9529 // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. 9530 RunOn *string `json:"runOn,omitempty"` 9531} 9532 9533// MarshalJSON is the custom marshaler for WebhookCreateOrUpdateProperties. 9534func (wcoup WebhookCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { 9535 objectMap := make(map[string]interface{}) 9536 if wcoup.IsEnabled != nil { 9537 objectMap["isEnabled"] = wcoup.IsEnabled 9538 } 9539 if wcoup.URI != nil { 9540 objectMap["uri"] = wcoup.URI 9541 } 9542 if wcoup.ExpiryTime != nil { 9543 objectMap["expiryTime"] = wcoup.ExpiryTime 9544 } 9545 if wcoup.Parameters != nil { 9546 objectMap["parameters"] = wcoup.Parameters 9547 } 9548 if wcoup.Runbook != nil { 9549 objectMap["runbook"] = wcoup.Runbook 9550 } 9551 if wcoup.RunOn != nil { 9552 objectMap["runOn"] = wcoup.RunOn 9553 } 9554 return json.Marshal(objectMap) 9555} 9556 9557// WebhookListResult the response model for the list webhook operation. 9558type WebhookListResult struct { 9559 autorest.Response `json:"-"` 9560 // Value - Gets or sets a list of webhooks. 9561 Value *[]Webhook `json:"value,omitempty"` 9562 // NextLink - Gets or sets the next link. 9563 NextLink *string `json:"nextLink,omitempty"` 9564} 9565 9566// WebhookListResultIterator provides access to a complete listing of Webhook values. 9567type WebhookListResultIterator struct { 9568 i int 9569 page WebhookListResultPage 9570} 9571 9572// NextWithContext advances to the next value. If there was an error making 9573// the request the iterator does not advance and the error is returned. 9574func (iter *WebhookListResultIterator) NextWithContext(ctx context.Context) (err error) { 9575 if tracing.IsEnabled() { 9576 ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultIterator.NextWithContext") 9577 defer func() { 9578 sc := -1 9579 if iter.Response().Response.Response != nil { 9580 sc = iter.Response().Response.Response.StatusCode 9581 } 9582 tracing.EndSpan(ctx, sc, err) 9583 }() 9584 } 9585 iter.i++ 9586 if iter.i < len(iter.page.Values()) { 9587 return nil 9588 } 9589 err = iter.page.NextWithContext(ctx) 9590 if err != nil { 9591 iter.i-- 9592 return err 9593 } 9594 iter.i = 0 9595 return nil 9596} 9597 9598// Next advances to the next value. If there was an error making 9599// the request the iterator does not advance and the error is returned. 9600// Deprecated: Use NextWithContext() instead. 9601func (iter *WebhookListResultIterator) Next() error { 9602 return iter.NextWithContext(context.Background()) 9603} 9604 9605// NotDone returns true if the enumeration should be started or is not yet complete. 9606func (iter WebhookListResultIterator) NotDone() bool { 9607 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 9608} 9609 9610// Response returns the raw server response from the last page request. 9611func (iter WebhookListResultIterator) Response() WebhookListResult { 9612 return iter.page.Response() 9613} 9614 9615// Value returns the current value or a zero-initialized value if the 9616// iterator has advanced beyond the end of the collection. 9617func (iter WebhookListResultIterator) Value() Webhook { 9618 if !iter.page.NotDone() { 9619 return Webhook{} 9620 } 9621 return iter.page.Values()[iter.i] 9622} 9623 9624// Creates a new instance of the WebhookListResultIterator type. 9625func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator { 9626 return WebhookListResultIterator{page: page} 9627} 9628 9629// IsEmpty returns true if the ListResult contains no values. 9630func (wlr WebhookListResult) IsEmpty() bool { 9631 return wlr.Value == nil || len(*wlr.Value) == 0 9632} 9633 9634// hasNextLink returns true if the NextLink is not empty. 9635func (wlr WebhookListResult) hasNextLink() bool { 9636 return wlr.NextLink != nil && len(*wlr.NextLink) != 0 9637} 9638 9639// webhookListResultPreparer prepares a request to retrieve the next set of results. 9640// It returns nil if no more results exist. 9641func (wlr WebhookListResult) webhookListResultPreparer(ctx context.Context) (*http.Request, error) { 9642 if !wlr.hasNextLink() { 9643 return nil, nil 9644 } 9645 return autorest.Prepare((&http.Request{}).WithContext(ctx), 9646 autorest.AsJSON(), 9647 autorest.AsGet(), 9648 autorest.WithBaseURL(to.String(wlr.NextLink))) 9649} 9650 9651// WebhookListResultPage contains a page of Webhook values. 9652type WebhookListResultPage struct { 9653 fn func(context.Context, WebhookListResult) (WebhookListResult, error) 9654 wlr WebhookListResult 9655} 9656 9657// NextWithContext advances to the next page of values. If there was an error making 9658// the request the page does not advance and the error is returned. 9659func (page *WebhookListResultPage) NextWithContext(ctx context.Context) (err error) { 9660 if tracing.IsEnabled() { 9661 ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultPage.NextWithContext") 9662 defer func() { 9663 sc := -1 9664 if page.Response().Response.Response != nil { 9665 sc = page.Response().Response.Response.StatusCode 9666 } 9667 tracing.EndSpan(ctx, sc, err) 9668 }() 9669 } 9670 for { 9671 next, err := page.fn(ctx, page.wlr) 9672 if err != nil { 9673 return err 9674 } 9675 page.wlr = next 9676 if !next.hasNextLink() || !next.IsEmpty() { 9677 break 9678 } 9679 } 9680 return nil 9681} 9682 9683// Next advances to the next page of values. If there was an error making 9684// the request the page does not advance and the error is returned. 9685// Deprecated: Use NextWithContext() instead. 9686func (page *WebhookListResultPage) Next() error { 9687 return page.NextWithContext(context.Background()) 9688} 9689 9690// NotDone returns true if the page enumeration should be started or is not yet complete. 9691func (page WebhookListResultPage) NotDone() bool { 9692 return !page.wlr.IsEmpty() 9693} 9694 9695// Response returns the raw server response from the last page request. 9696func (page WebhookListResultPage) Response() WebhookListResult { 9697 return page.wlr 9698} 9699 9700// Values returns the slice of values for the current page or nil if there are no values. 9701func (page WebhookListResultPage) Values() []Webhook { 9702 if page.wlr.IsEmpty() { 9703 return nil 9704 } 9705 return *page.wlr.Value 9706} 9707 9708// Creates a new instance of the WebhookListResultPage type. 9709func NewWebhookListResultPage(cur WebhookListResult, getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage { 9710 return WebhookListResultPage{ 9711 fn: getNextPage, 9712 wlr: cur, 9713 } 9714} 9715 9716// WebhookProperties definition of the webhook properties 9717type WebhookProperties struct { 9718 // IsEnabled - Gets or sets the value of the enabled flag of the webhook. 9719 IsEnabled *bool `json:"isEnabled,omitempty"` 9720 // URI - Gets or sets the webhook uri. 9721 URI *string `json:"uri,omitempty"` 9722 // ExpiryTime - Gets or sets the expiry time. 9723 ExpiryTime *date.Time `json:"expiryTime,omitempty"` 9724 // LastInvokedTime - Gets or sets the last invoked time. 9725 LastInvokedTime *date.Time `json:"lastInvokedTime,omitempty"` 9726 // Parameters - Gets or sets the parameters of the job that is created when the webhook calls the runbook it is associated with. 9727 Parameters map[string]*string `json:"parameters"` 9728 // Runbook - Gets or sets the runbook the webhook is associated with. 9729 Runbook *RunbookAssociationProperty `json:"runbook,omitempty"` 9730 // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. 9731 RunOn *string `json:"runOn,omitempty"` 9732 // CreationTime - Gets or sets the creation time. 9733 CreationTime *date.Time `json:"creationTime,omitempty"` 9734 // LastModifiedTime - Gets or sets the last modified time. 9735 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 9736 // LastModifiedBy - Details of the user who last modified the Webhook 9737 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 9738 // Description - Gets or sets the description. 9739 Description *string `json:"description,omitempty"` 9740} 9741 9742// MarshalJSON is the custom marshaler for WebhookProperties. 9743func (wp WebhookProperties) MarshalJSON() ([]byte, error) { 9744 objectMap := make(map[string]interface{}) 9745 if wp.IsEnabled != nil { 9746 objectMap["isEnabled"] = wp.IsEnabled 9747 } 9748 if wp.URI != nil { 9749 objectMap["uri"] = wp.URI 9750 } 9751 if wp.ExpiryTime != nil { 9752 objectMap["expiryTime"] = wp.ExpiryTime 9753 } 9754 if wp.LastInvokedTime != nil { 9755 objectMap["lastInvokedTime"] = wp.LastInvokedTime 9756 } 9757 if wp.Parameters != nil { 9758 objectMap["parameters"] = wp.Parameters 9759 } 9760 if wp.Runbook != nil { 9761 objectMap["runbook"] = wp.Runbook 9762 } 9763 if wp.RunOn != nil { 9764 objectMap["runOn"] = wp.RunOn 9765 } 9766 if wp.CreationTime != nil { 9767 objectMap["creationTime"] = wp.CreationTime 9768 } 9769 if wp.LastModifiedTime != nil { 9770 objectMap["lastModifiedTime"] = wp.LastModifiedTime 9771 } 9772 if wp.LastModifiedBy != nil { 9773 objectMap["lastModifiedBy"] = wp.LastModifiedBy 9774 } 9775 if wp.Description != nil { 9776 objectMap["description"] = wp.Description 9777 } 9778 return json.Marshal(objectMap) 9779} 9780 9781// WebhookUpdateParameters the parameters supplied to the update webhook operation. 9782type WebhookUpdateParameters struct { 9783 // Name - Gets or sets the name of the webhook. 9784 Name *string `json:"name,omitempty"` 9785 // WebhookUpdateProperties - Gets or sets the value of the webhook. 9786 *WebhookUpdateProperties `json:"properties,omitempty"` 9787} 9788 9789// MarshalJSON is the custom marshaler for WebhookUpdateParameters. 9790func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { 9791 objectMap := make(map[string]interface{}) 9792 if wup.Name != nil { 9793 objectMap["name"] = wup.Name 9794 } 9795 if wup.WebhookUpdateProperties != nil { 9796 objectMap["properties"] = wup.WebhookUpdateProperties 9797 } 9798 return json.Marshal(objectMap) 9799} 9800 9801// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. 9802func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { 9803 var m map[string]*json.RawMessage 9804 err := json.Unmarshal(body, &m) 9805 if err != nil { 9806 return err 9807 } 9808 for k, v := range m { 9809 switch k { 9810 case "name": 9811 if v != nil { 9812 var name string 9813 err = json.Unmarshal(*v, &name) 9814 if err != nil { 9815 return err 9816 } 9817 wup.Name = &name 9818 } 9819 case "properties": 9820 if v != nil { 9821 var webhookUpdateProperties WebhookUpdateProperties 9822 err = json.Unmarshal(*v, &webhookUpdateProperties) 9823 if err != nil { 9824 return err 9825 } 9826 wup.WebhookUpdateProperties = &webhookUpdateProperties 9827 } 9828 } 9829 } 9830 9831 return nil 9832} 9833 9834// WebhookUpdateProperties the properties of the update webhook. 9835type WebhookUpdateProperties struct { 9836 // IsEnabled - Gets or sets the value of the enabled flag of webhook. 9837 IsEnabled *bool `json:"isEnabled,omitempty"` 9838 // RunOn - Gets or sets the name of the hybrid worker group the webhook job will run on. 9839 RunOn *string `json:"runOn,omitempty"` 9840 // Parameters - Gets or sets the parameters of the job. 9841 Parameters map[string]*string `json:"parameters"` 9842 // Description - Gets or sets the description of the webhook. 9843 Description *string `json:"description,omitempty"` 9844} 9845 9846// MarshalJSON is the custom marshaler for WebhookUpdateProperties. 9847func (wup WebhookUpdateProperties) MarshalJSON() ([]byte, error) { 9848 objectMap := make(map[string]interface{}) 9849 if wup.IsEnabled != nil { 9850 objectMap["isEnabled"] = wup.IsEnabled 9851 } 9852 if wup.RunOn != nil { 9853 objectMap["runOn"] = wup.RunOn 9854 } 9855 if wup.Parameters != nil { 9856 objectMap["parameters"] = wup.Parameters 9857 } 9858 if wup.Description != nil { 9859 objectMap["description"] = wup.Description 9860 } 9861 return json.Marshal(objectMap) 9862} 9863 9864// WindowsProperties windows specific update configuration. 9865type WindowsProperties struct { 9866 // IncludedUpdateClassifications - Update classification included in the software update configuration. A comma separated string with required values. Possible values include: 'WindowsUpdateClassesUnclassified', 'WindowsUpdateClassesCritical', 'WindowsUpdateClassesSecurity', 'WindowsUpdateClassesUpdateRollup', 'WindowsUpdateClassesFeaturePack', 'WindowsUpdateClassesServicePack', 'WindowsUpdateClassesDefinition', 'WindowsUpdateClassesTools', 'WindowsUpdateClassesUpdates' 9867 IncludedUpdateClassifications WindowsUpdateClasses `json:"includedUpdateClassifications,omitempty"` 9868 // ExcludedKbNumbers - KB numbers excluded from the software update configuration. 9869 ExcludedKbNumbers *[]string `json:"excludedKbNumbers,omitempty"` 9870 // IncludedKbNumbers - KB numbers included from the software update configuration. 9871 IncludedKbNumbers *[]string `json:"includedKbNumbers,omitempty"` 9872 // RebootSetting - Reboot setting for the software update configuration. 9873 RebootSetting *string `json:"rebootSetting,omitempty"` 9874} 9875