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/preview/machinelearning/mgmt/2016-05-01-preview/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 *AssetLocation `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// AssetLocation describes the access location for a web service asset.
276type AssetLocation struct {
277	// URI - The URI where the asset is accessible from, (e.g. aml://abc for system assets or https://xyz for user assets
278	URI *string `json:"uri,omitempty"`
279	// Credentials - Access credentials for the asset, if applicable (e.g. asset specified by storage account connection string + blob URI)
280	Credentials *string `json:"credentials,omitempty"`
281}
282
283// ColumnSpecification swagger 2.0 schema for a column within the data table representing a web service
284// input or output. See Swagger specification: http://swagger.io/specification/
285type ColumnSpecification struct {
286	// Type - Data type of the column. Possible values include: 'Boolean', 'Integer', 'Number', 'String'
287	Type ColumnType `json:"type,omitempty"`
288	// 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'
289	Format ColumnFormat `json:"format,omitempty"`
290	// Enum - If the data type is categorical, this provides the list of accepted categories.
291	Enum *[]interface{} `json:"enum,omitempty"`
292	// XMsIsnullable - Flag indicating if the type supports null values or not.
293	XMsIsnullable *bool `json:"x-ms-isnullable,omitempty"`
294	// XMsIsordered - Flag indicating whether the categories are treated as an ordered set or not, if this is a categorical column.
295	XMsIsordered *bool `json:"x-ms-isordered,omitempty"`
296}
297
298// CommitmentPlan information about the machine learning commitment plan associated with the web service.
299type CommitmentPlan struct {
300	// ID - Specifies the Azure Resource Manager ID of the commitment plan associated with the web service.
301	ID *string `json:"id,omitempty"`
302}
303
304// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
305// operation.
306type CreateOrUpdateFuture struct {
307	azure.Future
308}
309
310// Result returns the result of the asynchronous operation.
311// If the operation has not completed it will return an error.
312func (future *CreateOrUpdateFuture) Result(client Client) (ws WebService, err error) {
313	var done bool
314	done, err = future.DoneWithContext(context.Background(), client)
315	if err != nil {
316		err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
317		return
318	}
319	if !done {
320		err = azure.NewAsyncOpIncompleteError("webservices.CreateOrUpdateFuture")
321		return
322	}
323	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
324	if ws.Response.Response, err = future.GetResult(sender); err == nil && ws.Response.Response.StatusCode != http.StatusNoContent {
325		ws, err = client.CreateOrUpdateResponder(ws.Response.Response)
326		if err != nil {
327			err = autorest.NewErrorWithError(err, "webservices.CreateOrUpdateFuture", "Result", ws.Response.Response, "Failure responding to request")
328		}
329	}
330	return
331}
332
333// DiagnosticsConfiguration diagnostics settings for an Azure ML web service.
334type DiagnosticsConfiguration struct {
335	// 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'
336	Level DiagnosticsLevel `json:"level,omitempty"`
337	// Expiry - Specifies the date and time when the logging will cease. If null, diagnostic collection is not time limited.
338	Expiry *date.Time `json:"expiry,omitempty"`
339}
340
341// ExampleRequest sample input data for the service's input(s).
342type ExampleRequest struct {
343	// Inputs - Sample input data for the web service's input(s) given as an input name to sample input values matrix map.
344	Inputs map[string][][]interface{} `json:"inputs"`
345	// GlobalParameters - Sample input data for the web service's global parameters
346	GlobalParameters map[string]interface{} `json:"globalParameters"`
347}
348
349// MarshalJSON is the custom marshaler for ExampleRequest.
350func (er ExampleRequest) MarshalJSON() ([]byte, error) {
351	objectMap := make(map[string]interface{})
352	if er.Inputs != nil {
353		objectMap["inputs"] = er.Inputs
354	}
355	if er.GlobalParameters != nil {
356		objectMap["globalParameters"] = er.GlobalParameters
357	}
358	return json.Marshal(objectMap)
359}
360
361// GraphEdge defines an edge within the web service's graph.
362type GraphEdge struct {
363	// SourceNodeID - The source graph node's identifier.
364	SourceNodeID *string `json:"sourceNodeId,omitempty"`
365	// SourcePortID - The identifier of the source node's port that the edge connects from.
366	SourcePortID *string `json:"sourcePortId,omitempty"`
367	// TargetNodeID - The destination graph node's identifier.
368	TargetNodeID *string `json:"targetNodeId,omitempty"`
369	// TargetPortID - The identifier of the destination node's port that the edge connects into.
370	TargetPortID *string `json:"targetPortId,omitempty"`
371}
372
373// GraphNode specifies a node in the web service graph. The node can either be an input, output or asset
374// node, so only one of the corresponding id properties is populated at any given time.
375type GraphNode struct {
376	// AssetID - The id of the asset represented by this node.
377	AssetID *string `json:"assetId,omitempty"`
378	// InputID - The id of the input element represented by this node.
379	InputID *string `json:"inputId,omitempty"`
380	// OutputID - The id of the output element represented by this node.
381	OutputID *string `json:"outputId,omitempty"`
382	// Parameters - If applicable, parameters of the node. Global graph parameters map into these, with values set at runtime.
383	Parameters map[string]*string `json:"parameters"`
384}
385
386// MarshalJSON is the custom marshaler for GraphNode.
387func (gn GraphNode) MarshalJSON() ([]byte, error) {
388	objectMap := make(map[string]interface{})
389	if gn.AssetID != nil {
390		objectMap["assetId"] = gn.AssetID
391	}
392	if gn.InputID != nil {
393		objectMap["inputId"] = gn.InputID
394	}
395	if gn.OutputID != nil {
396		objectMap["outputId"] = gn.OutputID
397	}
398	if gn.Parameters != nil {
399		objectMap["parameters"] = gn.Parameters
400	}
401	return json.Marshal(objectMap)
402}
403
404// GraphPackage defines the graph of modules making up the machine learning solution.
405type GraphPackage struct {
406	// Nodes - The set of nodes making up the graph, provided as a nodeId to GraphNode map
407	Nodes map[string]*GraphNode `json:"nodes"`
408	// Edges - The list of edges making up the graph.
409	Edges *[]GraphEdge `json:"edges,omitempty"`
410	// 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.
411	GraphParameters map[string]*GraphParameter `json:"graphParameters"`
412}
413
414// MarshalJSON is the custom marshaler for GraphPackage.
415func (gp GraphPackage) MarshalJSON() ([]byte, error) {
416	objectMap := make(map[string]interface{})
417	if gp.Nodes != nil {
418		objectMap["nodes"] = gp.Nodes
419	}
420	if gp.Edges != nil {
421		objectMap["edges"] = gp.Edges
422	}
423	if gp.GraphParameters != nil {
424		objectMap["graphParameters"] = gp.GraphParameters
425	}
426	return json.Marshal(objectMap)
427}
428
429// GraphParameter defines a global parameter in the graph.
430type GraphParameter struct {
431	// Description - Description of this graph parameter.
432	Description *string `json:"description,omitempty"`
433	// Type - Graph parameter's type. Possible values include: 'ParameterTypeString', 'ParameterTypeInt', 'ParameterTypeFloat', 'ParameterTypeEnumerated', 'ParameterTypeScript', 'ParameterTypeMode', 'ParameterTypeCredential', 'ParameterTypeBoolean', 'ParameterTypeDouble', 'ParameterTypeColumnPicker', 'ParameterTypeParameterRange', 'ParameterTypeDataGatewayName'
434	Type ParameterType `json:"type,omitempty"`
435	// Links - Association links for this parameter to nodes in the graph.
436	Links *[]GraphParameterLink `json:"links,omitempty"`
437}
438
439// GraphParameterLink association link for a graph global parameter to a node in the graph.
440type GraphParameterLink struct {
441	// NodeID - The graph node's identifier
442	NodeID *string `json:"nodeId,omitempty"`
443	// ParameterKey - The identifier of the node parameter that the global parameter maps to.
444	ParameterKey *string `json:"parameterKey,omitempty"`
445}
446
447// InputPort asset input port
448type InputPort struct {
449	// Type - Port data type. Possible values include: 'Dataset'
450	Type InputPortType `json:"type,omitempty"`
451}
452
453// Keys access keys for the web service calls.
454type Keys struct {
455	autorest.Response `json:"-"`
456	// Primary - The primary access key.
457	Primary *string `json:"primary,omitempty"`
458	// Secondary - The secondary access key.
459	Secondary *string `json:"secondary,omitempty"`
460}
461
462// MachineLearningWorkspace information about the machine learning workspace containing the experiment that
463// is source for the web service.
464type MachineLearningWorkspace struct {
465	// ID - Specifies the workspace ID of the machine learning workspace associated with the web service
466	ID *string `json:"id,omitempty"`
467}
468
469// ModeValueInfo nested parameter definition.
470type ModeValueInfo struct {
471	// InterfaceString - The interface string name for the nested parameter.
472	InterfaceString *string `json:"interfaceString,omitempty"`
473	// Parameters - The definition of the parameter.
474	Parameters *[]ModuleAssetParameter `json:"parameters,omitempty"`
475}
476
477// ModuleAssetParameter parameter definition for a module asset.
478type ModuleAssetParameter struct {
479	// Name - Parameter name.
480	Name *string `json:"name,omitempty"`
481	// ParameterType - Parameter type.
482	ParameterType *string `json:"parameterType,omitempty"`
483	// ModeValuesInfo - Definitions for nested interface parameters if this is a complex module parameter.
484	ModeValuesInfo map[string]*ModeValueInfo `json:"modeValuesInfo"`
485}
486
487// MarshalJSON is the custom marshaler for ModuleAssetParameter.
488func (mapVar ModuleAssetParameter) MarshalJSON() ([]byte, error) {
489	objectMap := make(map[string]interface{})
490	if mapVar.Name != nil {
491		objectMap["name"] = mapVar.Name
492	}
493	if mapVar.ParameterType != nil {
494		objectMap["parameterType"] = mapVar.ParameterType
495	}
496	if mapVar.ModeValuesInfo != nil {
497		objectMap["modeValuesInfo"] = mapVar.ModeValuesInfo
498	}
499	return json.Marshal(objectMap)
500}
501
502// OutputPort asset output port
503type OutputPort struct {
504	// Type - Port data type. Possible values include: 'OutputPortTypeDataset'
505	Type OutputPortType `json:"type,omitempty"`
506}
507
508// PaginatedWebServicesList paginated list of web services.
509type PaginatedWebServicesList struct {
510	autorest.Response `json:"-"`
511	// Value - An array of web service objects.
512	Value *[]WebService `json:"value,omitempty"`
513	// NextLink - A continuation link (absolute URI) to the next page of results in the list.
514	NextLink *string `json:"nextLink,omitempty"`
515}
516
517// PaginatedWebServicesListIterator provides access to a complete listing of WebService values.
518type PaginatedWebServicesListIterator struct {
519	i    int
520	page PaginatedWebServicesListPage
521}
522
523// NextWithContext advances to the next value.  If there was an error making
524// the request the iterator does not advance and the error is returned.
525func (iter *PaginatedWebServicesListIterator) NextWithContext(ctx context.Context) (err error) {
526	if tracing.IsEnabled() {
527		ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedWebServicesListIterator.NextWithContext")
528		defer func() {
529			sc := -1
530			if iter.Response().Response.Response != nil {
531				sc = iter.Response().Response.Response.StatusCode
532			}
533			tracing.EndSpan(ctx, sc, err)
534		}()
535	}
536	iter.i++
537	if iter.i < len(iter.page.Values()) {
538		return nil
539	}
540	err = iter.page.NextWithContext(ctx)
541	if err != nil {
542		iter.i--
543		return err
544	}
545	iter.i = 0
546	return nil
547}
548
549// Next advances to the next value.  If there was an error making
550// the request the iterator does not advance and the error is returned.
551// Deprecated: Use NextWithContext() instead.
552func (iter *PaginatedWebServicesListIterator) Next() error {
553	return iter.NextWithContext(context.Background())
554}
555
556// NotDone returns true if the enumeration should be started or is not yet complete.
557func (iter PaginatedWebServicesListIterator) NotDone() bool {
558	return iter.page.NotDone() && iter.i < len(iter.page.Values())
559}
560
561// Response returns the raw server response from the last page request.
562func (iter PaginatedWebServicesListIterator) Response() PaginatedWebServicesList {
563	return iter.page.Response()
564}
565
566// Value returns the current value or a zero-initialized value if the
567// iterator has advanced beyond the end of the collection.
568func (iter PaginatedWebServicesListIterator) Value() WebService {
569	if !iter.page.NotDone() {
570		return WebService{}
571	}
572	return iter.page.Values()[iter.i]
573}
574
575// Creates a new instance of the PaginatedWebServicesListIterator type.
576func NewPaginatedWebServicesListIterator(page PaginatedWebServicesListPage) PaginatedWebServicesListIterator {
577	return PaginatedWebServicesListIterator{page: page}
578}
579
580// IsEmpty returns true if the ListResult contains no values.
581func (pwsl PaginatedWebServicesList) IsEmpty() bool {
582	return pwsl.Value == nil || len(*pwsl.Value) == 0
583}
584
585// paginatedWebServicesListPreparer prepares a request to retrieve the next set of results.
586// It returns nil if no more results exist.
587func (pwsl PaginatedWebServicesList) paginatedWebServicesListPreparer(ctx context.Context) (*http.Request, error) {
588	if pwsl.NextLink == nil || len(to.String(pwsl.NextLink)) < 1 {
589		return nil, nil
590	}
591	return autorest.Prepare((&http.Request{}).WithContext(ctx),
592		autorest.AsJSON(),
593		autorest.AsGet(),
594		autorest.WithBaseURL(to.String(pwsl.NextLink)))
595}
596
597// PaginatedWebServicesListPage contains a page of WebService values.
598type PaginatedWebServicesListPage struct {
599	fn   func(context.Context, PaginatedWebServicesList) (PaginatedWebServicesList, error)
600	pwsl PaginatedWebServicesList
601}
602
603// NextWithContext advances to the next page of values.  If there was an error making
604// the request the page does not advance and the error is returned.
605func (page *PaginatedWebServicesListPage) NextWithContext(ctx context.Context) (err error) {
606	if tracing.IsEnabled() {
607		ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedWebServicesListPage.NextWithContext")
608		defer func() {
609			sc := -1
610			if page.Response().Response.Response != nil {
611				sc = page.Response().Response.Response.StatusCode
612			}
613			tracing.EndSpan(ctx, sc, err)
614		}()
615	}
616	next, err := page.fn(ctx, page.pwsl)
617	if err != nil {
618		return err
619	}
620	page.pwsl = next
621	return nil
622}
623
624// Next advances to the next page of values.  If there was an error making
625// the request the page does not advance and the error is returned.
626// Deprecated: Use NextWithContext() instead.
627func (page *PaginatedWebServicesListPage) Next() error {
628	return page.NextWithContext(context.Background())
629}
630
631// NotDone returns true if the page enumeration should be started or is not yet complete.
632func (page PaginatedWebServicesListPage) NotDone() bool {
633	return !page.pwsl.IsEmpty()
634}
635
636// Response returns the raw server response from the last page request.
637func (page PaginatedWebServicesListPage) Response() PaginatedWebServicesList {
638	return page.pwsl
639}
640
641// Values returns the slice of values for the current page or nil if there are no values.
642func (page PaginatedWebServicesListPage) Values() []WebService {
643	if page.pwsl.IsEmpty() {
644		return nil
645	}
646	return *page.pwsl.Value
647}
648
649// Creates a new instance of the PaginatedWebServicesListPage type.
650func NewPaginatedWebServicesListPage(getNextPage func(context.Context, PaginatedWebServicesList) (PaginatedWebServicesList, error)) PaginatedWebServicesListPage {
651	return PaginatedWebServicesListPage{fn: getNextPage}
652}
653
654// PatchFuture an abstraction for monitoring and retrieving the results of a long-running operation.
655type PatchFuture struct {
656	azure.Future
657}
658
659// Result returns the result of the asynchronous operation.
660// If the operation has not completed it will return an error.
661func (future *PatchFuture) Result(client Client) (ws WebService, err error) {
662	var done bool
663	done, err = future.DoneWithContext(context.Background(), client)
664	if err != nil {
665		err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", future.Response(), "Polling failure")
666		return
667	}
668	if !done {
669		err = azure.NewAsyncOpIncompleteError("webservices.PatchFuture")
670		return
671	}
672	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
673	if ws.Response.Response, err = future.GetResult(sender); err == nil && ws.Response.Response.StatusCode != http.StatusNoContent {
674		ws, err = client.PatchResponder(ws.Response.Response)
675		if err != nil {
676			err = autorest.NewErrorWithError(err, "webservices.PatchFuture", "Result", ws.Response.Response, "Failure responding to request")
677		}
678	}
679	return
680}
681
682// BasicProperties the set of properties specific to the Azure ML web service resource.
683type BasicProperties interface {
684	AsPropertiesForGraph() (*PropertiesForGraph, bool)
685	AsProperties() (*Properties, bool)
686}
687
688// Properties the set of properties specific to the Azure ML web service resource.
689type Properties struct {
690	// Title - The title of the web service.
691	Title *string `json:"title,omitempty"`
692	// Description - The description of the web service.
693	Description *string `json:"description,omitempty"`
694	// CreatedOn - READ-ONLY; Read Only: The date and time when the web service was created.
695	CreatedOn *date.Time `json:"createdOn,omitempty"`
696	// ModifiedOn - READ-ONLY; Read Only: The date and time when the web service was last modified.
697	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
698	// 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'
699	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
700	// 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.
701	Keys *Keys `json:"keys,omitempty"`
702	// 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.
703	ReadOnly *bool `json:"readOnly,omitempty"`
704	// SwaggerLocation - READ-ONLY; Read Only: Contains the URI of the swagger spec associated with this web service.
705	SwaggerLocation *string `json:"swaggerLocation,omitempty"`
706	// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
707	ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
708	// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
709	RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
710	// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
711	Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
712	// 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.
713	StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
714	// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
715	MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
716	// 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.
717	CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
718	// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
719	Input *ServiceInputOutputSpecification `json:"input,omitempty"`
720	// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.
721	Output *ServiceInputOutputSpecification `json:"output,omitempty"`
722	// ExampleRequest - Defines sample input data for one or more of the service's inputs.
723	ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
724	// Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs.
725	Assets map[string]*AssetItem `json:"assets"`
726	// 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.
727	Parameters map[string]*string `json:"parameters"`
728	// PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph'
729	PackageType PackageType `json:"packageType,omitempty"`
730}
731
732func unmarshalBasicProperties(body []byte) (BasicProperties, error) {
733	var m map[string]interface{}
734	err := json.Unmarshal(body, &m)
735	if err != nil {
736		return nil, err
737	}
738
739	switch m["packageType"] {
740	case string(PackageTypeGraph):
741		var pfg PropertiesForGraph
742		err := json.Unmarshal(body, &pfg)
743		return pfg, err
744	default:
745		var p Properties
746		err := json.Unmarshal(body, &p)
747		return p, err
748	}
749}
750func unmarshalBasicPropertiesArray(body []byte) ([]BasicProperties, error) {
751	var rawMessages []*json.RawMessage
752	err := json.Unmarshal(body, &rawMessages)
753	if err != nil {
754		return nil, err
755	}
756
757	pArray := make([]BasicProperties, len(rawMessages))
758
759	for index, rawMessage := range rawMessages {
760		p, err := unmarshalBasicProperties(*rawMessage)
761		if err != nil {
762			return nil, err
763		}
764		pArray[index] = p
765	}
766	return pArray, nil
767}
768
769// MarshalJSON is the custom marshaler for Properties.
770func (p Properties) MarshalJSON() ([]byte, error) {
771	p.PackageType = PackageTypeWebServiceProperties
772	objectMap := make(map[string]interface{})
773	if p.Title != nil {
774		objectMap["title"] = p.Title
775	}
776	if p.Description != nil {
777		objectMap["description"] = p.Description
778	}
779	if p.Keys != nil {
780		objectMap["keys"] = p.Keys
781	}
782	if p.ReadOnly != nil {
783		objectMap["readOnly"] = p.ReadOnly
784	}
785	if p.ExposeSampleData != nil {
786		objectMap["exposeSampleData"] = p.ExposeSampleData
787	}
788	if p.RealtimeConfiguration != nil {
789		objectMap["realtimeConfiguration"] = p.RealtimeConfiguration
790	}
791	if p.Diagnostics != nil {
792		objectMap["diagnostics"] = p.Diagnostics
793	}
794	if p.StorageAccount != nil {
795		objectMap["storageAccount"] = p.StorageAccount
796	}
797	if p.MachineLearningWorkspace != nil {
798		objectMap["machineLearningWorkspace"] = p.MachineLearningWorkspace
799	}
800	if p.CommitmentPlan != nil {
801		objectMap["commitmentPlan"] = p.CommitmentPlan
802	}
803	if p.Input != nil {
804		objectMap["input"] = p.Input
805	}
806	if p.Output != nil {
807		objectMap["output"] = p.Output
808	}
809	if p.ExampleRequest != nil {
810		objectMap["exampleRequest"] = p.ExampleRequest
811	}
812	if p.Assets != nil {
813		objectMap["assets"] = p.Assets
814	}
815	if p.Parameters != nil {
816		objectMap["parameters"] = p.Parameters
817	}
818	if p.PackageType != "" {
819		objectMap["packageType"] = p.PackageType
820	}
821	return json.Marshal(objectMap)
822}
823
824// AsPropertiesForGraph is the BasicProperties implementation for Properties.
825func (p Properties) AsPropertiesForGraph() (*PropertiesForGraph, bool) {
826	return nil, false
827}
828
829// AsProperties is the BasicProperties implementation for Properties.
830func (p Properties) AsProperties() (*Properties, bool) {
831	return &p, true
832}
833
834// AsBasicProperties is the BasicProperties implementation for Properties.
835func (p Properties) AsBasicProperties() (BasicProperties, bool) {
836	return &p, true
837}
838
839// PropertiesForGraph properties specific to a Graph based web service.
840type PropertiesForGraph struct {
841	// Package - The definition of the graph package making up this web service.
842	Package *GraphPackage `json:"package,omitempty"`
843	// Title - The title of the web service.
844	Title *string `json:"title,omitempty"`
845	// Description - The description of the web service.
846	Description *string `json:"description,omitempty"`
847	// CreatedOn - READ-ONLY; Read Only: The date and time when the web service was created.
848	CreatedOn *date.Time `json:"createdOn,omitempty"`
849	// ModifiedOn - READ-ONLY; Read Only: The date and time when the web service was last modified.
850	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
851	// 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'
852	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
853	// 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.
854	Keys *Keys `json:"keys,omitempty"`
855	// 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.
856	ReadOnly *bool `json:"readOnly,omitempty"`
857	// SwaggerLocation - READ-ONLY; Read Only: Contains the URI of the swagger spec associated with this web service.
858	SwaggerLocation *string `json:"swaggerLocation,omitempty"`
859	// ExposeSampleData - When set to true, sample data is included in the web service's swagger definition. The default value is true.
860	ExposeSampleData *bool `json:"exposeSampleData,omitempty"`
861	// RealtimeConfiguration - Contains the configuration settings for the web service endpoint.
862	RealtimeConfiguration *RealtimeConfiguration `json:"realtimeConfiguration,omitempty"`
863	// Diagnostics - Settings controlling the diagnostics traces collection for the web service.
864	Diagnostics *DiagnosticsConfiguration `json:"diagnostics,omitempty"`
865	// 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.
866	StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
867	// MachineLearningWorkspace - Specifies the Machine Learning workspace containing the experiment that is source for the web service.
868	MachineLearningWorkspace *MachineLearningWorkspace `json:"machineLearningWorkspace,omitempty"`
869	// 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.
870	CommitmentPlan *CommitmentPlan `json:"commitmentPlan,omitempty"`
871	// Input - Contains the Swagger 2.0 schema describing one or more of the web service's inputs. For more information, see the Swagger specification.
872	Input *ServiceInputOutputSpecification `json:"input,omitempty"`
873	// Output - Contains the Swagger 2.0 schema describing one or more of the web service's outputs. For more information, see the Swagger specification.
874	Output *ServiceInputOutputSpecification `json:"output,omitempty"`
875	// ExampleRequest - Defines sample input data for one or more of the service's inputs.
876	ExampleRequest *ExampleRequest `json:"exampleRequest,omitempty"`
877	// Assets - Contains user defined properties describing web service assets. Properties are expressed as Key/Value pairs.
878	Assets map[string]*AssetItem `json:"assets"`
879	// 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.
880	Parameters map[string]*string `json:"parameters"`
881	// PackageType - Possible values include: 'PackageTypeWebServiceProperties', 'PackageTypeGraph'
882	PackageType PackageType `json:"packageType,omitempty"`
883}
884
885// MarshalJSON is the custom marshaler for PropertiesForGraph.
886func (pfg PropertiesForGraph) MarshalJSON() ([]byte, error) {
887	pfg.PackageType = PackageTypeGraph
888	objectMap := make(map[string]interface{})
889	if pfg.Package != nil {
890		objectMap["package"] = pfg.Package
891	}
892	if pfg.Title != nil {
893		objectMap["title"] = pfg.Title
894	}
895	if pfg.Description != nil {
896		objectMap["description"] = pfg.Description
897	}
898	if pfg.Keys != nil {
899		objectMap["keys"] = pfg.Keys
900	}
901	if pfg.ReadOnly != nil {
902		objectMap["readOnly"] = pfg.ReadOnly
903	}
904	if pfg.ExposeSampleData != nil {
905		objectMap["exposeSampleData"] = pfg.ExposeSampleData
906	}
907	if pfg.RealtimeConfiguration != nil {
908		objectMap["realtimeConfiguration"] = pfg.RealtimeConfiguration
909	}
910	if pfg.Diagnostics != nil {
911		objectMap["diagnostics"] = pfg.Diagnostics
912	}
913	if pfg.StorageAccount != nil {
914		objectMap["storageAccount"] = pfg.StorageAccount
915	}
916	if pfg.MachineLearningWorkspace != nil {
917		objectMap["machineLearningWorkspace"] = pfg.MachineLearningWorkspace
918	}
919	if pfg.CommitmentPlan != nil {
920		objectMap["commitmentPlan"] = pfg.CommitmentPlan
921	}
922	if pfg.Input != nil {
923		objectMap["input"] = pfg.Input
924	}
925	if pfg.Output != nil {
926		objectMap["output"] = pfg.Output
927	}
928	if pfg.ExampleRequest != nil {
929		objectMap["exampleRequest"] = pfg.ExampleRequest
930	}
931	if pfg.Assets != nil {
932		objectMap["assets"] = pfg.Assets
933	}
934	if pfg.Parameters != nil {
935		objectMap["parameters"] = pfg.Parameters
936	}
937	if pfg.PackageType != "" {
938		objectMap["packageType"] = pfg.PackageType
939	}
940	return json.Marshal(objectMap)
941}
942
943// AsPropertiesForGraph is the BasicProperties implementation for PropertiesForGraph.
944func (pfg PropertiesForGraph) AsPropertiesForGraph() (*PropertiesForGraph, bool) {
945	return &pfg, true
946}
947
948// AsProperties is the BasicProperties implementation for PropertiesForGraph.
949func (pfg PropertiesForGraph) AsProperties() (*Properties, bool) {
950	return nil, false
951}
952
953// AsBasicProperties is the BasicProperties implementation for PropertiesForGraph.
954func (pfg PropertiesForGraph) AsBasicProperties() (BasicProperties, bool) {
955	return &pfg, true
956}
957
958// RealtimeConfiguration holds the available configuration options for an Azure ML web service endpoint.
959type RealtimeConfiguration struct {
960	// MaxConcurrentCalls - Specifies the maximum concurrent calls that can be made to the web service. Minimum value: 4, Maximum value: 200.
961	MaxConcurrentCalls *int32 `json:"maxConcurrentCalls,omitempty"`
962}
963
964// RemoveFuture an abstraction for monitoring and retrieving the results of a long-running operation.
965type RemoveFuture struct {
966	azure.Future
967}
968
969// Result returns the result of the asynchronous operation.
970// If the operation has not completed it will return an error.
971func (future *RemoveFuture) Result(client Client) (ar autorest.Response, err error) {
972	var done bool
973	done, err = future.DoneWithContext(context.Background(), client)
974	if err != nil {
975		err = autorest.NewErrorWithError(err, "webservices.RemoveFuture", "Result", future.Response(), "Polling failure")
976		return
977	}
978	if !done {
979		err = azure.NewAsyncOpIncompleteError("webservices.RemoveFuture")
980		return
981	}
982	ar.Response = future.Response()
983	return
984}
985
986// Resource ...
987type Resource struct {
988	// ID - READ-ONLY; Specifies the resource ID.
989	ID *string `json:"id,omitempty"`
990	// Name - Specifies the name of the resource.
991	Name *string `json:"name,omitempty"`
992	// Location - Specifies the location of the resource.
993	Location *string `json:"location,omitempty"`
994	// Type - READ-ONLY; Specifies the type of the resource.
995	Type *string `json:"type,omitempty"`
996	// Tags - Contains resource tags defined as key/value pairs.
997	Tags map[string]*string `json:"tags"`
998}
999
1000// MarshalJSON is the custom marshaler for Resource.
1001func (r Resource) MarshalJSON() ([]byte, error) {
1002	objectMap := make(map[string]interface{})
1003	if r.Name != nil {
1004		objectMap["name"] = r.Name
1005	}
1006	if r.Location != nil {
1007		objectMap["location"] = r.Location
1008	}
1009	if r.Tags != nil {
1010		objectMap["tags"] = r.Tags
1011	}
1012	return json.Marshal(objectMap)
1013}
1014
1015// ServiceInputOutputSpecification the swagger 2.0 schema describing the service's inputs or outputs. See
1016// Swagger specification: http://swagger.io/specification/
1017type ServiceInputOutputSpecification struct {
1018	// Title - The title of your Swagger schema.
1019	Title *string `json:"title,omitempty"`
1020	// Description - The description of the Swagger schema.
1021	Description *string `json:"description,omitempty"`
1022	// Type - The type of the entity described in swagger. Always 'object'.
1023	Type *string `json:"type,omitempty"`
1024	// 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.
1025	Properties map[string]*TableSpecification `json:"properties"`
1026}
1027
1028// MarshalJSON is the custom marshaler for ServiceInputOutputSpecification.
1029func (sios ServiceInputOutputSpecification) MarshalJSON() ([]byte, error) {
1030	objectMap := make(map[string]interface{})
1031	if sios.Title != nil {
1032		objectMap["title"] = sios.Title
1033	}
1034	if sios.Description != nil {
1035		objectMap["description"] = sios.Description
1036	}
1037	if sios.Type != nil {
1038		objectMap["type"] = sios.Type
1039	}
1040	if sios.Properties != nil {
1041		objectMap["properties"] = sios.Properties
1042	}
1043	return json.Marshal(objectMap)
1044}
1045
1046// StorageAccount access information for a storage account.
1047type StorageAccount struct {
1048	// Name - Specifies the name of the storage account.
1049	Name *string `json:"name,omitempty"`
1050	// Key - Specifies the key used to access the storage account.
1051	Key *string `json:"key,omitempty"`
1052}
1053
1054// TableSpecification the swagger 2.0 schema describing a single service input or output. See Swagger
1055// specification: http://swagger.io/specification/
1056type TableSpecification struct {
1057	// Title - Swagger schema title.
1058	Title *string `json:"title,omitempty"`
1059	// Description - Swagger schema description.
1060	Description *string `json:"description,omitempty"`
1061	// Type - The type of the entity described in swagger.
1062	Type *string `json:"type,omitempty"`
1063	// Format - The format, if 'type' is not 'object'
1064	Format *string `json:"format,omitempty"`
1065	// Properties - The set of columns within the data table.
1066	Properties map[string]*ColumnSpecification `json:"properties"`
1067}
1068
1069// MarshalJSON is the custom marshaler for TableSpecification.
1070func (ts TableSpecification) MarshalJSON() ([]byte, error) {
1071	objectMap := make(map[string]interface{})
1072	if ts.Title != nil {
1073		objectMap["title"] = ts.Title
1074	}
1075	if ts.Description != nil {
1076		objectMap["description"] = ts.Description
1077	}
1078	if ts.Type != nil {
1079		objectMap["type"] = ts.Type
1080	}
1081	if ts.Format != nil {
1082		objectMap["format"] = ts.Format
1083	}
1084	if ts.Properties != nil {
1085		objectMap["properties"] = ts.Properties
1086	}
1087	return json.Marshal(objectMap)
1088}
1089
1090// WebService instance of an Azure ML web service resource.
1091type WebService struct {
1092	autorest.Response `json:"-"`
1093	// Properties - Contains the property payload that describes the web service.
1094	Properties BasicProperties `json:"properties,omitempty"`
1095	// ID - READ-ONLY; Specifies the resource ID.
1096	ID *string `json:"id,omitempty"`
1097	// Name - Specifies the name of the resource.
1098	Name *string `json:"name,omitempty"`
1099	// Location - Specifies the location of the resource.
1100	Location *string `json:"location,omitempty"`
1101	// Type - READ-ONLY; Specifies the type of the resource.
1102	Type *string `json:"type,omitempty"`
1103	// Tags - Contains resource tags defined as key/value pairs.
1104	Tags map[string]*string `json:"tags"`
1105}
1106
1107// MarshalJSON is the custom marshaler for WebService.
1108func (ws WebService) MarshalJSON() ([]byte, error) {
1109	objectMap := make(map[string]interface{})
1110	objectMap["properties"] = ws.Properties
1111	if ws.Name != nil {
1112		objectMap["name"] = ws.Name
1113	}
1114	if ws.Location != nil {
1115		objectMap["location"] = ws.Location
1116	}
1117	if ws.Tags != nil {
1118		objectMap["tags"] = ws.Tags
1119	}
1120	return json.Marshal(objectMap)
1121}
1122
1123// UnmarshalJSON is the custom unmarshaler for WebService struct.
1124func (ws *WebService) UnmarshalJSON(body []byte) error {
1125	var m map[string]*json.RawMessage
1126	err := json.Unmarshal(body, &m)
1127	if err != nil {
1128		return err
1129	}
1130	for k, v := range m {
1131		switch k {
1132		case "properties":
1133			if v != nil {
1134				properties, err := unmarshalBasicProperties(*v)
1135				if err != nil {
1136					return err
1137				}
1138				ws.Properties = properties
1139			}
1140		case "id":
1141			if v != nil {
1142				var ID string
1143				err = json.Unmarshal(*v, &ID)
1144				if err != nil {
1145					return err
1146				}
1147				ws.ID = &ID
1148			}
1149		case "name":
1150			if v != nil {
1151				var name string
1152				err = json.Unmarshal(*v, &name)
1153				if err != nil {
1154					return err
1155				}
1156				ws.Name = &name
1157			}
1158		case "location":
1159			if v != nil {
1160				var location string
1161				err = json.Unmarshal(*v, &location)
1162				if err != nil {
1163					return err
1164				}
1165				ws.Location = &location
1166			}
1167		case "type":
1168			if v != nil {
1169				var typeVar string
1170				err = json.Unmarshal(*v, &typeVar)
1171				if err != nil {
1172					return err
1173				}
1174				ws.Type = &typeVar
1175			}
1176		case "tags":
1177			if v != nil {
1178				var tags map[string]*string
1179				err = json.Unmarshal(*v, &tags)
1180				if err != nil {
1181					return err
1182				}
1183				ws.Tags = tags
1184			}
1185		}
1186	}
1187
1188	return nil
1189}
1190