1package blockchain 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "net/http" 29) 30 31// The package's fully qualified name. 32const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/blockchain/mgmt/2018-06-01-preview/blockchain" 33 34// APIKey API key payload which is exposed in the request/response of the resource provider. 35type APIKey struct { 36 // KeyName - Gets or sets the API key name. 37 KeyName *string `json:"keyName,omitempty"` 38 // Value - Gets or sets the API key value. 39 Value *string `json:"value,omitempty"` 40} 41 42// APIKeyCollection collection of the API key payload which is exposed in the response of the resource 43// provider. 44type APIKeyCollection struct { 45 autorest.Response `json:"-"` 46 // Keys - Gets or sets the collection of API key. 47 Keys *[]APIKey `json:"keys,omitempty"` 48} 49 50// Consortium consortium payload 51type Consortium struct { 52 // Name - Gets or sets the blockchain member name. 53 Name *string `json:"name,omitempty"` 54 // Protocol - Gets or sets the protocol for the consortium. Possible values include: 'ProtocolNotSpecified', 'ProtocolParity', 'ProtocolQuorum', 'ProtocolCorda' 55 Protocol Protocol `json:"protocol,omitempty"` 56} 57 58// ConsortiumCollection collection of the consortium payload. 59type ConsortiumCollection struct { 60 autorest.Response `json:"-"` 61 // Value - Gets or sets the collection of consortiums. 62 Value *[]Consortium `json:"value,omitempty"` 63} 64 65// ConsortiumMember consortium approval 66type ConsortiumMember struct { 67 // Name - Gets the consortium member name. 68 Name *string `json:"name,omitempty"` 69 // DisplayName - Gets the consortium member display name. 70 DisplayName *string `json:"displayName,omitempty"` 71 // SubscriptionID - Gets the consortium member subscription id. 72 SubscriptionID *string `json:"subscriptionId,omitempty"` 73 // Role - Gets the consortium member role. 74 Role *string `json:"role,omitempty"` 75 // Status - Gets the consortium member status. 76 Status *string `json:"status,omitempty"` 77 // JoinDate - Gets the consortium member join date. 78 JoinDate *date.Time `json:"joinDate,omitempty"` 79 // DateModified - Gets the consortium member modified date. 80 DateModified *date.Time `json:"dateModified,omitempty"` 81} 82 83// ConsortiumMemberCollection collection of consortium payload. 84type ConsortiumMemberCollection struct { 85 autorest.Response `json:"-"` 86 // Value - Gets or sets the collection of consortiums. 87 Value *[]ConsortiumMember `json:"value,omitempty"` 88 // NextLink - Gets or sets the URL, that the client should use to fetch the next page (per server side paging). 89 // It's null for now, added for future use. 90 NextLink *string `json:"nextLink,omitempty"` 91} 92 93// ConsortiumMemberCollectionIterator provides access to a complete listing of ConsortiumMember values. 94type ConsortiumMemberCollectionIterator struct { 95 i int 96 page ConsortiumMemberCollectionPage 97} 98 99// NextWithContext advances to the next value. If there was an error making 100// the request the iterator does not advance and the error is returned. 101func (iter *ConsortiumMemberCollectionIterator) NextWithContext(ctx context.Context) (err error) { 102 if tracing.IsEnabled() { 103 ctx = tracing.StartSpan(ctx, fqdn+"/ConsortiumMemberCollectionIterator.NextWithContext") 104 defer func() { 105 sc := -1 106 if iter.Response().Response.Response != nil { 107 sc = iter.Response().Response.Response.StatusCode 108 } 109 tracing.EndSpan(ctx, sc, err) 110 }() 111 } 112 iter.i++ 113 if iter.i < len(iter.page.Values()) { 114 return nil 115 } 116 err = iter.page.NextWithContext(ctx) 117 if err != nil { 118 iter.i-- 119 return err 120 } 121 iter.i = 0 122 return nil 123} 124 125// Next advances to the next value. If there was an error making 126// the request the iterator does not advance and the error is returned. 127// Deprecated: Use NextWithContext() instead. 128func (iter *ConsortiumMemberCollectionIterator) Next() error { 129 return iter.NextWithContext(context.Background()) 130} 131 132// NotDone returns true if the enumeration should be started or is not yet complete. 133func (iter ConsortiumMemberCollectionIterator) NotDone() bool { 134 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 135} 136 137// Response returns the raw server response from the last page request. 138func (iter ConsortiumMemberCollectionIterator) Response() ConsortiumMemberCollection { 139 return iter.page.Response() 140} 141 142// Value returns the current value or a zero-initialized value if the 143// iterator has advanced beyond the end of the collection. 144func (iter ConsortiumMemberCollectionIterator) Value() ConsortiumMember { 145 if !iter.page.NotDone() { 146 return ConsortiumMember{} 147 } 148 return iter.page.Values()[iter.i] 149} 150 151// Creates a new instance of the ConsortiumMemberCollectionIterator type. 152func NewConsortiumMemberCollectionIterator(page ConsortiumMemberCollectionPage) ConsortiumMemberCollectionIterator { 153 return ConsortiumMemberCollectionIterator{page: page} 154} 155 156// IsEmpty returns true if the ListResult contains no values. 157func (cmc ConsortiumMemberCollection) IsEmpty() bool { 158 return cmc.Value == nil || len(*cmc.Value) == 0 159} 160 161// hasNextLink returns true if the NextLink is not empty. 162func (cmc ConsortiumMemberCollection) hasNextLink() bool { 163 return cmc.NextLink != nil && len(*cmc.NextLink) != 0 164} 165 166// consortiumMemberCollectionPreparer prepares a request to retrieve the next set of results. 167// It returns nil if no more results exist. 168func (cmc ConsortiumMemberCollection) consortiumMemberCollectionPreparer(ctx context.Context) (*http.Request, error) { 169 if !cmc.hasNextLink() { 170 return nil, nil 171 } 172 return autorest.Prepare((&http.Request{}).WithContext(ctx), 173 autorest.AsJSON(), 174 autorest.AsGet(), 175 autorest.WithBaseURL(to.String(cmc.NextLink))) 176} 177 178// ConsortiumMemberCollectionPage contains a page of ConsortiumMember values. 179type ConsortiumMemberCollectionPage struct { 180 fn func(context.Context, ConsortiumMemberCollection) (ConsortiumMemberCollection, error) 181 cmc ConsortiumMemberCollection 182} 183 184// NextWithContext advances to the next page of values. If there was an error making 185// the request the page does not advance and the error is returned. 186func (page *ConsortiumMemberCollectionPage) NextWithContext(ctx context.Context) (err error) { 187 if tracing.IsEnabled() { 188 ctx = tracing.StartSpan(ctx, fqdn+"/ConsortiumMemberCollectionPage.NextWithContext") 189 defer func() { 190 sc := -1 191 if page.Response().Response.Response != nil { 192 sc = page.Response().Response.Response.StatusCode 193 } 194 tracing.EndSpan(ctx, sc, err) 195 }() 196 } 197 for { 198 next, err := page.fn(ctx, page.cmc) 199 if err != nil { 200 return err 201 } 202 page.cmc = next 203 if !next.hasNextLink() || !next.IsEmpty() { 204 break 205 } 206 } 207 return nil 208} 209 210// Next advances to the next page of values. If there was an error making 211// the request the page does not advance and the error is returned. 212// Deprecated: Use NextWithContext() instead. 213func (page *ConsortiumMemberCollectionPage) Next() error { 214 return page.NextWithContext(context.Background()) 215} 216 217// NotDone returns true if the page enumeration should be started or is not yet complete. 218func (page ConsortiumMemberCollectionPage) NotDone() bool { 219 return !page.cmc.IsEmpty() 220} 221 222// Response returns the raw server response from the last page request. 223func (page ConsortiumMemberCollectionPage) Response() ConsortiumMemberCollection { 224 return page.cmc 225} 226 227// Values returns the slice of values for the current page or nil if there are no values. 228func (page ConsortiumMemberCollectionPage) Values() []ConsortiumMember { 229 if page.cmc.IsEmpty() { 230 return nil 231 } 232 return *page.cmc.Value 233} 234 235// Creates a new instance of the ConsortiumMemberCollectionPage type. 236func NewConsortiumMemberCollectionPage(cur ConsortiumMemberCollection, getNextPage func(context.Context, ConsortiumMemberCollection) (ConsortiumMemberCollection, error)) ConsortiumMemberCollectionPage { 237 return ConsortiumMemberCollectionPage{ 238 fn: getNextPage, 239 cmc: cur, 240 } 241} 242 243// FirewallRule ip range for firewall rules 244type FirewallRule struct { 245 // RuleName - Gets or sets the name of the firewall rules. 246 RuleName *string `json:"ruleName,omitempty"` 247 // StartIPAddress - Gets or sets the start IP address of the firewall rule range. 248 StartIPAddress *string `json:"startIpAddress,omitempty"` 249 // EndIPAddress - Gets or sets the end IP address of the firewall rule range. 250 EndIPAddress *string `json:"endIpAddress,omitempty"` 251} 252 253// Member payload of the blockchain member which is exposed in the request/response of the resource 254// provider. 255type Member struct { 256 autorest.Response `json:"-"` 257 // MemberProperties - Gets or sets the blockchain member properties. 258 *MemberProperties `json:"properties,omitempty"` 259 // Sku - Gets or sets the blockchain member Sku. 260 Sku *Sku `json:"sku,omitempty"` 261 // Location - The GEO location of the blockchain service. 262 Location *string `json:"location,omitempty"` 263 // Tags - Tags of the service which is a list of key value pairs that describes the resource. 264 Tags map[string]*string `json:"tags"` 265 // ID - READ-ONLY; Fully qualified resource Id of the resource. 266 ID *string `json:"id,omitempty"` 267 // Name - READ-ONLY; The name of the resource. 268 Name *string `json:"name,omitempty"` 269 // Type - READ-ONLY; The type of the service - e.g. "Microsoft.Blockchain" 270 Type *string `json:"type,omitempty"` 271} 272 273// MarshalJSON is the custom marshaler for Member. 274func (mVar Member) MarshalJSON() ([]byte, error) { 275 objectMap := make(map[string]interface{}) 276 if mVar.MemberProperties != nil { 277 objectMap["properties"] = mVar.MemberProperties 278 } 279 if mVar.Sku != nil { 280 objectMap["sku"] = mVar.Sku 281 } 282 if mVar.Location != nil { 283 objectMap["location"] = mVar.Location 284 } 285 if mVar.Tags != nil { 286 objectMap["tags"] = mVar.Tags 287 } 288 return json.Marshal(objectMap) 289} 290 291// UnmarshalJSON is the custom unmarshaler for Member struct. 292func (mVar *Member) UnmarshalJSON(body []byte) error { 293 var m map[string]*json.RawMessage 294 err := json.Unmarshal(body, &m) 295 if err != nil { 296 return err 297 } 298 for k, v := range m { 299 switch k { 300 case "properties": 301 if v != nil { 302 var memberProperties MemberProperties 303 err = json.Unmarshal(*v, &memberProperties) 304 if err != nil { 305 return err 306 } 307 mVar.MemberProperties = &memberProperties 308 } 309 case "sku": 310 if v != nil { 311 var sku Sku 312 err = json.Unmarshal(*v, &sku) 313 if err != nil { 314 return err 315 } 316 mVar.Sku = &sku 317 } 318 case "location": 319 if v != nil { 320 var location string 321 err = json.Unmarshal(*v, &location) 322 if err != nil { 323 return err 324 } 325 mVar.Location = &location 326 } 327 case "tags": 328 if v != nil { 329 var tags map[string]*string 330 err = json.Unmarshal(*v, &tags) 331 if err != nil { 332 return err 333 } 334 mVar.Tags = tags 335 } 336 case "id": 337 if v != nil { 338 var ID string 339 err = json.Unmarshal(*v, &ID) 340 if err != nil { 341 return err 342 } 343 mVar.ID = &ID 344 } 345 case "name": 346 if v != nil { 347 var name string 348 err = json.Unmarshal(*v, &name) 349 if err != nil { 350 return err 351 } 352 mVar.Name = &name 353 } 354 case "type": 355 if v != nil { 356 var typeVar string 357 err = json.Unmarshal(*v, &typeVar) 358 if err != nil { 359 return err 360 } 361 mVar.Type = &typeVar 362 } 363 } 364 } 365 366 return nil 367} 368 369// MemberCollection collection of the blockchain member payload which is exposed in the request/response of 370// the resource provider. 371type MemberCollection struct { 372 autorest.Response `json:"-"` 373 // Value - Gets or sets the collection of blockchain members. 374 Value *[]Member `json:"value,omitempty"` 375 // NextLink - Gets or sets the URL, that the client should use to fetch the next page (per server side paging). 376 // It's null for now, added for future use. 377 NextLink *string `json:"nextLink,omitempty"` 378} 379 380// MemberCollectionIterator provides access to a complete listing of Member values. 381type MemberCollectionIterator struct { 382 i int 383 page MemberCollectionPage 384} 385 386// NextWithContext advances to the next value. If there was an error making 387// the request the iterator does not advance and the error is returned. 388func (iter *MemberCollectionIterator) NextWithContext(ctx context.Context) (err error) { 389 if tracing.IsEnabled() { 390 ctx = tracing.StartSpan(ctx, fqdn+"/MemberCollectionIterator.NextWithContext") 391 defer func() { 392 sc := -1 393 if iter.Response().Response.Response != nil { 394 sc = iter.Response().Response.Response.StatusCode 395 } 396 tracing.EndSpan(ctx, sc, err) 397 }() 398 } 399 iter.i++ 400 if iter.i < len(iter.page.Values()) { 401 return nil 402 } 403 err = iter.page.NextWithContext(ctx) 404 if err != nil { 405 iter.i-- 406 return err 407 } 408 iter.i = 0 409 return nil 410} 411 412// Next advances to the next value. If there was an error making 413// the request the iterator does not advance and the error is returned. 414// Deprecated: Use NextWithContext() instead. 415func (iter *MemberCollectionIterator) Next() error { 416 return iter.NextWithContext(context.Background()) 417} 418 419// NotDone returns true if the enumeration should be started or is not yet complete. 420func (iter MemberCollectionIterator) NotDone() bool { 421 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 422} 423 424// Response returns the raw server response from the last page request. 425func (iter MemberCollectionIterator) Response() MemberCollection { 426 return iter.page.Response() 427} 428 429// Value returns the current value or a zero-initialized value if the 430// iterator has advanced beyond the end of the collection. 431func (iter MemberCollectionIterator) Value() Member { 432 if !iter.page.NotDone() { 433 return Member{} 434 } 435 return iter.page.Values()[iter.i] 436} 437 438// Creates a new instance of the MemberCollectionIterator type. 439func NewMemberCollectionIterator(page MemberCollectionPage) MemberCollectionIterator { 440 return MemberCollectionIterator{page: page} 441} 442 443// IsEmpty returns true if the ListResult contains no values. 444func (mc MemberCollection) IsEmpty() bool { 445 return mc.Value == nil || len(*mc.Value) == 0 446} 447 448// hasNextLink returns true if the NextLink is not empty. 449func (mc MemberCollection) hasNextLink() bool { 450 return mc.NextLink != nil && len(*mc.NextLink) != 0 451} 452 453// memberCollectionPreparer prepares a request to retrieve the next set of results. 454// It returns nil if no more results exist. 455func (mc MemberCollection) memberCollectionPreparer(ctx context.Context) (*http.Request, error) { 456 if !mc.hasNextLink() { 457 return nil, nil 458 } 459 return autorest.Prepare((&http.Request{}).WithContext(ctx), 460 autorest.AsJSON(), 461 autorest.AsGet(), 462 autorest.WithBaseURL(to.String(mc.NextLink))) 463} 464 465// MemberCollectionPage contains a page of Member values. 466type MemberCollectionPage struct { 467 fn func(context.Context, MemberCollection) (MemberCollection, error) 468 mc MemberCollection 469} 470 471// NextWithContext advances to the next page of values. If there was an error making 472// the request the page does not advance and the error is returned. 473func (page *MemberCollectionPage) NextWithContext(ctx context.Context) (err error) { 474 if tracing.IsEnabled() { 475 ctx = tracing.StartSpan(ctx, fqdn+"/MemberCollectionPage.NextWithContext") 476 defer func() { 477 sc := -1 478 if page.Response().Response.Response != nil { 479 sc = page.Response().Response.Response.StatusCode 480 } 481 tracing.EndSpan(ctx, sc, err) 482 }() 483 } 484 for { 485 next, err := page.fn(ctx, page.mc) 486 if err != nil { 487 return err 488 } 489 page.mc = next 490 if !next.hasNextLink() || !next.IsEmpty() { 491 break 492 } 493 } 494 return nil 495} 496 497// Next advances to the next page of values. If there was an error making 498// the request the page does not advance and the error is returned. 499// Deprecated: Use NextWithContext() instead. 500func (page *MemberCollectionPage) Next() error { 501 return page.NextWithContext(context.Background()) 502} 503 504// NotDone returns true if the page enumeration should be started or is not yet complete. 505func (page MemberCollectionPage) NotDone() bool { 506 return !page.mc.IsEmpty() 507} 508 509// Response returns the raw server response from the last page request. 510func (page MemberCollectionPage) Response() MemberCollection { 511 return page.mc 512} 513 514// Values returns the slice of values for the current page or nil if there are no values. 515func (page MemberCollectionPage) Values() []Member { 516 if page.mc.IsEmpty() { 517 return nil 518 } 519 return *page.mc.Value 520} 521 522// Creates a new instance of the MemberCollectionPage type. 523func NewMemberCollectionPage(cur MemberCollection, getNextPage func(context.Context, MemberCollection) (MemberCollection, error)) MemberCollectionPage { 524 return MemberCollectionPage{ 525 fn: getNextPage, 526 mc: cur, 527 } 528} 529 530// MemberNodesSku payload of the blockchain member nodes Sku for a blockchain member. 531type MemberNodesSku struct { 532 // Capacity - Gets or sets the nodes capacity. 533 Capacity *int32 `json:"capacity,omitempty"` 534} 535 536// MemberProperties payload of the blockchain member properties for a blockchain member. 537type MemberProperties struct { 538 // Protocol - Gets or sets the blockchain protocol. Possible values include: 'ProtocolNotSpecified', 'ProtocolParity', 'ProtocolQuorum', 'ProtocolCorda' 539 Protocol Protocol `json:"protocol,omitempty"` 540 // ValidatorNodesSku - Gets or sets the blockchain validator nodes Sku. 541 ValidatorNodesSku *MemberNodesSku `json:"validatorNodesSku,omitempty"` 542 // ProvisioningState - READ-ONLY; Gets or sets the blockchain member provision state. Possible values include: 'NotSpecified', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Stale' 543 ProvisioningState MemberProvisioningState `json:"provisioningState,omitempty"` 544 // DNS - READ-ONLY; Gets the dns endpoint of the blockchain member. 545 DNS *string `json:"dns,omitempty"` 546 // UserName - READ-ONLY; Gets the auth user name of the blockchain member. 547 UserName *string `json:"userName,omitempty"` 548 // Password - Sets the basic auth password of the blockchain member. 549 Password *string `json:"password,omitempty"` 550 // Consortium - Gets or sets the consortium for the blockchain member. 551 Consortium *string `json:"consortium,omitempty"` 552 // ConsortiumManagementAccountAddress - READ-ONLY; Gets the managed consortium management account address. 553 ConsortiumManagementAccountAddress *string `json:"consortiumManagementAccountAddress,omitempty"` 554 // ConsortiumManagementAccountPassword - Sets the managed consortium management account password. 555 ConsortiumManagementAccountPassword *string `json:"consortiumManagementAccountPassword,omitempty"` 556 // ConsortiumRole - Gets the role of the member in the consortium. 557 ConsortiumRole *string `json:"consortiumRole,omitempty"` 558 // ConsortiumMemberDisplayName - Gets the display name of the member in the consortium. 559 ConsortiumMemberDisplayName *string `json:"consortiumMemberDisplayName,omitempty"` 560 // RootContractAddress - READ-ONLY; Gets the Ethereum root contract address of the blockchain. 561 RootContractAddress *string `json:"rootContractAddress,omitempty"` 562 // PublicKey - READ-ONLY; Gets the public key of the blockchain member (default transaction node). 563 PublicKey *string `json:"publicKey,omitempty"` 564 // FirewallRules - Gets or sets firewall rules 565 FirewallRules *[]FirewallRule `json:"firewallRules,omitempty"` 566} 567 568// MarshalJSON is the custom marshaler for MemberProperties. 569func (mp MemberProperties) MarshalJSON() ([]byte, error) { 570 objectMap := make(map[string]interface{}) 571 if mp.Protocol != "" { 572 objectMap["protocol"] = mp.Protocol 573 } 574 if mp.ValidatorNodesSku != nil { 575 objectMap["validatorNodesSku"] = mp.ValidatorNodesSku 576 } 577 if mp.Password != nil { 578 objectMap["password"] = mp.Password 579 } 580 if mp.Consortium != nil { 581 objectMap["consortium"] = mp.Consortium 582 } 583 if mp.ConsortiumManagementAccountPassword != nil { 584 objectMap["consortiumManagementAccountPassword"] = mp.ConsortiumManagementAccountPassword 585 } 586 if mp.ConsortiumRole != nil { 587 objectMap["consortiumRole"] = mp.ConsortiumRole 588 } 589 if mp.ConsortiumMemberDisplayName != nil { 590 objectMap["consortiumMemberDisplayName"] = mp.ConsortiumMemberDisplayName 591 } 592 if mp.FirewallRules != nil { 593 objectMap["firewallRules"] = mp.FirewallRules 594 } 595 return json.Marshal(objectMap) 596} 597 598// MemberPropertiesUpdate update the payload of the blockchain member properties for a blockchain member. 599type MemberPropertiesUpdate struct { 600 // ConsortiumManagementAccountPassword - Sets the managed consortium management account password. 601 ConsortiumManagementAccountPassword *string `json:"consortiumManagementAccountPassword,omitempty"` 602 // Password - Sets the transaction node dns endpoint basic auth password. 603 Password *string `json:"password,omitempty"` 604 // FirewallRules - Gets or sets the firewall rules. 605 FirewallRules *[]FirewallRule `json:"firewallRules,omitempty"` 606} 607 608// MembersCreateFuture an abstraction for monitoring and retrieving the results of a long-running 609// operation. 610type MembersCreateFuture struct { 611 azure.FutureAPI 612 // Result returns the result of the asynchronous operation. 613 // If the operation has not completed it will return an error. 614 Result func(MembersClient) (Member, error) 615} 616 617// MembersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 618// operation. 619type MembersDeleteFuture struct { 620 azure.FutureAPI 621 // Result returns the result of the asynchronous operation. 622 // If the operation has not completed it will return an error. 623 Result func(MembersClient) (autorest.Response, error) 624} 625 626// MemberUpdate update the payload of the blockchain member which is exposed in the request/response of the 627// resource provider. 628type MemberUpdate struct { 629 // Tags - Tags of the service which is a list of key value pairs that describes the resource. 630 Tags map[string]*string `json:"tags"` 631 // MemberPropertiesUpdate - Gets or sets the blockchain member update properties. 632 *MemberPropertiesUpdate `json:"properties,omitempty"` 633} 634 635// MarshalJSON is the custom marshaler for MemberUpdate. 636func (mu MemberUpdate) MarshalJSON() ([]byte, error) { 637 objectMap := make(map[string]interface{}) 638 if mu.Tags != nil { 639 objectMap["tags"] = mu.Tags 640 } 641 if mu.MemberPropertiesUpdate != nil { 642 objectMap["properties"] = mu.MemberPropertiesUpdate 643 } 644 return json.Marshal(objectMap) 645} 646 647// UnmarshalJSON is the custom unmarshaler for MemberUpdate struct. 648func (mu *MemberUpdate) UnmarshalJSON(body []byte) error { 649 var m map[string]*json.RawMessage 650 err := json.Unmarshal(body, &m) 651 if err != nil { 652 return err 653 } 654 for k, v := range m { 655 switch k { 656 case "tags": 657 if v != nil { 658 var tags map[string]*string 659 err = json.Unmarshal(*v, &tags) 660 if err != nil { 661 return err 662 } 663 mu.Tags = tags 664 } 665 case "properties": 666 if v != nil { 667 var memberPropertiesUpdate MemberPropertiesUpdate 668 err = json.Unmarshal(*v, &memberPropertiesUpdate) 669 if err != nil { 670 return err 671 } 672 mu.MemberPropertiesUpdate = &memberPropertiesUpdate 673 } 674 } 675 } 676 677 return nil 678} 679 680// NameAvailability name availability payload which is exposed in the response of the resource provider. 681type NameAvailability struct { 682 autorest.Response `json:"-"` 683 // NameAvailable - Gets or sets the value indicating whether the name is available. 684 NameAvailable *bool `json:"nameAvailable,omitempty"` 685 // Message - Gets or sets the message. 686 Message *string `json:"message,omitempty"` 687 // Reason - Gets or sets the name availability reason. Possible values include: 'NameAvailabilityReasonNotSpecified', 'NameAvailabilityReasonAlreadyExists', 'NameAvailabilityReasonInvalid' 688 Reason NameAvailabilityReason `json:"reason,omitempty"` 689} 690 691// NameAvailabilityRequest name availability request payload which is exposed in the request of the 692// resource provider. 693type NameAvailabilityRequest struct { 694 // Name - Gets or sets the name to check. 695 Name *string `json:"name,omitempty"` 696 // Type - Gets or sets the type of the resource to check. 697 Type *string `json:"type,omitempty"` 698} 699 700// OperationResult operation result payload which is exposed in the response of the resource provider. 701type OperationResult struct { 702 autorest.Response `json:"-"` 703 // Name - Gets or sets the operation name. 704 Name *string `json:"name,omitempty"` 705 // StartTime - Gets or sets the operation start time. 706 StartTime *date.Time `json:"startTime,omitempty"` 707 // EndTime - Gets or sets the operation end time. 708 EndTime *date.Time `json:"endTime,omitempty"` 709} 710 711// Resource the core properties of the resources. 712type Resource struct { 713 // ID - READ-ONLY; Fully qualified resource Id of the resource. 714 ID *string `json:"id,omitempty"` 715 // Name - READ-ONLY; The name of the resource. 716 Name *string `json:"name,omitempty"` 717 // Type - READ-ONLY; The type of the service - e.g. "Microsoft.Blockchain" 718 Type *string `json:"type,omitempty"` 719} 720 721// ResourceProviderOperation operation payload which is exposed in the response of the resource provider. 722type ResourceProviderOperation struct { 723 // Origin - Gets or sets the origin. 724 Origin *string `json:"origin,omitempty"` 725 // Name - Gets or sets the operation name. 726 Name *string `json:"name,omitempty"` 727 // IsDataAction - Gets or sets a value indicating whether the operation is a data action or not. 728 IsDataAction *bool `json:"isDataAction,omitempty"` 729 // Display - Gets or sets operation display 730 Display *ResourceProviderOperationDisplay `json:"display,omitempty"` 731} 732 733// ResourceProviderOperationCollection collection of operation payload which is exposed in the response of 734// the resource provider. 735type ResourceProviderOperationCollection struct { 736 autorest.Response `json:"-"` 737 // Value - Gets or sets the collection of operations. 738 Value *[]ResourceProviderOperation `json:"value,omitempty"` 739 // NextLink - Gets or sets the URL, that the client should use to fetch the next page (per server side paging). 740 // It's null for now, added for future use. 741 NextLink *string `json:"nextLink,omitempty"` 742} 743 744// ResourceProviderOperationCollectionIterator provides access to a complete listing of 745// ResourceProviderOperation values. 746type ResourceProviderOperationCollectionIterator struct { 747 i int 748 page ResourceProviderOperationCollectionPage 749} 750 751// NextWithContext advances to the next value. If there was an error making 752// the request the iterator does not advance and the error is returned. 753func (iter *ResourceProviderOperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { 754 if tracing.IsEnabled() { 755 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationCollectionIterator.NextWithContext") 756 defer func() { 757 sc := -1 758 if iter.Response().Response.Response != nil { 759 sc = iter.Response().Response.Response.StatusCode 760 } 761 tracing.EndSpan(ctx, sc, err) 762 }() 763 } 764 iter.i++ 765 if iter.i < len(iter.page.Values()) { 766 return nil 767 } 768 err = iter.page.NextWithContext(ctx) 769 if err != nil { 770 iter.i-- 771 return err 772 } 773 iter.i = 0 774 return nil 775} 776 777// Next advances to the next value. If there was an error making 778// the request the iterator does not advance and the error is returned. 779// Deprecated: Use NextWithContext() instead. 780func (iter *ResourceProviderOperationCollectionIterator) Next() error { 781 return iter.NextWithContext(context.Background()) 782} 783 784// NotDone returns true if the enumeration should be started or is not yet complete. 785func (iter ResourceProviderOperationCollectionIterator) NotDone() bool { 786 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 787} 788 789// Response returns the raw server response from the last page request. 790func (iter ResourceProviderOperationCollectionIterator) Response() ResourceProviderOperationCollection { 791 return iter.page.Response() 792} 793 794// Value returns the current value or a zero-initialized value if the 795// iterator has advanced beyond the end of the collection. 796func (iter ResourceProviderOperationCollectionIterator) Value() ResourceProviderOperation { 797 if !iter.page.NotDone() { 798 return ResourceProviderOperation{} 799 } 800 return iter.page.Values()[iter.i] 801} 802 803// Creates a new instance of the ResourceProviderOperationCollectionIterator type. 804func NewResourceProviderOperationCollectionIterator(page ResourceProviderOperationCollectionPage) ResourceProviderOperationCollectionIterator { 805 return ResourceProviderOperationCollectionIterator{page: page} 806} 807 808// IsEmpty returns true if the ListResult contains no values. 809func (rpoc ResourceProviderOperationCollection) IsEmpty() bool { 810 return rpoc.Value == nil || len(*rpoc.Value) == 0 811} 812 813// hasNextLink returns true if the NextLink is not empty. 814func (rpoc ResourceProviderOperationCollection) hasNextLink() bool { 815 return rpoc.NextLink != nil && len(*rpoc.NextLink) != 0 816} 817 818// resourceProviderOperationCollectionPreparer prepares a request to retrieve the next set of results. 819// It returns nil if no more results exist. 820func (rpoc ResourceProviderOperationCollection) resourceProviderOperationCollectionPreparer(ctx context.Context) (*http.Request, error) { 821 if !rpoc.hasNextLink() { 822 return nil, nil 823 } 824 return autorest.Prepare((&http.Request{}).WithContext(ctx), 825 autorest.AsJSON(), 826 autorest.AsGet(), 827 autorest.WithBaseURL(to.String(rpoc.NextLink))) 828} 829 830// ResourceProviderOperationCollectionPage contains a page of ResourceProviderOperation values. 831type ResourceProviderOperationCollectionPage struct { 832 fn func(context.Context, ResourceProviderOperationCollection) (ResourceProviderOperationCollection, error) 833 rpoc ResourceProviderOperationCollection 834} 835 836// NextWithContext advances to the next page of values. If there was an error making 837// the request the page does not advance and the error is returned. 838func (page *ResourceProviderOperationCollectionPage) NextWithContext(ctx context.Context) (err error) { 839 if tracing.IsEnabled() { 840 ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderOperationCollectionPage.NextWithContext") 841 defer func() { 842 sc := -1 843 if page.Response().Response.Response != nil { 844 sc = page.Response().Response.Response.StatusCode 845 } 846 tracing.EndSpan(ctx, sc, err) 847 }() 848 } 849 for { 850 next, err := page.fn(ctx, page.rpoc) 851 if err != nil { 852 return err 853 } 854 page.rpoc = next 855 if !next.hasNextLink() || !next.IsEmpty() { 856 break 857 } 858 } 859 return nil 860} 861 862// Next advances to the next page of values. If there was an error making 863// the request the page does not advance and the error is returned. 864// Deprecated: Use NextWithContext() instead. 865func (page *ResourceProviderOperationCollectionPage) Next() error { 866 return page.NextWithContext(context.Background()) 867} 868 869// NotDone returns true if the page enumeration should be started or is not yet complete. 870func (page ResourceProviderOperationCollectionPage) NotDone() bool { 871 return !page.rpoc.IsEmpty() 872} 873 874// Response returns the raw server response from the last page request. 875func (page ResourceProviderOperationCollectionPage) Response() ResourceProviderOperationCollection { 876 return page.rpoc 877} 878 879// Values returns the slice of values for the current page or nil if there are no values. 880func (page ResourceProviderOperationCollectionPage) Values() []ResourceProviderOperation { 881 if page.rpoc.IsEmpty() { 882 return nil 883 } 884 return *page.rpoc.Value 885} 886 887// Creates a new instance of the ResourceProviderOperationCollectionPage type. 888func NewResourceProviderOperationCollectionPage(cur ResourceProviderOperationCollection, getNextPage func(context.Context, ResourceProviderOperationCollection) (ResourceProviderOperationCollection, error)) ResourceProviderOperationCollectionPage { 889 return ResourceProviderOperationCollectionPage{ 890 fn: getNextPage, 891 rpoc: cur, 892 } 893} 894 895// ResourceProviderOperationDisplay operation display payload which is exposed in the response of the 896// resource provider. 897type ResourceProviderOperationDisplay struct { 898 // Provider - Gets or sets the name of the provider for display purposes. 899 Provider *string `json:"provider,omitempty"` 900 // Resource - Gets or sets the name of the resource type for display purposes. 901 Resource *string `json:"resource,omitempty"` 902 // Operation - Gets or sets the name of the operation for display purposes. 903 Operation *string `json:"operation,omitempty"` 904 // Description - Gets or sets the description of the provider for display purposes. 905 Description *string `json:"description,omitempty"` 906} 907 908// ResourceTypeSku resource type Sku. 909type ResourceTypeSku struct { 910 // ResourceType - Gets or sets the resource type 911 ResourceType *string `json:"resourceType,omitempty"` 912 // Skus - Gets or sets the Skus 913 Skus *[]SkuSetting `json:"skus,omitempty"` 914} 915 916// ResourceTypeSkuCollection collection of the resource type Sku. 917type ResourceTypeSkuCollection struct { 918 autorest.Response `json:"-"` 919 // Value - Gets or sets the collection of resource type Sku. 920 Value *[]ResourceTypeSku `json:"value,omitempty"` 921} 922 923// Sku blockchain member Sku in payload 924type Sku struct { 925 // Name - Gets or sets Sku name 926 Name *string `json:"name,omitempty"` 927 // Tier - Gets or sets Sku tier 928 Tier *string `json:"tier,omitempty"` 929} 930 931// SkuSetting sku Setting. 932type SkuSetting struct { 933 // Name - Gets or sets the Sku name. 934 Name *string `json:"name,omitempty"` 935 // Tier - Gets or sets the Sku tier. 936 Tier *string `json:"tier,omitempty"` 937 // Locations - Gets or sets the locations. 938 Locations *[]string `json:"locations,omitempty"` 939 // RequiredFeatures - Gets or sets the required features. 940 RequiredFeatures *[]string `json:"requiredFeatures,omitempty"` 941} 942 943// TrackedResource the resource model definition for a top level resource. 944type TrackedResource struct { 945 // Location - The GEO location of the blockchain service. 946 Location *string `json:"location,omitempty"` 947 // Tags - Tags of the service which is a list of key value pairs that describes the resource. 948 Tags map[string]*string `json:"tags"` 949 // ID - READ-ONLY; Fully qualified resource Id of the resource. 950 ID *string `json:"id,omitempty"` 951 // Name - READ-ONLY; The name of the resource. 952 Name *string `json:"name,omitempty"` 953 // Type - READ-ONLY; The type of the service - e.g. "Microsoft.Blockchain" 954 Type *string `json:"type,omitempty"` 955} 956 957// MarshalJSON is the custom marshaler for TrackedResource. 958func (tr TrackedResource) MarshalJSON() ([]byte, error) { 959 objectMap := make(map[string]interface{}) 960 if tr.Location != nil { 961 objectMap["location"] = tr.Location 962 } 963 if tr.Tags != nil { 964 objectMap["tags"] = tr.Tags 965 } 966 return json.Marshal(objectMap) 967} 968 969// TransactionNode payload of the transaction node which is the request/response of the resource provider. 970type TransactionNode struct { 971 autorest.Response `json:"-"` 972 // Location - Gets or sets the transaction node location. 973 Location *string `json:"location,omitempty"` 974 // TransactionNodeProperties - Gets or sets the blockchain member properties. 975 *TransactionNodeProperties `json:"properties,omitempty"` 976 // ID - READ-ONLY; Fully qualified resource Id of the resource. 977 ID *string `json:"id,omitempty"` 978 // Name - READ-ONLY; The name of the resource. 979 Name *string `json:"name,omitempty"` 980 // Type - READ-ONLY; The type of the service - e.g. "Microsoft.Blockchain" 981 Type *string `json:"type,omitempty"` 982} 983 984// MarshalJSON is the custom marshaler for TransactionNode. 985func (tn TransactionNode) MarshalJSON() ([]byte, error) { 986 objectMap := make(map[string]interface{}) 987 if tn.Location != nil { 988 objectMap["location"] = tn.Location 989 } 990 if tn.TransactionNodeProperties != nil { 991 objectMap["properties"] = tn.TransactionNodeProperties 992 } 993 return json.Marshal(objectMap) 994} 995 996// UnmarshalJSON is the custom unmarshaler for TransactionNode struct. 997func (tn *TransactionNode) UnmarshalJSON(body []byte) error { 998 var m map[string]*json.RawMessage 999 err := json.Unmarshal(body, &m) 1000 if err != nil { 1001 return err 1002 } 1003 for k, v := range m { 1004 switch k { 1005 case "location": 1006 if v != nil { 1007 var location string 1008 err = json.Unmarshal(*v, &location) 1009 if err != nil { 1010 return err 1011 } 1012 tn.Location = &location 1013 } 1014 case "properties": 1015 if v != nil { 1016 var transactionNodeProperties TransactionNodeProperties 1017 err = json.Unmarshal(*v, &transactionNodeProperties) 1018 if err != nil { 1019 return err 1020 } 1021 tn.TransactionNodeProperties = &transactionNodeProperties 1022 } 1023 case "id": 1024 if v != nil { 1025 var ID string 1026 err = json.Unmarshal(*v, &ID) 1027 if err != nil { 1028 return err 1029 } 1030 tn.ID = &ID 1031 } 1032 case "name": 1033 if v != nil { 1034 var name string 1035 err = json.Unmarshal(*v, &name) 1036 if err != nil { 1037 return err 1038 } 1039 tn.Name = &name 1040 } 1041 case "type": 1042 if v != nil { 1043 var typeVar string 1044 err = json.Unmarshal(*v, &typeVar) 1045 if err != nil { 1046 return err 1047 } 1048 tn.Type = &typeVar 1049 } 1050 } 1051 } 1052 1053 return nil 1054} 1055 1056// TransactionNodeCollection collection of transaction node payload which is exposed in the 1057// request/response of the resource provider. 1058type TransactionNodeCollection struct { 1059 autorest.Response `json:"-"` 1060 // Value - Gets or sets the collection of transaction nodes. 1061 Value *[]TransactionNode `json:"value,omitempty"` 1062 // NextLink - Gets or sets the URL, that the client should use to fetch the next page (per server side paging). 1063 // It's null for now, added for future use. 1064 NextLink *string `json:"nextLink,omitempty"` 1065} 1066 1067// TransactionNodeCollectionIterator provides access to a complete listing of TransactionNode values. 1068type TransactionNodeCollectionIterator struct { 1069 i int 1070 page TransactionNodeCollectionPage 1071} 1072 1073// NextWithContext advances to the next value. If there was an error making 1074// the request the iterator does not advance and the error is returned. 1075func (iter *TransactionNodeCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1076 if tracing.IsEnabled() { 1077 ctx = tracing.StartSpan(ctx, fqdn+"/TransactionNodeCollectionIterator.NextWithContext") 1078 defer func() { 1079 sc := -1 1080 if iter.Response().Response.Response != nil { 1081 sc = iter.Response().Response.Response.StatusCode 1082 } 1083 tracing.EndSpan(ctx, sc, err) 1084 }() 1085 } 1086 iter.i++ 1087 if iter.i < len(iter.page.Values()) { 1088 return nil 1089 } 1090 err = iter.page.NextWithContext(ctx) 1091 if err != nil { 1092 iter.i-- 1093 return err 1094 } 1095 iter.i = 0 1096 return nil 1097} 1098 1099// Next advances to the next value. If there was an error making 1100// the request the iterator does not advance and the error is returned. 1101// Deprecated: Use NextWithContext() instead. 1102func (iter *TransactionNodeCollectionIterator) Next() error { 1103 return iter.NextWithContext(context.Background()) 1104} 1105 1106// NotDone returns true if the enumeration should be started or is not yet complete. 1107func (iter TransactionNodeCollectionIterator) NotDone() bool { 1108 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1109} 1110 1111// Response returns the raw server response from the last page request. 1112func (iter TransactionNodeCollectionIterator) Response() TransactionNodeCollection { 1113 return iter.page.Response() 1114} 1115 1116// Value returns the current value or a zero-initialized value if the 1117// iterator has advanced beyond the end of the collection. 1118func (iter TransactionNodeCollectionIterator) Value() TransactionNode { 1119 if !iter.page.NotDone() { 1120 return TransactionNode{} 1121 } 1122 return iter.page.Values()[iter.i] 1123} 1124 1125// Creates a new instance of the TransactionNodeCollectionIterator type. 1126func NewTransactionNodeCollectionIterator(page TransactionNodeCollectionPage) TransactionNodeCollectionIterator { 1127 return TransactionNodeCollectionIterator{page: page} 1128} 1129 1130// IsEmpty returns true if the ListResult contains no values. 1131func (tnc TransactionNodeCollection) IsEmpty() bool { 1132 return tnc.Value == nil || len(*tnc.Value) == 0 1133} 1134 1135// hasNextLink returns true if the NextLink is not empty. 1136func (tnc TransactionNodeCollection) hasNextLink() bool { 1137 return tnc.NextLink != nil && len(*tnc.NextLink) != 0 1138} 1139 1140// transactionNodeCollectionPreparer prepares a request to retrieve the next set of results. 1141// It returns nil if no more results exist. 1142func (tnc TransactionNodeCollection) transactionNodeCollectionPreparer(ctx context.Context) (*http.Request, error) { 1143 if !tnc.hasNextLink() { 1144 return nil, nil 1145 } 1146 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1147 autorest.AsJSON(), 1148 autorest.AsGet(), 1149 autorest.WithBaseURL(to.String(tnc.NextLink))) 1150} 1151 1152// TransactionNodeCollectionPage contains a page of TransactionNode values. 1153type TransactionNodeCollectionPage struct { 1154 fn func(context.Context, TransactionNodeCollection) (TransactionNodeCollection, error) 1155 tnc TransactionNodeCollection 1156} 1157 1158// NextWithContext advances to the next page of values. If there was an error making 1159// the request the page does not advance and the error is returned. 1160func (page *TransactionNodeCollectionPage) NextWithContext(ctx context.Context) (err error) { 1161 if tracing.IsEnabled() { 1162 ctx = tracing.StartSpan(ctx, fqdn+"/TransactionNodeCollectionPage.NextWithContext") 1163 defer func() { 1164 sc := -1 1165 if page.Response().Response.Response != nil { 1166 sc = page.Response().Response.Response.StatusCode 1167 } 1168 tracing.EndSpan(ctx, sc, err) 1169 }() 1170 } 1171 for { 1172 next, err := page.fn(ctx, page.tnc) 1173 if err != nil { 1174 return err 1175 } 1176 page.tnc = next 1177 if !next.hasNextLink() || !next.IsEmpty() { 1178 break 1179 } 1180 } 1181 return nil 1182} 1183 1184// Next advances to the next page of values. If there was an error making 1185// the request the page does not advance and the error is returned. 1186// Deprecated: Use NextWithContext() instead. 1187func (page *TransactionNodeCollectionPage) Next() error { 1188 return page.NextWithContext(context.Background()) 1189} 1190 1191// NotDone returns true if the page enumeration should be started or is not yet complete. 1192func (page TransactionNodeCollectionPage) NotDone() bool { 1193 return !page.tnc.IsEmpty() 1194} 1195 1196// Response returns the raw server response from the last page request. 1197func (page TransactionNodeCollectionPage) Response() TransactionNodeCollection { 1198 return page.tnc 1199} 1200 1201// Values returns the slice of values for the current page or nil if there are no values. 1202func (page TransactionNodeCollectionPage) Values() []TransactionNode { 1203 if page.tnc.IsEmpty() { 1204 return nil 1205 } 1206 return *page.tnc.Value 1207} 1208 1209// Creates a new instance of the TransactionNodeCollectionPage type. 1210func NewTransactionNodeCollectionPage(cur TransactionNodeCollection, getNextPage func(context.Context, TransactionNodeCollection) (TransactionNodeCollection, error)) TransactionNodeCollectionPage { 1211 return TransactionNodeCollectionPage{ 1212 fn: getNextPage, 1213 tnc: cur, 1214 } 1215} 1216 1217// TransactionNodeProperties payload of transaction node properties payload in the transaction node 1218// payload. 1219type TransactionNodeProperties struct { 1220 // ProvisioningState - READ-ONLY; Gets or sets the blockchain member provision state. Possible values include: 'NodeProvisioningStateNotSpecified', 'NodeProvisioningStateUpdating', 'NodeProvisioningStateDeleting', 'NodeProvisioningStateSucceeded', 'NodeProvisioningStateFailed' 1221 ProvisioningState NodeProvisioningState `json:"provisioningState,omitempty"` 1222 // DNS - READ-ONLY; Gets or sets the transaction node dns endpoint. 1223 DNS *string `json:"dns,omitempty"` 1224 // PublicKey - READ-ONLY; Gets or sets the transaction node public key. 1225 PublicKey *string `json:"publicKey,omitempty"` 1226 // UserName - READ-ONLY; Gets or sets the transaction node dns endpoint basic auth user name. 1227 UserName *string `json:"userName,omitempty"` 1228 // Password - Sets the transaction node dns endpoint basic auth password. 1229 Password *string `json:"password,omitempty"` 1230 // FirewallRules - Gets or sets the firewall rules. 1231 FirewallRules *[]FirewallRule `json:"firewallRules,omitempty"` 1232} 1233 1234// MarshalJSON is the custom marshaler for TransactionNodeProperties. 1235func (tnp TransactionNodeProperties) MarshalJSON() ([]byte, error) { 1236 objectMap := make(map[string]interface{}) 1237 if tnp.Password != nil { 1238 objectMap["password"] = tnp.Password 1239 } 1240 if tnp.FirewallRules != nil { 1241 objectMap["firewallRules"] = tnp.FirewallRules 1242 } 1243 return json.Marshal(objectMap) 1244} 1245 1246// TransactionNodePropertiesUpdate update the payload of the transaction node properties in the transaction 1247// node payload. 1248type TransactionNodePropertiesUpdate struct { 1249 // Password - Sets the transaction node dns endpoint basic auth password. 1250 Password *string `json:"password,omitempty"` 1251 // FirewallRules - Gets or sets the firewall rules. 1252 FirewallRules *[]FirewallRule `json:"firewallRules,omitempty"` 1253} 1254 1255// TransactionNodesCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1256// operation. 1257type TransactionNodesCreateFuture struct { 1258 azure.FutureAPI 1259 // Result returns the result of the asynchronous operation. 1260 // If the operation has not completed it will return an error. 1261 Result func(TransactionNodesClient) (TransactionNode, error) 1262} 1263 1264// TransactionNodesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1265// operation. 1266type TransactionNodesDeleteFuture struct { 1267 azure.FutureAPI 1268 // Result returns the result of the asynchronous operation. 1269 // If the operation has not completed it will return an error. 1270 Result func(TransactionNodesClient) (autorest.Response, error) 1271} 1272 1273// TransactionNodeUpdate update the transaction node payload which is exposed in the request/response of 1274// the resource provider. 1275type TransactionNodeUpdate struct { 1276 // TransactionNodePropertiesUpdate - Gets or sets the transaction node update properties. 1277 *TransactionNodePropertiesUpdate `json:"properties,omitempty"` 1278} 1279 1280// MarshalJSON is the custom marshaler for TransactionNodeUpdate. 1281func (tnu TransactionNodeUpdate) MarshalJSON() ([]byte, error) { 1282 objectMap := make(map[string]interface{}) 1283 if tnu.TransactionNodePropertiesUpdate != nil { 1284 objectMap["properties"] = tnu.TransactionNodePropertiesUpdate 1285 } 1286 return json.Marshal(objectMap) 1287} 1288 1289// UnmarshalJSON is the custom unmarshaler for TransactionNodeUpdate struct. 1290func (tnu *TransactionNodeUpdate) UnmarshalJSON(body []byte) error { 1291 var m map[string]*json.RawMessage 1292 err := json.Unmarshal(body, &m) 1293 if err != nil { 1294 return err 1295 } 1296 for k, v := range m { 1297 switch k { 1298 case "properties": 1299 if v != nil { 1300 var transactionNodePropertiesUpdate TransactionNodePropertiesUpdate 1301 err = json.Unmarshal(*v, &transactionNodePropertiesUpdate) 1302 if err != nil { 1303 return err 1304 } 1305 tnu.TransactionNodePropertiesUpdate = &transactionNodePropertiesUpdate 1306 } 1307 } 1308 } 1309 1310 return nil 1311} 1312