...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/webservices/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/webservices

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

View as plain text