forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
1376 lines (1271 loc) · 52.3 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package webservices
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"net/http"
)
// AssetType enumerates the values for asset type.
type AssetType string
const (
// AssetTypeModule ...
AssetTypeModule AssetType = "Module"
// AssetTypeResource ...
AssetTypeResource AssetType = "Resource"
)
// PossibleAssetTypeValues returns an array of possible values for the AssetType const type.
func PossibleAssetTypeValues() []AssetType {
return []AssetType{AssetTypeModule, AssetTypeResource}
}
// ColumnFormat enumerates the values for column format.
type ColumnFormat string
const (
// Byte ...
Byte ColumnFormat = "Byte"
// Char ...
Char ColumnFormat = "Char"
// Complex128 ...
Complex128 ColumnFormat = "Complex128"
// Complex64 ...
Complex64 ColumnFormat = "Complex64"
// DateTime ...
DateTime ColumnFormat = "Date-time"
// DateTimeOffset ...
DateTimeOffset ColumnFormat = "Date-timeOffset"
// Double ...
Double ColumnFormat = "Double"
// Duration ...
Duration ColumnFormat = "Duration"
// Float ...
Float ColumnFormat = "Float"
// Int16 ...
Int16 ColumnFormat = "Int16"
// Int32 ...
Int32 ColumnFormat = "Int32"
// Int64 ...
Int64 ColumnFormat = "Int64"
// Int8 ...
Int8 ColumnFormat = "Int8"
// Uint16 ...
Uint16 ColumnFormat = "Uint16"
// Uint32 ...
Uint32 ColumnFormat = "Uint32"
// Uint64 ...
Uint64 ColumnFormat = "Uint64"
// Uint8 ...
Uint8 ColumnFormat = "Uint8"
)
// PossibleColumnFormatValues returns an array of possible values for the ColumnFormat const type.
func PossibleColumnFormatValues() []ColumnFormat {
return []ColumnFormat{Byte, Char, Complex128, Complex64, DateTime, DateTimeOffset, Double, Duration, Float, Int16, Int32, Int64, Int8, Uint16, Uint32, Uint64, Uint8}
}
// ColumnType enumerates the values for column type.
type ColumnType string
const (
// Boolean ...
Boolean ColumnType = "Boolean"
// Integer ...
Integer ColumnType = "Integer"
// Number ...
Number ColumnType = "Number"
// String ...
String ColumnType = "String"
)
// PossibleColumnTypeValues returns an array of possible values for the ColumnType const type.
func PossibleColumnTypeValues() []ColumnType {
return []ColumnType{Boolean, Integer, Number, String}
}
// DiagnosticsLevel enumerates the values for diagnostics level.
type DiagnosticsLevel string
const (
// All ...
All DiagnosticsLevel = "All"
// Error ...
Error DiagnosticsLevel = "Error"
// None ...
None DiagnosticsLevel = "None"
)
// PossibleDiagnosticsLevelValues returns an array of possible values for the DiagnosticsLevel const type.
func PossibleDiagnosticsLevelValues() []DiagnosticsLevel {
return []DiagnosticsLevel{All, Error, None}
}
// InputPortType enumerates the values for input port type.
type InputPortType string
const (
// Dataset ...
Dataset InputPortType = "Dataset"
)
// PossibleInputPortTypeValues returns an array of possible values for the InputPortType const type.
func PossibleInputPortTypeValues() []InputPortType {
return []InputPortType{Dataset}
}
// OutputPortType enumerates the values for output port type.
type OutputPortType string
const (
// OutputPortTypeDataset ...
OutputPortTypeDataset OutputPortType = "Dataset"
)
// PossibleOutputPortTypeValues returns an array of possible values for the OutputPortType const type.
func PossibleOutputPortTypeValues() []OutputPortType {
return []OutputPortType{OutputPortTypeDataset}
}
// PackageType enumerates the values for package type.
type PackageType string
const (
// PackageTypeGraph ...
PackageTypeGraph PackageType = "Graph"
// PackageTypeWebServiceProperties ...
PackageTypeWebServiceProperties PackageType = "WebServiceProperties"
)
// PossiblePackageTypeValues returns an array of possible values for the PackageType const type.
func PossiblePackageTypeValues() []PackageType {
return []PackageType{PackageTypeGraph, PackageTypeWebServiceProperties}
}
// ParameterType enumerates the values for parameter type.
type ParameterType string
const (
// ParameterTypeBoolean ...
ParameterTypeBoolean ParameterType = "Boolean"
// ParameterTypeColumnPicker ...
ParameterTypeColumnPicker ParameterType = "ColumnPicker"
// ParameterTypeCredential ...
ParameterTypeCredential ParameterType = "Credential"
// ParameterTypeDataGatewayName ...
ParameterTypeDataGatewayName ParameterType = "DataGatewayName"
// ParameterTypeDouble ...
ParameterTypeDouble ParameterType = "Double"
// ParameterTypeEnumerated ...
ParameterTypeEnumerated ParameterType = "Enumerated"
// ParameterTypeFloat ...
ParameterTypeFloat ParameterType = "Float"
// ParameterTypeInt ...
ParameterTypeInt ParameterType = "Int"
// ParameterTypeMode ...
ParameterTypeMode ParameterType = "Mode"
// ParameterTypeParameterRange ...
ParameterTypeParameterRange ParameterType = "ParameterRange"
// ParameterTypeScript ...
ParameterTypeScript ParameterType = "Script"
// ParameterTypeString ...
ParameterTypeString ParameterType = "String"
)
// PossibleParameterTypeValues returns an array of possible values for the ParameterType const type.
func PossibleParameterTypeValues() []ParameterType {
return []ParameterType{ParameterTypeBoolean, ParameterTypeColumnPicker, ParameterTypeCredential, ParameterTypeDataGatewayName, ParameterTypeDouble, ParameterTypeEnumerated, ParameterTypeFloat, ParameterTypeInt, ParameterTypeMode, ParameterTypeParameterRange, ParameterTypeScript, ParameterTypeString}
}
// ProvisioningState enumerates the values for provisioning state.
type ProvisioningState string
const (
// Failed ...
Failed ProvisioningState = "Failed"
// Provisioning ...
Provisioning ProvisioningState = "Provisioning"
// Succeeded ...
Succeeded ProvisioningState = "Succeeded"
// Unknown ...
Unknown ProvisioningState = "Unknown"
)
// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type.
func PossibleProvisioningStateValues() []ProvisioningState {
return []ProvisioningState{Failed, Provisioning, Succeeded, Unknown}
}
// AssetItem information about an asset associated with the web service.
type AssetItem struct {
// Name - Asset's friendly name.
Name *string `json:"name,omitempty"`
// ID - Asset's Id.
ID *string `json:"id,omitempty"`
// Type - Asset's type. Possible values include: 'AssetTypeModule', 'AssetTypeResource'
Type AssetType `json:"type,omitempty"`
// LocationInfo - Access information for the asset.
LocationInfo *BlobLocation `json:"locationInfo,omitempty"`
// InputPorts - Information about the asset's input ports.
InputPorts map[string]*InputPort `json:"inputPorts"`
// OutputPorts - Information about the asset's output ports.
OutputPorts map[string]*OutputPort `json:"outputPorts"`
// Metadata - If the asset is a custom module, this holds the module's metadata.
Metadata map[string]*string `json:"metadata"`
// Parameters - If the asset is a custom module, this holds the module's parameters.
Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
}
// MarshalJSON is the custom marshaler for AssetItem.
func (ai AssetItem) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ai.Name != nil {
objectMap["name"] = ai.Name
}
if ai.ID != nil {
objectMap["id"] = ai.ID
}
if ai.Type != "" {
objectMap["type"] = ai.Type
}
if ai.LocationInfo != nil {
objectMap["locationInfo"] = ai.LocationInfo
}
if ai.InputPorts != nil {
objectMap["inputPorts"] = ai.InputPorts
}
if ai.OutputPorts != nil {
objectMap["outputPorts"] = ai.OutputPorts
}
if ai.Metadata != nil {
objectMap["metadata"] = ai.Metadata
}
if ai.Parameters != nil {
objectMap["parameters"] = ai.Parameters
}
return json.Marshal(objectMap)
}
// AsyncOperationErrorInfo the error detail information for async operation
type AsyncOperationErrorInfo struct {
// Code - The error code.
Code *string `json:"code,omitempty"`
// Target - The error target.
Target *string `json:"target,omitempty"`
// Message - The error message.
Message *string `json:"message,omitempty"`
// Details - An array containing error information.
Details *[]AsyncOperationErrorInfo `json:"details,omitempty"`
}
// AsyncOperationStatus azure async operation status.
type AsyncOperationStatus struct {
autorest.Response `json:"-"`
// ID - Async operation id.
ID *string `json:"id,omitempty"`
// Name - Async operation name.
Name *string `json:"name,omitempty"`
// ProvisioningState - Read Only: The provisioning state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// StartTime - The date time that the async operation started.
StartTime *date.Time `json:"startTime,omitempty"`
// EndTime - The date time that the async operation finished.
EndTime *date.Time `json:"endTime,omitempty"`
// PercentComplete - Async operation progress.
PercentComplete *float64 `json:"percentComplete,omitempty"`
// ErrorInfo - If the async operation fails, this structure contains the error details.
ErrorInfo *AsyncOperationErrorInfo `json:"errorInfo,omitempty"`
}
// BlobLocation describes the access location for a blob.
type BlobLocation struct {
// 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.
URI *string `json:"uri,omitempty"`
// Credentials - Access credentials for the blob, if applicable (e.g. blob specified by storage account connection string + blob URI)
Credentials *string `json:"credentials,omitempty"`
}
// ColumnSpecification swagger 2.0 schema for a column within the data table representing a web service input or
// output. See Swagger specification: http://swagger.io/specification/
type ColumnSpecification struct {
// Type - Data type of the column. Possible values include: 'Boolean', 'Integer', 'Number', 'String'
Type ColumnType `json:"type,omitempty"`
// 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'
Format ColumnFormat `json:"format,omitempty"`
// Enum - If the data type is categorical, this provides the list of accepted categories.
Enum *[]interface{} `json:"enum,omitempty"`
// XMsIsnullable - Flag indicating if the type supports null values or not.
XMsIsnullable *bool `json:"x-ms-isnullable,omitempty"`
// XMsIsordered - Flag indicating whether the categories are treated as an ordered set or not, if this is a categorical column.
XMsIsordered *bool `json:"x-ms-isordered,omitempty"`
}
// CommitmentPlan information about the machine learning commitment plan associated with the web service.
type CommitmentPlan struct {
// ID - Specifies the Azure Resource Manager ID of the commitment plan associated with the web service.
ID *string `json:"id,omitempty"`
}
// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type CreateOrUpdateFuture struct {
azure.Future
req *http.Request
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future CreateOrUpdateFuture) Result(client Client) (ws WebService, err error) {
var done bool
done, err = future.Done(client)
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
return ws, azure.NewAsyncOpIncompleteError("webservices.CreateOrUpdateFuture")
}
if future.PollingMethod() == azure.PollingLocation {
ws, err = client.CreateOrUpdateResponder(future.Response())
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request")
}
return
}
var req *http.Request
var resp *http.Response
if future.PollingURL() != "" {
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
if err != nil {
return
}
} else {
req = autorest.ChangeToGet(future.req)
}
resp, err = autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", resp, "Failure sending request")
return
}
ws, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", resp, "Failure responding to request")
}
return
}
// CreateRegionalPropertiesFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type CreateRegionalPropertiesFuture struct {
azure.Future
req *http.Request
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future CreateRegionalPropertiesFuture) Result(client Client) (aos AsyncOperationStatus, err error) {
var done bool
done, err = future.Done(client)
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateRegionalPropertiesFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
return aos, azure.NewAsyncOpIncompleteError("webservices.CreateRegionalPropertiesFuture")
}
if future.PollingMethod() == azure.PollingLocation {
aos, err = client.CreateRegionalPropertiesResponder(future.Response())
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateRegionalPropertiesFuture", "Result", future.Response(), "Failure responding to request")
}
return
}
var req *http.Request
var resp *http.Response
if future.PollingURL() != "" {
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
if err != nil {
return
}
} else {
req = autorest.ChangeToGet(future.req)
}
resp, err = autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateRegionalPropertiesFuture", "Result", resp, "Failure sending request")
return
}
aos, err = client.CreateRegionalPropertiesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.CreateRegionalPropertiesFuture", "Result", resp, "Failure responding to request")
}
return
}
// DiagnosticsConfiguration diagnostics settings for an Azure ML web service.
type DiagnosticsConfiguration struct {
// 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'
Level DiagnosticsLevel `json:"level,omitempty"`
// Expiry - Specifies the date and time when the logging will cease. If null, diagnostic collection is not time limited.
Expiry *date.Time `json:"expiry,omitempty"`
}
// ExampleRequest sample input data for the service's input(s).
type ExampleRequest struct {
// Inputs - Sample input data for the web service's input(s) given as an input name to sample input values matrix map.
Inputs map[string][][]interface{} `json:"inputs"`
// GlobalParameters - Sample input data for the web service's global parameters
GlobalParameters map[string]interface{} `json:"globalParameters"`
}
// MarshalJSON is the custom marshaler for ExampleRequest.
func (er ExampleRequest) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if er.Inputs != nil {
objectMap["inputs"] = er.Inputs
}
if er.GlobalParameters != nil {
objectMap["globalParameters"] = er.GlobalParameters
}
return json.Marshal(objectMap)
}
// GraphEdge defines an edge within the web service's graph.
type GraphEdge struct {
// SourceNodeID - The source graph node's identifier.
SourceNodeID *string `json:"sourceNodeId,omitempty"`
// SourcePortID - The identifier of the source node's port that the edge connects from.
SourcePortID *string `json:"sourcePortId,omitempty"`
// TargetNodeID - The destination graph node's identifier.
TargetNodeID *string `json:"targetNodeId,omitempty"`
// TargetPortID - The identifier of the destination node's port that the edge connects into.
TargetPortID *string `json:"targetPortId,omitempty"`
}
// GraphNode specifies a node in the web service graph. The node can either be an input, output or asset node, so
// only one of the corresponding id properties is populated at any given time.
type GraphNode struct {
// AssetID - The id of the asset represented by this node.
AssetID *string `json:"assetId,omitempty"`
// InputID - The id of the input element represented by this node.
InputID *string `json:"inputId,omitempty"`
// OutputID - The id of the output element represented by this node.
OutputID *string `json:"outputId,omitempty"`
// Parameters - If applicable, parameters of the node. Global graph parameters map into these, with values set at runtime.
Parameters map[string]*Parameter `json:"parameters"`
}
// MarshalJSON is the custom marshaler for GraphNode.
func (gn GraphNode) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if gn.AssetID != nil {
objectMap["assetId"] = gn.AssetID
}
if gn.InputID != nil {
objectMap["inputId"] = gn.InputID
}
if gn.OutputID != nil {
objectMap["outputId"] = gn.OutputID
}
if gn.Parameters != nil {
objectMap["parameters"] = gn.Parameters
}
return json.Marshal(objectMap)
}
// GraphPackage defines the graph of modules making up the machine learning solution.
type GraphPackage struct {
// Nodes - The set of nodes making up the graph, provided as a nodeId to GraphNode map
Nodes map[string]*GraphNode `json:"nodes"`
// Edges - The list of edges making up the graph.
Edges *[]GraphEdge `json:"edges,omitempty"`
// 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.
GraphParameters map[string]*GraphParameter `json:"graphParameters"`
}
// MarshalJSON is the custom marshaler for GraphPackage.
func (gp GraphPackage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if gp.Nodes != nil {
objectMap["nodes"] = gp.Nodes
}
if gp.Edges != nil {
objectMap["edges"] = gp.Edges
}
if gp.GraphParameters != nil {
objectMap["graphParameters"] = gp.GraphParameters
}
return json.Marshal(objectMap)
}
// GraphParameter defines a global parameter in the graph.
type GraphParameter struct {
// Description - Description of this graph parameter.
Description *string `json:"description,omitempty"`
// Type - Graph parameter's type. Possible values include: 'ParameterTypeString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeEnumerated', 'ParameterTypeScript', 'ParameterTypeMode', 'ParameterTypeCredential', 'ParameterTypeBoolean', 'ParameterTypeDouble', 'ParameterTypeColumnPicker', 'ParameterTypeParameterRange', 'ParameterTypeDataGatewayName'
Type ParameterType `json:"type,omitempty"`
// Links - Association links for this parameter to nodes in the graph.
Links *[]GraphParameterLink `json:"links,omitempty"`
}
// GraphParameterLink association link for a graph global parameter to a node in the graph.
type GraphParameterLink struct {
// NodeID - The graph node's identifier
NodeID *string `json:"nodeId,omitempty"`
// ParameterKey - The identifier of the node parameter that the global parameter maps to.
ParameterKey *string `json:"parameterKey,omitempty"`
}
// InputPort asset input port
type InputPort struct {
// Type - Port data type. Possible values include: 'Dataset'
Type InputPortType `json:"type,omitempty"`
}
// Keys access keys for the web service calls.
type Keys struct {
autorest.Response `json:"-"`
// Primary - The primary access key.
Primary *string `json:"primary,omitempty"`
// Secondary - The secondary access key.
Secondary *string `json:"secondary,omitempty"`
}
// MachineLearningWorkspace information about the machine learning workspace containing the experiment that is
// source for the web service.
type MachineLearningWorkspace struct {
// ID - Specifies the workspace ID of the machine learning workspace associated with the web service
ID *string `json:"id,omitempty"`
}
// ModeValueInfo nested parameter definition.
type ModeValueInfo struct {
// InterfaceString - The interface string name for the nested parameter.
InterfaceString *string `json:"interfaceString,omitempty"`
// Parameters - The definition of the parameter.
Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
}
// ModuleAssetParameter parameter definition for a module asset.
type ModuleAssetParameter struct {
// Name - Parameter name.
Name *string `json:"name,omitempty"`
// ParameterType - Parameter type.
ParameterType *string `json:"parameterType,omitempty"`
// ModeValuesInfo - Definitions for nested interface parameters if this is a complex module parameter.
ModeValuesInfo map[string]*ModeValueInfo `json:"modeValuesInfo"`
}
// MarshalJSON is the custom marshaler for ModuleAssetParameter.
func (mapVar ModuleAssetParameter) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if mapVar.Name != nil {
objectMap["name"] = mapVar.Name
}
if mapVar.ParameterType != nil {
objectMap["parameterType"] = mapVar.ParameterType
}
if mapVar.ModeValuesInfo != nil {
objectMap["modeValuesInfo"] = mapVar.ModeValuesInfo
}
return json.Marshal(objectMap)
}
// OperationDisplayInfo the API operation info.
type OperationDisplayInfo struct {
// Description - The description of the operation.
Description *string `json:"description,omitempty"`
// Operation - The action that users can perform, based on their permission level.
Operation *string `json:"operation,omitempty"`
// Provider - The service provider.
Provider *string `json:"provider,omitempty"`
// Resource - The resource on which the operation is performed.
Resource *string `json:"resource,omitempty"`
}
// OperationEntity an API operation.
type OperationEntity struct {
// Name - Operation name: {provider}/{resource}/{operation}.
Name *string `json:"name,omitempty"`
// Display - The API operation info.
Display *OperationDisplayInfo `json:"display,omitempty"`
}
// OperationEntityListResult the list of REST API operations.
type OperationEntityListResult struct {
autorest.Response `json:"-"`
// Value - The list of operations.
Value *[]OperationEntity `json:"value,omitempty"`
}
// OutputPort asset output port
type OutputPort struct {
// Type - Port data type. Possible values include: 'OutputPortTypeDataset'
Type OutputPortType `json:"type,omitempty"`
}
// PaginatedWebServicesList paginated list of web services.
type PaginatedWebServicesList struct {
autorest.Response `json:"-"`
// Value - An array of web service objects.
Value *[]WebService `json:"value,omitempty"`
// NextLink - A continuation link (absolute URI) to the next page of results in the list.
NextLink *string `json:"nextLink,omitempty"`
}
// PaginatedWebServicesListIterator provides access to a complete listing of WebService values.
type PaginatedWebServicesListIterator struct {
i int
page PaginatedWebServicesListPage
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *PaginatedWebServicesListIterator) Next() error {
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err := iter.page.Next()
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// NotDone returns true if the enumeration should be started or is not yet complete.
func (iter PaginatedWebServicesListIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
func (iter PaginatedWebServicesListIterator) Response() PaginatedWebServicesList {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
func (iter PaginatedWebServicesListIterator) Value() WebService {
if !iter.page.NotDone() {
return WebService{}
}
return iter.page.Values()[iter.i]
}
// IsEmpty returns true if the ListResult contains no values.
func (pwsl PaginatedWebServicesList) IsEmpty() bool {
return pwsl.Value == nil || len(*pwsl.Value) == 0
}
// paginatedWebServicesListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
func (pwsl PaginatedWebServicesList) paginatedWebServicesListPreparer() (*http.Request, error) {
if pwsl.NextLink == nil || len(to.String(pwsl.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(pwsl.NextLink)))
}
// PaginatedWebServicesListPage contains a page of WebService values.
type PaginatedWebServicesListPage struct {
fn func(PaginatedWebServicesList) (PaginatedWebServicesList, error)
pwsl PaginatedWebServicesList
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
func (page *PaginatedWebServicesListPage) Next() error {
next, err := page.fn(page.pwsl)
if err != nil {
return err
}
page.pwsl = next
return nil
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
func (page PaginatedWebServicesListPage) NotDone() bool {
return !page.pwsl.IsEmpty()
}
// Response returns the raw server response from the last page request.
func (page PaginatedWebServicesListPage) Response() PaginatedWebServicesList {
return page.pwsl
}
// Values returns the slice of values for the current page or nil if there are no values.
func (page PaginatedWebServicesListPage) Values() []WebService {
if page.pwsl.IsEmpty() {
return nil
}
return *page.pwsl.Value
}
// Parameter web Service Parameter object for node and global parameter
type Parameter struct {
// Value - The parameter value
Value interface{} `json:"value,omitempty"`
// CertificateThumbprint - If the parameter value in 'value' field is encrypted, the thumbprint of the certificate should be put here.
CertificateThumbprint *string `json:"certificateThumbprint,omitempty"`
}
// PatchFuture an abstraction for monitoring and retrieving the results of a long-running operation.
type PatchFuture struct {
azure.Future
req *http.Request
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future PatchFuture) Result(client Client) (ws WebService, err error) {
var done bool
done, err = future.Done(client)
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
return ws, azure.NewAsyncOpIncompleteError("webservices.PatchFuture")
}
if future.PollingMethod() == azure.PollingLocation {
ws, err = client.PatchResponder(future.Response())
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", future.Response(), "Failure responding to request")
}
return
}
var req *http.Request
var resp *http.Response
if future.PollingURL() != "" {
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
if err != nil {
return
}
} else {
req = autorest.ChangeToGet(future.req)
}
resp, err = autorest.SendWithSender(client, req,
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", resp, "Failure sending request")
return
}
ws, err = client.PatchResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", resp, "Failure responding to request")
}
return
}
// BasicProperties the set of properties specific to the Azure ML web service resource.
type BasicProperties interface {
AsPropertiesForGraph() (*PropertiesForGraph, bool)
AsProperties() (*Properties, bool)
}
// Properties the set of properties specific to the Azure ML web service resource.
type Properties struct {
// Title - The title of the web service.
Title *string `json:"title,omitempty"`
// Description - The description of the web service.
Description *string `json:"description,omitempty"`
// CreatedOn - Read Only: The date and time when the web service was created.
CreatedOn *date.Time `json:"createdOn,omitempty"`
// ModifiedOn - Read Only: The date and time when the web service was last modified.
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
// ProvisioningState - Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// 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.
Keys *Keys `json:"keys,omitempty"`
// 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.
ReadOnly *bool `json:"readOnly,omitempty"`
// SwaggerLocation - Read Only: Contains the URI of the swagger spec associated with this web service.
SwaggerLocation *string `json:"swaggerLocation,omitempty"`
// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
// 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.
StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
// 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.
CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
Input *ServiceInputOutputSpecification `json:"input,omitempty"`
// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.
Output *ServiceInputOutputSpecification `json:"output,omitempty"`
// ExampleRequest - Defines sample input data for one or more of the service's inputs.
ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
// Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs.
Assets map[string]*AssetItem `json:"assets"`
// 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.
Parameters map[string]*Parameter `json:"parameters"`
// 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.
PayloadsInBlobStorage *bool `json:"payloadsInBlobStorage,omitempty"`
// PayloadsLocation - The URI of the payload blob. This paramater contains a value only if the payloadsInBlobStorage parameter is set to true. Otherwise is set to null.
PayloadsLocation *BlobLocation `json:"payloadsLocation,omitempty"`
// PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph'
PackageType PackageType `json:"packageType,omitempty"`
}
func unmarshalBasicProperties(body []byte) (BasicProperties, error) {
var m map[string]interface{}
err := json.Unmarshal(body, &m)
if err != nil {
return nil, err
}
switch m["packageType"] {
case string(PackageTypeGraph):
var pfg PropertiesForGraph
err := json.Unmarshal(body, &pfg)
return pfg, err
default:
var p Properties
err := json.Unmarshal(body, &p)
return p, err
}
}
func unmarshalBasicPropertiesArray(body []byte) ([]BasicProperties, error) {
var rawMessages []*json.RawMessage
err := json.Unmarshal(body, &rawMessages)
if err != nil {
return nil, err
}
pArray := make([]BasicProperties, len(rawMessages))
for index, rawMessage := range rawMessages {
p, err := unmarshalBasicProperties(*rawMessage)
if err != nil {
return nil, err
}
pArray[index] = p
}
return pArray, nil
}
// MarshalJSON is the custom marshaler for Properties.
func (p Properties) MarshalJSON() ([]byte, error) {
p.PackageType = PackageTypeWebServiceProperties
objectMap := make(map[string]interface{})
if p.Title != nil {
objectMap["title"] = p.Title
}
if p.Description != nil {
objectMap["description"] = p.Description
}
if p.CreatedOn != nil {
objectMap["createdOn"] = p.CreatedOn
}
if p.ModifiedOn != nil {
objectMap["modifiedOn"] = p.ModifiedOn
}
if p.ProvisioningState != "" {
objectMap["provisioningState"] = p.ProvisioningState
}
if p.Keys != nil {
objectMap["keys"] = p.Keys
}
if p.ReadOnly != nil {
objectMap["readOnly"] = p.ReadOnly
}
if p.SwaggerLocation != nil {
objectMap["swaggerLocation"] = p.SwaggerLocation
}
if p.ExposeSampleData != nil {
objectMap["exposeSampleData"] = p.ExposeSampleData
}
if p.RealtimeConfiguration != nil {
objectMap["realtimeConfiguration"] = p.RealtimeConfiguration
}
if p.Diagnostics != nil {
objectMap["diagnostics"] = p.Diagnostics
}
if p.StorageAccount != nil {
objectMap["storageAccount"] = p.StorageAccount
}
if p.MachineLearningWorkspace != nil {
objectMap["machineLearningWorkspace"] = p.MachineLearningWorkspace
}
if p.CommitmentPlan != nil {
objectMap["commitmentPlan"] = p.CommitmentPlan
}
if p.Input != nil {
objectMap["input"] = p.Input
}
if p.Output != nil {
objectMap["output"] = p.Output
}
if p.ExampleRequest != nil {
objectMap["exampleRequest"] = p.ExampleRequest
}
if p.Assets != nil {
objectMap["assets"] = p.Assets
}
if p.Parameters != nil {
objectMap["parameters"] = p.Parameters
}
if p.PayloadsInBlobStorage != nil {
objectMap["payloadsInBlobStorage"] = p.PayloadsInBlobStorage
}
if p.PayloadsLocation != nil {
objectMap["payloadsLocation"] = p.PayloadsLocation
}
if p.PackageType != "" {
objectMap["packageType"] = p.PackageType
}
return json.Marshal(objectMap)
}
// AsPropertiesForGraph is the BasicProperties implementation for Properties.
func (p Properties) AsPropertiesForGraph() (*PropertiesForGraph, bool) {
return nil, false
}
// AsProperties is the BasicProperties implementation for Properties.
func (p Properties) AsProperties() (*Properties, bool) {
return &p, true
}
// AsBasicProperties is the BasicProperties implementation for Properties.
func (p Properties) AsBasicProperties() (BasicProperties, bool) {
return &p, true
}
// PropertiesForGraph properties specific to a Graph based web service.
type PropertiesForGraph struct {
// Package - The definition of the graph package making up this web service.
Package *GraphPackage `json:"package,omitempty"`
// Title - The title of the web service.
Title *string `json:"title,omitempty"`
// Description - The description of the web service.
Description *string `json:"description,omitempty"`
// CreatedOn - Read Only: The date and time when the web service was created.
CreatedOn *date.Time `json:"createdOn,omitempty"`
// ModifiedOn - Read Only: The date and time when the web service was last modified.
ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
// ProvisioningState - Read Only: The provision state of the web service. Valid values are Unknown, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Provisioning', 'Succeeded', 'Failed'
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
// 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.
Keys *Keys `json:"keys,omitempty"`
// 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.
ReadOnly *bool `json:"readOnly,omitempty"`
// SwaggerLocation - Read Only: Contains the URI of the swagger spec associated with this web service.
SwaggerLocation *string `json:"swaggerLocation,omitempty"`
// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
// 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.
StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
// 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.
CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
Input *ServiceInputOutputSpecification `json:"input,omitempty"`
// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.