1package resourcehealth 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/date" 25 "github.com/Azure/go-autorest/autorest/to" 26 "github.com/Azure/go-autorest/tracing" 27 "net/http" 28) 29 30// The package's fully qualified name. 31const fqdn = "github.com/Azure/azure-sdk-for-go/services/resourcehealth/mgmt/2017-07-01/resourcehealth" 32 33// AvailabilityStateValues enumerates the values for availability state values. 34type AvailabilityStateValues string 35 36const ( 37 // Available ... 38 Available AvailabilityStateValues = "Available" 39 // Unavailable ... 40 Unavailable AvailabilityStateValues = "Unavailable" 41 // Unknown ... 42 Unknown AvailabilityStateValues = "Unknown" 43) 44 45// PossibleAvailabilityStateValuesValues returns an array of possible values for the AvailabilityStateValues const type. 46func PossibleAvailabilityStateValuesValues() []AvailabilityStateValues { 47 return []AvailabilityStateValues{Available, Unavailable, Unknown} 48} 49 50// ReasonChronicityTypes enumerates the values for reason chronicity types. 51type ReasonChronicityTypes string 52 53const ( 54 // Persistent ... 55 Persistent ReasonChronicityTypes = "Persistent" 56 // Transient ... 57 Transient ReasonChronicityTypes = "Transient" 58) 59 60// PossibleReasonChronicityTypesValues returns an array of possible values for the ReasonChronicityTypes const type. 61func PossibleReasonChronicityTypesValues() []ReasonChronicityTypes { 62 return []ReasonChronicityTypes{Persistent, Transient} 63} 64 65// SeverityValues enumerates the values for severity values. 66type SeverityValues string 67 68const ( 69 // Error ... 70 Error SeverityValues = "Error" 71 // Information ... 72 Information SeverityValues = "Information" 73 // Warning ... 74 Warning SeverityValues = "Warning" 75) 76 77// PossibleSeverityValuesValues returns an array of possible values for the SeverityValues const type. 78func PossibleSeverityValuesValues() []SeverityValues { 79 return []SeverityValues{Error, Information, Warning} 80} 81 82// StageValues enumerates the values for stage values. 83type StageValues string 84 85const ( 86 // Active ... 87 Active StageValues = "Active" 88 // Archived ... 89 Archived StageValues = "Archived" 90 // Resolve ... 91 Resolve StageValues = "Resolve" 92) 93 94// PossibleStageValuesValues returns an array of possible values for the StageValues const type. 95func PossibleStageValuesValues() []StageValues { 96 return []StageValues{Active, Archived, Resolve} 97} 98 99// AvailabilityStatus availabilityStatus of a resource. 100type AvailabilityStatus struct { 101 autorest.Response `json:"-"` 102 // ID - Azure Resource Manager Identity for the availabilityStatuses resource. 103 ID *string `json:"id,omitempty"` 104 // Name - current. 105 Name *string `json:"name,omitempty"` 106 // Type - Microsoft.ResourceHealth/AvailabilityStatuses. 107 Type *string `json:"type,omitempty"` 108 // Location - Azure Resource Manager geo location of the resource. 109 Location *string `json:"location,omitempty"` 110 // Properties - Properties of availability state. 111 Properties *AvailabilityStatusProperties `json:"properties,omitempty"` 112} 113 114// AvailabilityStatusListResult the List availabilityStatus operation response. 115type AvailabilityStatusListResult struct { 116 autorest.Response `json:"-"` 117 // Value - The list of availabilityStatuses. 118 Value *[]AvailabilityStatus `json:"value,omitempty"` 119 // NextLink - The URI to fetch the next page of availabilityStatuses. Call ListNext() with this URI to fetch the next page of availabilityStatuses. 120 NextLink *string `json:"nextLink,omitempty"` 121} 122 123// AvailabilityStatusListResultIterator provides access to a complete listing of AvailabilityStatus values. 124type AvailabilityStatusListResultIterator struct { 125 i int 126 page AvailabilityStatusListResultPage 127} 128 129// NextWithContext advances to the next value. If there was an error making 130// the request the iterator does not advance and the error is returned. 131func (iter *AvailabilityStatusListResultIterator) NextWithContext(ctx context.Context) (err error) { 132 if tracing.IsEnabled() { 133 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilityStatusListResultIterator.NextWithContext") 134 defer func() { 135 sc := -1 136 if iter.Response().Response.Response != nil { 137 sc = iter.Response().Response.Response.StatusCode 138 } 139 tracing.EndSpan(ctx, sc, err) 140 }() 141 } 142 iter.i++ 143 if iter.i < len(iter.page.Values()) { 144 return nil 145 } 146 err = iter.page.NextWithContext(ctx) 147 if err != nil { 148 iter.i-- 149 return err 150 } 151 iter.i = 0 152 return nil 153} 154 155// Next advances to the next value. If there was an error making 156// the request the iterator does not advance and the error is returned. 157// Deprecated: Use NextWithContext() instead. 158func (iter *AvailabilityStatusListResultIterator) Next() error { 159 return iter.NextWithContext(context.Background()) 160} 161 162// NotDone returns true if the enumeration should be started or is not yet complete. 163func (iter AvailabilityStatusListResultIterator) NotDone() bool { 164 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 165} 166 167// Response returns the raw server response from the last page request. 168func (iter AvailabilityStatusListResultIterator) Response() AvailabilityStatusListResult { 169 return iter.page.Response() 170} 171 172// Value returns the current value or a zero-initialized value if the 173// iterator has advanced beyond the end of the collection. 174func (iter AvailabilityStatusListResultIterator) Value() AvailabilityStatus { 175 if !iter.page.NotDone() { 176 return AvailabilityStatus{} 177 } 178 return iter.page.Values()[iter.i] 179} 180 181// Creates a new instance of the AvailabilityStatusListResultIterator type. 182func NewAvailabilityStatusListResultIterator(page AvailabilityStatusListResultPage) AvailabilityStatusListResultIterator { 183 return AvailabilityStatusListResultIterator{page: page} 184} 185 186// IsEmpty returns true if the ListResult contains no values. 187func (aslr AvailabilityStatusListResult) IsEmpty() bool { 188 return aslr.Value == nil || len(*aslr.Value) == 0 189} 190 191// availabilityStatusListResultPreparer prepares a request to retrieve the next set of results. 192// It returns nil if no more results exist. 193func (aslr AvailabilityStatusListResult) availabilityStatusListResultPreparer(ctx context.Context) (*http.Request, error) { 194 if aslr.NextLink == nil || len(to.String(aslr.NextLink)) < 1 { 195 return nil, nil 196 } 197 return autorest.Prepare((&http.Request{}).WithContext(ctx), 198 autorest.AsJSON(), 199 autorest.AsGet(), 200 autorest.WithBaseURL(to.String(aslr.NextLink))) 201} 202 203// AvailabilityStatusListResultPage contains a page of AvailabilityStatus values. 204type AvailabilityStatusListResultPage struct { 205 fn func(context.Context, AvailabilityStatusListResult) (AvailabilityStatusListResult, error) 206 aslr AvailabilityStatusListResult 207} 208 209// NextWithContext advances to the next page of values. If there was an error making 210// the request the page does not advance and the error is returned. 211func (page *AvailabilityStatusListResultPage) NextWithContext(ctx context.Context) (err error) { 212 if tracing.IsEnabled() { 213 ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilityStatusListResultPage.NextWithContext") 214 defer func() { 215 sc := -1 216 if page.Response().Response.Response != nil { 217 sc = page.Response().Response.Response.StatusCode 218 } 219 tracing.EndSpan(ctx, sc, err) 220 }() 221 } 222 next, err := page.fn(ctx, page.aslr) 223 if err != nil { 224 return err 225 } 226 page.aslr = next 227 return nil 228} 229 230// Next advances to the next page of values. If there was an error making 231// the request the page does not advance and the error is returned. 232// Deprecated: Use NextWithContext() instead. 233func (page *AvailabilityStatusListResultPage) Next() error { 234 return page.NextWithContext(context.Background()) 235} 236 237// NotDone returns true if the page enumeration should be started or is not yet complete. 238func (page AvailabilityStatusListResultPage) NotDone() bool { 239 return !page.aslr.IsEmpty() 240} 241 242// Response returns the raw server response from the last page request. 243func (page AvailabilityStatusListResultPage) Response() AvailabilityStatusListResult { 244 return page.aslr 245} 246 247// Values returns the slice of values for the current page or nil if there are no values. 248func (page AvailabilityStatusListResultPage) Values() []AvailabilityStatus { 249 if page.aslr.IsEmpty() { 250 return nil 251 } 252 return *page.aslr.Value 253} 254 255// Creates a new instance of the AvailabilityStatusListResultPage type. 256func NewAvailabilityStatusListResultPage(getNextPage func(context.Context, AvailabilityStatusListResult) (AvailabilityStatusListResult, error)) AvailabilityStatusListResultPage { 257 return AvailabilityStatusListResultPage{fn: getNextPage} 258} 259 260// AvailabilityStatusProperties properties of availability state. 261type AvailabilityStatusProperties struct { 262 // AvailabilityState - Availability status of the resource. When it is null, this availabilityStatus object represents an availability impacting event. Possible values include: 'Available', 'Unavailable', 'Unknown' 263 AvailabilityState AvailabilityStateValues `json:"availabilityState,omitempty"` 264 // Summary - Summary description of the availability status. 265 Summary *string `json:"summary,omitempty"` 266 // DetailedStatus - Details of the availability status. 267 DetailedStatus *string `json:"detailedStatus,omitempty"` 268 // ReasonType - When the resource's availabilityState is Unavailable, it describes where the health impacting event was originated. Examples are planned, unplanned, user initiated or an outage etc. 269 ReasonType *string `json:"reasonType,omitempty"` 270 // RootCauseAttributionTime - When the resource's availabilityState is Unavailable, it provides the Timestamp for when the health impacting event was received. 271 RootCauseAttributionTime *date.Time `json:"rootCauseAttributionTime,omitempty"` 272 // HealthEventType - In case of an availability impacting event, it describes when the health impacting event was originated. Examples are Lifecycle, Downtime, Fault Analysis etc. 273 HealthEventType *string `json:"healthEventType,omitempty"` 274 // HealthEventCause - In case of an availability impacting event, it describes where the health impacting event was originated. Examples are PlatformInitiated, UserInitiated etc. 275 HealthEventCause *string `json:"healthEventCause,omitempty"` 276 // HealthEventCategory - In case of an availability impacting event, it describes the category of a PlatformInitiated health impacting event. Examples are Planned, Unplanned etc. 277 HealthEventCategory *string `json:"healthEventCategory,omitempty"` 278 // HealthEventID - It is a unique Id that identifies the event 279 HealthEventID *string `json:"healthEventId,omitempty"` 280 // ResolutionETA - When the resource's availabilityState is Unavailable and the reasonType is not User Initiated, it provides the date and time for when the issue is expected to be resolved. 281 ResolutionETA *date.Time `json:"resolutionETA,omitempty"` 282 // OccuredTime - Timestamp for when last change in health status occurred. 283 OccuredTime *date.Time `json:"occuredTime,omitempty"` 284 // ReasonChronicity - Chronicity of the availability transition. Possible values include: 'Transient', 'Persistent' 285 ReasonChronicity ReasonChronicityTypes `json:"reasonChronicity,omitempty"` 286 // ReportedTime - Timestamp for when the health was last checked. 287 ReportedTime *date.Time `json:"reportedTime,omitempty"` 288 // RecentlyResolvedState - An annotation describing a change in the availabilityState to Available from Unavailable with a reasonType of type Unplanned 289 RecentlyResolvedState *AvailabilityStatusPropertiesRecentlyResolvedState `json:"recentlyResolvedState,omitempty"` 290 // RecommendedActions - Lists actions the user can take based on the current availabilityState of the resource. 291 RecommendedActions *[]RecommendedAction `json:"recommendedActions,omitempty"` 292 // ServiceImpactingEvents - Lists the service impacting events that may be affecting the health of the resource. 293 ServiceImpactingEvents *[]ServiceImpactingEvent `json:"serviceImpactingEvents,omitempty"` 294} 295 296// AvailabilityStatusPropertiesRecentlyResolvedState an annotation describing a change in the 297// availabilityState to Available from Unavailable with a reasonType of type Unplanned 298type AvailabilityStatusPropertiesRecentlyResolvedState struct { 299 // UnavailableOccurredTime - Timestamp for when the availabilityState changed to Unavailable 300 UnavailableOccurredTime *date.Time `json:"unavailableOccurredTime,omitempty"` 301 // ResolvedTime - Timestamp when the availabilityState changes to Available. 302 ResolvedTime *date.Time `json:"resolvedTime,omitempty"` 303 // UnavailabilitySummary - Brief description of cause of the resource becoming unavailable. 304 UnavailabilitySummary *string `json:"unavailabilitySummary,omitempty"` 305} 306 307// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag. 308type AzureEntityResource struct { 309 // Etag - READ-ONLY; Resource Etag. 310 Etag *string `json:"etag,omitempty"` 311 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 312 ID *string `json:"id,omitempty"` 313 // Name - READ-ONLY; The name of the resource 314 Name *string `json:"name,omitempty"` 315 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 316 Type *string `json:"type,omitempty"` 317} 318 319// EmergingIssue on-going emerging issue from azure status. 320type EmergingIssue struct { 321 // RefreshTimestamp - Timestamp for when last time refreshed for ongoing emerging issue. 322 RefreshTimestamp *date.Time `json:"refreshTimestamp,omitempty"` 323 // StatusBanners - The list of emerging issues of banner type. 324 StatusBanners *[]StatusBanner `json:"statusBanners,omitempty"` 325 // StatusActiveEvents - The list of emerging issues of active event type. 326 StatusActiveEvents *[]StatusActiveEvent `json:"statusActiveEvents,omitempty"` 327} 328 329// EmergingIssueImpact object of the emerging issue impact on services and regions. 330type EmergingIssueImpact struct { 331 // ID - The impacted service id. 332 ID *string `json:"id,omitempty"` 333 // Name - The impacted service name. 334 Name *string `json:"name,omitempty"` 335 // Regions - The list of impacted regions for corresponding emerging issues. 336 Regions *[]ImpactedRegion `json:"regions,omitempty"` 337} 338 339// EmergingIssueListResult the list of emerging issues. 340type EmergingIssueListResult struct { 341 autorest.Response `json:"-"` 342 // Value - The list of emerging issues. 343 Value *[]EmergingIssuesGetResult `json:"value,omitempty"` 344 // NextLink - The link used to get the next page of emerging issues. 345 NextLink *string `json:"nextLink,omitempty"` 346} 347 348// EmergingIssueListResultIterator provides access to a complete listing of EmergingIssuesGetResult values. 349type EmergingIssueListResultIterator struct { 350 i int 351 page EmergingIssueListResultPage 352} 353 354// NextWithContext advances to the next value. If there was an error making 355// the request the iterator does not advance and the error is returned. 356func (iter *EmergingIssueListResultIterator) NextWithContext(ctx context.Context) (err error) { 357 if tracing.IsEnabled() { 358 ctx = tracing.StartSpan(ctx, fqdn+"/EmergingIssueListResultIterator.NextWithContext") 359 defer func() { 360 sc := -1 361 if iter.Response().Response.Response != nil { 362 sc = iter.Response().Response.Response.StatusCode 363 } 364 tracing.EndSpan(ctx, sc, err) 365 }() 366 } 367 iter.i++ 368 if iter.i < len(iter.page.Values()) { 369 return nil 370 } 371 err = iter.page.NextWithContext(ctx) 372 if err != nil { 373 iter.i-- 374 return err 375 } 376 iter.i = 0 377 return nil 378} 379 380// Next advances to the next value. If there was an error making 381// the request the iterator does not advance and the error is returned. 382// Deprecated: Use NextWithContext() instead. 383func (iter *EmergingIssueListResultIterator) Next() error { 384 return iter.NextWithContext(context.Background()) 385} 386 387// NotDone returns true if the enumeration should be started or is not yet complete. 388func (iter EmergingIssueListResultIterator) NotDone() bool { 389 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 390} 391 392// Response returns the raw server response from the last page request. 393func (iter EmergingIssueListResultIterator) Response() EmergingIssueListResult { 394 return iter.page.Response() 395} 396 397// Value returns the current value or a zero-initialized value if the 398// iterator has advanced beyond the end of the collection. 399func (iter EmergingIssueListResultIterator) Value() EmergingIssuesGetResult { 400 if !iter.page.NotDone() { 401 return EmergingIssuesGetResult{} 402 } 403 return iter.page.Values()[iter.i] 404} 405 406// Creates a new instance of the EmergingIssueListResultIterator type. 407func NewEmergingIssueListResultIterator(page EmergingIssueListResultPage) EmergingIssueListResultIterator { 408 return EmergingIssueListResultIterator{page: page} 409} 410 411// IsEmpty returns true if the ListResult contains no values. 412func (eilr EmergingIssueListResult) IsEmpty() bool { 413 return eilr.Value == nil || len(*eilr.Value) == 0 414} 415 416// emergingIssueListResultPreparer prepares a request to retrieve the next set of results. 417// It returns nil if no more results exist. 418func (eilr EmergingIssueListResult) emergingIssueListResultPreparer(ctx context.Context) (*http.Request, error) { 419 if eilr.NextLink == nil || len(to.String(eilr.NextLink)) < 1 { 420 return nil, nil 421 } 422 return autorest.Prepare((&http.Request{}).WithContext(ctx), 423 autorest.AsJSON(), 424 autorest.AsGet(), 425 autorest.WithBaseURL(to.String(eilr.NextLink))) 426} 427 428// EmergingIssueListResultPage contains a page of EmergingIssuesGetResult values. 429type EmergingIssueListResultPage struct { 430 fn func(context.Context, EmergingIssueListResult) (EmergingIssueListResult, error) 431 eilr EmergingIssueListResult 432} 433 434// NextWithContext advances to the next page of values. If there was an error making 435// the request the page does not advance and the error is returned. 436func (page *EmergingIssueListResultPage) NextWithContext(ctx context.Context) (err error) { 437 if tracing.IsEnabled() { 438 ctx = tracing.StartSpan(ctx, fqdn+"/EmergingIssueListResultPage.NextWithContext") 439 defer func() { 440 sc := -1 441 if page.Response().Response.Response != nil { 442 sc = page.Response().Response.Response.StatusCode 443 } 444 tracing.EndSpan(ctx, sc, err) 445 }() 446 } 447 next, err := page.fn(ctx, page.eilr) 448 if err != nil { 449 return err 450 } 451 page.eilr = next 452 return nil 453} 454 455// Next advances to the next page of values. If there was an error making 456// the request the page does not advance and the error is returned. 457// Deprecated: Use NextWithContext() instead. 458func (page *EmergingIssueListResultPage) Next() error { 459 return page.NextWithContext(context.Background()) 460} 461 462// NotDone returns true if the page enumeration should be started or is not yet complete. 463func (page EmergingIssueListResultPage) NotDone() bool { 464 return !page.eilr.IsEmpty() 465} 466 467// Response returns the raw server response from the last page request. 468func (page EmergingIssueListResultPage) Response() EmergingIssueListResult { 469 return page.eilr 470} 471 472// Values returns the slice of values for the current page or nil if there are no values. 473func (page EmergingIssueListResultPage) Values() []EmergingIssuesGetResult { 474 if page.eilr.IsEmpty() { 475 return nil 476 } 477 return *page.eilr.Value 478} 479 480// Creates a new instance of the EmergingIssueListResultPage type. 481func NewEmergingIssueListResultPage(getNextPage func(context.Context, EmergingIssueListResult) (EmergingIssueListResult, error)) EmergingIssueListResultPage { 482 return EmergingIssueListResultPage{fn: getNextPage} 483} 484 485// EmergingIssuesGetResult the Get EmergingIssues operation response. 486type EmergingIssuesGetResult struct { 487 autorest.Response `json:"-"` 488 // EmergingIssue - The emerging issue entity properties. 489 *EmergingIssue `json:"properties,omitempty"` 490 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 491 ID *string `json:"id,omitempty"` 492 // Name - READ-ONLY; The name of the resource 493 Name *string `json:"name,omitempty"` 494 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 495 Type *string `json:"type,omitempty"` 496} 497 498// MarshalJSON is the custom marshaler for EmergingIssuesGetResult. 499func (eigr EmergingIssuesGetResult) MarshalJSON() ([]byte, error) { 500 objectMap := make(map[string]interface{}) 501 if eigr.EmergingIssue != nil { 502 objectMap["properties"] = eigr.EmergingIssue 503 } 504 return json.Marshal(objectMap) 505} 506 507// UnmarshalJSON is the custom unmarshaler for EmergingIssuesGetResult struct. 508func (eigr *EmergingIssuesGetResult) UnmarshalJSON(body []byte) error { 509 var m map[string]*json.RawMessage 510 err := json.Unmarshal(body, &m) 511 if err != nil { 512 return err 513 } 514 for k, v := range m { 515 switch k { 516 case "properties": 517 if v != nil { 518 var emergingIssue EmergingIssue 519 err = json.Unmarshal(*v, &emergingIssue) 520 if err != nil { 521 return err 522 } 523 eigr.EmergingIssue = &emergingIssue 524 } 525 case "id": 526 if v != nil { 527 var ID string 528 err = json.Unmarshal(*v, &ID) 529 if err != nil { 530 return err 531 } 532 eigr.ID = &ID 533 } 534 case "name": 535 if v != nil { 536 var name string 537 err = json.Unmarshal(*v, &name) 538 if err != nil { 539 return err 540 } 541 eigr.Name = &name 542 } 543 case "type": 544 if v != nil { 545 var typeVar string 546 err = json.Unmarshal(*v, &typeVar) 547 if err != nil { 548 return err 549 } 550 eigr.Type = &typeVar 551 } 552 } 553 } 554 555 return nil 556} 557 558// ErrorResponse error details. 559type ErrorResponse struct { 560 // Code - READ-ONLY; The error code. 561 Code *string `json:"code,omitempty"` 562 // Message - READ-ONLY; The error message. 563 Message *string `json:"message,omitempty"` 564 // Details - READ-ONLY; The error details. 565 Details *string `json:"details,omitempty"` 566} 567 568// ImpactedRegion object of impacted region. 569type ImpactedRegion struct { 570 // ID - The impacted region id. 571 ID *string `json:"id,omitempty"` 572 // Name - The impacted region name. 573 Name *string `json:"name,omitempty"` 574} 575 576// Operation operation available in the resourcehealth resource provider. 577type Operation struct { 578 // Name - Name of the operation. 579 Name *string `json:"name,omitempty"` 580 // Display - Properties of the operation. 581 Display *OperationDisplay `json:"display,omitempty"` 582} 583 584// OperationDisplay properties of the operation. 585type OperationDisplay struct { 586 // Provider - Provider name. 587 Provider *string `json:"provider,omitempty"` 588 // Resource - Resource name. 589 Resource *string `json:"resource,omitempty"` 590 // Operation - Operation name. 591 Operation *string `json:"operation,omitempty"` 592 // Description - Description of the operation. 593 Description *string `json:"description,omitempty"` 594} 595 596// OperationListResult lists the operations response. 597type OperationListResult struct { 598 autorest.Response `json:"-"` 599 // Value - List of operations available in the resourcehealth resource provider. 600 Value *[]Operation `json:"value,omitempty"` 601} 602 603// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than 604// required location and tags 605type ProxyResource struct { 606 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 607 ID *string `json:"id,omitempty"` 608 // Name - READ-ONLY; The name of the resource 609 Name *string `json:"name,omitempty"` 610 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 611 Type *string `json:"type,omitempty"` 612} 613 614// RecommendedAction lists actions the user can take based on the current availabilityState of the 615// resource. 616type RecommendedAction struct { 617 // Action - Recommended action. 618 Action *string `json:"action,omitempty"` 619 // ActionURL - Link to the action 620 ActionURL *string `json:"actionUrl,omitempty"` 621 // ActionURLText - Substring of action, it describes which text should host the action url. 622 ActionURLText *string `json:"actionUrlText,omitempty"` 623} 624 625// Resource ... 626type Resource struct { 627 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 628 ID *string `json:"id,omitempty"` 629 // Name - READ-ONLY; The name of the resource 630 Name *string `json:"name,omitempty"` 631 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 632 Type *string `json:"type,omitempty"` 633} 634 635// ServiceImpactingEvent lists the service impacting events that may be affecting the health of the 636// resource. 637type ServiceImpactingEvent struct { 638 // EventStartTime - Timestamp for when the event started. 639 EventStartTime *date.Time `json:"eventStartTime,omitempty"` 640 // EventStatusLastModifiedTime - Timestamp for when event was submitted/detected. 641 EventStatusLastModifiedTime *date.Time `json:"eventStatusLastModifiedTime,omitempty"` 642 // CorrelationID - Correlation id for the event 643 CorrelationID *string `json:"correlationId,omitempty"` 644 // Status - Status of the service impacting event. 645 Status *ServiceImpactingEventStatus `json:"status,omitempty"` 646 // IncidentProperties - Properties of the service impacting event. 647 IncidentProperties *ServiceImpactingEventIncidentProperties `json:"incidentProperties,omitempty"` 648} 649 650// ServiceImpactingEventIncidentProperties properties of the service impacting event. 651type ServiceImpactingEventIncidentProperties struct { 652 // Title - Title of the incident. 653 Title *string `json:"title,omitempty"` 654 // Service - Service impacted by the event. 655 Service *string `json:"service,omitempty"` 656 // Region - Region impacted by the event. 657 Region *string `json:"region,omitempty"` 658 // IncidentType - Type of Event. 659 IncidentType *string `json:"incidentType,omitempty"` 660} 661 662// ServiceImpactingEventStatus status of the service impacting event. 663type ServiceImpactingEventStatus struct { 664 // Value - Current status of the event 665 Value *string `json:"value,omitempty"` 666} 667 668// StatusActiveEvent active event type of emerging issue. 669type StatusActiveEvent struct { 670 // Title - The active event title. 671 Title *string `json:"title,omitempty"` 672 // Description - The details of active event. 673 Description *string `json:"description,omitempty"` 674 // TrackingID - The tracking id of this active event. 675 TrackingID *string `json:"trackingId,omitempty"` 676 // StartTime - The impact start time on this active event. 677 StartTime *date.Time `json:"startTime,omitempty"` 678 // Cloud - The cloud type of this active event. 679 Cloud *string `json:"cloud,omitempty"` 680 // Severity - The severity level of this active event. Possible values include: 'Information', 'Warning', 'Error' 681 Severity SeverityValues `json:"severity,omitempty"` 682 // Stage - The stage of this active event. Possible values include: 'Active', 'Resolve', 'Archived' 683 Stage StageValues `json:"stage,omitempty"` 684 // Published - The boolean value of this active event if published or not. 685 Published *bool `json:"published,omitempty"` 686 // LastModifiedTime - The last time modified on this banner. 687 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 688 // Impacts - The list of emerging issues impacts. 689 Impacts *[]EmergingIssueImpact `json:"impacts,omitempty"` 690} 691 692// StatusBanner banner type of emerging issue. 693type StatusBanner struct { 694 // Title - The banner title. 695 Title *string `json:"title,omitempty"` 696 // Message - The details of banner. 697 Message *string `json:"message,omitempty"` 698 // Cloud - The cloud type of this banner. 699 Cloud *string `json:"cloud,omitempty"` 700 // LastModifiedTime - The last time modified on this banner. 701 LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` 702} 703 704// TrackedResource the resource model definition for a ARM tracked top level resource 705type TrackedResource struct { 706 // Tags - Resource tags. 707 Tags map[string]*string `json:"tags"` 708 // Location - The geo-location where the resource lives 709 Location *string `json:"location,omitempty"` 710 // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 711 ID *string `json:"id,omitempty"` 712 // Name - READ-ONLY; The name of the resource 713 Name *string `json:"name,omitempty"` 714 // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. 715 Type *string `json:"type,omitempty"` 716} 717 718// MarshalJSON is the custom marshaler for TrackedResource. 719func (tr TrackedResource) MarshalJSON() ([]byte, error) { 720 objectMap := make(map[string]interface{}) 721 if tr.Tags != nil { 722 objectMap["tags"] = tr.Tags 723 } 724 if tr.Location != nil { 725 objectMap["location"] = tr.Location 726 } 727 return json.Marshal(objectMap) 728} 729