1package webservices 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/machinelearning/mgmt/2017-01-01/webservices" 33 34// AssetType enumerates the values for asset type. 35type AssetType string 36 37const ( 38 // AssetTypeModule ... 39 AssetTypeModule AssetType = "Module" 40 // AssetTypeResource ... 41 AssetTypeResource AssetType = "Resource" 42) 43 44// PossibleAssetTypeValues returns an array of possible values for the AssetType const type. 45func PossibleAssetTypeValues() []AssetType { 46 return []AssetType{AssetTypeModule, AssetTypeResource} 47} 48 49// ColumnFormat enumerates the values for column format. 50type ColumnFormat string 51 52const ( 53 // Byte ... 54 Byte ColumnFormat = "Byte" 55 // Char ... 56 Char ColumnFormat = "Char" 57 // Complex128 ... 58 Complex128 ColumnFormat = "Complex128" 59 // Complex64 ... 60 Complex64 ColumnFormat = "Complex64" 61 // DateTime ... 62 DateTime ColumnFormat = "Date-time" 63 // DateTimeOffset ... 64 DateTimeOffset ColumnFormat = "Date-timeOffset" 65 // Double ... 66 Double ColumnFormat = "Double" 67 // Duration ... 68 Duration ColumnFormat = "Duration" 69 // Float ... 70 Float ColumnFormat = "Float" 71 // Int16 ... 72 Int16 ColumnFormat = "Int16" 73 // Int32 ... 74 Int32 ColumnFormat = "Int32" 75 // Int64 ... 76 Int64 ColumnFormat = "Int64" 77 // Int8 ... 78 Int8 ColumnFormat = "Int8" 79 // Uint16 ... 80 Uint16 ColumnFormat = "Uint16" 81 // Uint32 ... 82 Uint32 ColumnFormat = "Uint32" 83 // Uint64 ... 84 Uint64 ColumnFormat = "Uint64" 85 // Uint8 ... 86 Uint8 ColumnFormat = "Uint8" 87) 88 89// PossibleColumnFormatValues returns an array of possible values for the ColumnFormat const type. 90func PossibleColumnFormatValues() []ColumnFormat { 91 return []ColumnFormat{Byte, Char, Complex128, Complex64, DateTime, DateTimeOffset, Double, Duration, Float, Int16, Int32, Int64, Int8, Uint16, Uint32, Uint64, Uint8} 92} 93 94// ColumnType enumerates the values for column type. 95type ColumnType string 96 97const ( 98 // Boolean ... 99 Boolean ColumnType = "Boolean" 100 // Integer ... 101 Integer ColumnType = "Integer" 102 // Number ... 103 Number ColumnType = "Number" 104 // String ... 105 String ColumnType = "String" 106) 107 108// PossibleColumnTypeValues returns an array of possible values for the ColumnType const type. 109func PossibleColumnTypeValues() []ColumnType { 110 return []ColumnType{Boolean, Integer, Number, String} 111} 112 113// DiagnosticsLevel enumerates the values for diagnostics level. 114type DiagnosticsLevel string 115 116const ( 117 // All ... 118 All DiagnosticsLevel = "All" 119 // Error ... 120 Error DiagnosticsLevel = "Error" 121 // None ... 122 None DiagnosticsLevel = "None" 123) 124 125// PossibleDiagnosticsLevelValues returns an array of possible values for the DiagnosticsLevel const type. 126func PossibleDiagnosticsLevelValues() []DiagnosticsLevel { 127 return []DiagnosticsLevel{All, Error, None} 128} 129 130// InputPortType enumerates the values for input port type. 131type InputPortType string 132 133const ( 134 // Dataset ... 135 Dataset InputPortType = "Dataset" 136) 137 138// PossibleInputPortTypeValues returns an array of possible values for the InputPortType const type. 139func PossibleInputPortTypeValues() []InputPortType { 140 return []InputPortType{Dataset} 141} 142 143// OutputPortType enumerates the values for output port type. 144type OutputPortType string 145 146const ( 147 // OutputPortTypeDataset ... 148 OutputPortTypeDataset OutputPortType = "Dataset" 149) 150 151// PossibleOutputPortTypeValues returns an array of possible values for the OutputPortType const type. 152func PossibleOutputPortTypeValues() []OutputPortType { 153 return []OutputPortType{OutputPortTypeDataset} 154} 155 156// PackageType enumerates the values for package type. 157type PackageType string 158 159const ( 160 // PackageTypeGraph ... 161 PackageTypeGraph PackageType = "Graph" 162 // PackageTypeWebServiceProperties ... 163 PackageTypeWebServiceProperties PackageType = "WebServiceProperties" 164) 165 166// PossiblePackageTypeValues returns an array of possible values for the PackageType const type. 167func PossiblePackageTypeValues() []PackageType { 168 return []PackageType{PackageTypeGraph, PackageTypeWebServiceProperties} 169} 170 171// ParameterType enumerates the values for parameter type. 172type ParameterType string 173 174const ( 175 // ParameterTypeBoolean ... 176 ParameterTypeBoolean ParameterType = "Boolean" 177 // ParameterTypeColumnPicker ... 178 ParameterTypeColumnPicker ParameterType = "ColumnPicker" 179 // ParameterTypeCredential ... 180 ParameterTypeCredential ParameterType = "Credential" 181 // ParameterTypeDataGatewayName ... 182 ParameterTypeDataGatewayName ParameterType = "DataGatewayName" 183 // ParameterTypeDouble ... 184 ParameterTypeDouble ParameterType = "Double" 185 // ParameterTypeEnumerated ... 186 ParameterTypeEnumerated ParameterType = "Enumerated" 187 // ParameterTypeFloat ... 188 ParameterTypeFloat ParameterType = "Float" 189 // ParameterTypeInt ... 190 ParameterTypeInt ParameterType = "Int" 191 // ParameterTypeMode ... 192 ParameterTypeMode ParameterType = "Mode" 193 // ParameterTypeParameterRange ... 194 ParameterTypeParameterRange ParameterType = "ParameterRange" 195 // ParameterTypeScript ... 196 ParameterTypeScript ParameterType = "Script" 197 // ParameterTypeString ... 198 ParameterTypeString ParameterType = "String" 199) 200 201// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type. 202func PossibleParameterTypeValues() []ParameterType { 203 return []ParameterType{ParameterTypeBoolean, ParameterTypeColumnPicker, ParameterTypeCredential, ParameterTypeDataGatewayName, ParameterTypeDouble, ParameterTypeEnumerated, ParameterTypeFloat, ParameterTypeInt, ParameterTypeMode, ParameterTypeParameterRange, ParameterTypeScript, ParameterTypeString} 204} 205 206// ProvisioningState enumerates the values for provisioning state. 207type ProvisioningState string 208 209const ( 210 // Failed ... 211 Failed ProvisioningState = "Failed" 212 // Provisioning ... 213 Provisioning ProvisioningState = "Provisioning" 214 // Succeeded ... 215 Succeeded ProvisioningState = "Succeeded" 216 // Unknown ... 217 Unknown ProvisioningState = "Unknown" 218) 219 220// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. 221func PossibleProvisioningStateValues() []ProvisioningState { 222 return []ProvisioningState{Failed, Provisioning, Succeeded, Unknown} 223} 224 225// AssetItem information about an asset associated with the web service. 226type AssetItem struct { 227 // Name - Asset's friendly name. 228 Name *string `json:"name,omitempty"` 229 // ID - Asset's Id. 230 ID *string `json:"id,omitempty"` 231 // Type - Asset's type. Possible values include: 'AssetTypeModule', 'AssetTypeResource' 232 Type AssetType `json:"type,omitempty"` 233 // LocationInfo - Access information for the asset. 234 LocationInfo *BlobLocation `json:"locationInfo,omitempty"` 235 // InputPorts - Information about the asset's input ports. 236 InputPorts map[string]*InputPort `json:"inputPorts"` 237 // OutputPorts - Information about the asset's output ports. 238 OutputPorts map[string]*OutputPort `json:"outputPorts"` 239 // Metadata - If the asset is a custom module, this holds the module's metadata. 240 Metadata map[string]*string `json:"metadata"` 241 // Parameters - If the asset is a custom module, this holds the module's parameters. 242 Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"` 243} 244 245// MarshalJSON is the custom marshaler for AssetItem. 246func (ai AssetItem) MarshalJSON() ([]byte, error) { 247 objectMap := make(map[string]interface{}) 248 if ai.Name != nil { 249 objectMap["name"] = ai.Name 250 } 251 if ai.ID != nil { 252 objectMap["id"] = ai.ID 253 } 254 if ai.Type != "" { 255 objectMap["type"] = ai.Type 256 } 257 if ai.LocationInfo != nil { 258 objectMap["locationInfo"] = ai.LocationInfo 259 } 260 if ai.InputPorts != nil { 261 objectMap["inputPorts"] = ai.InputPorts 262 } 263 if ai.OutputPorts != nil { 264 objectMap["outputPorts"] = ai.OutputPorts 265 } 266 if ai.Metadata != nil { 267 objectMap["metadata"] = ai.Metadata 268 } 269 if ai.Parameters != nil { 270 objectMap["parameters"] = ai.Parameters 271 } 272 return json.Marshal(objectMap) 273} 274 275// AsyncOperationErrorInfo the error detail information for async operation 276type AsyncOperationErrorInfo struct { 277 // Code - READ-ONLY; The error code. 278 Code *string `json:"code,omitempty"` 279 // Target - READ-ONLY; The error target. 280 Target *string `json:"target,omitempty"` 281 // Message - READ-ONLY; The error message. 282 Message *string `json:"message,omitempty"` 283 // Details - READ-ONLY; An array containing error information. 284 Details *[]AsyncOperationErrorInfo `json:"details,omitempty"` 285} 286 287// AsyncOperationStatus azure async operation status. 288type AsyncOperationStatus struct { 289 autorest.Response `json:"-"` 290 // ID - READ-ONLY; Async operation id. 291 ID *string `json:"id,omitempty"` 292 // Name - READ-ONLY; Async operation name. 293 Name *string `json:"name,omitempty"` 294 // ProvisioningState - READ-ONLY; Read Only: The provisioning state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed' 295 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 296 // StartTime - READ-ONLY; The date time that the async operation started. 297 StartTime *date.Time `json:"startTime,omitempty"` 298 // EndTime - READ-ONLY; The date time that the async operation finished. 299 EndTime *date.Time `json:"endTime,omitempty"` 300 // PercentComplete - READ-ONLY; Async operation progress. 301 PercentComplete *float64 `json:"percentComplete,omitempty"` 302 // ErrorInfo - READ-ONLY; If the async operation fails, this structure contains the error details. 303 ErrorInfo *AsyncOperationErrorInfo `json:"errorInfo,omitempty"` 304} 305 306// BlobLocation describes the access location for a blob. 307type BlobLocation struct { 308 // URI - The URI from which the blob is accessible from. For example, aml://abc for system assets or https://xyz for user assets or payload. 309 URI *string `json:"uri,omitempty"` 310 // Credentials - Access credentials for the blob, if applicable (e.g. blob specified by storage account connection string + blob URI) 311 Credentials *string `json:"credentials,omitempty"` 312} 313 314// ColumnSpecification swagger 2.0 schema for a column within the data table representing a web service 315// input or output. See Swagger specification: http://swagger.io/specification/ 316type ColumnSpecification struct { 317 // Type - Data type of the column. Possible values include: 'Boolean', 'Integer', 'Number', 'String' 318 Type ColumnType `json:"type,omitempty"` 319 // Format - Additional format information for the data type. Possible values include: 'Byte', 'Char', 'Complex64', 'Complex128', 'DateTime', 'DateTimeOffset', 'Double', 'Duration', 'Float', 'Int8', 'Int16', 'Int32', 'Int64', 'Uint8', 'Uint16', 'Uint32', 'Uint64' 320 Format ColumnFormat `json:"format,omitempty"` 321 // Enum - If the data type is categorical, this provides the list of accepted categories. 322 Enum *[]interface{} `json:"enum,omitempty"` 323 // XMsIsnullable - Flag indicating if the type supports null values or not. 324 XMsIsnullable *bool `json:"x-ms-isnullable,omitempty"` 325 // XMsIsordered - Flag indicating whether the categories are treated as an ordered set or not, if this is a categorical column. 326 XMsIsordered *bool `json:"x-ms-isordered,omitempty"` 327} 328 329// CommitmentPlan information about the machine learning commitment plan associated with the web service. 330type CommitmentPlan struct { 331 // ID - Specifies the Azure Resource Manager ID of the commitment plan associated with the web service. 332 ID *string `json:"id,omitempty"` 333} 334 335// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 336// operation. 337type CreateOrUpdateFuture struct { 338 azure.Future 339} 340 341// Result returns the result of the asynchronous operation. 342// If the operation has not completed it will return an error. 343func (future *CreateOrUpdateFuture) Result(client Client) (ws WebService, err error) { 344 var done bool 345 done, err = future.DoneWithContext(context.Background(), client) 346 if err != nil { 347 err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 348 return 349 } 350 if !done { 351 err = azure.NewAsyncOpIncompleteError("webservices.CreateOrUpdateFuture") 352 return 353 } 354 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 355 if ws.Response.Response, err = future.GetResult(sender); err == nil && ws.Response.Response.StatusCode != http.StatusNoContent { 356 ws, err = client.CreateOrUpdateResponder(ws.Response.Response) 357 if err != nil { 358 err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", ws.Response.Response, "Failure responding to request") 359 } 360 } 361 return 362} 363 364// CreateRegionalPropertiesFuture an abstraction for monitoring and retrieving the results of a 365// long-running operation. 366type CreateRegionalPropertiesFuture struct { 367 azure.Future 368} 369 370// Result returns the result of the asynchronous operation. 371// If the operation has not completed it will return an error. 372func (future *CreateRegionalPropertiesFuture) Result(client Client) (aos AsyncOperationStatus, err error) { 373 var done bool 374 done, err = future.DoneWithContext(context.Background(), client) 375 if err != nil { 376 err = autorest.NewErrorWithError(err, "webservices.CreateRegionalPropertiesFuture", "Result", future.Response(), "Polling failure") 377 return 378 } 379 if !done { 380 err = azure.NewAsyncOpIncompleteError("webservices.CreateRegionalPropertiesFuture") 381 return 382 } 383 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 384 if aos.Response.Response, err = future.GetResult(sender); err == nil && aos.Response.Response.StatusCode != http.StatusNoContent { 385 aos, err = client.CreateRegionalPropertiesResponder(aos.Response.Response) 386 if err != nil { 387 err = autorest.NewErrorWithError(err, "webservices.CreateRegionalPropertiesFuture", "Result", aos.Response.Response, "Failure responding to request") 388 } 389 } 390 return 391} 392 393// DiagnosticsConfiguration diagnostics settings for an Azure ML web service. 394type DiagnosticsConfiguration struct { 395 // Level - Specifies the verbosity of the diagnostic output. Valid values are: None - disables tracing; Error - collects only error (stderr) traces; All - collects all traces (stdout and stderr). Possible values include: 'None', 'Error', 'All' 396 Level DiagnosticsLevel `json:"level,omitempty"` 397 // Expiry - Specifies the date and time when the logging will cease. If null, diagnostic collection is not time limited. 398 Expiry *date.Time `json:"expiry,omitempty"` 399} 400 401// ExampleRequest sample input data for the service's input(s). 402type ExampleRequest struct { 403 // Inputs - Sample input data for the web service's input(s) given as an input name to sample input values matrix map. 404 Inputs map[string][][]interface{} `json:"inputs"` 405 // GlobalParameters - Sample input data for the web service's global parameters 406 GlobalParameters map[string]interface{} `json:"globalParameters"` 407} 408 409// MarshalJSON is the custom marshaler for ExampleRequest. 410func (er ExampleRequest) MarshalJSON() ([]byte, error) { 411 objectMap := make(map[string]interface{}) 412 if er.Inputs != nil { 413 objectMap["inputs"] = er.Inputs 414 } 415 if er.GlobalParameters != nil { 416 objectMap["globalParameters"] = er.GlobalParameters 417 } 418 return json.Marshal(objectMap) 419} 420 421// GraphEdge defines an edge within the web service's graph. 422type GraphEdge struct { 423 // SourceNodeID - The source graph node's identifier. 424 SourceNodeID *string `json:"sourceNodeId,omitempty"` 425 // SourcePortID - The identifier of the source node's port that the edge connects from. 426 SourcePortID *string `json:"sourcePortId,omitempty"` 427 // TargetNodeID - The destination graph node's identifier. 428 TargetNodeID *string `json:"targetNodeId,omitempty"` 429 // TargetPortID - The identifier of the destination node's port that the edge connects into. 430 TargetPortID *string `json:"targetPortId,omitempty"` 431} 432 433// GraphNode specifies a node in the web service graph. The node can either be an input, output or asset 434// node, so only one of the corresponding id properties is populated at any given time. 435type GraphNode struct { 436 // AssetID - The id of the asset represented by this node. 437 AssetID *string `json:"assetId,omitempty"` 438 // InputID - The id of the input element represented by this node. 439 InputID *string `json:"inputId,omitempty"` 440 // OutputID - The id of the output element represented by this node. 441 OutputID *string `json:"outputId,omitempty"` 442 // Parameters - If applicable, parameters of the node. Global graph parameters map into these, with values set at runtime. 443 Parameters map[string]*Parameter `json:"parameters"` 444} 445 446// MarshalJSON is the custom marshaler for GraphNode. 447func (gn GraphNode) MarshalJSON() ([]byte, error) { 448 objectMap := make(map[string]interface{}) 449 if gn.AssetID != nil { 450 objectMap["assetId"] = gn.AssetID 451 } 452 if gn.InputID != nil { 453 objectMap["inputId"] = gn.InputID 454 } 455 if gn.OutputID != nil { 456 objectMap["outputId"] = gn.OutputID 457 } 458 if gn.Parameters != nil { 459 objectMap["parameters"] = gn.Parameters 460 } 461 return json.Marshal(objectMap) 462} 463 464// GraphPackage defines the graph of modules making up the machine learning solution. 465type GraphPackage struct { 466 // Nodes - The set of nodes making up the graph, provided as a nodeId to GraphNode map 467 Nodes map[string]*GraphNode `json:"nodes"` 468 // Edges - The list of edges making up the graph. 469 Edges *[]GraphEdge `json:"edges,omitempty"` 470 // GraphParameters - The collection of global parameters for the graph, given as a global parameter name to GraphParameter map. Each parameter here has a 1:1 match with the global parameters values map declared at the WebServiceProperties level. 471 GraphParameters map[string]*GraphParameter `json:"graphParameters"` 472} 473 474// MarshalJSON is the custom marshaler for GraphPackage. 475func (gp GraphPackage) MarshalJSON() ([]byte, error) { 476 objectMap := make(map[string]interface{}) 477 if gp.Nodes != nil { 478 objectMap["nodes"] = gp.Nodes 479 } 480 if gp.Edges != nil { 481 objectMap["edges"] = gp.Edges 482 } 483 if gp.GraphParameters != nil { 484 objectMap["graphParameters"] = gp.GraphParameters 485 } 486 return json.Marshal(objectMap) 487} 488 489// GraphParameter defines a global parameter in the graph. 490type GraphParameter struct { 491 // Description - Description of this graph parameter. 492 Description *string `json:"description,omitempty"` 493 // Type - Graph parameter's type. Possible values include: 'ParameterTypeString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeEnumerated', 'ParameterTypeScript', 'ParameterTypeMode', 'ParameterTypeCredential', 'ParameterTypeBoolean', 'ParameterTypeDouble', 'ParameterTypeColumnPicker', 'ParameterTypeParameterRange', 'ParameterTypeDataGatewayName' 494 Type ParameterType `json:"type,omitempty"` 495 // Links - Association links for this parameter to nodes in the graph. 496 Links *[]GraphParameterLink `json:"links,omitempty"` 497} 498 499// GraphParameterLink association link for a graph global parameter to a node in the graph. 500type GraphParameterLink struct { 501 // NodeID - The graph node's identifier 502 NodeID *string `json:"nodeId,omitempty"` 503 // ParameterKey - The identifier of the node parameter that the global parameter maps to. 504 ParameterKey *string `json:"parameterKey,omitempty"` 505} 506 507// InputPort asset input port 508type InputPort struct { 509 // Type - Port data type. Possible values include: 'Dataset' 510 Type InputPortType `json:"type,omitempty"` 511} 512 513// Keys access keys for the web service calls. 514type Keys struct { 515 autorest.Response `json:"-"` 516 // Primary - The primary access key. 517 Primary *string `json:"primary,omitempty"` 518 // Secondary - The secondary access key. 519 Secondary *string `json:"secondary,omitempty"` 520} 521 522// MachineLearningWorkspace information about the machine learning workspace containing the experiment that 523// is source for the web service. 524type MachineLearningWorkspace struct { 525 // ID - Specifies the workspace ID of the machine learning workspace associated with the web service 526 ID *string `json:"id,omitempty"` 527} 528 529// ModeValueInfo nested parameter definition. 530type ModeValueInfo struct { 531 // InterfaceString - The interface string name for the nested parameter. 532 InterfaceString *string `json:"interfaceString,omitempty"` 533 // Parameters - The definition of the parameter. 534 Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"` 535} 536 537// ModuleAssetParameter parameter definition for a module asset. 538type ModuleAssetParameter struct { 539 // Name - Parameter name. 540 Name *string `json:"name,omitempty"` 541 // ParameterType - Parameter type. 542 ParameterType *string `json:"parameterType,omitempty"` 543 // ModeValuesInfo - Definitions for nested interface parameters if this is a complex module parameter. 544 ModeValuesInfo map[string]*ModeValueInfo `json:"modeValuesInfo"` 545} 546 547// MarshalJSON is the custom marshaler for ModuleAssetParameter. 548func (mapVar ModuleAssetParameter) MarshalJSON() ([]byte, error) { 549 objectMap := make(map[string]interface{}) 550 if mapVar.Name != nil { 551 objectMap["name"] = mapVar.Name 552 } 553 if mapVar.ParameterType != nil { 554 objectMap["parameterType"] = mapVar.ParameterType 555 } 556 if mapVar.ModeValuesInfo != nil { 557 objectMap["modeValuesInfo"] = mapVar.ModeValuesInfo 558 } 559 return json.Marshal(objectMap) 560} 561 562// OperationDisplayInfo the API operation info. 563type OperationDisplayInfo struct { 564 // Description - READ-ONLY; The description of the operation. 565 Description *string `json:"description,omitempty"` 566 // Operation - READ-ONLY; The action that users can perform, based on their permission level. 567 Operation *string `json:"operation,omitempty"` 568 // Provider - READ-ONLY; The service provider. 569 Provider *string `json:"provider,omitempty"` 570 // Resource - READ-ONLY; The resource on which the operation is performed. 571 Resource *string `json:"resource,omitempty"` 572} 573 574// OperationEntity an API operation. 575type OperationEntity struct { 576 // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. 577 Name *string `json:"name,omitempty"` 578 // Display - The API operation info. 579 Display *OperationDisplayInfo `json:"display,omitempty"` 580} 581 582// OperationEntityListResult the list of REST API operations. 583type OperationEntityListResult struct { 584 autorest.Response `json:"-"` 585 // Value - READ-ONLY; The list of operations. 586 Value *[]OperationEntity `json:"value,omitempty"` 587} 588 589// OutputPort asset output port 590type OutputPort struct { 591 // Type - Port data type. Possible values include: 'OutputPortTypeDataset' 592 Type OutputPortType `json:"type,omitempty"` 593} 594 595// PaginatedWebServicesList paginated list of web services. 596type PaginatedWebServicesList struct { 597 autorest.Response `json:"-"` 598 // Value - An array of web service objects. 599 Value *[]WebService `json:"value,omitempty"` 600 // NextLink - A continuation link (absolute URI) to the next page of results in the list. 601 NextLink *string `json:"nextLink,omitempty"` 602} 603 604// PaginatedWebServicesListIterator provides access to a complete listing of WebService values. 605type PaginatedWebServicesListIterator struct { 606 i int 607 page PaginatedWebServicesListPage 608} 609 610// NextWithContext advances to the next value. If there was an error making 611// the request the iterator does not advance and the error is returned. 612func (iter *PaginatedWebServicesListIterator) NextWithContext(ctx context.Context) (err error) { 613 if tracing.IsEnabled() { 614 ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedWebServicesListIterator.NextWithContext") 615 defer func() { 616 sc := -1 617 if iter.Response().Response.Response != nil { 618 sc = iter.Response().Response.Response.StatusCode 619 } 620 tracing.EndSpan(ctx, sc, err) 621 }() 622 } 623 iter.i++ 624 if iter.i < len(iter.page.Values()) { 625 return nil 626 } 627 err = iter.page.NextWithContext(ctx) 628 if err != nil { 629 iter.i-- 630 return err 631 } 632 iter.i = 0 633 return nil 634} 635 636// Next advances to the next value. If there was an error making 637// the request the iterator does not advance and the error is returned. 638// Deprecated: Use NextWithContext() instead. 639func (iter *PaginatedWebServicesListIterator) Next() error { 640 return iter.NextWithContext(context.Background()) 641} 642 643// NotDone returns true if the enumeration should be started or is not yet complete. 644func (iter PaginatedWebServicesListIterator) NotDone() bool { 645 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 646} 647 648// Response returns the raw server response from the last page request. 649func (iter PaginatedWebServicesListIterator) Response() PaginatedWebServicesList { 650 return iter.page.Response() 651} 652 653// Value returns the current value or a zero-initialized value if the 654// iterator has advanced beyond the end of the collection. 655func (iter PaginatedWebServicesListIterator) Value() WebService { 656 if !iter.page.NotDone() { 657 return WebService{} 658 } 659 return iter.page.Values()[iter.i] 660} 661 662// Creates a new instance of the PaginatedWebServicesListIterator type. 663func NewPaginatedWebServicesListIterator(page PaginatedWebServicesListPage) PaginatedWebServicesListIterator { 664 return PaginatedWebServicesListIterator{page: page} 665} 666 667// IsEmpty returns true if the ListResult contains no values. 668func (pwsl PaginatedWebServicesList) IsEmpty() bool { 669 return pwsl.Value == nil || len(*pwsl.Value) == 0 670} 671 672// paginatedWebServicesListPreparer prepares a request to retrieve the next set of results. 673// It returns nil if no more results exist. 674func (pwsl PaginatedWebServicesList) paginatedWebServicesListPreparer(ctx context.Context) (*http.Request, error) { 675 if pwsl.NextLink == nil || len(to.String(pwsl.NextLink)) < 1 { 676 return nil, nil 677 } 678 return autorest.Prepare((&http.Request{}).WithContext(ctx), 679 autorest.AsJSON(), 680 autorest.AsGet(), 681 autorest.WithBaseURL(to.String(pwsl.NextLink))) 682} 683 684// PaginatedWebServicesListPage contains a page of WebService values. 685type PaginatedWebServicesListPage struct { 686 fn func(context.Context, PaginatedWebServicesList) (PaginatedWebServicesList, error) 687 pwsl PaginatedWebServicesList 688} 689 690// NextWithContext advances to the next page of values. If there was an error making 691// the request the page does not advance and the error is returned. 692func (page *PaginatedWebServicesListPage) NextWithContext(ctx context.Context) (err error) { 693 if tracing.IsEnabled() { 694 ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedWebServicesListPage.NextWithContext") 695 defer func() { 696 sc := -1 697 if page.Response().Response.Response != nil { 698 sc = page.Response().Response.Response.StatusCode 699 } 700 tracing.EndSpan(ctx, sc, err) 701 }() 702 } 703 next, err := page.fn(ctx, page.pwsl) 704 if err != nil { 705 return err 706 } 707 page.pwsl = next 708 return nil 709} 710 711// Next advances to the next page of values. If there was an error making 712// the request the page does not advance and the error is returned. 713// Deprecated: Use NextWithContext() instead. 714func (page *PaginatedWebServicesListPage) Next() error { 715 return page.NextWithContext(context.Background()) 716} 717 718// NotDone returns true if the page enumeration should be started or is not yet complete. 719func (page PaginatedWebServicesListPage) NotDone() bool { 720 return !page.pwsl.IsEmpty() 721} 722 723// Response returns the raw server response from the last page request. 724func (page PaginatedWebServicesListPage) Response() PaginatedWebServicesList { 725 return page.pwsl 726} 727 728// Values returns the slice of values for the current page or nil if there are no values. 729func (page PaginatedWebServicesListPage) Values() []WebService { 730 if page.pwsl.IsEmpty() { 731 return nil 732 } 733 return *page.pwsl.Value 734} 735 736// Creates a new instance of the PaginatedWebServicesListPage type. 737func NewPaginatedWebServicesListPage(getNextPage func(context.Context, PaginatedWebServicesList) (PaginatedWebServicesList, error)) PaginatedWebServicesListPage { 738 return PaginatedWebServicesListPage{fn: getNextPage} 739} 740 741// Parameter web Service Parameter object for node and global parameter 742type Parameter struct { 743 // Value - The parameter value 744 Value interface{} `json:"value,omitempty"` 745 // CertificateThumbprint - If the parameter value in 'value' field is encrypted, the thumbprint of the certificate should be put here. 746 CertificateThumbprint *string `json:"certificateThumbprint,omitempty"` 747} 748 749// PatchedResource azure resource. 750type PatchedResource struct { 751 // ID - READ-ONLY; Specifies the resource ID. 752 ID *string `json:"id,omitempty"` 753 // Name - READ-ONLY; Specifies the name of the resource. 754 Name *string `json:"name,omitempty"` 755 // Location - READ-ONLY; Specifies the location of the resource. 756 Location *string `json:"location,omitempty"` 757 // Type - READ-ONLY; Specifies the type of the resource. 758 Type *string `json:"type,omitempty"` 759 // Tags - Contains resource tags defined as key/value pairs. 760 Tags map[string]*string `json:"tags"` 761} 762 763// MarshalJSON is the custom marshaler for PatchedResource. 764func (pr PatchedResource) MarshalJSON() ([]byte, error) { 765 objectMap := make(map[string]interface{}) 766 if pr.Tags != nil { 767 objectMap["tags"] = pr.Tags 768 } 769 return json.Marshal(objectMap) 770} 771 772// PatchedWebService instance of an Patched Azure ML web service resource. 773type PatchedWebService struct { 774 // Properties - Contains the property payload that describes the web service. 775 Properties BasicProperties `json:"properties,omitempty"` 776 // ID - READ-ONLY; Specifies the resource ID. 777 ID *string `json:"id,omitempty"` 778 // Name - READ-ONLY; Specifies the name of the resource. 779 Name *string `json:"name,omitempty"` 780 // Location - READ-ONLY; Specifies the location of the resource. 781 Location *string `json:"location,omitempty"` 782 // Type - READ-ONLY; Specifies the type of the resource. 783 Type *string `json:"type,omitempty"` 784 // Tags - Contains resource tags defined as key/value pairs. 785 Tags map[string]*string `json:"tags"` 786} 787 788// MarshalJSON is the custom marshaler for PatchedWebService. 789func (pws PatchedWebService) MarshalJSON() ([]byte, error) { 790 objectMap := make(map[string]interface{}) 791 objectMap["properties"] = pws.Properties 792 if pws.Tags != nil { 793 objectMap["tags"] = pws.Tags 794 } 795 return json.Marshal(objectMap) 796} 797 798// UnmarshalJSON is the custom unmarshaler for PatchedWebService struct. 799func (pws *PatchedWebService) UnmarshalJSON(body []byte) error { 800 var m map[string]*json.RawMessage 801 err := json.Unmarshal(body, &m) 802 if err != nil { 803 return err 804 } 805 for k, v := range m { 806 switch k { 807 case "properties": 808 if v != nil { 809 properties, err := unmarshalBasicProperties(*v) 810 if err != nil { 811 return err 812 } 813 pws.Properties = properties 814 } 815 case "id": 816 if v != nil { 817 var ID string 818 err = json.Unmarshal(*v, &ID) 819 if err != nil { 820 return err 821 } 822 pws.ID = &ID 823 } 824 case "name": 825 if v != nil { 826 var name string 827 err = json.Unmarshal(*v, &name) 828 if err != nil { 829 return err 830 } 831 pws.Name = &name 832 } 833 case "location": 834 if v != nil { 835 var location string 836 err = json.Unmarshal(*v, &location) 837 if err != nil { 838 return err 839 } 840 pws.Location = &location 841 } 842 case "type": 843 if v != nil { 844 var typeVar string 845 err = json.Unmarshal(*v, &typeVar) 846 if err != nil { 847 return err 848 } 849 pws.Type = &typeVar 850 } 851 case "tags": 852 if v != nil { 853 var tags map[string]*string 854 err = json.Unmarshal(*v, &tags) 855 if err != nil { 856 return err 857 } 858 pws.Tags = tags 859 } 860 } 861 } 862 863 return nil 864} 865 866// PatchFuture an abstraction for monitoring and retrieving the results of a long-running operation. 867type PatchFuture struct { 868 azure.Future 869} 870 871// Result returns the result of the asynchronous operation. 872// If the operation has not completed it will return an error. 873func (future *PatchFuture) Result(client Client) (ws WebService, err error) { 874 var done bool 875 done, err = future.DoneWithContext(context.Background(), client) 876 if err != nil { 877 err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", future.Response(), "Polling failure") 878 return 879 } 880 if !done { 881 err = azure.NewAsyncOpIncompleteError("webservices.PatchFuture") 882 return 883 } 884 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 885 if ws.Response.Response, err = future.GetResult(sender); err == nil && ws.Response.Response.StatusCode != http.StatusNoContent { 886 ws, err = client.PatchResponder(ws.Response.Response) 887 if err != nil { 888 err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", ws.Response.Response, "Failure responding to request") 889 } 890 } 891 return 892} 893 894// BasicProperties the set of properties specific to the Azure ML web service resource. 895type BasicProperties interface { 896 AsPropertiesForGraph() (*PropertiesForGraph, bool) 897 AsProperties() (*Properties, bool) 898} 899 900// Properties the set of properties specific to the Azure ML web service resource. 901type Properties struct { 902 // Title - The title of the web service. 903 Title *string `json:"title,omitempty"` 904 // Description - The description of the web service. 905 Description *string `json:"description,omitempty"` 906 // CreatedOn - READ-ONLY; Read Only: The date and time when the web service was created. 907 CreatedOn *date.Time `json:"createdOn,omitempty"` 908 // ModifiedOn - READ-ONLY; Read Only: The date and time when the web service was last modified. 909 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 910 // ProvisioningState - READ-ONLY; Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed' 911 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 912 // Keys - Contains the web service provisioning keys. If you do not specify provisioning keys, the Azure Machine Learning system generates them for you. Note: The keys are not returned from calls to GET operations. 913 Keys *Keys `json:"keys,omitempty"` 914 // ReadOnly - When set to true, indicates that the web service is read-only and can no longer be updated or patched, only removed. Default, is false. Note: Once set to true, you cannot change its value. 915 ReadOnly *bool `json:"readOnly,omitempty"` 916 // SwaggerLocation - READ-ONLY; Read Only: Contains the URI of the swagger spec associated with this web service. 917 SwaggerLocation *string `json:"swaggerLocation,omitempty"` 918 // ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true. 919 ExposeSampleData *bool `json:"exposeSampleData,omitempty"` 920 // RealtimeConfiguration - Contains the configuration settings for the web service endpoint. 921 RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"` 922 // Diagnostics - Settings controlling the diagnostics traces collection for the web service. 923 Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"` 924 // StorageAccount - Specifies the storage account that Azure Machine Learning uses to store information about the web service. Only the name of the storage account is returned from calls to GET operations. When updating the storage account information, you must ensure that all necessary assets are available in the new storage account or calls to your web service will fail. 925 StorageAccount *StorageAccount `json:"storageAccount,omitempty"` 926 // MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service. 927 MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"` 928 // CommitmentPlan - Contains the commitment plan associated with this web service. Set at creation time. Once set, this value cannot be changed. Note: The commitment plan is not returned from calls to GET operations. 929 CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"` 930 // Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification. 931 Input *ServiceInputOutputSpecification `json:"input,omitempty"` 932 // Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification. 933 Output *ServiceInputOutputSpecification `json:"output,omitempty"` 934 // ExampleRequest - Defines sample input data for one or more of the service's inputs. 935 ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"` 936 // Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs. 937 Assets map[string]*AssetItem `json:"assets"` 938 // Parameters - The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required. 939 Parameters map[string]*Parameter `json:"parameters"` 940 // PayloadsInBlobStorage - When set to true, indicates that the payload size is larger than 3 MB. Otherwise false. If the payload size exceed 3 MB, the payload is stored in a blob and the PayloadsLocation parameter contains the URI of the blob. Otherwise, this will be set to false and Assets, Input, Output, Package, Parameters, ExampleRequest are inline. The Payload sizes is determined by adding the size of the Assets, Input, Output, Package, Parameters, and the ExampleRequest. 941 PayloadsInBlobStorage *bool `json:"payloadsInBlobStorage,omitempty"` 942 // PayloadsLocation - The URI of the payload blob. This parameter contains a value only if the payloadsInBlobStorage parameter is set to true. Otherwise is set to null. 943 PayloadsLocation *BlobLocation `json:"payloadsLocation,omitempty"` 944 // PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph' 945 PackageType PackageType `json:"packageType,omitempty"` 946} 947 948func unmarshalBasicProperties(body []byte) (BasicProperties, error) { 949 var m map[string]interface{} 950 err := json.Unmarshal(body, &m) 951 if err != nil { 952 return nil, err 953 } 954 955 switch m["packageType"] { 956 case string(PackageTypeGraph): 957 var pfg PropertiesForGraph 958 err := json.Unmarshal(body, &pfg) 959 return pfg, err 960 default: 961 var p Properties 962 err := json.Unmarshal(body, &p) 963 return p, err 964 } 965} 966func unmarshalBasicPropertiesArray(body []byte) ([]BasicProperties, error) { 967 var rawMessages []*json.RawMessage 968 err := json.Unmarshal(body, &rawMessages) 969 if err != nil { 970 return nil, err 971 } 972 973 pArray := make([]BasicProperties, len(rawMessages)) 974 975 for index, rawMessage := range rawMessages { 976 p, err := unmarshalBasicProperties(*rawMessage) 977 if err != nil { 978 return nil, err 979 } 980 pArray[index] = p 981 } 982 return pArray, nil 983} 984 985// MarshalJSON is the custom marshaler for Properties. 986func (p Properties) MarshalJSON() ([]byte, error) { 987 p.PackageType = PackageTypeWebServiceProperties 988 objectMap := make(map[string]interface{}) 989 if p.Title != nil { 990 objectMap["title"] = p.Title 991 } 992 if p.Description != nil { 993 objectMap["description"] = p.Description 994 } 995 if p.Keys != nil { 996 objectMap["keys"] = p.Keys 997 } 998 if p.ReadOnly != nil { 999 objectMap["readOnly"] = p.ReadOnly 1000 } 1001 if p.ExposeSampleData != nil { 1002 objectMap["exposeSampleData"] = p.ExposeSampleData 1003 } 1004 if p.RealtimeConfiguration != nil { 1005 objectMap["realtimeConfiguration"] = p.RealtimeConfiguration 1006 } 1007 if p.Diagnostics != nil { 1008 objectMap["diagnostics"] = p.Diagnostics 1009 } 1010 if p.StorageAccount != nil { 1011 objectMap["storageAccount"] = p.StorageAccount 1012 } 1013 if p.MachineLearningWorkspace != nil { 1014 objectMap["machineLearningWorkspace"] = p.MachineLearningWorkspace 1015 } 1016 if p.CommitmentPlan != nil { 1017 objectMap["commitmentPlan"] = p.CommitmentPlan 1018 } 1019 if p.Input != nil { 1020 objectMap["input"] = p.Input 1021 } 1022 if p.Output != nil { 1023 objectMap["output"] = p.Output 1024 } 1025 if p.ExampleRequest != nil { 1026 objectMap["exampleRequest"] = p.ExampleRequest 1027 } 1028 if p.Assets != nil { 1029 objectMap["assets"] = p.Assets 1030 } 1031 if p.Parameters != nil { 1032 objectMap["parameters"] = p.Parameters 1033 } 1034 if p.PayloadsInBlobStorage != nil { 1035 objectMap["payloadsInBlobStorage"] = p.PayloadsInBlobStorage 1036 } 1037 if p.PayloadsLocation != nil { 1038 objectMap["payloadsLocation"] = p.PayloadsLocation 1039 } 1040 if p.PackageType != "" { 1041 objectMap["packageType"] = p.PackageType 1042 } 1043 return json.Marshal(objectMap) 1044} 1045 1046// AsPropertiesForGraph is the BasicProperties implementation for Properties. 1047func (p Properties) AsPropertiesForGraph() (*PropertiesForGraph, bool) { 1048 return nil, false 1049} 1050 1051// AsProperties is the BasicProperties implementation for Properties. 1052func (p Properties) AsProperties() (*Properties, bool) { 1053 return &p, true 1054} 1055 1056// AsBasicProperties is the BasicProperties implementation for Properties. 1057func (p Properties) AsBasicProperties() (BasicProperties, bool) { 1058 return &p, true 1059} 1060 1061// PropertiesForGraph properties specific to a Graph based web service. 1062type PropertiesForGraph struct { 1063 // Package - The definition of the graph package making up this web service. 1064 Package *GraphPackage `json:"package,omitempty"` 1065 // Title - The title of the web service. 1066 Title *string `json:"title,omitempty"` 1067 // Description - The description of the web service. 1068 Description *string `json:"description,omitempty"` 1069 // CreatedOn - READ-ONLY; Read Only: The date and time when the web service was created. 1070 CreatedOn *date.Time `json:"createdOn,omitempty"` 1071 // ModifiedOn - READ-ONLY; Read Only: The date and time when the web service was last modified. 1072 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 1073 // ProvisioningState - READ-ONLY; Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed' 1074 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1075 // Keys - Contains the web service provisioning keys. If you do not specify provisioning keys, the Azure Machine Learning system generates them for you. Note: The keys are not returned from calls to GET operations. 1076 Keys *Keys `json:"keys,omitempty"` 1077 // ReadOnly - When set to true, indicates that the web service is read-only and can no longer be updated or patched, only removed. Default, is false. Note: Once set to true, you cannot change its value. 1078 ReadOnly *bool `json:"readOnly,omitempty"` 1079 // SwaggerLocation - READ-ONLY; Read Only: Contains the URI of the swagger spec associated with this web service. 1080 SwaggerLocation *string `json:"swaggerLocation,omitempty"` 1081 // ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true. 1082 ExposeSampleData *bool `json:"exposeSampleData,omitempty"` 1083 // RealtimeConfiguration - Contains the configuration settings for the web service endpoint. 1084 RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"` 1085 // Diagnostics - Settings controlling the diagnostics traces collection for the web service. 1086 Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"` 1087 // StorageAccount - Specifies the storage account that Azure Machine Learning uses to store information about the web service. Only the name of the storage account is returned from calls to GET operations. When updating the storage account information, you must ensure that all necessary assets are available in the new storage account or calls to your web service will fail. 1088 StorageAccount *StorageAccount `json:"storageAccount,omitempty"` 1089 // MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service. 1090 MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"` 1091 // CommitmentPlan - Contains the commitment plan associated with this web service. Set at creation time. Once set, this value cannot be changed. Note: The commitment plan is not returned from calls to GET operations. 1092 CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"` 1093 // Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification. 1094 Input *ServiceInputOutputSpecification `json:"input,omitempty"` 1095 // Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification. 1096 Output *ServiceInputOutputSpecification `json:"output,omitempty"` 1097 // ExampleRequest - Defines sample input data for one or more of the service's inputs. 1098 ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"` 1099 // Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs. 1100 Assets map[string]*AssetItem `json:"assets"` 1101 // Parameters - The set of global parameters values defined for the web service, given as a global parameter name to default value map. If no default value is specified, the parameter is considered to be required. 1102 Parameters map[string]*Parameter `json:"parameters"` 1103 // PayloadsInBlobStorage - When set to true, indicates that the payload size is larger than 3 MB. Otherwise false. If the payload size exceed 3 MB, the payload is stored in a blob and the PayloadsLocation parameter contains the URI of the blob. Otherwise, this will be set to false and Assets, Input, Output, Package, Parameters, ExampleRequest are inline. The Payload sizes is determined by adding the size of the Assets, Input, Output, Package, Parameters, and the ExampleRequest. 1104 PayloadsInBlobStorage *bool `json:"payloadsInBlobStorage,omitempty"` 1105 // PayloadsLocation - The URI of the payload blob. This parameter contains a value only if the payloadsInBlobStorage parameter is set to true. Otherwise is set to null. 1106 PayloadsLocation *BlobLocation `json:"payloadsLocation,omitempty"` 1107 // PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph' 1108 PackageType PackageType `json:"packageType,omitempty"` 1109} 1110 1111// MarshalJSON is the custom marshaler for PropertiesForGraph. 1112func (pfg PropertiesForGraph) MarshalJSON() ([]byte, error) { 1113 pfg.PackageType = PackageTypeGraph 1114 objectMap := make(map[string]interface{}) 1115 if pfg.Package != nil { 1116 objectMap["package"] = pfg.Package 1117 } 1118 if pfg.Title != nil { 1119 objectMap["title"] = pfg.Title 1120 } 1121 if pfg.Description != nil { 1122 objectMap["description"] = pfg.Description 1123 } 1124 if pfg.Keys != nil { 1125 objectMap["keys"] = pfg.Keys 1126 } 1127 if pfg.ReadOnly != nil { 1128 objectMap["readOnly"] = pfg.ReadOnly 1129 } 1130 if pfg.ExposeSampleData != nil { 1131 objectMap["exposeSampleData"] = pfg.ExposeSampleData 1132 } 1133 if pfg.RealtimeConfiguration != nil { 1134 objectMap["realtimeConfiguration"] = pfg.RealtimeConfiguration 1135 } 1136 if pfg.Diagnostics != nil { 1137 objectMap["diagnostics"] = pfg.Diagnostics 1138 } 1139 if pfg.StorageAccount != nil { 1140 objectMap["storageAccount"] = pfg.StorageAccount 1141 } 1142 if pfg.MachineLearningWorkspace != nil { 1143 objectMap["machineLearningWorkspace"] = pfg.MachineLearningWorkspace 1144 } 1145 if pfg.CommitmentPlan != nil { 1146 objectMap["commitmentPlan"] = pfg.CommitmentPlan 1147 } 1148 if pfg.Input != nil { 1149 objectMap["input"] = pfg.Input 1150 } 1151 if pfg.Output != nil { 1152 objectMap["output"] = pfg.Output 1153 } 1154 if pfg.ExampleRequest != nil { 1155 objectMap["exampleRequest"] = pfg.ExampleRequest 1156 } 1157 if pfg.Assets != nil { 1158 objectMap["assets"] = pfg.Assets 1159 } 1160 if pfg.Parameters != nil { 1161 objectMap["parameters"] = pfg.Parameters 1162 } 1163 if pfg.PayloadsInBlobStorage != nil { 1164 objectMap["payloadsInBlobStorage"] = pfg.PayloadsInBlobStorage 1165 } 1166 if pfg.PayloadsLocation != nil { 1167 objectMap["payloadsLocation"] = pfg.PayloadsLocation 1168 } 1169 if pfg.PackageType != "" { 1170 objectMap["packageType"] = pfg.PackageType 1171 } 1172 return json.Marshal(objectMap) 1173} 1174 1175// AsPropertiesForGraph is the BasicProperties implementation for PropertiesForGraph. 1176func (pfg PropertiesForGraph) AsPropertiesForGraph() (*PropertiesForGraph, bool) { 1177 return &pfg, true 1178} 1179 1180// AsProperties is the BasicProperties implementation for PropertiesForGraph. 1181func (pfg PropertiesForGraph) AsProperties() (*Properties, bool) { 1182 return nil, false 1183} 1184 1185// AsBasicProperties is the BasicProperties implementation for PropertiesForGraph. 1186func (pfg PropertiesForGraph) AsBasicProperties() (BasicProperties, bool) { 1187 return &pfg, true 1188} 1189 1190// RealtimeConfiguration holds the available configuration options for an Azure ML web service endpoint. 1191type RealtimeConfiguration struct { 1192 // MaxConcurrentCalls - Specifies the maximum concurrent calls that can be made to the web service. Minimum value: 4, Maximum value: 200. 1193 MaxConcurrentCalls *int32 `json:"maxConcurrentCalls,omitempty"` 1194} 1195 1196// RemoveFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1197type RemoveFuture struct { 1198 azure.Future 1199} 1200 1201// Result returns the result of the asynchronous operation. 1202// If the operation has not completed it will return an error. 1203func (future *RemoveFuture) Result(client Client) (ar autorest.Response, err error) { 1204 var done bool 1205 done, err = future.DoneWithContext(context.Background(), client) 1206 if err != nil { 1207 err = autorest.NewErrorWithError(err, "webservices.RemoveFuture", "Result", future.Response(), "Polling failure") 1208 return 1209 } 1210 if !done { 1211 err = azure.NewAsyncOpIncompleteError("webservices.RemoveFuture") 1212 return 1213 } 1214 ar.Response = future.Response() 1215 return 1216} 1217 1218// Resource azure resource. 1219type Resource struct { 1220 // ID - READ-ONLY; Specifies the resource ID. 1221 ID *string `json:"id,omitempty"` 1222 // Name - READ-ONLY; Specifies the name of the resource. 1223 Name *string `json:"name,omitempty"` 1224 // Location - Specifies the location of the resource. 1225 Location *string `json:"location,omitempty"` 1226 // Type - READ-ONLY; Specifies the type of the resource. 1227 Type *string `json:"type,omitempty"` 1228 // Tags - Contains resource tags defined as key/value pairs. 1229 Tags map[string]*string `json:"tags"` 1230} 1231 1232// MarshalJSON is the custom marshaler for Resource. 1233func (r Resource) MarshalJSON() ([]byte, error) { 1234 objectMap := make(map[string]interface{}) 1235 if r.Location != nil { 1236 objectMap["location"] = r.Location 1237 } 1238 if r.Tags != nil { 1239 objectMap["tags"] = r.Tags 1240 } 1241 return json.Marshal(objectMap) 1242} 1243 1244// ServiceInputOutputSpecification the swagger 2.0 schema describing the service's inputs or outputs. See 1245// Swagger specification: http://swagger.io/specification/ 1246type ServiceInputOutputSpecification struct { 1247 // Title - The title of your Swagger schema. 1248 Title *string `json:"title,omitempty"` 1249 // Description - The description of the Swagger schema. 1250 Description *string `json:"description,omitempty"` 1251 // Type - The type of the entity described in swagger. Always 'object'. 1252 Type *string `json:"type,omitempty"` 1253 // Properties - Specifies a collection that contains the column schema for each input or output of the web service. For more information, see the Swagger specification. 1254 Properties map[string]*TableSpecification `json:"properties"` 1255} 1256 1257// MarshalJSON is the custom marshaler for ServiceInputOutputSpecification. 1258func (sios ServiceInputOutputSpecification) MarshalJSON() ([]byte, error) { 1259 objectMap := make(map[string]interface{}) 1260 if sios.Title != nil { 1261 objectMap["title"] = sios.Title 1262 } 1263 if sios.Description != nil { 1264 objectMap["description"] = sios.Description 1265 } 1266 if sios.Type != nil { 1267 objectMap["type"] = sios.Type 1268 } 1269 if sios.Properties != nil { 1270 objectMap["properties"] = sios.Properties 1271 } 1272 return json.Marshal(objectMap) 1273} 1274 1275// StorageAccount access information for a storage account. 1276type StorageAccount struct { 1277 // Name - Specifies the name of the storage account. 1278 Name *string `json:"name,omitempty"` 1279 // Key - Specifies the key used to access the storage account. 1280 Key *string `json:"key,omitempty"` 1281} 1282 1283// TableSpecification the swagger 2.0 schema describing a single service input or output. See Swagger 1284// specification: http://swagger.io/specification/ 1285type TableSpecification struct { 1286 // Title - Swagger schema title. 1287 Title *string `json:"title,omitempty"` 1288 // Description - Swagger schema description. 1289 Description *string `json:"description,omitempty"` 1290 // Type - The type of the entity described in swagger. 1291 Type *string `json:"type,omitempty"` 1292 // Format - The format, if 'type' is not 'object' 1293 Format *string `json:"format,omitempty"` 1294 // Properties - The set of columns within the data table. 1295 Properties map[string]*ColumnSpecification `json:"properties"` 1296} 1297 1298// MarshalJSON is the custom marshaler for TableSpecification. 1299func (ts TableSpecification) MarshalJSON() ([]byte, error) { 1300 objectMap := make(map[string]interface{}) 1301 if ts.Title != nil { 1302 objectMap["title"] = ts.Title 1303 } 1304 if ts.Description != nil { 1305 objectMap["description"] = ts.Description 1306 } 1307 if ts.Type != nil { 1308 objectMap["type"] = ts.Type 1309 } 1310 if ts.Format != nil { 1311 objectMap["format"] = ts.Format 1312 } 1313 if ts.Properties != nil { 1314 objectMap["properties"] = ts.Properties 1315 } 1316 return json.Marshal(objectMap) 1317} 1318 1319// WebService instance of an Azure ML web service resource. 1320type WebService struct { 1321 autorest.Response `json:"-"` 1322 // Properties - Contains the property payload that describes the web service. 1323 Properties BasicProperties `json:"properties,omitempty"` 1324 // ID - READ-ONLY; Specifies the resource ID. 1325 ID *string `json:"id,omitempty"` 1326 // Name - READ-ONLY; Specifies the name of the resource. 1327 Name *string `json:"name,omitempty"` 1328 // Location - Specifies the location of the resource. 1329 Location *string `json:"location,omitempty"` 1330 // Type - READ-ONLY; Specifies the type of the resource. 1331 Type *string `json:"type,omitempty"` 1332 // Tags - Contains resource tags defined as key/value pairs. 1333 Tags map[string]*string `json:"tags"` 1334} 1335 1336// MarshalJSON is the custom marshaler for WebService. 1337func (ws WebService) MarshalJSON() ([]byte, error) { 1338 objectMap := make(map[string]interface{}) 1339 objectMap["properties"] = ws.Properties 1340 if ws.Location != nil { 1341 objectMap["location"] = ws.Location 1342 } 1343 if ws.Tags != nil { 1344 objectMap["tags"] = ws.Tags 1345 } 1346 return json.Marshal(objectMap) 1347} 1348 1349// UnmarshalJSON is the custom unmarshaler for WebService struct. 1350func (ws *WebService) UnmarshalJSON(body []byte) error { 1351 var m map[string]*json.RawMessage 1352 err := json.Unmarshal(body, &m) 1353 if err != nil { 1354 return err 1355 } 1356 for k, v := range m { 1357 switch k { 1358 case "properties": 1359 if v != nil { 1360 properties, err := unmarshalBasicProperties(*v) 1361 if err != nil { 1362 return err 1363 } 1364 ws.Properties = properties 1365 } 1366 case "id": 1367 if v != nil { 1368 var ID string 1369 err = json.Unmarshal(*v, &ID) 1370 if err != nil { 1371 return err 1372 } 1373 ws.ID = &ID 1374 } 1375 case "name": 1376 if v != nil { 1377 var name string 1378 err = json.Unmarshal(*v, &name) 1379 if err != nil { 1380 return err 1381 } 1382 ws.Name = &name 1383 } 1384 case "location": 1385 if v != nil { 1386 var location string 1387 err = json.Unmarshal(*v, &location) 1388 if err != nil { 1389 return err 1390 } 1391 ws.Location = &location 1392 } 1393 case "type": 1394 if v != nil { 1395 var typeVar string 1396 err = json.Unmarshal(*v, &typeVar) 1397 if err != nil { 1398 return err 1399 } 1400 ws.Type = &typeVar 1401 } 1402 case "tags": 1403 if v != nil { 1404 var tags map[string]*string 1405 err = json.Unmarshal(*v, &tags) 1406 if err != nil { 1407 return err 1408 } 1409 ws.Tags = tags 1410 } 1411 } 1412 } 1413 1414 return nil 1415} 1416