...

Source file src/github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap

     1  package servicemap
     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/date"
    14  	"github.com/Azure/go-autorest/autorest/to"
    15  	"github.com/Azure/go-autorest/tracing"
    16  	"net/http"
    17  )
    18  
    19  // The package's fully qualified name.
    20  const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/servicemap"
    21  
    22  // Acceptor a process accepting on a port.
    23  type Acceptor struct {
    24  	*AcceptorProperties `json:"properties,omitempty"`
    25  	// ID - READ-ONLY; Resource identifier.
    26  	ID *string `json:"id,omitempty"`
    27  	// Type - READ-ONLY; Resource type.
    28  	Type *string `json:"type,omitempty"`
    29  	// Name - READ-ONLY; Resource name.
    30  	Name *string `json:"name,omitempty"`
    31  	// Kind - Possible values include: 'KindRelationship', 'KindRelconnection', 'KindRelacceptor'
    32  	Kind KindBasicRelationship `json:"kind,omitempty"`
    33  }
    34  
    35  // MarshalJSON is the custom marshaler for Acceptor.
    36  func (a Acceptor) MarshalJSON() ([]byte, error) {
    37  	a.Kind = KindRelacceptor
    38  	objectMap := make(map[string]interface{})
    39  	if a.AcceptorProperties != nil {
    40  		objectMap["properties"] = a.AcceptorProperties
    41  	}
    42  	if a.Kind != "" {
    43  		objectMap["kind"] = a.Kind
    44  	}
    45  	return json.Marshal(objectMap)
    46  }
    47  
    48  // AsConnection is the BasicRelationship implementation for Acceptor.
    49  func (a Acceptor) AsConnection() (*Connection, bool) {
    50  	return nil, false
    51  }
    52  
    53  // AsAcceptor is the BasicRelationship implementation for Acceptor.
    54  func (a Acceptor) AsAcceptor() (*Acceptor, bool) {
    55  	return &a, true
    56  }
    57  
    58  // AsRelationship is the BasicRelationship implementation for Acceptor.
    59  func (a Acceptor) AsRelationship() (*Relationship, bool) {
    60  	return nil, false
    61  }
    62  
    63  // AsBasicRelationship is the BasicRelationship implementation for Acceptor.
    64  func (a Acceptor) AsBasicRelationship() (BasicRelationship, bool) {
    65  	return &a, true
    66  }
    67  
    68  // UnmarshalJSON is the custom unmarshaler for Acceptor struct.
    69  func (a *Acceptor) UnmarshalJSON(body []byte) error {
    70  	var m map[string]*json.RawMessage
    71  	err := json.Unmarshal(body, &m)
    72  	if err != nil {
    73  		return err
    74  	}
    75  	for k, v := range m {
    76  		switch k {
    77  		case "properties":
    78  			if v != nil {
    79  				var acceptorProperties AcceptorProperties
    80  				err = json.Unmarshal(*v, &acceptorProperties)
    81  				if err != nil {
    82  					return err
    83  				}
    84  				a.AcceptorProperties = &acceptorProperties
    85  			}
    86  		case "kind":
    87  			if v != nil {
    88  				var kind KindBasicRelationship
    89  				err = json.Unmarshal(*v, &kind)
    90  				if err != nil {
    91  					return err
    92  				}
    93  				a.Kind = kind
    94  			}
    95  		case "id":
    96  			if v != nil {
    97  				var ID string
    98  				err = json.Unmarshal(*v, &ID)
    99  				if err != nil {
   100  					return err
   101  				}
   102  				a.ID = &ID
   103  			}
   104  		case "type":
   105  			if v != nil {
   106  				var typeVar string
   107  				err = json.Unmarshal(*v, &typeVar)
   108  				if err != nil {
   109  					return err
   110  				}
   111  				a.Type = &typeVar
   112  			}
   113  		case "name":
   114  			if v != nil {
   115  				var name string
   116  				err = json.Unmarshal(*v, &name)
   117  				if err != nil {
   118  					return err
   119  				}
   120  				a.Name = &name
   121  			}
   122  		}
   123  	}
   124  
   125  	return nil
   126  }
   127  
   128  // AcceptorProperties properties for an acceptor relationship.
   129  type AcceptorProperties struct {
   130  	// Source - Port being accepted.
   131  	Source *PortReference `json:"source,omitempty"`
   132  	// Destination - Accepting process.
   133  	Destination *ProcessReference `json:"destination,omitempty"`
   134  	// StartTime - Relationship start time.
   135  	StartTime *date.Time `json:"startTime,omitempty"`
   136  	// EndTime - Relationship end time.
   137  	EndTime *date.Time `json:"endTime,omitempty"`
   138  }
   139  
   140  // AgentConfiguration describes the configuration of the Dependency Agent installed on a machine.
   141  type AgentConfiguration struct {
   142  	// AgentID - Health Service Agent unique identifier.
   143  	AgentID *string `json:"agentId,omitempty"`
   144  	// DependencyAgentID - Dependency Agent unique identifier.
   145  	DependencyAgentID *string `json:"dependencyAgentId,omitempty"`
   146  	// DependencyAgentVersion - Dependency Agent version number.
   147  	DependencyAgentVersion *string `json:"dependencyAgentVersion,omitempty"`
   148  	// DependencyAgentRevision - Dependency Agent revision number.
   149  	DependencyAgentRevision *string `json:"dependencyAgentRevision,omitempty"`
   150  	// RebootStatus - Specifies whether the machine has been rebooted since the Dependency Agent installation. Possible values include: 'MachineRebootStatusUnknown', 'MachineRebootStatusRebooted', 'MachineRebootStatusNotRebooted'
   151  	RebootStatus MachineRebootStatus `json:"rebootStatus,omitempty"`
   152  	// ClockGranularity - Machine clock granularity in milliseconds.
   153  	ClockGranularity *int32 `json:"clockGranularity,omitempty"`
   154  }
   155  
   156  // AzureCloudServiceConfiguration describes an Azure Cloud Service
   157  type AzureCloudServiceConfiguration struct {
   158  	// Name - Cloud Service name
   159  	Name *string `json:"name,omitempty"`
   160  	// InstanceID - Cloud Service instance identifier
   161  	InstanceID *string `json:"instanceId,omitempty"`
   162  	// Deployment - Cloud Service deployment identifier
   163  	Deployment *string `json:"deployment,omitempty"`
   164  	// RoleName - Cloud Service role name
   165  	RoleName *string `json:"roleName,omitempty"`
   166  	// RoleType - Used to specify type of an Azure Cloud Service role. Possible values include: 'Unknown', 'Worker', 'Web'
   167  	RoleType AzureCloudServiceRoleType `json:"roleType,omitempty"`
   168  }
   169  
   170  // AzureHostingConfiguration provides information about how a machine is hosted in Azure
   171  type AzureHostingConfiguration struct {
   172  	// VMID - Virtual Machine ID (unique identifier).
   173  	VMID *string `json:"vmId,omitempty"`
   174  	// Location - Geographical location of the VM.
   175  	Location *string `json:"location,omitempty"`
   176  	// Name - Machine name according to the hosting provider.
   177  	Name *string `json:"name,omitempty"`
   178  	// Size - Size of the VM.
   179  	Size *string `json:"size,omitempty"`
   180  	// UpdateDomain - Update domain of the VM.
   181  	UpdateDomain *string `json:"updateDomain,omitempty"`
   182  	// FaultDomain - Fault domain of the VM.
   183  	FaultDomain *string `json:"faultDomain,omitempty"`
   184  	// SubscriptionID - Subscription ID.
   185  	SubscriptionID *string `json:"subscriptionId,omitempty"`
   186  	// ResourceGroup - Resource group name within the specified subscription.
   187  	ResourceGroup *string `json:"resourceGroup,omitempty"`
   188  	// ResourceID - Unique identifier of the resource.
   189  	ResourceID *string `json:"resourceId,omitempty"`
   190  	// Image - Image of the machine.
   191  	Image *ImageConfiguration `json:"image,omitempty"`
   192  	// CloudService - Contains information about machines hosted as an Azure Cloud Service
   193  	CloudService *AzureCloudServiceConfiguration `json:"cloudService,omitempty"`
   194  	// VMScaleSet - Contains information about machines hosted as an Azure Virtual Machine Scale Set
   195  	VMScaleSet *AzureVMScaleSetConfiguration `json:"vmScaleSet,omitempty"`
   196  	// ServiceFabricCluster - Contains information about machines that belong an Azure Service Fabric Cluster
   197  	ServiceFabricCluster *AzureServiceFabricClusterConfiguration `json:"serviceFabricCluster,omitempty"`
   198  	// Provider - The hosting provider of the VM. Possible values include: 'Azure'
   199  	Provider Provider `json:"provider,omitempty"`
   200  	// Kind - Possible values include: 'KindHostingConfiguration', 'KindProviderazure'
   201  	Kind KindBasicHostingConfiguration `json:"kind,omitempty"`
   202  }
   203  
   204  // MarshalJSON is the custom marshaler for AzureHostingConfiguration.
   205  func (ahc AzureHostingConfiguration) MarshalJSON() ([]byte, error) {
   206  	ahc.Kind = KindProviderazure
   207  	objectMap := make(map[string]interface{})
   208  	if ahc.VMID != nil {
   209  		objectMap["vmId"] = ahc.VMID
   210  	}
   211  	if ahc.Location != nil {
   212  		objectMap["location"] = ahc.Location
   213  	}
   214  	if ahc.Name != nil {
   215  		objectMap["name"] = ahc.Name
   216  	}
   217  	if ahc.Size != nil {
   218  		objectMap["size"] = ahc.Size
   219  	}
   220  	if ahc.UpdateDomain != nil {
   221  		objectMap["updateDomain"] = ahc.UpdateDomain
   222  	}
   223  	if ahc.FaultDomain != nil {
   224  		objectMap["faultDomain"] = ahc.FaultDomain
   225  	}
   226  	if ahc.SubscriptionID != nil {
   227  		objectMap["subscriptionId"] = ahc.SubscriptionID
   228  	}
   229  	if ahc.ResourceGroup != nil {
   230  		objectMap["resourceGroup"] = ahc.ResourceGroup
   231  	}
   232  	if ahc.ResourceID != nil {
   233  		objectMap["resourceId"] = ahc.ResourceID
   234  	}
   235  	if ahc.Image != nil {
   236  		objectMap["image"] = ahc.Image
   237  	}
   238  	if ahc.CloudService != nil {
   239  		objectMap["cloudService"] = ahc.CloudService
   240  	}
   241  	if ahc.VMScaleSet != nil {
   242  		objectMap["vmScaleSet"] = ahc.VMScaleSet
   243  	}
   244  	if ahc.ServiceFabricCluster != nil {
   245  		objectMap["serviceFabricCluster"] = ahc.ServiceFabricCluster
   246  	}
   247  	if ahc.Provider != "" {
   248  		objectMap["provider"] = ahc.Provider
   249  	}
   250  	if ahc.Kind != "" {
   251  		objectMap["kind"] = ahc.Kind
   252  	}
   253  	return json.Marshal(objectMap)
   254  }
   255  
   256  // AsAzureHostingConfiguration is the BasicHostingConfiguration implementation for AzureHostingConfiguration.
   257  func (ahc AzureHostingConfiguration) AsAzureHostingConfiguration() (*AzureHostingConfiguration, bool) {
   258  	return &ahc, true
   259  }
   260  
   261  // AsHostingConfiguration is the BasicHostingConfiguration implementation for AzureHostingConfiguration.
   262  func (ahc AzureHostingConfiguration) AsHostingConfiguration() (*HostingConfiguration, bool) {
   263  	return nil, false
   264  }
   265  
   266  // AsBasicHostingConfiguration is the BasicHostingConfiguration implementation for AzureHostingConfiguration.
   267  func (ahc AzureHostingConfiguration) AsBasicHostingConfiguration() (BasicHostingConfiguration, bool) {
   268  	return &ahc, true
   269  }
   270  
   271  // AzureProcessHostingConfiguration describes the hosting configuration of a process when hosted on azure
   272  type AzureProcessHostingConfiguration struct {
   273  	// CloudService - Contains information about the cloud service the process belongs to
   274  	CloudService *AzureCloudServiceConfiguration `json:"cloudService,omitempty"`
   275  	// Provider - The hosting provider of the VM. Possible values include: 'Provider1Azure'
   276  	Provider Provider1 `json:"provider,omitempty"`
   277  	// Kind - Possible values include: 'KindBasicProcessHostingConfigurationKindProcessHostingConfiguration', 'KindBasicProcessHostingConfigurationKindProviderazure'
   278  	Kind KindBasicProcessHostingConfiguration `json:"kind,omitempty"`
   279  }
   280  
   281  // MarshalJSON is the custom marshaler for AzureProcessHostingConfiguration.
   282  func (aphc AzureProcessHostingConfiguration) MarshalJSON() ([]byte, error) {
   283  	aphc.Kind = KindBasicProcessHostingConfigurationKindProviderazure
   284  	objectMap := make(map[string]interface{})
   285  	if aphc.CloudService != nil {
   286  		objectMap["cloudService"] = aphc.CloudService
   287  	}
   288  	if aphc.Provider != "" {
   289  		objectMap["provider"] = aphc.Provider
   290  	}
   291  	if aphc.Kind != "" {
   292  		objectMap["kind"] = aphc.Kind
   293  	}
   294  	return json.Marshal(objectMap)
   295  }
   296  
   297  // AsAzureProcessHostingConfiguration is the BasicProcessHostingConfiguration implementation for AzureProcessHostingConfiguration.
   298  func (aphc AzureProcessHostingConfiguration) AsAzureProcessHostingConfiguration() (*AzureProcessHostingConfiguration, bool) {
   299  	return &aphc, true
   300  }
   301  
   302  // AsProcessHostingConfiguration is the BasicProcessHostingConfiguration implementation for AzureProcessHostingConfiguration.
   303  func (aphc AzureProcessHostingConfiguration) AsProcessHostingConfiguration() (*ProcessHostingConfiguration, bool) {
   304  	return nil, false
   305  }
   306  
   307  // AsBasicProcessHostingConfiguration is the BasicProcessHostingConfiguration implementation for AzureProcessHostingConfiguration.
   308  func (aphc AzureProcessHostingConfiguration) AsBasicProcessHostingConfiguration() (BasicProcessHostingConfiguration, bool) {
   309  	return &aphc, true
   310  }
   311  
   312  // AzureServiceFabricClusterConfiguration describes an Azure Service Fabric Cluster
   313  type AzureServiceFabricClusterConfiguration struct {
   314  	// Name - Service Fabric cluster name.
   315  	Name *string `json:"name,omitempty"`
   316  	// ClusterID - Service Fabric cluster identifier.
   317  	ClusterID *string `json:"clusterId,omitempty"`
   318  }
   319  
   320  // AzureVMScaleSetConfiguration describes an Azure Virtual Machine Scale Set
   321  type AzureVMScaleSetConfiguration struct {
   322  	// Name - Virtual Machine Scale Set name
   323  	Name *string `json:"name,omitempty"`
   324  	// InstanceID - Virtual Machine Scale Set instance identifier
   325  	InstanceID *string `json:"instanceId,omitempty"`
   326  	// Deployment - Virtual Machine Scale Set deployment identifier
   327  	Deployment *string `json:"deployment,omitempty"`
   328  	// ResourceID - Unique identifier of the resource.
   329  	ResourceID *string `json:"resourceId,omitempty"`
   330  }
   331  
   332  // ClientGroup represents a collection of clients of a resource. A client group can represent the clients
   333  // of a port, process, or a machine.
   334  type ClientGroup struct {
   335  	autorest.Response `json:"-"`
   336  	// ClientGroupProperties - Resource properties.
   337  	*ClientGroupProperties `json:"properties,omitempty"`
   338  	// Etag - Resource ETAG.
   339  	Etag *string `json:"etag,omitempty"`
   340  	// ID - READ-ONLY; Resource identifier.
   341  	ID *string `json:"id,omitempty"`
   342  	// Type - READ-ONLY; Resource type.
   343  	Type *string `json:"type,omitempty"`
   344  	// Name - READ-ONLY; Resource name.
   345  	Name *string `json:"name,omitempty"`
   346  	// Kind - Possible values include: 'KindCoreResource', 'KindMachine', 'KindProcess', 'KindPort', 'KindClientGroup', 'KindMachineGroup'
   347  	Kind KindBasicCoreResource `json:"kind,omitempty"`
   348  }
   349  
   350  // MarshalJSON is the custom marshaler for ClientGroup.
   351  func (cg ClientGroup) MarshalJSON() ([]byte, error) {
   352  	cg.Kind = KindClientGroup
   353  	objectMap := make(map[string]interface{})
   354  	if cg.ClientGroupProperties != nil {
   355  		objectMap["properties"] = cg.ClientGroupProperties
   356  	}
   357  	if cg.Etag != nil {
   358  		objectMap["etag"] = cg.Etag
   359  	}
   360  	if cg.Kind != "" {
   361  		objectMap["kind"] = cg.Kind
   362  	}
   363  	return json.Marshal(objectMap)
   364  }
   365  
   366  // AsMachine is the BasicCoreResource implementation for ClientGroup.
   367  func (cg ClientGroup) AsMachine() (*Machine, bool) {
   368  	return nil, false
   369  }
   370  
   371  // AsProcess is the BasicCoreResource implementation for ClientGroup.
   372  func (cg ClientGroup) AsProcess() (*Process, bool) {
   373  	return nil, false
   374  }
   375  
   376  // AsPort is the BasicCoreResource implementation for ClientGroup.
   377  func (cg ClientGroup) AsPort() (*Port, bool) {
   378  	return nil, false
   379  }
   380  
   381  // AsClientGroup is the BasicCoreResource implementation for ClientGroup.
   382  func (cg ClientGroup) AsClientGroup() (*ClientGroup, bool) {
   383  	return &cg, true
   384  }
   385  
   386  // AsMachineGroup is the BasicCoreResource implementation for ClientGroup.
   387  func (cg ClientGroup) AsMachineGroup() (*MachineGroup, bool) {
   388  	return nil, false
   389  }
   390  
   391  // AsCoreResource is the BasicCoreResource implementation for ClientGroup.
   392  func (cg ClientGroup) AsCoreResource() (*CoreResource, bool) {
   393  	return nil, false
   394  }
   395  
   396  // AsBasicCoreResource is the BasicCoreResource implementation for ClientGroup.
   397  func (cg ClientGroup) AsBasicCoreResource() (BasicCoreResource, bool) {
   398  	return &cg, true
   399  }
   400  
   401  // UnmarshalJSON is the custom unmarshaler for ClientGroup struct.
   402  func (cg *ClientGroup) UnmarshalJSON(body []byte) error {
   403  	var m map[string]*json.RawMessage
   404  	err := json.Unmarshal(body, &m)
   405  	if err != nil {
   406  		return err
   407  	}
   408  	for k, v := range m {
   409  		switch k {
   410  		case "properties":
   411  			if v != nil {
   412  				var clientGroupProperties ClientGroupProperties
   413  				err = json.Unmarshal(*v, &clientGroupProperties)
   414  				if err != nil {
   415  					return err
   416  				}
   417  				cg.ClientGroupProperties = &clientGroupProperties
   418  			}
   419  		case "etag":
   420  			if v != nil {
   421  				var etag string
   422  				err = json.Unmarshal(*v, &etag)
   423  				if err != nil {
   424  					return err
   425  				}
   426  				cg.Etag = &etag
   427  			}
   428  		case "kind":
   429  			if v != nil {
   430  				var kind KindBasicCoreResource
   431  				err = json.Unmarshal(*v, &kind)
   432  				if err != nil {
   433  					return err
   434  				}
   435  				cg.Kind = kind
   436  			}
   437  		case "id":
   438  			if v != nil {
   439  				var ID string
   440  				err = json.Unmarshal(*v, &ID)
   441  				if err != nil {
   442  					return err
   443  				}
   444  				cg.ID = &ID
   445  			}
   446  		case "type":
   447  			if v != nil {
   448  				var typeVar string
   449  				err = json.Unmarshal(*v, &typeVar)
   450  				if err != nil {
   451  					return err
   452  				}
   453  				cg.Type = &typeVar
   454  			}
   455  		case "name":
   456  			if v != nil {
   457  				var name string
   458  				err = json.Unmarshal(*v, &name)
   459  				if err != nil {
   460  					return err
   461  				}
   462  				cg.Name = &name
   463  			}
   464  		}
   465  	}
   466  
   467  	return nil
   468  }
   469  
   470  // ClientGroupMember represents a member of a client group
   471  type ClientGroupMember struct {
   472  	// ClientGroupMemberProperties - Resource properties.
   473  	*ClientGroupMemberProperties `json:"properties,omitempty"`
   474  	// ID - READ-ONLY; Resource identifier.
   475  	ID *string `json:"id,omitempty"`
   476  	// Type - READ-ONLY; Resource type.
   477  	Type *string `json:"type,omitempty"`
   478  	// Name - READ-ONLY; Resource name.
   479  	Name *string `json:"name,omitempty"`
   480  }
   481  
   482  // MarshalJSON is the custom marshaler for ClientGroupMember.
   483  func (cgm ClientGroupMember) MarshalJSON() ([]byte, error) {
   484  	objectMap := make(map[string]interface{})
   485  	if cgm.ClientGroupMemberProperties != nil {
   486  		objectMap["properties"] = cgm.ClientGroupMemberProperties
   487  	}
   488  	return json.Marshal(objectMap)
   489  }
   490  
   491  // UnmarshalJSON is the custom unmarshaler for ClientGroupMember struct.
   492  func (cgm *ClientGroupMember) UnmarshalJSON(body []byte) error {
   493  	var m map[string]*json.RawMessage
   494  	err := json.Unmarshal(body, &m)
   495  	if err != nil {
   496  		return err
   497  	}
   498  	for k, v := range m {
   499  		switch k {
   500  		case "properties":
   501  			if v != nil {
   502  				var clientGroupMemberProperties ClientGroupMemberProperties
   503  				err = json.Unmarshal(*v, &clientGroupMemberProperties)
   504  				if err != nil {
   505  					return err
   506  				}
   507  				cgm.ClientGroupMemberProperties = &clientGroupMemberProperties
   508  			}
   509  		case "id":
   510  			if v != nil {
   511  				var ID string
   512  				err = json.Unmarshal(*v, &ID)
   513  				if err != nil {
   514  					return err
   515  				}
   516  				cgm.ID = &ID
   517  			}
   518  		case "type":
   519  			if v != nil {
   520  				var typeVar string
   521  				err = json.Unmarshal(*v, &typeVar)
   522  				if err != nil {
   523  					return err
   524  				}
   525  				cgm.Type = &typeVar
   526  			}
   527  		case "name":
   528  			if v != nil {
   529  				var name string
   530  				err = json.Unmarshal(*v, &name)
   531  				if err != nil {
   532  					return err
   533  				}
   534  				cgm.Name = &name
   535  			}
   536  		}
   537  	}
   538  
   539  	return nil
   540  }
   541  
   542  // ClientGroupMemberProperties resource properties.
   543  type ClientGroupMemberProperties struct {
   544  	// IPAddress - IP address.
   545  	IPAddress *string `json:"ipAddress,omitempty"`
   546  	// Port - Port into which this client connected
   547  	Port *PortReference `json:"port,omitempty"`
   548  	// Processes - Processes accepting on the above port that received connections from this client.
   549  	Processes *[]ProcessReference `json:"processes,omitempty"`
   550  }
   551  
   552  // ClientGroupMembersCollection collection of ClientGroupMember resources.
   553  type ClientGroupMembersCollection struct {
   554  	autorest.Response `json:"-"`
   555  	// Value - Collection of ClientGroupMember resources.
   556  	Value *[]ClientGroupMember `json:"value,omitempty"`
   557  	// NextLink - The URL to the next set of resources.
   558  	NextLink *string `json:"nextLink,omitempty"`
   559  }
   560  
   561  // ClientGroupMembersCollectionIterator provides access to a complete listing of ClientGroupMember values.
   562  type ClientGroupMembersCollectionIterator struct {
   563  	i    int
   564  	page ClientGroupMembersCollectionPage
   565  }
   566  
   567  // NextWithContext advances to the next value.  If there was an error making
   568  // the request the iterator does not advance and the error is returned.
   569  func (iter *ClientGroupMembersCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   570  	if tracing.IsEnabled() {
   571  		ctx = tracing.StartSpan(ctx, fqdn+"/ClientGroupMembersCollectionIterator.NextWithContext")
   572  		defer func() {
   573  			sc := -1
   574  			if iter.Response().Response.Response != nil {
   575  				sc = iter.Response().Response.Response.StatusCode
   576  			}
   577  			tracing.EndSpan(ctx, sc, err)
   578  		}()
   579  	}
   580  	iter.i++
   581  	if iter.i < len(iter.page.Values()) {
   582  		return nil
   583  	}
   584  	err = iter.page.NextWithContext(ctx)
   585  	if err != nil {
   586  		iter.i--
   587  		return err
   588  	}
   589  	iter.i = 0
   590  	return nil
   591  }
   592  
   593  // Next advances to the next value.  If there was an error making
   594  // the request the iterator does not advance and the error is returned.
   595  // Deprecated: Use NextWithContext() instead.
   596  func (iter *ClientGroupMembersCollectionIterator) Next() error {
   597  	return iter.NextWithContext(context.Background())
   598  }
   599  
   600  // NotDone returns true if the enumeration should be started or is not yet complete.
   601  func (iter ClientGroupMembersCollectionIterator) NotDone() bool {
   602  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   603  }
   604  
   605  // Response returns the raw server response from the last page request.
   606  func (iter ClientGroupMembersCollectionIterator) Response() ClientGroupMembersCollection {
   607  	return iter.page.Response()
   608  }
   609  
   610  // Value returns the current value or a zero-initialized value if the
   611  // iterator has advanced beyond the end of the collection.
   612  func (iter ClientGroupMembersCollectionIterator) Value() ClientGroupMember {
   613  	if !iter.page.NotDone() {
   614  		return ClientGroupMember{}
   615  	}
   616  	return iter.page.Values()[iter.i]
   617  }
   618  
   619  // Creates a new instance of the ClientGroupMembersCollectionIterator type.
   620  func NewClientGroupMembersCollectionIterator(page ClientGroupMembersCollectionPage) ClientGroupMembersCollectionIterator {
   621  	return ClientGroupMembersCollectionIterator{page: page}
   622  }
   623  
   624  // IsEmpty returns true if the ListResult contains no values.
   625  func (cgmc ClientGroupMembersCollection) IsEmpty() bool {
   626  	return cgmc.Value == nil || len(*cgmc.Value) == 0
   627  }
   628  
   629  // hasNextLink returns true if the NextLink is not empty.
   630  func (cgmc ClientGroupMembersCollection) hasNextLink() bool {
   631  	return cgmc.NextLink != nil && len(*cgmc.NextLink) != 0
   632  }
   633  
   634  // clientGroupMembersCollectionPreparer prepares a request to retrieve the next set of results.
   635  // It returns nil if no more results exist.
   636  func (cgmc ClientGroupMembersCollection) clientGroupMembersCollectionPreparer(ctx context.Context) (*http.Request, error) {
   637  	if !cgmc.hasNextLink() {
   638  		return nil, nil
   639  	}
   640  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
   641  		autorest.AsJSON(),
   642  		autorest.AsGet(),
   643  		autorest.WithBaseURL(to.String(cgmc.NextLink)))
   644  }
   645  
   646  // ClientGroupMembersCollectionPage contains a page of ClientGroupMember values.
   647  type ClientGroupMembersCollectionPage struct {
   648  	fn   func(context.Context, ClientGroupMembersCollection) (ClientGroupMembersCollection, error)
   649  	cgmc ClientGroupMembersCollection
   650  }
   651  
   652  // NextWithContext advances to the next page of values.  If there was an error making
   653  // the request the page does not advance and the error is returned.
   654  func (page *ClientGroupMembersCollectionPage) NextWithContext(ctx context.Context) (err error) {
   655  	if tracing.IsEnabled() {
   656  		ctx = tracing.StartSpan(ctx, fqdn+"/ClientGroupMembersCollectionPage.NextWithContext")
   657  		defer func() {
   658  			sc := -1
   659  			if page.Response().Response.Response != nil {
   660  				sc = page.Response().Response.Response.StatusCode
   661  			}
   662  			tracing.EndSpan(ctx, sc, err)
   663  		}()
   664  	}
   665  	for {
   666  		next, err := page.fn(ctx, page.cgmc)
   667  		if err != nil {
   668  			return err
   669  		}
   670  		page.cgmc = next
   671  		if !next.hasNextLink() || !next.IsEmpty() {
   672  			break
   673  		}
   674  	}
   675  	return nil
   676  }
   677  
   678  // Next advances to the next page of values.  If there was an error making
   679  // the request the page does not advance and the error is returned.
   680  // Deprecated: Use NextWithContext() instead.
   681  func (page *ClientGroupMembersCollectionPage) Next() error {
   682  	return page.NextWithContext(context.Background())
   683  }
   684  
   685  // NotDone returns true if the page enumeration should be started or is not yet complete.
   686  func (page ClientGroupMembersCollectionPage) NotDone() bool {
   687  	return !page.cgmc.IsEmpty()
   688  }
   689  
   690  // Response returns the raw server response from the last page request.
   691  func (page ClientGroupMembersCollectionPage) Response() ClientGroupMembersCollection {
   692  	return page.cgmc
   693  }
   694  
   695  // Values returns the slice of values for the current page or nil if there are no values.
   696  func (page ClientGroupMembersCollectionPage) Values() []ClientGroupMember {
   697  	if page.cgmc.IsEmpty() {
   698  		return nil
   699  	}
   700  	return *page.cgmc.Value
   701  }
   702  
   703  // Creates a new instance of the ClientGroupMembersCollectionPage type.
   704  func NewClientGroupMembersCollectionPage(cur ClientGroupMembersCollection, getNextPage func(context.Context, ClientGroupMembersCollection) (ClientGroupMembersCollection, error)) ClientGroupMembersCollectionPage {
   705  	return ClientGroupMembersCollectionPage{
   706  		fn:   getNextPage,
   707  		cgmc: cur,
   708  	}
   709  }
   710  
   711  // ClientGroupMembersCount specifies the number of members in a client group.
   712  type ClientGroupMembersCount struct {
   713  	autorest.Response `json:"-"`
   714  	// StartTime - Membership interval start time.
   715  	StartTime *date.Time `json:"startTime,omitempty"`
   716  	// EndTime - Membership interval start time.
   717  	EndTime *date.Time `json:"endTime,omitempty"`
   718  	// GroupID - Client Group URI.
   719  	GroupID *string `json:"groupId,omitempty"`
   720  	// Count - Number of members in the client group. Use this value together with the value of ```accuracy```. If accuracy is `exact` then the value represents the actual number of members in the cloud. When accuracy is `estimated`, the actual number of members is larger than the value of ```count```.
   721  	Count *int32 `json:"count,omitempty"`
   722  	// Accuracy - Accuracy of the reported count. Possible values include: 'Actual', 'Estimated'
   723  	Accuracy Accuracy `json:"accuracy,omitempty"`
   724  }
   725  
   726  // ClientGroupProperties resource properties.
   727  type ClientGroupProperties struct {
   728  	// ClientsOf - Reference to the resource whose clients are represented by this group.
   729  	ClientsOf BasicResourceReference `json:"clientsOf,omitempty"`
   730  }
   731  
   732  // UnmarshalJSON is the custom unmarshaler for ClientGroupProperties struct.
   733  func (cg *ClientGroupProperties) UnmarshalJSON(body []byte) error {
   734  	var m map[string]*json.RawMessage
   735  	err := json.Unmarshal(body, &m)
   736  	if err != nil {
   737  		return err
   738  	}
   739  	for k, v := range m {
   740  		switch k {
   741  		case "clientsOf":
   742  			if v != nil {
   743  				clientsOf, err := unmarshalBasicResourceReference(*v)
   744  				if err != nil {
   745  					return err
   746  				}
   747  				cg.ClientsOf = clientsOf
   748  			}
   749  		}
   750  	}
   751  
   752  	return nil
   753  }
   754  
   755  // ClientGroupReference reference to a client group.
   756  type ClientGroupReference struct {
   757  	// ID - Resource URI.
   758  	ID *string `json:"id,omitempty"`
   759  	// Type - READ-ONLY; Resource type qualifier.
   760  	Type *string `json:"type,omitempty"`
   761  	// Name - READ-ONLY; Resource name.
   762  	Name *string `json:"name,omitempty"`
   763  	// Kind - Possible values include: 'KindResourceReference', 'KindRefmachine', 'KindRefprocess', 'KindRefport', 'KindRefmachinewithhints', 'KindRefclientgroup'
   764  	Kind Kind `json:"kind,omitempty"`
   765  }
   766  
   767  // MarshalJSON is the custom marshaler for ClientGroupReference.
   768  func (cgr ClientGroupReference) MarshalJSON() ([]byte, error) {
   769  	cgr.Kind = KindRefclientgroup
   770  	objectMap := make(map[string]interface{})
   771  	if cgr.ID != nil {
   772  		objectMap["id"] = cgr.ID
   773  	}
   774  	if cgr.Kind != "" {
   775  		objectMap["kind"] = cgr.Kind
   776  	}
   777  	return json.Marshal(objectMap)
   778  }
   779  
   780  // AsMachineReference is the BasicResourceReference implementation for ClientGroupReference.
   781  func (cgr ClientGroupReference) AsMachineReference() (*MachineReference, bool) {
   782  	return nil, false
   783  }
   784  
   785  // AsProcessReference is the BasicResourceReference implementation for ClientGroupReference.
   786  func (cgr ClientGroupReference) AsProcessReference() (*ProcessReference, bool) {
   787  	return nil, false
   788  }
   789  
   790  // AsPortReference is the BasicResourceReference implementation for ClientGroupReference.
   791  func (cgr ClientGroupReference) AsPortReference() (*PortReference, bool) {
   792  	return nil, false
   793  }
   794  
   795  // AsMachineReferenceWithHints is the BasicResourceReference implementation for ClientGroupReference.
   796  func (cgr ClientGroupReference) AsMachineReferenceWithHints() (*MachineReferenceWithHints, bool) {
   797  	return nil, false
   798  }
   799  
   800  // AsClientGroupReference is the BasicResourceReference implementation for ClientGroupReference.
   801  func (cgr ClientGroupReference) AsClientGroupReference() (*ClientGroupReference, bool) {
   802  	return &cgr, true
   803  }
   804  
   805  // AsResourceReference is the BasicResourceReference implementation for ClientGroupReference.
   806  func (cgr ClientGroupReference) AsResourceReference() (*ResourceReference, bool) {
   807  	return nil, false
   808  }
   809  
   810  // AsBasicResourceReference is the BasicResourceReference implementation for ClientGroupReference.
   811  func (cgr ClientGroupReference) AsBasicResourceReference() (BasicResourceReference, bool) {
   812  	return &cgr, true
   813  }
   814  
   815  // Connection a network connection.
   816  type Connection struct {
   817  	*ConnectionProperties `json:"properties,omitempty"`
   818  	// Kind - Possible values include: 'KindRelationship', 'KindRelconnection', 'KindRelacceptor'
   819  	Kind KindBasicRelationship `json:"kind,omitempty"`
   820  	// ID - READ-ONLY; Resource identifier.
   821  	ID *string `json:"id,omitempty"`
   822  	// Type - READ-ONLY; Resource type.
   823  	Type *string `json:"type,omitempty"`
   824  	// Name - READ-ONLY; Resource name.
   825  	Name *string `json:"name,omitempty"`
   826  }
   827  
   828  // MarshalJSON is the custom marshaler for Connection.
   829  func (c Connection) MarshalJSON() ([]byte, error) {
   830  	c.Kind = KindRelconnection
   831  	objectMap := make(map[string]interface{})
   832  	if c.ConnectionProperties != nil {
   833  		objectMap["properties"] = c.ConnectionProperties
   834  	}
   835  	if c.Kind != "" {
   836  		objectMap["kind"] = c.Kind
   837  	}
   838  	return json.Marshal(objectMap)
   839  }
   840  
   841  // AsConnection is the BasicRelationship implementation for Connection.
   842  func (c Connection) AsConnection() (*Connection, bool) {
   843  	return &c, true
   844  }
   845  
   846  // AsAcceptor is the BasicRelationship implementation for Connection.
   847  func (c Connection) AsAcceptor() (*Acceptor, bool) {
   848  	return nil, false
   849  }
   850  
   851  // AsRelationship is the BasicRelationship implementation for Connection.
   852  func (c Connection) AsRelationship() (*Relationship, bool) {
   853  	return nil, false
   854  }
   855  
   856  // AsBasicRelationship is the BasicRelationship implementation for Connection.
   857  func (c Connection) AsBasicRelationship() (BasicRelationship, bool) {
   858  	return &c, true
   859  }
   860  
   861  // UnmarshalJSON is the custom unmarshaler for Connection struct.
   862  func (c *Connection) UnmarshalJSON(body []byte) error {
   863  	var m map[string]*json.RawMessage
   864  	err := json.Unmarshal(body, &m)
   865  	if err != nil {
   866  		return err
   867  	}
   868  	for k, v := range m {
   869  		switch k {
   870  		case "properties":
   871  			if v != nil {
   872  				var connectionProperties ConnectionProperties
   873  				err = json.Unmarshal(*v, &connectionProperties)
   874  				if err != nil {
   875  					return err
   876  				}
   877  				c.ConnectionProperties = &connectionProperties
   878  			}
   879  		case "kind":
   880  			if v != nil {
   881  				var kind KindBasicRelationship
   882  				err = json.Unmarshal(*v, &kind)
   883  				if err != nil {
   884  					return err
   885  				}
   886  				c.Kind = kind
   887  			}
   888  		case "id":
   889  			if v != nil {
   890  				var ID string
   891  				err = json.Unmarshal(*v, &ID)
   892  				if err != nil {
   893  					return err
   894  				}
   895  				c.ID = &ID
   896  			}
   897  		case "type":
   898  			if v != nil {
   899  				var typeVar string
   900  				err = json.Unmarshal(*v, &typeVar)
   901  				if err != nil {
   902  					return err
   903  				}
   904  				c.Type = &typeVar
   905  			}
   906  		case "name":
   907  			if v != nil {
   908  				var name string
   909  				err = json.Unmarshal(*v, &name)
   910  				if err != nil {
   911  					return err
   912  				}
   913  				c.Name = &name
   914  			}
   915  		}
   916  	}
   917  
   918  	return nil
   919  }
   920  
   921  // ConnectionCollection collection of Connection resources.
   922  type ConnectionCollection struct {
   923  	autorest.Response `json:"-"`
   924  	// Value - Collection of Connection resources.
   925  	Value *[]Connection `json:"value,omitempty"`
   926  	// NextLink - The URL to the next set of resources.
   927  	NextLink *string `json:"nextLink,omitempty"`
   928  }
   929  
   930  // ConnectionCollectionIterator provides access to a complete listing of Connection values.
   931  type ConnectionCollectionIterator struct {
   932  	i    int
   933  	page ConnectionCollectionPage
   934  }
   935  
   936  // NextWithContext advances to the next value.  If there was an error making
   937  // the request the iterator does not advance and the error is returned.
   938  func (iter *ConnectionCollectionIterator) NextWithContext(ctx context.Context) (err error) {
   939  	if tracing.IsEnabled() {
   940  		ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionCollectionIterator.NextWithContext")
   941  		defer func() {
   942  			sc := -1
   943  			if iter.Response().Response.Response != nil {
   944  				sc = iter.Response().Response.Response.StatusCode
   945  			}
   946  			tracing.EndSpan(ctx, sc, err)
   947  		}()
   948  	}
   949  	iter.i++
   950  	if iter.i < len(iter.page.Values()) {
   951  		return nil
   952  	}
   953  	err = iter.page.NextWithContext(ctx)
   954  	if err != nil {
   955  		iter.i--
   956  		return err
   957  	}
   958  	iter.i = 0
   959  	return nil
   960  }
   961  
   962  // Next advances to the next value.  If there was an error making
   963  // the request the iterator does not advance and the error is returned.
   964  // Deprecated: Use NextWithContext() instead.
   965  func (iter *ConnectionCollectionIterator) Next() error {
   966  	return iter.NextWithContext(context.Background())
   967  }
   968  
   969  // NotDone returns true if the enumeration should be started or is not yet complete.
   970  func (iter ConnectionCollectionIterator) NotDone() bool {
   971  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
   972  }
   973  
   974  // Response returns the raw server response from the last page request.
   975  func (iter ConnectionCollectionIterator) Response() ConnectionCollection {
   976  	return iter.page.Response()
   977  }
   978  
   979  // Value returns the current value or a zero-initialized value if the
   980  // iterator has advanced beyond the end of the collection.
   981  func (iter ConnectionCollectionIterator) Value() Connection {
   982  	if !iter.page.NotDone() {
   983  		return Connection{}
   984  	}
   985  	return iter.page.Values()[iter.i]
   986  }
   987  
   988  // Creates a new instance of the ConnectionCollectionIterator type.
   989  func NewConnectionCollectionIterator(page ConnectionCollectionPage) ConnectionCollectionIterator {
   990  	return ConnectionCollectionIterator{page: page}
   991  }
   992  
   993  // IsEmpty returns true if the ListResult contains no values.
   994  func (cc ConnectionCollection) IsEmpty() bool {
   995  	return cc.Value == nil || len(*cc.Value) == 0
   996  }
   997  
   998  // hasNextLink returns true if the NextLink is not empty.
   999  func (cc ConnectionCollection) hasNextLink() bool {
  1000  	return cc.NextLink != nil && len(*cc.NextLink) != 0
  1001  }
  1002  
  1003  // connectionCollectionPreparer prepares a request to retrieve the next set of results.
  1004  // It returns nil if no more results exist.
  1005  func (cc ConnectionCollection) connectionCollectionPreparer(ctx context.Context) (*http.Request, error) {
  1006  	if !cc.hasNextLink() {
  1007  		return nil, nil
  1008  	}
  1009  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1010  		autorest.AsJSON(),
  1011  		autorest.AsGet(),
  1012  		autorest.WithBaseURL(to.String(cc.NextLink)))
  1013  }
  1014  
  1015  // ConnectionCollectionPage contains a page of Connection values.
  1016  type ConnectionCollectionPage struct {
  1017  	fn func(context.Context, ConnectionCollection) (ConnectionCollection, error)
  1018  	cc ConnectionCollection
  1019  }
  1020  
  1021  // NextWithContext advances to the next page of values.  If there was an error making
  1022  // the request the page does not advance and the error is returned.
  1023  func (page *ConnectionCollectionPage) NextWithContext(ctx context.Context) (err error) {
  1024  	if tracing.IsEnabled() {
  1025  		ctx = tracing.StartSpan(ctx, fqdn+"/ConnectionCollectionPage.NextWithContext")
  1026  		defer func() {
  1027  			sc := -1
  1028  			if page.Response().Response.Response != nil {
  1029  				sc = page.Response().Response.Response.StatusCode
  1030  			}
  1031  			tracing.EndSpan(ctx, sc, err)
  1032  		}()
  1033  	}
  1034  	for {
  1035  		next, err := page.fn(ctx, page.cc)
  1036  		if err != nil {
  1037  			return err
  1038  		}
  1039  		page.cc = next
  1040  		if !next.hasNextLink() || !next.IsEmpty() {
  1041  			break
  1042  		}
  1043  	}
  1044  	return nil
  1045  }
  1046  
  1047  // Next advances to the next page of values.  If there was an error making
  1048  // the request the page does not advance and the error is returned.
  1049  // Deprecated: Use NextWithContext() instead.
  1050  func (page *ConnectionCollectionPage) Next() error {
  1051  	return page.NextWithContext(context.Background())
  1052  }
  1053  
  1054  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1055  func (page ConnectionCollectionPage) NotDone() bool {
  1056  	return !page.cc.IsEmpty()
  1057  }
  1058  
  1059  // Response returns the raw server response from the last page request.
  1060  func (page ConnectionCollectionPage) Response() ConnectionCollection {
  1061  	return page.cc
  1062  }
  1063  
  1064  // Values returns the slice of values for the current page or nil if there are no values.
  1065  func (page ConnectionCollectionPage) Values() []Connection {
  1066  	if page.cc.IsEmpty() {
  1067  		return nil
  1068  	}
  1069  	return *page.cc.Value
  1070  }
  1071  
  1072  // Creates a new instance of the ConnectionCollectionPage type.
  1073  func NewConnectionCollectionPage(cur ConnectionCollection, getNextPage func(context.Context, ConnectionCollection) (ConnectionCollection, error)) ConnectionCollectionPage {
  1074  	return ConnectionCollectionPage{
  1075  		fn: getNextPage,
  1076  		cc: cur,
  1077  	}
  1078  }
  1079  
  1080  // ConnectionProperties properties for a connection resource.
  1081  type ConnectionProperties struct {
  1082  	// ServerPort - Reference to the server port via which this connection has been established.
  1083  	ServerPort *PortReference `json:"serverPort,omitempty"`
  1084  	// FailureState - Specifies whether there are only successful, failed or a mixture of both connections represented by this resource. Possible values include: 'Ok', 'Failed', 'Mixed'
  1085  	FailureState ConnectionFailureState `json:"failureState,omitempty"`
  1086  	// Source - Source resource of the relationship.
  1087  	Source BasicResourceReference `json:"source,omitempty"`
  1088  	// Destination - Destination resource of the relationship.
  1089  	Destination BasicResourceReference `json:"destination,omitempty"`
  1090  	// StartTime - Relationship start time.
  1091  	StartTime *date.Time `json:"startTime,omitempty"`
  1092  	// EndTime - Relationship end time.
  1093  	EndTime *date.Time `json:"endTime,omitempty"`
  1094  }
  1095  
  1096  // UnmarshalJSON is the custom unmarshaler for ConnectionProperties struct.
  1097  func (cp *ConnectionProperties) UnmarshalJSON(body []byte) error {
  1098  	var m map[string]*json.RawMessage
  1099  	err := json.Unmarshal(body, &m)
  1100  	if err != nil {
  1101  		return err
  1102  	}
  1103  	for k, v := range m {
  1104  		switch k {
  1105  		case "serverPort":
  1106  			if v != nil {
  1107  				var serverPort PortReference
  1108  				err = json.Unmarshal(*v, &serverPort)
  1109  				if err != nil {
  1110  					return err
  1111  				}
  1112  				cp.ServerPort = &serverPort
  1113  			}
  1114  		case "failureState":
  1115  			if v != nil {
  1116  				var failureState ConnectionFailureState
  1117  				err = json.Unmarshal(*v, &failureState)
  1118  				if err != nil {
  1119  					return err
  1120  				}
  1121  				cp.FailureState = failureState
  1122  			}
  1123  		case "source":
  1124  			if v != nil {
  1125  				source, err := unmarshalBasicResourceReference(*v)
  1126  				if err != nil {
  1127  					return err
  1128  				}
  1129  				cp.Source = source
  1130  			}
  1131  		case "destination":
  1132  			if v != nil {
  1133  				destination, err := unmarshalBasicResourceReference(*v)
  1134  				if err != nil {
  1135  					return err
  1136  				}
  1137  				cp.Destination = destination
  1138  			}
  1139  		case "startTime":
  1140  			if v != nil {
  1141  				var startTime date.Time
  1142  				err = json.Unmarshal(*v, &startTime)
  1143  				if err != nil {
  1144  					return err
  1145  				}
  1146  				cp.StartTime = &startTime
  1147  			}
  1148  		case "endTime":
  1149  			if v != nil {
  1150  				var endTime date.Time
  1151  				err = json.Unmarshal(*v, &endTime)
  1152  				if err != nil {
  1153  					return err
  1154  				}
  1155  				cp.EndTime = &endTime
  1156  			}
  1157  		}
  1158  	}
  1159  
  1160  	return nil
  1161  }
  1162  
  1163  // BasicCoreResource marker resource for the core Service Map resources
  1164  type BasicCoreResource interface {
  1165  	AsMachine() (*Machine, bool)
  1166  	AsProcess() (*Process, bool)
  1167  	AsPort() (*Port, bool)
  1168  	AsClientGroup() (*ClientGroup, bool)
  1169  	AsMachineGroup() (*MachineGroup, bool)
  1170  	AsCoreResource() (*CoreResource, bool)
  1171  }
  1172  
  1173  // CoreResource marker resource for the core Service Map resources
  1174  type CoreResource struct {
  1175  	// Etag - Resource ETAG.
  1176  	Etag *string `json:"etag,omitempty"`
  1177  	// Kind - Possible values include: 'KindCoreResource', 'KindMachine', 'KindProcess', 'KindPort', 'KindClientGroup', 'KindMachineGroup'
  1178  	Kind KindBasicCoreResource `json:"kind,omitempty"`
  1179  	// ID - READ-ONLY; Resource identifier.
  1180  	ID *string `json:"id,omitempty"`
  1181  	// Type - READ-ONLY; Resource type.
  1182  	Type *string `json:"type,omitempty"`
  1183  	// Name - READ-ONLY; Resource name.
  1184  	Name *string `json:"name,omitempty"`
  1185  }
  1186  
  1187  func unmarshalBasicCoreResource(body []byte) (BasicCoreResource, error) {
  1188  	var m map[string]interface{}
  1189  	err := json.Unmarshal(body, &m)
  1190  	if err != nil {
  1191  		return nil, err
  1192  	}
  1193  
  1194  	switch m["kind"] {
  1195  	case string(KindMachine):
  1196  		var mVar Machine
  1197  		err := json.Unmarshal(body, &mVar)
  1198  		return mVar, err
  1199  	case string(KindProcess):
  1200  		var p Process
  1201  		err := json.Unmarshal(body, &p)
  1202  		return p, err
  1203  	case string(KindPort):
  1204  		var p Port
  1205  		err := json.Unmarshal(body, &p)
  1206  		return p, err
  1207  	case string(KindClientGroup):
  1208  		var cg ClientGroup
  1209  		err := json.Unmarshal(body, &cg)
  1210  		return cg, err
  1211  	case string(KindMachineGroup):
  1212  		var mg MachineGroup
  1213  		err := json.Unmarshal(body, &mg)
  1214  		return mg, err
  1215  	default:
  1216  		var cr CoreResource
  1217  		err := json.Unmarshal(body, &cr)
  1218  		return cr, err
  1219  	}
  1220  }
  1221  func unmarshalBasicCoreResourceArray(body []byte) ([]BasicCoreResource, error) {
  1222  	var rawMessages []*json.RawMessage
  1223  	err := json.Unmarshal(body, &rawMessages)
  1224  	if err != nil {
  1225  		return nil, err
  1226  	}
  1227  
  1228  	crArray := make([]BasicCoreResource, len(rawMessages))
  1229  
  1230  	for index, rawMessage := range rawMessages {
  1231  		cr, err := unmarshalBasicCoreResource(*rawMessage)
  1232  		if err != nil {
  1233  			return nil, err
  1234  		}
  1235  		crArray[index] = cr
  1236  	}
  1237  	return crArray, nil
  1238  }
  1239  
  1240  // MarshalJSON is the custom marshaler for CoreResource.
  1241  func (cr CoreResource) MarshalJSON() ([]byte, error) {
  1242  	cr.Kind = KindCoreResource
  1243  	objectMap := make(map[string]interface{})
  1244  	if cr.Etag != nil {
  1245  		objectMap["etag"] = cr.Etag
  1246  	}
  1247  	if cr.Kind != "" {
  1248  		objectMap["kind"] = cr.Kind
  1249  	}
  1250  	return json.Marshal(objectMap)
  1251  }
  1252  
  1253  // AsMachine is the BasicCoreResource implementation for CoreResource.
  1254  func (cr CoreResource) AsMachine() (*Machine, bool) {
  1255  	return nil, false
  1256  }
  1257  
  1258  // AsProcess is the BasicCoreResource implementation for CoreResource.
  1259  func (cr CoreResource) AsProcess() (*Process, bool) {
  1260  	return nil, false
  1261  }
  1262  
  1263  // AsPort is the BasicCoreResource implementation for CoreResource.
  1264  func (cr CoreResource) AsPort() (*Port, bool) {
  1265  	return nil, false
  1266  }
  1267  
  1268  // AsClientGroup is the BasicCoreResource implementation for CoreResource.
  1269  func (cr CoreResource) AsClientGroup() (*ClientGroup, bool) {
  1270  	return nil, false
  1271  }
  1272  
  1273  // AsMachineGroup is the BasicCoreResource implementation for CoreResource.
  1274  func (cr CoreResource) AsMachineGroup() (*MachineGroup, bool) {
  1275  	return nil, false
  1276  }
  1277  
  1278  // AsCoreResource is the BasicCoreResource implementation for CoreResource.
  1279  func (cr CoreResource) AsCoreResource() (*CoreResource, bool) {
  1280  	return &cr, true
  1281  }
  1282  
  1283  // AsBasicCoreResource is the BasicCoreResource implementation for CoreResource.
  1284  func (cr CoreResource) AsBasicCoreResource() (BasicCoreResource, bool) {
  1285  	return &cr, true
  1286  }
  1287  
  1288  // Error error details.
  1289  type Error struct {
  1290  	// Code - Error code identifying the specific error.
  1291  	Code *string `json:"code,omitempty"`
  1292  	// Message - Error message in the caller's locale.
  1293  	Message *string `json:"message,omitempty"`
  1294  }
  1295  
  1296  // ErrorResponse an error response from the API.
  1297  type ErrorResponse struct {
  1298  	// Error - Error information.
  1299  	Error *Error `json:"error,omitempty"`
  1300  }
  1301  
  1302  // BasicHostingConfiguration describes the hosting configuration of a machine.
  1303  type BasicHostingConfiguration interface {
  1304  	AsAzureHostingConfiguration() (*AzureHostingConfiguration, bool)
  1305  	AsHostingConfiguration() (*HostingConfiguration, bool)
  1306  }
  1307  
  1308  // HostingConfiguration describes the hosting configuration of a machine.
  1309  type HostingConfiguration struct {
  1310  	// Provider - The hosting provider of the VM. Possible values include: 'Azure'
  1311  	Provider Provider `json:"provider,omitempty"`
  1312  	// Kind - Possible values include: 'KindHostingConfiguration', 'KindProviderazure'
  1313  	Kind KindBasicHostingConfiguration `json:"kind,omitempty"`
  1314  }
  1315  
  1316  func unmarshalBasicHostingConfiguration(body []byte) (BasicHostingConfiguration, error) {
  1317  	var m map[string]interface{}
  1318  	err := json.Unmarshal(body, &m)
  1319  	if err != nil {
  1320  		return nil, err
  1321  	}
  1322  
  1323  	switch m["kind"] {
  1324  	case string(KindProviderazure):
  1325  		var ahc AzureHostingConfiguration
  1326  		err := json.Unmarshal(body, &ahc)
  1327  		return ahc, err
  1328  	default:
  1329  		var hc HostingConfiguration
  1330  		err := json.Unmarshal(body, &hc)
  1331  		return hc, err
  1332  	}
  1333  }
  1334  func unmarshalBasicHostingConfigurationArray(body []byte) ([]BasicHostingConfiguration, error) {
  1335  	var rawMessages []*json.RawMessage
  1336  	err := json.Unmarshal(body, &rawMessages)
  1337  	if err != nil {
  1338  		return nil, err
  1339  	}
  1340  
  1341  	hcArray := make([]BasicHostingConfiguration, len(rawMessages))
  1342  
  1343  	for index, rawMessage := range rawMessages {
  1344  		hc, err := unmarshalBasicHostingConfiguration(*rawMessage)
  1345  		if err != nil {
  1346  			return nil, err
  1347  		}
  1348  		hcArray[index] = hc
  1349  	}
  1350  	return hcArray, nil
  1351  }
  1352  
  1353  // MarshalJSON is the custom marshaler for HostingConfiguration.
  1354  func (hc HostingConfiguration) MarshalJSON() ([]byte, error) {
  1355  	hc.Kind = KindHostingConfiguration
  1356  	objectMap := make(map[string]interface{})
  1357  	if hc.Provider != "" {
  1358  		objectMap["provider"] = hc.Provider
  1359  	}
  1360  	if hc.Kind != "" {
  1361  		objectMap["kind"] = hc.Kind
  1362  	}
  1363  	return json.Marshal(objectMap)
  1364  }
  1365  
  1366  // AsAzureHostingConfiguration is the BasicHostingConfiguration implementation for HostingConfiguration.
  1367  func (hc HostingConfiguration) AsAzureHostingConfiguration() (*AzureHostingConfiguration, bool) {
  1368  	return nil, false
  1369  }
  1370  
  1371  // AsHostingConfiguration is the BasicHostingConfiguration implementation for HostingConfiguration.
  1372  func (hc HostingConfiguration) AsHostingConfiguration() (*HostingConfiguration, bool) {
  1373  	return &hc, true
  1374  }
  1375  
  1376  // AsBasicHostingConfiguration is the BasicHostingConfiguration implementation for HostingConfiguration.
  1377  func (hc HostingConfiguration) AsBasicHostingConfiguration() (BasicHostingConfiguration, bool) {
  1378  	return &hc, true
  1379  }
  1380  
  1381  // HypervisorConfiguration describes the hypervisor configuration of a machine.
  1382  type HypervisorConfiguration struct {
  1383  	// HypervisorType - Specifies the virtualization technology used by the hypervisor (hyperv, vmware, etc.). Possible values include: 'HypervisorTypeUnknown', 'HypervisorTypeHyperv'
  1384  	HypervisorType HypervisorType `json:"hypervisorType,omitempty"`
  1385  	// NativeHostMachineID - The unique identifier of the hypervisor machine as reported by the underlying virtualization system.
  1386  	NativeHostMachineID *string `json:"nativeHostMachineId,omitempty"`
  1387  }
  1388  
  1389  // ImageConfiguration describes the VM image of a machine.
  1390  type ImageConfiguration struct {
  1391  	// Publisher - Publisher of the VM image.
  1392  	Publisher *string `json:"publisher,omitempty"`
  1393  	// Offering - Offering of the VM image.
  1394  	Offering *string `json:"offering,omitempty"`
  1395  	// Sku - SKU of the VM image.
  1396  	Sku *string `json:"sku,omitempty"`
  1397  	// Version - Version of the VM image.
  1398  	Version *string `json:"version,omitempty"`
  1399  }
  1400  
  1401  // Ipv4NetworkInterface describes an IPv4 network interface.
  1402  type Ipv4NetworkInterface struct {
  1403  	// IPAddress - IPv4 address.
  1404  	IPAddress *string `json:"ipAddress,omitempty"`
  1405  	// SubnetMask - IPv4 subnet mask.
  1406  	SubnetMask *string `json:"subnetMask,omitempty"`
  1407  }
  1408  
  1409  // Ipv6NetworkInterface describes an IPv6 network interface.
  1410  type Ipv6NetworkInterface struct {
  1411  	// IPAddress - IPv6 address.
  1412  	IPAddress *string `json:"ipAddress,omitempty"`
  1413  }
  1414  
  1415  // Liveness specifies the contents of a check liveness response.
  1416  type Liveness struct {
  1417  	autorest.Response `json:"-"`
  1418  	// StartTime - Liveness interval start time.
  1419  	StartTime *date.Time `json:"startTime,omitempty"`
  1420  	// EndTime - Liveness interval end time.
  1421  	EndTime *date.Time `json:"endTime,omitempty"`
  1422  	// Live - `true` if the resource is live during [startTime, endTime], `false` otherwise
  1423  	Live *bool `json:"live,omitempty"`
  1424  }
  1425  
  1426  // Machine a machine resource represents a discovered computer system. It can be *monitored*, i.e., a
  1427  // Dependency Agent is running on it, or *discovered*, i.e., its existence was inferred by observing the
  1428  // data stream from monitored machines. As machines change, prior versions of the machine resource are
  1429  // preserved and available for access. A machine is live during an interval of time, if either its
  1430  // Dependency Agent has reported data during (parts) of that interval, or a Dependency agent running on
  1431  // other machines has reported activity associated with the machine.
  1432  type Machine struct {
  1433  	autorest.Response `json:"-"`
  1434  	// MachineProperties - Resource properties.
  1435  	*MachineProperties `json:"properties,omitempty"`
  1436  	// Etag - Resource ETAG.
  1437  	Etag *string `json:"etag,omitempty"`
  1438  	// Kind - Possible values include: 'KindCoreResource', 'KindMachine', 'KindProcess', 'KindPort', 'KindClientGroup', 'KindMachineGroup'
  1439  	Kind KindBasicCoreResource `json:"kind,omitempty"`
  1440  	// ID - READ-ONLY; Resource identifier.
  1441  	ID *string `json:"id,omitempty"`
  1442  	// Type - READ-ONLY; Resource type.
  1443  	Type *string `json:"type,omitempty"`
  1444  	// Name - READ-ONLY; Resource name.
  1445  	Name *string `json:"name,omitempty"`
  1446  }
  1447  
  1448  // MarshalJSON is the custom marshaler for Machine.
  1449  func (mVar Machine) MarshalJSON() ([]byte, error) {
  1450  	mVar.Kind = KindMachine
  1451  	objectMap := make(map[string]interface{})
  1452  	if mVar.MachineProperties != nil {
  1453  		objectMap["properties"] = mVar.MachineProperties
  1454  	}
  1455  	if mVar.Etag != nil {
  1456  		objectMap["etag"] = mVar.Etag
  1457  	}
  1458  	if mVar.Kind != "" {
  1459  		objectMap["kind"] = mVar.Kind
  1460  	}
  1461  	return json.Marshal(objectMap)
  1462  }
  1463  
  1464  // AsMachine is the BasicCoreResource implementation for Machine.
  1465  func (mVar Machine) AsMachine() (*Machine, bool) {
  1466  	return &mVar, true
  1467  }
  1468  
  1469  // AsProcess is the BasicCoreResource implementation for Machine.
  1470  func (mVar Machine) AsProcess() (*Process, bool) {
  1471  	return nil, false
  1472  }
  1473  
  1474  // AsPort is the BasicCoreResource implementation for Machine.
  1475  func (mVar Machine) AsPort() (*Port, bool) {
  1476  	return nil, false
  1477  }
  1478  
  1479  // AsClientGroup is the BasicCoreResource implementation for Machine.
  1480  func (mVar Machine) AsClientGroup() (*ClientGroup, bool) {
  1481  	return nil, false
  1482  }
  1483  
  1484  // AsMachineGroup is the BasicCoreResource implementation for Machine.
  1485  func (mVar Machine) AsMachineGroup() (*MachineGroup, bool) {
  1486  	return nil, false
  1487  }
  1488  
  1489  // AsCoreResource is the BasicCoreResource implementation for Machine.
  1490  func (mVar Machine) AsCoreResource() (*CoreResource, bool) {
  1491  	return nil, false
  1492  }
  1493  
  1494  // AsBasicCoreResource is the BasicCoreResource implementation for Machine.
  1495  func (mVar Machine) AsBasicCoreResource() (BasicCoreResource, bool) {
  1496  	return &mVar, true
  1497  }
  1498  
  1499  // UnmarshalJSON is the custom unmarshaler for Machine struct.
  1500  func (mVar *Machine) UnmarshalJSON(body []byte) error {
  1501  	var m map[string]*json.RawMessage
  1502  	err := json.Unmarshal(body, &m)
  1503  	if err != nil {
  1504  		return err
  1505  	}
  1506  	for k, v := range m {
  1507  		switch k {
  1508  		case "properties":
  1509  			if v != nil {
  1510  				var machineProperties MachineProperties
  1511  				err = json.Unmarshal(*v, &machineProperties)
  1512  				if err != nil {
  1513  					return err
  1514  				}
  1515  				mVar.MachineProperties = &machineProperties
  1516  			}
  1517  		case "etag":
  1518  			if v != nil {
  1519  				var etag string
  1520  				err = json.Unmarshal(*v, &etag)
  1521  				if err != nil {
  1522  					return err
  1523  				}
  1524  				mVar.Etag = &etag
  1525  			}
  1526  		case "kind":
  1527  			if v != nil {
  1528  				var kind KindBasicCoreResource
  1529  				err = json.Unmarshal(*v, &kind)
  1530  				if err != nil {
  1531  					return err
  1532  				}
  1533  				mVar.Kind = kind
  1534  			}
  1535  		case "id":
  1536  			if v != nil {
  1537  				var ID string
  1538  				err = json.Unmarshal(*v, &ID)
  1539  				if err != nil {
  1540  					return err
  1541  				}
  1542  				mVar.ID = &ID
  1543  			}
  1544  		case "type":
  1545  			if v != nil {
  1546  				var typeVar string
  1547  				err = json.Unmarshal(*v, &typeVar)
  1548  				if err != nil {
  1549  					return err
  1550  				}
  1551  				mVar.Type = &typeVar
  1552  			}
  1553  		case "name":
  1554  			if v != nil {
  1555  				var name string
  1556  				err = json.Unmarshal(*v, &name)
  1557  				if err != nil {
  1558  					return err
  1559  				}
  1560  				mVar.Name = &name
  1561  			}
  1562  		}
  1563  	}
  1564  
  1565  	return nil
  1566  }
  1567  
  1568  // MachineCollection collection of Machine resources.
  1569  type MachineCollection struct {
  1570  	autorest.Response `json:"-"`
  1571  	// Value - Collection of Machine resources.
  1572  	Value *[]Machine `json:"value,omitempty"`
  1573  	// NextLink - The URL to the next set of resources.
  1574  	NextLink *string `json:"nextLink,omitempty"`
  1575  }
  1576  
  1577  // MachineCollectionIterator provides access to a complete listing of Machine values.
  1578  type MachineCollectionIterator struct {
  1579  	i    int
  1580  	page MachineCollectionPage
  1581  }
  1582  
  1583  // NextWithContext advances to the next value.  If there was an error making
  1584  // the request the iterator does not advance and the error is returned.
  1585  func (iter *MachineCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  1586  	if tracing.IsEnabled() {
  1587  		ctx = tracing.StartSpan(ctx, fqdn+"/MachineCollectionIterator.NextWithContext")
  1588  		defer func() {
  1589  			sc := -1
  1590  			if iter.Response().Response.Response != nil {
  1591  				sc = iter.Response().Response.Response.StatusCode
  1592  			}
  1593  			tracing.EndSpan(ctx, sc, err)
  1594  		}()
  1595  	}
  1596  	iter.i++
  1597  	if iter.i < len(iter.page.Values()) {
  1598  		return nil
  1599  	}
  1600  	err = iter.page.NextWithContext(ctx)
  1601  	if err != nil {
  1602  		iter.i--
  1603  		return err
  1604  	}
  1605  	iter.i = 0
  1606  	return nil
  1607  }
  1608  
  1609  // Next advances to the next value.  If there was an error making
  1610  // the request the iterator does not advance and the error is returned.
  1611  // Deprecated: Use NextWithContext() instead.
  1612  func (iter *MachineCollectionIterator) Next() error {
  1613  	return iter.NextWithContext(context.Background())
  1614  }
  1615  
  1616  // NotDone returns true if the enumeration should be started or is not yet complete.
  1617  func (iter MachineCollectionIterator) NotDone() bool {
  1618  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1619  }
  1620  
  1621  // Response returns the raw server response from the last page request.
  1622  func (iter MachineCollectionIterator) Response() MachineCollection {
  1623  	return iter.page.Response()
  1624  }
  1625  
  1626  // Value returns the current value or a zero-initialized value if the
  1627  // iterator has advanced beyond the end of the collection.
  1628  func (iter MachineCollectionIterator) Value() Machine {
  1629  	if !iter.page.NotDone() {
  1630  		return Machine{}
  1631  	}
  1632  	return iter.page.Values()[iter.i]
  1633  }
  1634  
  1635  // Creates a new instance of the MachineCollectionIterator type.
  1636  func NewMachineCollectionIterator(page MachineCollectionPage) MachineCollectionIterator {
  1637  	return MachineCollectionIterator{page: page}
  1638  }
  1639  
  1640  // IsEmpty returns true if the ListResult contains no values.
  1641  func (mc MachineCollection) IsEmpty() bool {
  1642  	return mc.Value == nil || len(*mc.Value) == 0
  1643  }
  1644  
  1645  // hasNextLink returns true if the NextLink is not empty.
  1646  func (mc MachineCollection) hasNextLink() bool {
  1647  	return mc.NextLink != nil && len(*mc.NextLink) != 0
  1648  }
  1649  
  1650  // machineCollectionPreparer prepares a request to retrieve the next set of results.
  1651  // It returns nil if no more results exist.
  1652  func (mc MachineCollection) machineCollectionPreparer(ctx context.Context) (*http.Request, error) {
  1653  	if !mc.hasNextLink() {
  1654  		return nil, nil
  1655  	}
  1656  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1657  		autorest.AsJSON(),
  1658  		autorest.AsGet(),
  1659  		autorest.WithBaseURL(to.String(mc.NextLink)))
  1660  }
  1661  
  1662  // MachineCollectionPage contains a page of Machine values.
  1663  type MachineCollectionPage struct {
  1664  	fn func(context.Context, MachineCollection) (MachineCollection, error)
  1665  	mc MachineCollection
  1666  }
  1667  
  1668  // NextWithContext advances to the next page of values.  If there was an error making
  1669  // the request the page does not advance and the error is returned.
  1670  func (page *MachineCollectionPage) NextWithContext(ctx context.Context) (err error) {
  1671  	if tracing.IsEnabled() {
  1672  		ctx = tracing.StartSpan(ctx, fqdn+"/MachineCollectionPage.NextWithContext")
  1673  		defer func() {
  1674  			sc := -1
  1675  			if page.Response().Response.Response != nil {
  1676  				sc = page.Response().Response.Response.StatusCode
  1677  			}
  1678  			tracing.EndSpan(ctx, sc, err)
  1679  		}()
  1680  	}
  1681  	for {
  1682  		next, err := page.fn(ctx, page.mc)
  1683  		if err != nil {
  1684  			return err
  1685  		}
  1686  		page.mc = next
  1687  		if !next.hasNextLink() || !next.IsEmpty() {
  1688  			break
  1689  		}
  1690  	}
  1691  	return nil
  1692  }
  1693  
  1694  // Next advances to the next page of values.  If there was an error making
  1695  // the request the page does not advance and the error is returned.
  1696  // Deprecated: Use NextWithContext() instead.
  1697  func (page *MachineCollectionPage) Next() error {
  1698  	return page.NextWithContext(context.Background())
  1699  }
  1700  
  1701  // NotDone returns true if the page enumeration should be started or is not yet complete.
  1702  func (page MachineCollectionPage) NotDone() bool {
  1703  	return !page.mc.IsEmpty()
  1704  }
  1705  
  1706  // Response returns the raw server response from the last page request.
  1707  func (page MachineCollectionPage) Response() MachineCollection {
  1708  	return page.mc
  1709  }
  1710  
  1711  // Values returns the slice of values for the current page or nil if there are no values.
  1712  func (page MachineCollectionPage) Values() []Machine {
  1713  	if page.mc.IsEmpty() {
  1714  		return nil
  1715  	}
  1716  	return *page.mc.Value
  1717  }
  1718  
  1719  // Creates a new instance of the MachineCollectionPage type.
  1720  func NewMachineCollectionPage(cur MachineCollection, getNextPage func(context.Context, MachineCollection) (MachineCollection, error)) MachineCollectionPage {
  1721  	return MachineCollectionPage{
  1722  		fn: getNextPage,
  1723  		mc: cur,
  1724  	}
  1725  }
  1726  
  1727  // MachineCountsByOperatingSystem machines by operating system.
  1728  type MachineCountsByOperatingSystem struct {
  1729  	// Windows - Number of live Windows machines.
  1730  	Windows *int32 `json:"windows,omitempty"`
  1731  	// Linux - Number of live Linux machines.
  1732  	Linux *int32 `json:"linux,omitempty"`
  1733  }
  1734  
  1735  // MachineGroup a user-defined logical grouping of machines.
  1736  type MachineGroup struct {
  1737  	autorest.Response `json:"-"`
  1738  	// MachineGroupProperties - Resource properties.
  1739  	*MachineGroupProperties `json:"properties,omitempty"`
  1740  	// Etag - Resource ETAG.
  1741  	Etag *string `json:"etag,omitempty"`
  1742  	// Kind - Possible values include: 'KindCoreResource', 'KindMachine', 'KindProcess', 'KindPort', 'KindClientGroup', 'KindMachineGroup'
  1743  	Kind KindBasicCoreResource `json:"kind,omitempty"`
  1744  	// ID - READ-ONLY; Resource identifier.
  1745  	ID *string `json:"id,omitempty"`
  1746  	// Type - READ-ONLY; Resource type.
  1747  	Type *string `json:"type,omitempty"`
  1748  	// Name - READ-ONLY; Resource name.
  1749  	Name *string `json:"name,omitempty"`
  1750  }
  1751  
  1752  // MarshalJSON is the custom marshaler for MachineGroup.
  1753  func (mg MachineGroup) MarshalJSON() ([]byte, error) {
  1754  	mg.Kind = KindMachineGroup
  1755  	objectMap := make(map[string]interface{})
  1756  	if mg.MachineGroupProperties != nil {
  1757  		objectMap["properties"] = mg.MachineGroupProperties
  1758  	}
  1759  	if mg.Etag != nil {
  1760  		objectMap["etag"] = mg.Etag
  1761  	}
  1762  	if mg.Kind != "" {
  1763  		objectMap["kind"] = mg.Kind
  1764  	}
  1765  	return json.Marshal(objectMap)
  1766  }
  1767  
  1768  // AsMachine is the BasicCoreResource implementation for MachineGroup.
  1769  func (mg MachineGroup) AsMachine() (*Machine, bool) {
  1770  	return nil, false
  1771  }
  1772  
  1773  // AsProcess is the BasicCoreResource implementation for MachineGroup.
  1774  func (mg MachineGroup) AsProcess() (*Process, bool) {
  1775  	return nil, false
  1776  }
  1777  
  1778  // AsPort is the BasicCoreResource implementation for MachineGroup.
  1779  func (mg MachineGroup) AsPort() (*Port, bool) {
  1780  	return nil, false
  1781  }
  1782  
  1783  // AsClientGroup is the BasicCoreResource implementation for MachineGroup.
  1784  func (mg MachineGroup) AsClientGroup() (*ClientGroup, bool) {
  1785  	return nil, false
  1786  }
  1787  
  1788  // AsMachineGroup is the BasicCoreResource implementation for MachineGroup.
  1789  func (mg MachineGroup) AsMachineGroup() (*MachineGroup, bool) {
  1790  	return &mg, true
  1791  }
  1792  
  1793  // AsCoreResource is the BasicCoreResource implementation for MachineGroup.
  1794  func (mg MachineGroup) AsCoreResource() (*CoreResource, bool) {
  1795  	return nil, false
  1796  }
  1797  
  1798  // AsBasicCoreResource is the BasicCoreResource implementation for MachineGroup.
  1799  func (mg MachineGroup) AsBasicCoreResource() (BasicCoreResource, bool) {
  1800  	return &mg, true
  1801  }
  1802  
  1803  // UnmarshalJSON is the custom unmarshaler for MachineGroup struct.
  1804  func (mg *MachineGroup) UnmarshalJSON(body []byte) error {
  1805  	var m map[string]*json.RawMessage
  1806  	err := json.Unmarshal(body, &m)
  1807  	if err != nil {
  1808  		return err
  1809  	}
  1810  	for k, v := range m {
  1811  		switch k {
  1812  		case "properties":
  1813  			if v != nil {
  1814  				var machineGroupProperties MachineGroupProperties
  1815  				err = json.Unmarshal(*v, &machineGroupProperties)
  1816  				if err != nil {
  1817  					return err
  1818  				}
  1819  				mg.MachineGroupProperties = &machineGroupProperties
  1820  			}
  1821  		case "etag":
  1822  			if v != nil {
  1823  				var etag string
  1824  				err = json.Unmarshal(*v, &etag)
  1825  				if err != nil {
  1826  					return err
  1827  				}
  1828  				mg.Etag = &etag
  1829  			}
  1830  		case "kind":
  1831  			if v != nil {
  1832  				var kind KindBasicCoreResource
  1833  				err = json.Unmarshal(*v, &kind)
  1834  				if err != nil {
  1835  					return err
  1836  				}
  1837  				mg.Kind = kind
  1838  			}
  1839  		case "id":
  1840  			if v != nil {
  1841  				var ID string
  1842  				err = json.Unmarshal(*v, &ID)
  1843  				if err != nil {
  1844  					return err
  1845  				}
  1846  				mg.ID = &ID
  1847  			}
  1848  		case "type":
  1849  			if v != nil {
  1850  				var typeVar string
  1851  				err = json.Unmarshal(*v, &typeVar)
  1852  				if err != nil {
  1853  					return err
  1854  				}
  1855  				mg.Type = &typeVar
  1856  			}
  1857  		case "name":
  1858  			if v != nil {
  1859  				var name string
  1860  				err = json.Unmarshal(*v, &name)
  1861  				if err != nil {
  1862  					return err
  1863  				}
  1864  				mg.Name = &name
  1865  			}
  1866  		}
  1867  	}
  1868  
  1869  	return nil
  1870  }
  1871  
  1872  // MachineGroupCollection collection of Machine Group resources.
  1873  type MachineGroupCollection struct {
  1874  	autorest.Response `json:"-"`
  1875  	// Value - Collection of Machine Group resources.
  1876  	Value *[]MachineGroup `json:"value,omitempty"`
  1877  	// NextLink - The URL to the next set of resources.
  1878  	NextLink *string `json:"nextLink,omitempty"`
  1879  }
  1880  
  1881  // MachineGroupCollectionIterator provides access to a complete listing of MachineGroup values.
  1882  type MachineGroupCollectionIterator struct {
  1883  	i    int
  1884  	page MachineGroupCollectionPage
  1885  }
  1886  
  1887  // NextWithContext advances to the next value.  If there was an error making
  1888  // the request the iterator does not advance and the error is returned.
  1889  func (iter *MachineGroupCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  1890  	if tracing.IsEnabled() {
  1891  		ctx = tracing.StartSpan(ctx, fqdn+"/MachineGroupCollectionIterator.NextWithContext")
  1892  		defer func() {
  1893  			sc := -1
  1894  			if iter.Response().Response.Response != nil {
  1895  				sc = iter.Response().Response.Response.StatusCode
  1896  			}
  1897  			tracing.EndSpan(ctx, sc, err)
  1898  		}()
  1899  	}
  1900  	iter.i++
  1901  	if iter.i < len(iter.page.Values()) {
  1902  		return nil
  1903  	}
  1904  	err = iter.page.NextWithContext(ctx)
  1905  	if err != nil {
  1906  		iter.i--
  1907  		return err
  1908  	}
  1909  	iter.i = 0
  1910  	return nil
  1911  }
  1912  
  1913  // Next advances to the next value.  If there was an error making
  1914  // the request the iterator does not advance and the error is returned.
  1915  // Deprecated: Use NextWithContext() instead.
  1916  func (iter *MachineGroupCollectionIterator) Next() error {
  1917  	return iter.NextWithContext(context.Background())
  1918  }
  1919  
  1920  // NotDone returns true if the enumeration should be started or is not yet complete.
  1921  func (iter MachineGroupCollectionIterator) NotDone() bool {
  1922  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  1923  }
  1924  
  1925  // Response returns the raw server response from the last page request.
  1926  func (iter MachineGroupCollectionIterator) Response() MachineGroupCollection {
  1927  	return iter.page.Response()
  1928  }
  1929  
  1930  // Value returns the current value or a zero-initialized value if the
  1931  // iterator has advanced beyond the end of the collection.
  1932  func (iter MachineGroupCollectionIterator) Value() MachineGroup {
  1933  	if !iter.page.NotDone() {
  1934  		return MachineGroup{}
  1935  	}
  1936  	return iter.page.Values()[iter.i]
  1937  }
  1938  
  1939  // Creates a new instance of the MachineGroupCollectionIterator type.
  1940  func NewMachineGroupCollectionIterator(page MachineGroupCollectionPage) MachineGroupCollectionIterator {
  1941  	return MachineGroupCollectionIterator{page: page}
  1942  }
  1943  
  1944  // IsEmpty returns true if the ListResult contains no values.
  1945  func (mgc MachineGroupCollection) IsEmpty() bool {
  1946  	return mgc.Value == nil || len(*mgc.Value) == 0
  1947  }
  1948  
  1949  // hasNextLink returns true if the NextLink is not empty.
  1950  func (mgc MachineGroupCollection) hasNextLink() bool {
  1951  	return mgc.NextLink != nil && len(*mgc.NextLink) != 0
  1952  }
  1953  
  1954  // machineGroupCollectionPreparer prepares a request to retrieve the next set of results.
  1955  // It returns nil if no more results exist.
  1956  func (mgc MachineGroupCollection) machineGroupCollectionPreparer(ctx context.Context) (*http.Request, error) {
  1957  	if !mgc.hasNextLink() {
  1958  		return nil, nil
  1959  	}
  1960  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  1961  		autorest.AsJSON(),
  1962  		autorest.AsGet(),
  1963  		autorest.WithBaseURL(to.String(mgc.NextLink)))
  1964  }
  1965  
  1966  // MachineGroupCollectionPage contains a page of MachineGroup values.
  1967  type MachineGroupCollectionPage struct {
  1968  	fn  func(context.Context, MachineGroupCollection) (MachineGroupCollection, error)
  1969  	mgc MachineGroupCollection
  1970  }
  1971  
  1972  // NextWithContext advances to the next page of values.  If there was an error making
  1973  // the request the page does not advance and the error is returned.
  1974  func (page *MachineGroupCollectionPage) NextWithContext(ctx context.Context) (err error) {
  1975  	if tracing.IsEnabled() {
  1976  		ctx = tracing.StartSpan(ctx, fqdn+"/MachineGroupCollectionPage.NextWithContext")
  1977  		defer func() {
  1978  			sc := -1
  1979  			if page.Response().Response.Response != nil {
  1980  				sc = page.Response().Response.Response.StatusCode
  1981  			}
  1982  			tracing.EndSpan(ctx, sc, err)
  1983  		}()
  1984  	}
  1985  	for {
  1986  		next, err := page.fn(ctx, page.mgc)
  1987  		if err != nil {
  1988  			return err
  1989  		}
  1990  		page.mgc = next
  1991  		if !next.hasNextLink() || !next.IsEmpty() {
  1992  			break
  1993  		}
  1994  	}
  1995  	return nil
  1996  }
  1997  
  1998  // Next advances to the next page of values.  If there was an error making
  1999  // the request the page does not advance and the error is returned.
  2000  // Deprecated: Use NextWithContext() instead.
  2001  func (page *MachineGroupCollectionPage) Next() error {
  2002  	return page.NextWithContext(context.Background())
  2003  }
  2004  
  2005  // NotDone returns true if the page enumeration should be started or is not yet complete.
  2006  func (page MachineGroupCollectionPage) NotDone() bool {
  2007  	return !page.mgc.IsEmpty()
  2008  }
  2009  
  2010  // Response returns the raw server response from the last page request.
  2011  func (page MachineGroupCollectionPage) Response() MachineGroupCollection {
  2012  	return page.mgc
  2013  }
  2014  
  2015  // Values returns the slice of values for the current page or nil if there are no values.
  2016  func (page MachineGroupCollectionPage) Values() []MachineGroup {
  2017  	if page.mgc.IsEmpty() {
  2018  		return nil
  2019  	}
  2020  	return *page.mgc.Value
  2021  }
  2022  
  2023  // Creates a new instance of the MachineGroupCollectionPage type.
  2024  func NewMachineGroupCollectionPage(cur MachineGroupCollection, getNextPage func(context.Context, MachineGroupCollection) (MachineGroupCollection, error)) MachineGroupCollectionPage {
  2025  	return MachineGroupCollectionPage{
  2026  		fn:  getNextPage,
  2027  		mgc: cur,
  2028  	}
  2029  }
  2030  
  2031  // MachineGroupMapRequest specifies the computation of a machine group dependency map. A machine group
  2032  // dependency map includes all direct dependencies the machines in the group.
  2033  type MachineGroupMapRequest struct {
  2034  	// MachineGroupID - URI of machine group resource for which to generate the map.
  2035  	MachineGroupID *string `json:"machineGroupId,omitempty"`
  2036  	// FilterProcesses - If true, only processes between specified machines will be included. Any connections in or out of those processes will be included.
  2037  	FilterProcesses *bool `json:"filterProcesses,omitempty"`
  2038  	// StartTime - Map interval start time.
  2039  	StartTime *date.Time `json:"startTime,omitempty"`
  2040  	// EndTime - Map interval end time.
  2041  	EndTime *date.Time `json:"endTime,omitempty"`
  2042  	// Kind - Possible values include: 'KindMapRequest', 'KindMapsingleMachineDependency', 'KindMultipleMachinesMapRequest', 'KindMapmachineListDependency', 'KindMapmachineGroupDependency'
  2043  	Kind KindBasicMapRequest `json:"kind,omitempty"`
  2044  }
  2045  
  2046  // MarshalJSON is the custom marshaler for MachineGroupMapRequest.
  2047  func (mgmr MachineGroupMapRequest) MarshalJSON() ([]byte, error) {
  2048  	mgmr.Kind = KindMapmachineGroupDependency
  2049  	objectMap := make(map[string]interface{})
  2050  	if mgmr.MachineGroupID != nil {
  2051  		objectMap["machineGroupId"] = mgmr.MachineGroupID
  2052  	}
  2053  	if mgmr.FilterProcesses != nil {
  2054  		objectMap["filterProcesses"] = mgmr.FilterProcesses
  2055  	}
  2056  	if mgmr.StartTime != nil {
  2057  		objectMap["startTime"] = mgmr.StartTime
  2058  	}
  2059  	if mgmr.EndTime != nil {
  2060  		objectMap["endTime"] = mgmr.EndTime
  2061  	}
  2062  	if mgmr.Kind != "" {
  2063  		objectMap["kind"] = mgmr.Kind
  2064  	}
  2065  	return json.Marshal(objectMap)
  2066  }
  2067  
  2068  // AsSingleMachineDependencyMapRequest is the BasicMapRequest implementation for MachineGroupMapRequest.
  2069  func (mgmr MachineGroupMapRequest) AsSingleMachineDependencyMapRequest() (*SingleMachineDependencyMapRequest, bool) {
  2070  	return nil, false
  2071  }
  2072  
  2073  // AsMultipleMachinesMapRequest is the BasicMapRequest implementation for MachineGroupMapRequest.
  2074  func (mgmr MachineGroupMapRequest) AsMultipleMachinesMapRequest() (*MultipleMachinesMapRequest, bool) {
  2075  	return nil, false
  2076  }
  2077  
  2078  // AsBasicMultipleMachinesMapRequest is the BasicMapRequest implementation for MachineGroupMapRequest.
  2079  func (mgmr MachineGroupMapRequest) AsBasicMultipleMachinesMapRequest() (BasicMultipleMachinesMapRequest, bool) {
  2080  	return &mgmr, true
  2081  }
  2082  
  2083  // AsMachineListMapRequest is the BasicMapRequest implementation for MachineGroupMapRequest.
  2084  func (mgmr MachineGroupMapRequest) AsMachineListMapRequest() (*MachineListMapRequest, bool) {
  2085  	return nil, false
  2086  }
  2087  
  2088  // AsMachineGroupMapRequest is the BasicMapRequest implementation for MachineGroupMapRequest.
  2089  func (mgmr MachineGroupMapRequest) AsMachineGroupMapRequest() (*MachineGroupMapRequest, bool) {
  2090  	return &mgmr, true
  2091  }
  2092  
  2093  // AsMapRequest is the BasicMapRequest implementation for MachineGroupMapRequest.
  2094  func (mgmr MachineGroupMapRequest) AsMapRequest() (*MapRequest, bool) {
  2095  	return nil, false
  2096  }
  2097  
  2098  // AsBasicMapRequest is the BasicMapRequest implementation for MachineGroupMapRequest.
  2099  func (mgmr MachineGroupMapRequest) AsBasicMapRequest() (BasicMapRequest, bool) {
  2100  	return &mgmr, true
  2101  }
  2102  
  2103  // MachineGroupProperties resource properties.
  2104  type MachineGroupProperties struct {
  2105  	// GroupType - Type of the machine group. Possible values include: 'MachineGroupTypeUnknown', 'MachineGroupTypeAzureCs', 'MachineGroupTypeAzureSf', 'MachineGroupTypeAzureVmss', 'MachineGroupTypeUserStatic'
  2106  	GroupType MachineGroupType `json:"groupType,omitempty"`
  2107  	// DisplayName - User defined name for the group
  2108  	DisplayName *string `json:"displayName,omitempty"`
  2109  	// Count - Count of machines in this group. The value of count may be bigger than the number of machines in case of the group has been truncated due to exceeding the max number of machines a group can handle.
  2110  	Count *int32 `json:"count,omitempty"`
  2111  	// Machines - References of the machines in this group. The hints within each reference do not represent the current value of the corresponding fields. They are a snapshot created during the last time the machine group was updated.
  2112  	Machines *[]MachineReferenceWithHints `json:"machines,omitempty"`
  2113  }
  2114  
  2115  // MachineListMapRequest specifies the computation of a one hope dependency map for a list of machines. The
  2116  // resulting map includes all direct dependencies for the specified machines.
  2117  type MachineListMapRequest struct {
  2118  	// MachineIds - a list of URIs of machine resources for which to generate the map.
  2119  	MachineIds *[]string `json:"machineIds,omitempty"`
  2120  	// FilterProcesses - If true, only processes between specified machines will be included. Any connections in or out of those processes will be included.
  2121  	FilterProcesses *bool `json:"filterProcesses,omitempty"`
  2122  	// StartTime - Map interval start time.
  2123  	StartTime *date.Time `json:"startTime,omitempty"`
  2124  	// EndTime - Map interval end time.
  2125  	EndTime *date.Time `json:"endTime,omitempty"`
  2126  	// Kind - Possible values include: 'KindMapRequest', 'KindMapsingleMachineDependency', 'KindMultipleMachinesMapRequest', 'KindMapmachineListDependency', 'KindMapmachineGroupDependency'
  2127  	Kind KindBasicMapRequest `json:"kind,omitempty"`
  2128  }
  2129  
  2130  // MarshalJSON is the custom marshaler for MachineListMapRequest.
  2131  func (mlmr MachineListMapRequest) MarshalJSON() ([]byte, error) {
  2132  	mlmr.Kind = KindMapmachineListDependency
  2133  	objectMap := make(map[string]interface{})
  2134  	if mlmr.MachineIds != nil {
  2135  		objectMap["machineIds"] = mlmr.MachineIds
  2136  	}
  2137  	if mlmr.FilterProcesses != nil {
  2138  		objectMap["filterProcesses"] = mlmr.FilterProcesses
  2139  	}
  2140  	if mlmr.StartTime != nil {
  2141  		objectMap["startTime"] = mlmr.StartTime
  2142  	}
  2143  	if mlmr.EndTime != nil {
  2144  		objectMap["endTime"] = mlmr.EndTime
  2145  	}
  2146  	if mlmr.Kind != "" {
  2147  		objectMap["kind"] = mlmr.Kind
  2148  	}
  2149  	return json.Marshal(objectMap)
  2150  }
  2151  
  2152  // AsSingleMachineDependencyMapRequest is the BasicMapRequest implementation for MachineListMapRequest.
  2153  func (mlmr MachineListMapRequest) AsSingleMachineDependencyMapRequest() (*SingleMachineDependencyMapRequest, bool) {
  2154  	return nil, false
  2155  }
  2156  
  2157  // AsMultipleMachinesMapRequest is the BasicMapRequest implementation for MachineListMapRequest.
  2158  func (mlmr MachineListMapRequest) AsMultipleMachinesMapRequest() (*MultipleMachinesMapRequest, bool) {
  2159  	return nil, false
  2160  }
  2161  
  2162  // AsBasicMultipleMachinesMapRequest is the BasicMapRequest implementation for MachineListMapRequest.
  2163  func (mlmr MachineListMapRequest) AsBasicMultipleMachinesMapRequest() (BasicMultipleMachinesMapRequest, bool) {
  2164  	return &mlmr, true
  2165  }
  2166  
  2167  // AsMachineListMapRequest is the BasicMapRequest implementation for MachineListMapRequest.
  2168  func (mlmr MachineListMapRequest) AsMachineListMapRequest() (*MachineListMapRequest, bool) {
  2169  	return &mlmr, true
  2170  }
  2171  
  2172  // AsMachineGroupMapRequest is the BasicMapRequest implementation for MachineListMapRequest.
  2173  func (mlmr MachineListMapRequest) AsMachineGroupMapRequest() (*MachineGroupMapRequest, bool) {
  2174  	return nil, false
  2175  }
  2176  
  2177  // AsMapRequest is the BasicMapRequest implementation for MachineListMapRequest.
  2178  func (mlmr MachineListMapRequest) AsMapRequest() (*MapRequest, bool) {
  2179  	return nil, false
  2180  }
  2181  
  2182  // AsBasicMapRequest is the BasicMapRequest implementation for MachineListMapRequest.
  2183  func (mlmr MachineListMapRequest) AsBasicMapRequest() (BasicMapRequest, bool) {
  2184  	return &mlmr, true
  2185  }
  2186  
  2187  // MachineProperties resource properties.
  2188  type MachineProperties struct {
  2189  	// Timestamp - UTC date and time when this resource was updated in the system.
  2190  	Timestamp *date.Time `json:"timestamp,omitempty"`
  2191  	// MonitoringState - Specifies whether the machine is actively monitored or discovered. Possible values include: 'Monitored', 'Discovered'
  2192  	MonitoringState MonitoringState `json:"monitoringState,omitempty"`
  2193  	// VirtualizationState - Specifies whether the machine is virtualized. Possible values include: 'VirtualizationStateUnknown', 'VirtualizationStatePhysical', 'VirtualizationStateVirtual', 'VirtualizationStateHypervisor'
  2194  	VirtualizationState VirtualizationState `json:"virtualizationState,omitempty"`
  2195  	// DisplayName - Name to use for display purposes
  2196  	DisplayName *string `json:"displayName,omitempty"`
  2197  	// ComputerName - Name of the machine, e.g., server
  2198  	ComputerName *string `json:"computerName,omitempty"`
  2199  	// FullyQualifiedDomainName - Fully-qualified name of the machine, e.g., server.company.com
  2200  	FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"`
  2201  	// BootTime - UTC date and time when the machine last booted
  2202  	BootTime *date.Time `json:"bootTime,omitempty"`
  2203  	// Timezone - Timezone of the machine.
  2204  	Timezone *Timezone `json:"timezone,omitempty"`
  2205  	// Agent - Dependency Agent configuration.
  2206  	Agent *AgentConfiguration `json:"agent,omitempty"`
  2207  	// Resources - Machine resources (memory, cpu, etc.).
  2208  	Resources *MachineResourcesConfiguration `json:"resources,omitempty"`
  2209  	// Networking - Network configuration (ips, gateways, dns, etc.)
  2210  	Networking *NetworkConfiguration `json:"networking,omitempty"`
  2211  	// OperatingSystem - Operating system information.
  2212  	OperatingSystem *OperatingSystemConfiguration `json:"operatingSystem,omitempty"`
  2213  	// VirtualMachine - Virtualization-related configuration. Present only when `virtualizationState` is `virtual`.
  2214  	VirtualMachine *VirtualMachineConfiguration `json:"virtualMachine,omitempty"`
  2215  	// Hypervisor - Hypervisor-related configuration. Present only when 'virtualizationState' is `hypervisor`.
  2216  	Hypervisor *HypervisorConfiguration `json:"hypervisor,omitempty"`
  2217  	// Hosting - Hosting-related configuration. Present if hosting information is discovered for the VM.
  2218  	Hosting BasicHostingConfiguration `json:"hosting,omitempty"`
  2219  }
  2220  
  2221  // UnmarshalJSON is the custom unmarshaler for MachineProperties struct.
  2222  func (mVar *MachineProperties) UnmarshalJSON(body []byte) error {
  2223  	var m map[string]*json.RawMessage
  2224  	err := json.Unmarshal(body, &m)
  2225  	if err != nil {
  2226  		return err
  2227  	}
  2228  	for k, v := range m {
  2229  		switch k {
  2230  		case "timestamp":
  2231  			if v != nil {
  2232  				var timestamp date.Time
  2233  				err = json.Unmarshal(*v, &timestamp)
  2234  				if err != nil {
  2235  					return err
  2236  				}
  2237  				mVar.Timestamp = &timestamp
  2238  			}
  2239  		case "monitoringState":
  2240  			if v != nil {
  2241  				var monitoringState MonitoringState
  2242  				err = json.Unmarshal(*v, &monitoringState)
  2243  				if err != nil {
  2244  					return err
  2245  				}
  2246  				mVar.MonitoringState = monitoringState
  2247  			}
  2248  		case "virtualizationState":
  2249  			if v != nil {
  2250  				var virtualizationState VirtualizationState
  2251  				err = json.Unmarshal(*v, &virtualizationState)
  2252  				if err != nil {
  2253  					return err
  2254  				}
  2255  				mVar.VirtualizationState = virtualizationState
  2256  			}
  2257  		case "displayName":
  2258  			if v != nil {
  2259  				var displayName string
  2260  				err = json.Unmarshal(*v, &displayName)
  2261  				if err != nil {
  2262  					return err
  2263  				}
  2264  				mVar.DisplayName = &displayName
  2265  			}
  2266  		case "computerName":
  2267  			if v != nil {
  2268  				var computerName string
  2269  				err = json.Unmarshal(*v, &computerName)
  2270  				if err != nil {
  2271  					return err
  2272  				}
  2273  				mVar.ComputerName = &computerName
  2274  			}
  2275  		case "fullyQualifiedDomainName":
  2276  			if v != nil {
  2277  				var fullyQualifiedDomainName string
  2278  				err = json.Unmarshal(*v, &fullyQualifiedDomainName)
  2279  				if err != nil {
  2280  					return err
  2281  				}
  2282  				mVar.FullyQualifiedDomainName = &fullyQualifiedDomainName
  2283  			}
  2284  		case "bootTime":
  2285  			if v != nil {
  2286  				var bootTime date.Time
  2287  				err = json.Unmarshal(*v, &bootTime)
  2288  				if err != nil {
  2289  					return err
  2290  				}
  2291  				mVar.BootTime = &bootTime
  2292  			}
  2293  		case "timezone":
  2294  			if v != nil {
  2295  				var timezone Timezone
  2296  				err = json.Unmarshal(*v, &timezone)
  2297  				if err != nil {
  2298  					return err
  2299  				}
  2300  				mVar.Timezone = &timezone
  2301  			}
  2302  		case "agent":
  2303  			if v != nil {
  2304  				var agent AgentConfiguration
  2305  				err = json.Unmarshal(*v, &agent)
  2306  				if err != nil {
  2307  					return err
  2308  				}
  2309  				mVar.Agent = &agent
  2310  			}
  2311  		case "resources":
  2312  			if v != nil {
  2313  				var resources MachineResourcesConfiguration
  2314  				err = json.Unmarshal(*v, &resources)
  2315  				if err != nil {
  2316  					return err
  2317  				}
  2318  				mVar.Resources = &resources
  2319  			}
  2320  		case "networking":
  2321  			if v != nil {
  2322  				var networking NetworkConfiguration
  2323  				err = json.Unmarshal(*v, &networking)
  2324  				if err != nil {
  2325  					return err
  2326  				}
  2327  				mVar.Networking = &networking
  2328  			}
  2329  		case "operatingSystem":
  2330  			if v != nil {
  2331  				var operatingSystem OperatingSystemConfiguration
  2332  				err = json.Unmarshal(*v, &operatingSystem)
  2333  				if err != nil {
  2334  					return err
  2335  				}
  2336  				mVar.OperatingSystem = &operatingSystem
  2337  			}
  2338  		case "virtualMachine":
  2339  			if v != nil {
  2340  				var virtualMachine VirtualMachineConfiguration
  2341  				err = json.Unmarshal(*v, &virtualMachine)
  2342  				if err != nil {
  2343  					return err
  2344  				}
  2345  				mVar.VirtualMachine = &virtualMachine
  2346  			}
  2347  		case "hypervisor":
  2348  			if v != nil {
  2349  				var hypervisor HypervisorConfiguration
  2350  				err = json.Unmarshal(*v, &hypervisor)
  2351  				if err != nil {
  2352  					return err
  2353  				}
  2354  				mVar.Hypervisor = &hypervisor
  2355  			}
  2356  		case "hosting":
  2357  			if v != nil {
  2358  				hosting, err := unmarshalBasicHostingConfiguration(*v)
  2359  				if err != nil {
  2360  					return err
  2361  				}
  2362  				mVar.Hosting = hosting
  2363  			}
  2364  		}
  2365  	}
  2366  
  2367  	return nil
  2368  }
  2369  
  2370  // MachineReference reference to a machine.
  2371  type MachineReference struct {
  2372  	// ID - Resource URI.
  2373  	ID *string `json:"id,omitempty"`
  2374  	// Type - READ-ONLY; Resource type qualifier.
  2375  	Type *string `json:"type,omitempty"`
  2376  	// Name - READ-ONLY; Resource name.
  2377  	Name *string `json:"name,omitempty"`
  2378  	// Kind - Possible values include: 'KindResourceReference', 'KindRefmachine', 'KindRefprocess', 'KindRefport', 'KindRefmachinewithhints', 'KindRefclientgroup'
  2379  	Kind Kind `json:"kind,omitempty"`
  2380  }
  2381  
  2382  // MarshalJSON is the custom marshaler for MachineReference.
  2383  func (mr MachineReference) MarshalJSON() ([]byte, error) {
  2384  	mr.Kind = KindRefmachine
  2385  	objectMap := make(map[string]interface{})
  2386  	if mr.ID != nil {
  2387  		objectMap["id"] = mr.ID
  2388  	}
  2389  	if mr.Kind != "" {
  2390  		objectMap["kind"] = mr.Kind
  2391  	}
  2392  	return json.Marshal(objectMap)
  2393  }
  2394  
  2395  // AsMachineReference is the BasicResourceReference implementation for MachineReference.
  2396  func (mr MachineReference) AsMachineReference() (*MachineReference, bool) {
  2397  	return &mr, true
  2398  }
  2399  
  2400  // AsProcessReference is the BasicResourceReference implementation for MachineReference.
  2401  func (mr MachineReference) AsProcessReference() (*ProcessReference, bool) {
  2402  	return nil, false
  2403  }
  2404  
  2405  // AsPortReference is the BasicResourceReference implementation for MachineReference.
  2406  func (mr MachineReference) AsPortReference() (*PortReference, bool) {
  2407  	return nil, false
  2408  }
  2409  
  2410  // AsMachineReferenceWithHints is the BasicResourceReference implementation for MachineReference.
  2411  func (mr MachineReference) AsMachineReferenceWithHints() (*MachineReferenceWithHints, bool) {
  2412  	return nil, false
  2413  }
  2414  
  2415  // AsClientGroupReference is the BasicResourceReference implementation for MachineReference.
  2416  func (mr MachineReference) AsClientGroupReference() (*ClientGroupReference, bool) {
  2417  	return nil, false
  2418  }
  2419  
  2420  // AsResourceReference is the BasicResourceReference implementation for MachineReference.
  2421  func (mr MachineReference) AsResourceReference() (*ResourceReference, bool) {
  2422  	return nil, false
  2423  }
  2424  
  2425  // AsBasicResourceReference is the BasicResourceReference implementation for MachineReference.
  2426  func (mr MachineReference) AsBasicResourceReference() (BasicResourceReference, bool) {
  2427  	return &mr, true
  2428  }
  2429  
  2430  // MachineReferenceWithHints a machine reference with a hint of the machine's name and operating system.
  2431  type MachineReferenceWithHints struct {
  2432  	// MachineReferenceWithHintsProperties - Machine reference with name and os hints.
  2433  	*MachineReferenceWithHintsProperties `json:"properties,omitempty"`
  2434  	// ID - Resource URI.
  2435  	ID *string `json:"id,omitempty"`
  2436  	// Type - READ-ONLY; Resource type qualifier.
  2437  	Type *string `json:"type,omitempty"`
  2438  	// Name - READ-ONLY; Resource name.
  2439  	Name *string `json:"name,omitempty"`
  2440  	// Kind - Possible values include: 'KindResourceReference', 'KindRefmachine', 'KindRefprocess', 'KindRefport', 'KindRefmachinewithhints', 'KindRefclientgroup'
  2441  	Kind Kind `json:"kind,omitempty"`
  2442  }
  2443  
  2444  // MarshalJSON is the custom marshaler for MachineReferenceWithHints.
  2445  func (mrwh MachineReferenceWithHints) MarshalJSON() ([]byte, error) {
  2446  	mrwh.Kind = KindRefmachinewithhints
  2447  	objectMap := make(map[string]interface{})
  2448  	if mrwh.MachineReferenceWithHintsProperties != nil {
  2449  		objectMap["properties"] = mrwh.MachineReferenceWithHintsProperties
  2450  	}
  2451  	if mrwh.ID != nil {
  2452  		objectMap["id"] = mrwh.ID
  2453  	}
  2454  	if mrwh.Kind != "" {
  2455  		objectMap["kind"] = mrwh.Kind
  2456  	}
  2457  	return json.Marshal(objectMap)
  2458  }
  2459  
  2460  // AsMachineReference is the BasicResourceReference implementation for MachineReferenceWithHints.
  2461  func (mrwh MachineReferenceWithHints) AsMachineReference() (*MachineReference, bool) {
  2462  	return nil, false
  2463  }
  2464  
  2465  // AsProcessReference is the BasicResourceReference implementation for MachineReferenceWithHints.
  2466  func (mrwh MachineReferenceWithHints) AsProcessReference() (*ProcessReference, bool) {
  2467  	return nil, false
  2468  }
  2469  
  2470  // AsPortReference is the BasicResourceReference implementation for MachineReferenceWithHints.
  2471  func (mrwh MachineReferenceWithHints) AsPortReference() (*PortReference, bool) {
  2472  	return nil, false
  2473  }
  2474  
  2475  // AsMachineReferenceWithHints is the BasicResourceReference implementation for MachineReferenceWithHints.
  2476  func (mrwh MachineReferenceWithHints) AsMachineReferenceWithHints() (*MachineReferenceWithHints, bool) {
  2477  	return &mrwh, true
  2478  }
  2479  
  2480  // AsClientGroupReference is the BasicResourceReference implementation for MachineReferenceWithHints.
  2481  func (mrwh MachineReferenceWithHints) AsClientGroupReference() (*ClientGroupReference, bool) {
  2482  	return nil, false
  2483  }
  2484  
  2485  // AsResourceReference is the BasicResourceReference implementation for MachineReferenceWithHints.
  2486  func (mrwh MachineReferenceWithHints) AsResourceReference() (*ResourceReference, bool) {
  2487  	return nil, false
  2488  }
  2489  
  2490  // AsBasicResourceReference is the BasicResourceReference implementation for MachineReferenceWithHints.
  2491  func (mrwh MachineReferenceWithHints) AsBasicResourceReference() (BasicResourceReference, bool) {
  2492  	return &mrwh, true
  2493  }
  2494  
  2495  // UnmarshalJSON is the custom unmarshaler for MachineReferenceWithHints struct.
  2496  func (mrwh *MachineReferenceWithHints) UnmarshalJSON(body []byte) error {
  2497  	var m map[string]*json.RawMessage
  2498  	err := json.Unmarshal(body, &m)
  2499  	if err != nil {
  2500  		return err
  2501  	}
  2502  	for k, v := range m {
  2503  		switch k {
  2504  		case "properties":
  2505  			if v != nil {
  2506  				var machineReferenceWithHintsProperties MachineReferenceWithHintsProperties
  2507  				err = json.Unmarshal(*v, &machineReferenceWithHintsProperties)
  2508  				if err != nil {
  2509  					return err
  2510  				}
  2511  				mrwh.MachineReferenceWithHintsProperties = &machineReferenceWithHintsProperties
  2512  			}
  2513  		case "id":
  2514  			if v != nil {
  2515  				var ID string
  2516  				err = json.Unmarshal(*v, &ID)
  2517  				if err != nil {
  2518  					return err
  2519  				}
  2520  				mrwh.ID = &ID
  2521  			}
  2522  		case "type":
  2523  			if v != nil {
  2524  				var typeVar string
  2525  				err = json.Unmarshal(*v, &typeVar)
  2526  				if err != nil {
  2527  					return err
  2528  				}
  2529  				mrwh.Type = &typeVar
  2530  			}
  2531  		case "name":
  2532  			if v != nil {
  2533  				var name string
  2534  				err = json.Unmarshal(*v, &name)
  2535  				if err != nil {
  2536  					return err
  2537  				}
  2538  				mrwh.Name = &name
  2539  			}
  2540  		case "kind":
  2541  			if v != nil {
  2542  				var kind Kind
  2543  				err = json.Unmarshal(*v, &kind)
  2544  				if err != nil {
  2545  					return err
  2546  				}
  2547  				mrwh.Kind = kind
  2548  			}
  2549  		}
  2550  	}
  2551  
  2552  	return nil
  2553  }
  2554  
  2555  // MachineReferenceWithHintsProperties machine reference with name and os hints.
  2556  type MachineReferenceWithHintsProperties struct {
  2557  	// DisplayNameHint - READ-ONLY; Last known display name.
  2558  	DisplayNameHint *string `json:"displayNameHint,omitempty"`
  2559  	// OsFamilyHint - READ-ONLY; Last known operating system family. Possible values include: 'OperatingSystemFamilyUnknown', 'OperatingSystemFamilyWindows', 'OperatingSystemFamilyLinux', 'OperatingSystemFamilySolaris', 'OperatingSystemFamilyAix'
  2560  	OsFamilyHint OperatingSystemFamily `json:"osFamilyHint,omitempty"`
  2561  }
  2562  
  2563  // MarshalJSON is the custom marshaler for MachineReferenceWithHintsProperties.
  2564  func (mrwh MachineReferenceWithHintsProperties) MarshalJSON() ([]byte, error) {
  2565  	objectMap := make(map[string]interface{})
  2566  	return json.Marshal(objectMap)
  2567  }
  2568  
  2569  // MachineResourcesConfiguration describes the resources of a machine.
  2570  type MachineResourcesConfiguration struct {
  2571  	// PhysicalMemory - Physical memory in megabytes (MB).
  2572  	PhysicalMemory *int32 `json:"physicalMemory,omitempty"`
  2573  	// Cpus - Number of CPUs.
  2574  	Cpus *int32 `json:"cpus,omitempty"`
  2575  	// CPUSpeed - CPU speed in megahertz (Mhz).
  2576  	CPUSpeed *int32 `json:"cpuSpeed,omitempty"`
  2577  	// CPUSpeedAccuracy - Describes the accuracy of the cpuSpeed field. Possible values include: 'Actual', 'Estimated'
  2578  	CPUSpeedAccuracy Accuracy `json:"cpuSpeedAccuracy,omitempty"`
  2579  }
  2580  
  2581  // MachinesSummary a summary of the machines in the workspace.
  2582  type MachinesSummary struct {
  2583  	autorest.Response          `json:"-"`
  2584  	*MachinesSummaryProperties `json:"properties,omitempty"`
  2585  	// ID - READ-ONLY; Resource identifier.
  2586  	ID *string `json:"id,omitempty"`
  2587  	// Type - READ-ONLY; Resource type.
  2588  	Type *string `json:"type,omitempty"`
  2589  	// Name - READ-ONLY; Resource name.
  2590  	Name *string `json:"name,omitempty"`
  2591  }
  2592  
  2593  // MarshalJSON is the custom marshaler for MachinesSummary.
  2594  func (ms MachinesSummary) MarshalJSON() ([]byte, error) {
  2595  	objectMap := make(map[string]interface{})
  2596  	if ms.MachinesSummaryProperties != nil {
  2597  		objectMap["properties"] = ms.MachinesSummaryProperties
  2598  	}
  2599  	return json.Marshal(objectMap)
  2600  }
  2601  
  2602  // UnmarshalJSON is the custom unmarshaler for MachinesSummary struct.
  2603  func (ms *MachinesSummary) UnmarshalJSON(body []byte) error {
  2604  	var m map[string]*json.RawMessage
  2605  	err := json.Unmarshal(body, &m)
  2606  	if err != nil {
  2607  		return err
  2608  	}
  2609  	for k, v := range m {
  2610  		switch k {
  2611  		case "properties":
  2612  			if v != nil {
  2613  				var machinesSummaryProperties MachinesSummaryProperties
  2614  				err = json.Unmarshal(*v, &machinesSummaryProperties)
  2615  				if err != nil {
  2616  					return err
  2617  				}
  2618  				ms.MachinesSummaryProperties = &machinesSummaryProperties
  2619  			}
  2620  		case "id":
  2621  			if v != nil {
  2622  				var ID string
  2623  				err = json.Unmarshal(*v, &ID)
  2624  				if err != nil {
  2625  					return err
  2626  				}
  2627  				ms.ID = &ID
  2628  			}
  2629  		case "type":
  2630  			if v != nil {
  2631  				var typeVar string
  2632  				err = json.Unmarshal(*v, &typeVar)
  2633  				if err != nil {
  2634  					return err
  2635  				}
  2636  				ms.Type = &typeVar
  2637  			}
  2638  		case "name":
  2639  			if v != nil {
  2640  				var name string
  2641  				err = json.Unmarshal(*v, &name)
  2642  				if err != nil {
  2643  					return err
  2644  				}
  2645  				ms.Name = &name
  2646  			}
  2647  		}
  2648  	}
  2649  
  2650  	return nil
  2651  }
  2652  
  2653  // MachinesSummaryProperties summarizes machines in the workspace.
  2654  type MachinesSummaryProperties struct {
  2655  	// Total - Total number of machines.
  2656  	Total *int32 `json:"total,omitempty"`
  2657  	// Live - Number of live machines.
  2658  	Live *int32 `json:"live,omitempty"`
  2659  	// Os - Machine counts by operating system.
  2660  	Os *MachineCountsByOperatingSystem `json:"os,omitempty"`
  2661  	// StartTime - Summary interval start time.
  2662  	StartTime *date.Time `json:"startTime,omitempty"`
  2663  	// EndTime - Summary interval end time.
  2664  	EndTime *date.Time `json:"endTime,omitempty"`
  2665  }
  2666  
  2667  // Map a map of resources and relationships between them.
  2668  type Map struct {
  2669  	Nodes *MapNodes `json:"nodes,omitempty"`
  2670  	Edges *MapEdges `json:"edges,omitempty"`
  2671  }
  2672  
  2673  // MapEdges the edges (relationships) of a map.
  2674  type MapEdges struct {
  2675  	// Connections - Network connections.
  2676  	Connections *[]Connection `json:"connections,omitempty"`
  2677  	// Acceptors - Processes accepting on a port.
  2678  	Acceptors *[]Acceptor `json:"acceptors,omitempty"`
  2679  }
  2680  
  2681  // MapNodes the nodes (entities) of a map.
  2682  type MapNodes struct {
  2683  	// Machines - Machine resources.
  2684  	Machines *[]Machine `json:"machines,omitempty"`
  2685  	// Processes - Process resources.
  2686  	Processes *[]Process `json:"processes,omitempty"`
  2687  	// Ports - Port resources.
  2688  	Ports *[]Port `json:"ports,omitempty"`
  2689  	// ClientGroups - Client Group resources.
  2690  	ClientGroups *[]ClientGroup `json:"clientGroups,omitempty"`
  2691  }
  2692  
  2693  // BasicMapRequest specifies the contents of request to generate a map.
  2694  type BasicMapRequest interface {
  2695  	AsSingleMachineDependencyMapRequest() (*SingleMachineDependencyMapRequest, bool)
  2696  	AsMultipleMachinesMapRequest() (*MultipleMachinesMapRequest, bool)
  2697  	AsBasicMultipleMachinesMapRequest() (BasicMultipleMachinesMapRequest, bool)
  2698  	AsMachineListMapRequest() (*MachineListMapRequest, bool)
  2699  	AsMachineGroupMapRequest() (*MachineGroupMapRequest, bool)
  2700  	AsMapRequest() (*MapRequest, bool)
  2701  }
  2702  
  2703  // MapRequest specifies the contents of request to generate a map.
  2704  type MapRequest struct {
  2705  	// StartTime - Map interval start time.
  2706  	StartTime *date.Time `json:"startTime,omitempty"`
  2707  	// EndTime - Map interval end time.
  2708  	EndTime *date.Time `json:"endTime,omitempty"`
  2709  	// Kind - Possible values include: 'KindMapRequest', 'KindMapsingleMachineDependency', 'KindMultipleMachinesMapRequest', 'KindMapmachineListDependency', 'KindMapmachineGroupDependency'
  2710  	Kind KindBasicMapRequest `json:"kind,omitempty"`
  2711  }
  2712  
  2713  func unmarshalBasicMapRequest(body []byte) (BasicMapRequest, error) {
  2714  	var m map[string]interface{}
  2715  	err := json.Unmarshal(body, &m)
  2716  	if err != nil {
  2717  		return nil, err
  2718  	}
  2719  
  2720  	switch m["kind"] {
  2721  	case string(KindMapsingleMachineDependency):
  2722  		var smdmr SingleMachineDependencyMapRequest
  2723  		err := json.Unmarshal(body, &smdmr)
  2724  		return smdmr, err
  2725  	case string(KindMultipleMachinesMapRequest):
  2726  		var mmmr MultipleMachinesMapRequest
  2727  		err := json.Unmarshal(body, &mmmr)
  2728  		return mmmr, err
  2729  	case string(KindMapmachineListDependency):
  2730  		var mlmr MachineListMapRequest
  2731  		err := json.Unmarshal(body, &mlmr)
  2732  		return mlmr, err
  2733  	case string(KindMapmachineGroupDependency):
  2734  		var mgmr MachineGroupMapRequest
  2735  		err := json.Unmarshal(body, &mgmr)
  2736  		return mgmr, err
  2737  	default:
  2738  		var mr MapRequest
  2739  		err := json.Unmarshal(body, &mr)
  2740  		return mr, err
  2741  	}
  2742  }
  2743  func unmarshalBasicMapRequestArray(body []byte) ([]BasicMapRequest, error) {
  2744  	var rawMessages []*json.RawMessage
  2745  	err := json.Unmarshal(body, &rawMessages)
  2746  	if err != nil {
  2747  		return nil, err
  2748  	}
  2749  
  2750  	mrArray := make([]BasicMapRequest, len(rawMessages))
  2751  
  2752  	for index, rawMessage := range rawMessages {
  2753  		mr, err := unmarshalBasicMapRequest(*rawMessage)
  2754  		if err != nil {
  2755  			return nil, err
  2756  		}
  2757  		mrArray[index] = mr
  2758  	}
  2759  	return mrArray, nil
  2760  }
  2761  
  2762  // MarshalJSON is the custom marshaler for MapRequest.
  2763  func (mr MapRequest) MarshalJSON() ([]byte, error) {
  2764  	mr.Kind = KindMapRequest
  2765  	objectMap := make(map[string]interface{})
  2766  	if mr.StartTime != nil {
  2767  		objectMap["startTime"] = mr.StartTime
  2768  	}
  2769  	if mr.EndTime != nil {
  2770  		objectMap["endTime"] = mr.EndTime
  2771  	}
  2772  	if mr.Kind != "" {
  2773  		objectMap["kind"] = mr.Kind
  2774  	}
  2775  	return json.Marshal(objectMap)
  2776  }
  2777  
  2778  // AsSingleMachineDependencyMapRequest is the BasicMapRequest implementation for MapRequest.
  2779  func (mr MapRequest) AsSingleMachineDependencyMapRequest() (*SingleMachineDependencyMapRequest, bool) {
  2780  	return nil, false
  2781  }
  2782  
  2783  // AsMultipleMachinesMapRequest is the BasicMapRequest implementation for MapRequest.
  2784  func (mr MapRequest) AsMultipleMachinesMapRequest() (*MultipleMachinesMapRequest, bool) {
  2785  	return nil, false
  2786  }
  2787  
  2788  // AsBasicMultipleMachinesMapRequest is the BasicMapRequest implementation for MapRequest.
  2789  func (mr MapRequest) AsBasicMultipleMachinesMapRequest() (BasicMultipleMachinesMapRequest, bool) {
  2790  	return nil, false
  2791  }
  2792  
  2793  // AsMachineListMapRequest is the BasicMapRequest implementation for MapRequest.
  2794  func (mr MapRequest) AsMachineListMapRequest() (*MachineListMapRequest, bool) {
  2795  	return nil, false
  2796  }
  2797  
  2798  // AsMachineGroupMapRequest is the BasicMapRequest implementation for MapRequest.
  2799  func (mr MapRequest) AsMachineGroupMapRequest() (*MachineGroupMapRequest, bool) {
  2800  	return nil, false
  2801  }
  2802  
  2803  // AsMapRequest is the BasicMapRequest implementation for MapRequest.
  2804  func (mr MapRequest) AsMapRequest() (*MapRequest, bool) {
  2805  	return &mr, true
  2806  }
  2807  
  2808  // AsBasicMapRequest is the BasicMapRequest implementation for MapRequest.
  2809  func (mr MapRequest) AsBasicMapRequest() (BasicMapRequest, bool) {
  2810  	return &mr, true
  2811  }
  2812  
  2813  // MapResponse specified the contents of a map response.
  2814  type MapResponse struct {
  2815  	autorest.Response `json:"-"`
  2816  	// StartTime - Map interval start time.
  2817  	StartTime *date.Time `json:"startTime,omitempty"`
  2818  	// EndTime - Map interval end time.
  2819  	EndTime *date.Time `json:"endTime,omitempty"`
  2820  	// Map - The generated map.
  2821  	Map *Map `json:"map,omitempty"`
  2822  }
  2823  
  2824  // BasicMultipleMachinesMapRequest provides a base class for describing map requests for a collection of machines
  2825  type BasicMultipleMachinesMapRequest interface {
  2826  	AsMachineListMapRequest() (*MachineListMapRequest, bool)
  2827  	AsMachineGroupMapRequest() (*MachineGroupMapRequest, bool)
  2828  	AsMultipleMachinesMapRequest() (*MultipleMachinesMapRequest, bool)
  2829  }
  2830  
  2831  // MultipleMachinesMapRequest provides a base class for describing map requests for a collection of machines
  2832  type MultipleMachinesMapRequest struct {
  2833  	// FilterProcesses - If true, only processes between specified machines will be included. Any connections in or out of those processes will be included.
  2834  	FilterProcesses *bool `json:"filterProcesses,omitempty"`
  2835  	// StartTime - Map interval start time.
  2836  	StartTime *date.Time `json:"startTime,omitempty"`
  2837  	// EndTime - Map interval end time.
  2838  	EndTime *date.Time `json:"endTime,omitempty"`
  2839  	// Kind - Possible values include: 'KindMapRequest', 'KindMapsingleMachineDependency', 'KindMultipleMachinesMapRequest', 'KindMapmachineListDependency', 'KindMapmachineGroupDependency'
  2840  	Kind KindBasicMapRequest `json:"kind,omitempty"`
  2841  }
  2842  
  2843  func unmarshalBasicMultipleMachinesMapRequest(body []byte) (BasicMultipleMachinesMapRequest, error) {
  2844  	var m map[string]interface{}
  2845  	err := json.Unmarshal(body, &m)
  2846  	if err != nil {
  2847  		return nil, err
  2848  	}
  2849  
  2850  	switch m["kind"] {
  2851  	case string(KindMapmachineListDependency):
  2852  		var mlmr MachineListMapRequest
  2853  		err := json.Unmarshal(body, &mlmr)
  2854  		return mlmr, err
  2855  	case string(KindMapmachineGroupDependency):
  2856  		var mgmr MachineGroupMapRequest
  2857  		err := json.Unmarshal(body, &mgmr)
  2858  		return mgmr, err
  2859  	default:
  2860  		var mmmr MultipleMachinesMapRequest
  2861  		err := json.Unmarshal(body, &mmmr)
  2862  		return mmmr, err
  2863  	}
  2864  }
  2865  func unmarshalBasicMultipleMachinesMapRequestArray(body []byte) ([]BasicMultipleMachinesMapRequest, error) {
  2866  	var rawMessages []*json.RawMessage
  2867  	err := json.Unmarshal(body, &rawMessages)
  2868  	if err != nil {
  2869  		return nil, err
  2870  	}
  2871  
  2872  	mmmrArray := make([]BasicMultipleMachinesMapRequest, len(rawMessages))
  2873  
  2874  	for index, rawMessage := range rawMessages {
  2875  		mmmr, err := unmarshalBasicMultipleMachinesMapRequest(*rawMessage)
  2876  		if err != nil {
  2877  			return nil, err
  2878  		}
  2879  		mmmrArray[index] = mmmr
  2880  	}
  2881  	return mmmrArray, nil
  2882  }
  2883  
  2884  // MarshalJSON is the custom marshaler for MultipleMachinesMapRequest.
  2885  func (mmmr MultipleMachinesMapRequest) MarshalJSON() ([]byte, error) {
  2886  	mmmr.Kind = KindMultipleMachinesMapRequest
  2887  	objectMap := make(map[string]interface{})
  2888  	if mmmr.FilterProcesses != nil {
  2889  		objectMap["filterProcesses"] = mmmr.FilterProcesses
  2890  	}
  2891  	if mmmr.StartTime != nil {
  2892  		objectMap["startTime"] = mmmr.StartTime
  2893  	}
  2894  	if mmmr.EndTime != nil {
  2895  		objectMap["endTime"] = mmmr.EndTime
  2896  	}
  2897  	if mmmr.Kind != "" {
  2898  		objectMap["kind"] = mmmr.Kind
  2899  	}
  2900  	return json.Marshal(objectMap)
  2901  }
  2902  
  2903  // AsSingleMachineDependencyMapRequest is the BasicMapRequest implementation for MultipleMachinesMapRequest.
  2904  func (mmmr MultipleMachinesMapRequest) AsSingleMachineDependencyMapRequest() (*SingleMachineDependencyMapRequest, bool) {
  2905  	return nil, false
  2906  }
  2907  
  2908  // AsMultipleMachinesMapRequest is the BasicMapRequest implementation for MultipleMachinesMapRequest.
  2909  func (mmmr MultipleMachinesMapRequest) AsMultipleMachinesMapRequest() (*MultipleMachinesMapRequest, bool) {
  2910  	return &mmmr, true
  2911  }
  2912  
  2913  // AsBasicMultipleMachinesMapRequest is the BasicMapRequest implementation for MultipleMachinesMapRequest.
  2914  func (mmmr MultipleMachinesMapRequest) AsBasicMultipleMachinesMapRequest() (BasicMultipleMachinesMapRequest, bool) {
  2915  	return &mmmr, true
  2916  }
  2917  
  2918  // AsMachineListMapRequest is the BasicMapRequest implementation for MultipleMachinesMapRequest.
  2919  func (mmmr MultipleMachinesMapRequest) AsMachineListMapRequest() (*MachineListMapRequest, bool) {
  2920  	return nil, false
  2921  }
  2922  
  2923  // AsMachineGroupMapRequest is the BasicMapRequest implementation for MultipleMachinesMapRequest.
  2924  func (mmmr MultipleMachinesMapRequest) AsMachineGroupMapRequest() (*MachineGroupMapRequest, bool) {
  2925  	return nil, false
  2926  }
  2927  
  2928  // AsMapRequest is the BasicMapRequest implementation for MultipleMachinesMapRequest.
  2929  func (mmmr MultipleMachinesMapRequest) AsMapRequest() (*MapRequest, bool) {
  2930  	return nil, false
  2931  }
  2932  
  2933  // AsBasicMapRequest is the BasicMapRequest implementation for MultipleMachinesMapRequest.
  2934  func (mmmr MultipleMachinesMapRequest) AsBasicMapRequest() (BasicMapRequest, bool) {
  2935  	return &mmmr, true
  2936  }
  2937  
  2938  // NetworkConfiguration describes the network configuration of a machine.
  2939  type NetworkConfiguration struct {
  2940  	// Ipv4Interfaces - IPv4 interfaces.
  2941  	Ipv4Interfaces *[]Ipv4NetworkInterface `json:"ipv4Interfaces,omitempty"`
  2942  	// Ipv6Interfaces - IPv6 interfaces.
  2943  	Ipv6Interfaces *[]Ipv6NetworkInterface `json:"ipv6Interfaces,omitempty"`
  2944  	// DefaultIpv4Gateways - Default IPv4 gateways.
  2945  	DefaultIpv4Gateways *[]string `json:"defaultIpv4Gateways,omitempty"`
  2946  	// MacAddresses - MAC addresses of all active network interfaces.
  2947  	MacAddresses *[]string `json:"macAddresses,omitempty"`
  2948  	// DNSNames - DNS names associated with the machine.
  2949  	DNSNames *[]string `json:"dnsNames,omitempty"`
  2950  }
  2951  
  2952  // OperatingSystemConfiguration describes the configuration of the operating system of a machine.
  2953  type OperatingSystemConfiguration struct {
  2954  	// Family - Windows, Linux, etc. Possible values include: 'OperatingSystemFamilyUnknown', 'OperatingSystemFamilyWindows', 'OperatingSystemFamilyLinux', 'OperatingSystemFamilySolaris', 'OperatingSystemFamilyAix'
  2955  	Family OperatingSystemFamily `json:"family,omitempty"`
  2956  	// FullName - Operating system full name.
  2957  	FullName *string `json:"fullName,omitempty"`
  2958  	// Bitness - Operating system bitness (32-bit or 64-bit). Possible values include: 'ThreeTwobit', 'SixFourbit'
  2959  	Bitness Bitness `json:"bitness,omitempty"`
  2960  }
  2961  
  2962  // Port a port resource represents a server port on a machine. The port may be actively *monitored*, i.e.,
  2963  // a Dependency Agent is running on its machine, or *discovered*, i.e., its existence was inferred by
  2964  // observing the data stream from monitored machines. A port is live during an interval of time, if that
  2965  // port had associated activity during (parts) of that interval.
  2966  type Port struct {
  2967  	autorest.Response `json:"-"`
  2968  	// PortProperties - Resource properties.
  2969  	*PortProperties `json:"properties,omitempty"`
  2970  	// Etag - Resource ETAG.
  2971  	Etag *string `json:"etag,omitempty"`
  2972  	// Kind - Possible values include: 'KindCoreResource', 'KindMachine', 'KindProcess', 'KindPort', 'KindClientGroup', 'KindMachineGroup'
  2973  	Kind KindBasicCoreResource `json:"kind,omitempty"`
  2974  	// ID - READ-ONLY; Resource identifier.
  2975  	ID *string `json:"id,omitempty"`
  2976  	// Type - READ-ONLY; Resource type.
  2977  	Type *string `json:"type,omitempty"`
  2978  	// Name - READ-ONLY; Resource name.
  2979  	Name *string `json:"name,omitempty"`
  2980  }
  2981  
  2982  // MarshalJSON is the custom marshaler for Port.
  2983  func (p Port) MarshalJSON() ([]byte, error) {
  2984  	p.Kind = KindPort
  2985  	objectMap := make(map[string]interface{})
  2986  	if p.PortProperties != nil {
  2987  		objectMap["properties"] = p.PortProperties
  2988  	}
  2989  	if p.Etag != nil {
  2990  		objectMap["etag"] = p.Etag
  2991  	}
  2992  	if p.Kind != "" {
  2993  		objectMap["kind"] = p.Kind
  2994  	}
  2995  	return json.Marshal(objectMap)
  2996  }
  2997  
  2998  // AsMachine is the BasicCoreResource implementation for Port.
  2999  func (p Port) AsMachine() (*Machine, bool) {
  3000  	return nil, false
  3001  }
  3002  
  3003  // AsProcess is the BasicCoreResource implementation for Port.
  3004  func (p Port) AsProcess() (*Process, bool) {
  3005  	return nil, false
  3006  }
  3007  
  3008  // AsPort is the BasicCoreResource implementation for Port.
  3009  func (p Port) AsPort() (*Port, bool) {
  3010  	return &p, true
  3011  }
  3012  
  3013  // AsClientGroup is the BasicCoreResource implementation for Port.
  3014  func (p Port) AsClientGroup() (*ClientGroup, bool) {
  3015  	return nil, false
  3016  }
  3017  
  3018  // AsMachineGroup is the BasicCoreResource implementation for Port.
  3019  func (p Port) AsMachineGroup() (*MachineGroup, bool) {
  3020  	return nil, false
  3021  }
  3022  
  3023  // AsCoreResource is the BasicCoreResource implementation for Port.
  3024  func (p Port) AsCoreResource() (*CoreResource, bool) {
  3025  	return nil, false
  3026  }
  3027  
  3028  // AsBasicCoreResource is the BasicCoreResource implementation for Port.
  3029  func (p Port) AsBasicCoreResource() (BasicCoreResource, bool) {
  3030  	return &p, true
  3031  }
  3032  
  3033  // UnmarshalJSON is the custom unmarshaler for Port struct.
  3034  func (p *Port) UnmarshalJSON(body []byte) error {
  3035  	var m map[string]*json.RawMessage
  3036  	err := json.Unmarshal(body, &m)
  3037  	if err != nil {
  3038  		return err
  3039  	}
  3040  	for k, v := range m {
  3041  		switch k {
  3042  		case "properties":
  3043  			if v != nil {
  3044  				var portProperties PortProperties
  3045  				err = json.Unmarshal(*v, &portProperties)
  3046  				if err != nil {
  3047  					return err
  3048  				}
  3049  				p.PortProperties = &portProperties
  3050  			}
  3051  		case "etag":
  3052  			if v != nil {
  3053  				var etag string
  3054  				err = json.Unmarshal(*v, &etag)
  3055  				if err != nil {
  3056  					return err
  3057  				}
  3058  				p.Etag = &etag
  3059  			}
  3060  		case "kind":
  3061  			if v != nil {
  3062  				var kind KindBasicCoreResource
  3063  				err = json.Unmarshal(*v, &kind)
  3064  				if err != nil {
  3065  					return err
  3066  				}
  3067  				p.Kind = kind
  3068  			}
  3069  		case "id":
  3070  			if v != nil {
  3071  				var ID string
  3072  				err = json.Unmarshal(*v, &ID)
  3073  				if err != nil {
  3074  					return err
  3075  				}
  3076  				p.ID = &ID
  3077  			}
  3078  		case "type":
  3079  			if v != nil {
  3080  				var typeVar string
  3081  				err = json.Unmarshal(*v, &typeVar)
  3082  				if err != nil {
  3083  					return err
  3084  				}
  3085  				p.Type = &typeVar
  3086  			}
  3087  		case "name":
  3088  			if v != nil {
  3089  				var name string
  3090  				err = json.Unmarshal(*v, &name)
  3091  				if err != nil {
  3092  					return err
  3093  				}
  3094  				p.Name = &name
  3095  			}
  3096  		}
  3097  	}
  3098  
  3099  	return nil
  3100  }
  3101  
  3102  // PortCollection collection of Port resources.
  3103  type PortCollection struct {
  3104  	autorest.Response `json:"-"`
  3105  	// Value - Collection of Port resources.
  3106  	Value *[]Port `json:"value,omitempty"`
  3107  	// NextLink - The URL to the next set of resources.
  3108  	NextLink *string `json:"nextLink,omitempty"`
  3109  }
  3110  
  3111  // PortCollectionIterator provides access to a complete listing of Port values.
  3112  type PortCollectionIterator struct {
  3113  	i    int
  3114  	page PortCollectionPage
  3115  }
  3116  
  3117  // NextWithContext advances to the next value.  If there was an error making
  3118  // the request the iterator does not advance and the error is returned.
  3119  func (iter *PortCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  3120  	if tracing.IsEnabled() {
  3121  		ctx = tracing.StartSpan(ctx, fqdn+"/PortCollectionIterator.NextWithContext")
  3122  		defer func() {
  3123  			sc := -1
  3124  			if iter.Response().Response.Response != nil {
  3125  				sc = iter.Response().Response.Response.StatusCode
  3126  			}
  3127  			tracing.EndSpan(ctx, sc, err)
  3128  		}()
  3129  	}
  3130  	iter.i++
  3131  	if iter.i < len(iter.page.Values()) {
  3132  		return nil
  3133  	}
  3134  	err = iter.page.NextWithContext(ctx)
  3135  	if err != nil {
  3136  		iter.i--
  3137  		return err
  3138  	}
  3139  	iter.i = 0
  3140  	return nil
  3141  }
  3142  
  3143  // Next advances to the next value.  If there was an error making
  3144  // the request the iterator does not advance and the error is returned.
  3145  // Deprecated: Use NextWithContext() instead.
  3146  func (iter *PortCollectionIterator) Next() error {
  3147  	return iter.NextWithContext(context.Background())
  3148  }
  3149  
  3150  // NotDone returns true if the enumeration should be started or is not yet complete.
  3151  func (iter PortCollectionIterator) NotDone() bool {
  3152  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  3153  }
  3154  
  3155  // Response returns the raw server response from the last page request.
  3156  func (iter PortCollectionIterator) Response() PortCollection {
  3157  	return iter.page.Response()
  3158  }
  3159  
  3160  // Value returns the current value or a zero-initialized value if the
  3161  // iterator has advanced beyond the end of the collection.
  3162  func (iter PortCollectionIterator) Value() Port {
  3163  	if !iter.page.NotDone() {
  3164  		return Port{}
  3165  	}
  3166  	return iter.page.Values()[iter.i]
  3167  }
  3168  
  3169  // Creates a new instance of the PortCollectionIterator type.
  3170  func NewPortCollectionIterator(page PortCollectionPage) PortCollectionIterator {
  3171  	return PortCollectionIterator{page: page}
  3172  }
  3173  
  3174  // IsEmpty returns true if the ListResult contains no values.
  3175  func (pc PortCollection) IsEmpty() bool {
  3176  	return pc.Value == nil || len(*pc.Value) == 0
  3177  }
  3178  
  3179  // hasNextLink returns true if the NextLink is not empty.
  3180  func (pc PortCollection) hasNextLink() bool {
  3181  	return pc.NextLink != nil && len(*pc.NextLink) != 0
  3182  }
  3183  
  3184  // portCollectionPreparer prepares a request to retrieve the next set of results.
  3185  // It returns nil if no more results exist.
  3186  func (pc PortCollection) portCollectionPreparer(ctx context.Context) (*http.Request, error) {
  3187  	if !pc.hasNextLink() {
  3188  		return nil, nil
  3189  	}
  3190  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  3191  		autorest.AsJSON(),
  3192  		autorest.AsGet(),
  3193  		autorest.WithBaseURL(to.String(pc.NextLink)))
  3194  }
  3195  
  3196  // PortCollectionPage contains a page of Port values.
  3197  type PortCollectionPage struct {
  3198  	fn func(context.Context, PortCollection) (PortCollection, error)
  3199  	pc PortCollection
  3200  }
  3201  
  3202  // NextWithContext advances to the next page of values.  If there was an error making
  3203  // the request the page does not advance and the error is returned.
  3204  func (page *PortCollectionPage) NextWithContext(ctx context.Context) (err error) {
  3205  	if tracing.IsEnabled() {
  3206  		ctx = tracing.StartSpan(ctx, fqdn+"/PortCollectionPage.NextWithContext")
  3207  		defer func() {
  3208  			sc := -1
  3209  			if page.Response().Response.Response != nil {
  3210  				sc = page.Response().Response.Response.StatusCode
  3211  			}
  3212  			tracing.EndSpan(ctx, sc, err)
  3213  		}()
  3214  	}
  3215  	for {
  3216  		next, err := page.fn(ctx, page.pc)
  3217  		if err != nil {
  3218  			return err
  3219  		}
  3220  		page.pc = next
  3221  		if !next.hasNextLink() || !next.IsEmpty() {
  3222  			break
  3223  		}
  3224  	}
  3225  	return nil
  3226  }
  3227  
  3228  // Next advances to the next page of values.  If there was an error making
  3229  // the request the page does not advance and the error is returned.
  3230  // Deprecated: Use NextWithContext() instead.
  3231  func (page *PortCollectionPage) Next() error {
  3232  	return page.NextWithContext(context.Background())
  3233  }
  3234  
  3235  // NotDone returns true if the page enumeration should be started or is not yet complete.
  3236  func (page PortCollectionPage) NotDone() bool {
  3237  	return !page.pc.IsEmpty()
  3238  }
  3239  
  3240  // Response returns the raw server response from the last page request.
  3241  func (page PortCollectionPage) Response() PortCollection {
  3242  	return page.pc
  3243  }
  3244  
  3245  // Values returns the slice of values for the current page or nil if there are no values.
  3246  func (page PortCollectionPage) Values() []Port {
  3247  	if page.pc.IsEmpty() {
  3248  		return nil
  3249  	}
  3250  	return *page.pc.Value
  3251  }
  3252  
  3253  // Creates a new instance of the PortCollectionPage type.
  3254  func NewPortCollectionPage(cur PortCollection, getNextPage func(context.Context, PortCollection) (PortCollection, error)) PortCollectionPage {
  3255  	return PortCollectionPage{
  3256  		fn: getNextPage,
  3257  		pc: cur,
  3258  	}
  3259  }
  3260  
  3261  // PortProperties resource properties.
  3262  type PortProperties struct {
  3263  	// MonitoringState - Specifies whether the port is actively monitored or discovered. Possible values include: 'Monitored', 'Discovered'
  3264  	MonitoringState MonitoringState `json:"monitoringState,omitempty"`
  3265  	// Machine - Machine hosting this port.
  3266  	Machine BasicResourceReference `json:"machine,omitempty"`
  3267  	// DisplayName - Name to use for display purposes.
  3268  	DisplayName *string `json:"displayName,omitempty"`
  3269  	// IPAddress - IP address associated with the port. At present only IPv4 addresses are supported.
  3270  	IPAddress *string `json:"ipAddress,omitempty"`
  3271  	// PortNumber - Port number.
  3272  	PortNumber *int32 `json:"portNumber,omitempty"`
  3273  }
  3274  
  3275  // UnmarshalJSON is the custom unmarshaler for PortProperties struct.
  3276  func (p *PortProperties) UnmarshalJSON(body []byte) error {
  3277  	var m map[string]*json.RawMessage
  3278  	err := json.Unmarshal(body, &m)
  3279  	if err != nil {
  3280  		return err
  3281  	}
  3282  	for k, v := range m {
  3283  		switch k {
  3284  		case "monitoringState":
  3285  			if v != nil {
  3286  				var monitoringState MonitoringState
  3287  				err = json.Unmarshal(*v, &monitoringState)
  3288  				if err != nil {
  3289  					return err
  3290  				}
  3291  				p.MonitoringState = monitoringState
  3292  			}
  3293  		case "machine":
  3294  			if v != nil {
  3295  				machine, err := unmarshalBasicResourceReference(*v)
  3296  				if err != nil {
  3297  					return err
  3298  				}
  3299  				p.Machine = machine
  3300  			}
  3301  		case "displayName":
  3302  			if v != nil {
  3303  				var displayName string
  3304  				err = json.Unmarshal(*v, &displayName)
  3305  				if err != nil {
  3306  					return err
  3307  				}
  3308  				p.DisplayName = &displayName
  3309  			}
  3310  		case "ipAddress":
  3311  			if v != nil {
  3312  				var IPAddress string
  3313  				err = json.Unmarshal(*v, &IPAddress)
  3314  				if err != nil {
  3315  					return err
  3316  				}
  3317  				p.IPAddress = &IPAddress
  3318  			}
  3319  		case "portNumber":
  3320  			if v != nil {
  3321  				var portNumber int32
  3322  				err = json.Unmarshal(*v, &portNumber)
  3323  				if err != nil {
  3324  					return err
  3325  				}
  3326  				p.PortNumber = &portNumber
  3327  			}
  3328  		}
  3329  	}
  3330  
  3331  	return nil
  3332  }
  3333  
  3334  // PortReference reference to a port.
  3335  type PortReference struct {
  3336  	// PortReferenceProperties - Resource properties.
  3337  	*PortReferenceProperties `json:"properties,omitempty"`
  3338  	// ID - Resource URI.
  3339  	ID *string `json:"id,omitempty"`
  3340  	// Type - READ-ONLY; Resource type qualifier.
  3341  	Type *string `json:"type,omitempty"`
  3342  	// Name - READ-ONLY; Resource name.
  3343  	Name *string `json:"name,omitempty"`
  3344  	// Kind - Possible values include: 'KindResourceReference', 'KindRefmachine', 'KindRefprocess', 'KindRefport', 'KindRefmachinewithhints', 'KindRefclientgroup'
  3345  	Kind Kind `json:"kind,omitempty"`
  3346  }
  3347  
  3348  // MarshalJSON is the custom marshaler for PortReference.
  3349  func (pr PortReference) MarshalJSON() ([]byte, error) {
  3350  	pr.Kind = KindRefport
  3351  	objectMap := make(map[string]interface{})
  3352  	if pr.PortReferenceProperties != nil {
  3353  		objectMap["properties"] = pr.PortReferenceProperties
  3354  	}
  3355  	if pr.ID != nil {
  3356  		objectMap["id"] = pr.ID
  3357  	}
  3358  	if pr.Kind != "" {
  3359  		objectMap["kind"] = pr.Kind
  3360  	}
  3361  	return json.Marshal(objectMap)
  3362  }
  3363  
  3364  // AsMachineReference is the BasicResourceReference implementation for PortReference.
  3365  func (pr PortReference) AsMachineReference() (*MachineReference, bool) {
  3366  	return nil, false
  3367  }
  3368  
  3369  // AsProcessReference is the BasicResourceReference implementation for PortReference.
  3370  func (pr PortReference) AsProcessReference() (*ProcessReference, bool) {
  3371  	return nil, false
  3372  }
  3373  
  3374  // AsPortReference is the BasicResourceReference implementation for PortReference.
  3375  func (pr PortReference) AsPortReference() (*PortReference, bool) {
  3376  	return &pr, true
  3377  }
  3378  
  3379  // AsMachineReferenceWithHints is the BasicResourceReference implementation for PortReference.
  3380  func (pr PortReference) AsMachineReferenceWithHints() (*MachineReferenceWithHints, bool) {
  3381  	return nil, false
  3382  }
  3383  
  3384  // AsClientGroupReference is the BasicResourceReference implementation for PortReference.
  3385  func (pr PortReference) AsClientGroupReference() (*ClientGroupReference, bool) {
  3386  	return nil, false
  3387  }
  3388  
  3389  // AsResourceReference is the BasicResourceReference implementation for PortReference.
  3390  func (pr PortReference) AsResourceReference() (*ResourceReference, bool) {
  3391  	return nil, false
  3392  }
  3393  
  3394  // AsBasicResourceReference is the BasicResourceReference implementation for PortReference.
  3395  func (pr PortReference) AsBasicResourceReference() (BasicResourceReference, bool) {
  3396  	return &pr, true
  3397  }
  3398  
  3399  // UnmarshalJSON is the custom unmarshaler for PortReference struct.
  3400  func (pr *PortReference) UnmarshalJSON(body []byte) error {
  3401  	var m map[string]*json.RawMessage
  3402  	err := json.Unmarshal(body, &m)
  3403  	if err != nil {
  3404  		return err
  3405  	}
  3406  	for k, v := range m {
  3407  		switch k {
  3408  		case "properties":
  3409  			if v != nil {
  3410  				var portReferenceProperties PortReferenceProperties
  3411  				err = json.Unmarshal(*v, &portReferenceProperties)
  3412  				if err != nil {
  3413  					return err
  3414  				}
  3415  				pr.PortReferenceProperties = &portReferenceProperties
  3416  			}
  3417  		case "id":
  3418  			if v != nil {
  3419  				var ID string
  3420  				err = json.Unmarshal(*v, &ID)
  3421  				if err != nil {
  3422  					return err
  3423  				}
  3424  				pr.ID = &ID
  3425  			}
  3426  		case "type":
  3427  			if v != nil {
  3428  				var typeVar string
  3429  				err = json.Unmarshal(*v, &typeVar)
  3430  				if err != nil {
  3431  					return err
  3432  				}
  3433  				pr.Type = &typeVar
  3434  			}
  3435  		case "name":
  3436  			if v != nil {
  3437  				var name string
  3438  				err = json.Unmarshal(*v, &name)
  3439  				if err != nil {
  3440  					return err
  3441  				}
  3442  				pr.Name = &name
  3443  			}
  3444  		case "kind":
  3445  			if v != nil {
  3446  				var kind Kind
  3447  				err = json.Unmarshal(*v, &kind)
  3448  				if err != nil {
  3449  					return err
  3450  				}
  3451  				pr.Kind = kind
  3452  			}
  3453  		}
  3454  	}
  3455  
  3456  	return nil
  3457  }
  3458  
  3459  // PortReferenceProperties resource properties.
  3460  type PortReferenceProperties struct {
  3461  	// Machine - READ-ONLY; Machine hosting the port.
  3462  	Machine *MachineReference `json:"machine,omitempty"`
  3463  	// IPAddress - READ-ONLY; IP address of the port.
  3464  	IPAddress *string `json:"ipAddress,omitempty"`
  3465  	// PortNumber - Port number.
  3466  	PortNumber *int32 `json:"portNumber,omitempty"`
  3467  }
  3468  
  3469  // MarshalJSON is the custom marshaler for PortReferenceProperties.
  3470  func (pr PortReferenceProperties) MarshalJSON() ([]byte, error) {
  3471  	objectMap := make(map[string]interface{})
  3472  	if pr.PortNumber != nil {
  3473  		objectMap["portNumber"] = pr.PortNumber
  3474  	}
  3475  	return json.Marshal(objectMap)
  3476  }
  3477  
  3478  // Process a process resource represents a process running on a machine. The process may be actively
  3479  // *monitored*, i.e., a Dependency Agent is running on its machine, or *discovered*, i.e., its existence
  3480  // was inferred by observing the data stream from monitored machines. A process resource represents a pool
  3481  // of actual operating system resources that share command lines and metadata. As the process pool evolves
  3482  // over time, prior versions of the process resource are preserved and available for access. A process is
  3483  // live during an interval of time, if that process is executing during (parts) of that interval
  3484  type Process struct {
  3485  	autorest.Response `json:"-"`
  3486  	// ProcessProperties - Resource properties.
  3487  	*ProcessProperties `json:"properties,omitempty"`
  3488  	// Etag - Resource ETAG.
  3489  	Etag *string `json:"etag,omitempty"`
  3490  	// Kind - Possible values include: 'KindCoreResource', 'KindMachine', 'KindProcess', 'KindPort', 'KindClientGroup', 'KindMachineGroup'
  3491  	Kind KindBasicCoreResource `json:"kind,omitempty"`
  3492  	// ID - READ-ONLY; Resource identifier.
  3493  	ID *string `json:"id,omitempty"`
  3494  	// Type - READ-ONLY; Resource type.
  3495  	Type *string `json:"type,omitempty"`
  3496  	// Name - READ-ONLY; Resource name.
  3497  	Name *string `json:"name,omitempty"`
  3498  }
  3499  
  3500  // MarshalJSON is the custom marshaler for Process.
  3501  func (p Process) MarshalJSON() ([]byte, error) {
  3502  	p.Kind = KindProcess
  3503  	objectMap := make(map[string]interface{})
  3504  	if p.ProcessProperties != nil {
  3505  		objectMap["properties"] = p.ProcessProperties
  3506  	}
  3507  	if p.Etag != nil {
  3508  		objectMap["etag"] = p.Etag
  3509  	}
  3510  	if p.Kind != "" {
  3511  		objectMap["kind"] = p.Kind
  3512  	}
  3513  	return json.Marshal(objectMap)
  3514  }
  3515  
  3516  // AsMachine is the BasicCoreResource implementation for Process.
  3517  func (p Process) AsMachine() (*Machine, bool) {
  3518  	return nil, false
  3519  }
  3520  
  3521  // AsProcess is the BasicCoreResource implementation for Process.
  3522  func (p Process) AsProcess() (*Process, bool) {
  3523  	return &p, true
  3524  }
  3525  
  3526  // AsPort is the BasicCoreResource implementation for Process.
  3527  func (p Process) AsPort() (*Port, bool) {
  3528  	return nil, false
  3529  }
  3530  
  3531  // AsClientGroup is the BasicCoreResource implementation for Process.
  3532  func (p Process) AsClientGroup() (*ClientGroup, bool) {
  3533  	return nil, false
  3534  }
  3535  
  3536  // AsMachineGroup is the BasicCoreResource implementation for Process.
  3537  func (p Process) AsMachineGroup() (*MachineGroup, bool) {
  3538  	return nil, false
  3539  }
  3540  
  3541  // AsCoreResource is the BasicCoreResource implementation for Process.
  3542  func (p Process) AsCoreResource() (*CoreResource, bool) {
  3543  	return nil, false
  3544  }
  3545  
  3546  // AsBasicCoreResource is the BasicCoreResource implementation for Process.
  3547  func (p Process) AsBasicCoreResource() (BasicCoreResource, bool) {
  3548  	return &p, true
  3549  }
  3550  
  3551  // UnmarshalJSON is the custom unmarshaler for Process struct.
  3552  func (p *Process) UnmarshalJSON(body []byte) error {
  3553  	var m map[string]*json.RawMessage
  3554  	err := json.Unmarshal(body, &m)
  3555  	if err != nil {
  3556  		return err
  3557  	}
  3558  	for k, v := range m {
  3559  		switch k {
  3560  		case "properties":
  3561  			if v != nil {
  3562  				var processProperties ProcessProperties
  3563  				err = json.Unmarshal(*v, &processProperties)
  3564  				if err != nil {
  3565  					return err
  3566  				}
  3567  				p.ProcessProperties = &processProperties
  3568  			}
  3569  		case "etag":
  3570  			if v != nil {
  3571  				var etag string
  3572  				err = json.Unmarshal(*v, &etag)
  3573  				if err != nil {
  3574  					return err
  3575  				}
  3576  				p.Etag = &etag
  3577  			}
  3578  		case "kind":
  3579  			if v != nil {
  3580  				var kind KindBasicCoreResource
  3581  				err = json.Unmarshal(*v, &kind)
  3582  				if err != nil {
  3583  					return err
  3584  				}
  3585  				p.Kind = kind
  3586  			}
  3587  		case "id":
  3588  			if v != nil {
  3589  				var ID string
  3590  				err = json.Unmarshal(*v, &ID)
  3591  				if err != nil {
  3592  					return err
  3593  				}
  3594  				p.ID = &ID
  3595  			}
  3596  		case "type":
  3597  			if v != nil {
  3598  				var typeVar string
  3599  				err = json.Unmarshal(*v, &typeVar)
  3600  				if err != nil {
  3601  					return err
  3602  				}
  3603  				p.Type = &typeVar
  3604  			}
  3605  		case "name":
  3606  			if v != nil {
  3607  				var name string
  3608  				err = json.Unmarshal(*v, &name)
  3609  				if err != nil {
  3610  					return err
  3611  				}
  3612  				p.Name = &name
  3613  			}
  3614  		}
  3615  	}
  3616  
  3617  	return nil
  3618  }
  3619  
  3620  // ProcessCollection collection of Process resources.
  3621  type ProcessCollection struct {
  3622  	autorest.Response `json:"-"`
  3623  	// Value - Collection of Process resources.
  3624  	Value *[]Process `json:"value,omitempty"`
  3625  	// NextLink - The URL to the next set of resources.
  3626  	NextLink *string `json:"nextLink,omitempty"`
  3627  }
  3628  
  3629  // ProcessCollectionIterator provides access to a complete listing of Process values.
  3630  type ProcessCollectionIterator struct {
  3631  	i    int
  3632  	page ProcessCollectionPage
  3633  }
  3634  
  3635  // NextWithContext advances to the next value.  If there was an error making
  3636  // the request the iterator does not advance and the error is returned.
  3637  func (iter *ProcessCollectionIterator) NextWithContext(ctx context.Context) (err error) {
  3638  	if tracing.IsEnabled() {
  3639  		ctx = tracing.StartSpan(ctx, fqdn+"/ProcessCollectionIterator.NextWithContext")
  3640  		defer func() {
  3641  			sc := -1
  3642  			if iter.Response().Response.Response != nil {
  3643  				sc = iter.Response().Response.Response.StatusCode
  3644  			}
  3645  			tracing.EndSpan(ctx, sc, err)
  3646  		}()
  3647  	}
  3648  	iter.i++
  3649  	if iter.i < len(iter.page.Values()) {
  3650  		return nil
  3651  	}
  3652  	err = iter.page.NextWithContext(ctx)
  3653  	if err != nil {
  3654  		iter.i--
  3655  		return err
  3656  	}
  3657  	iter.i = 0
  3658  	return nil
  3659  }
  3660  
  3661  // Next advances to the next value.  If there was an error making
  3662  // the request the iterator does not advance and the error is returned.
  3663  // Deprecated: Use NextWithContext() instead.
  3664  func (iter *ProcessCollectionIterator) Next() error {
  3665  	return iter.NextWithContext(context.Background())
  3666  }
  3667  
  3668  // NotDone returns true if the enumeration should be started or is not yet complete.
  3669  func (iter ProcessCollectionIterator) NotDone() bool {
  3670  	return iter.page.NotDone() && iter.i < len(iter.page.Values())
  3671  }
  3672  
  3673  // Response returns the raw server response from the last page request.
  3674  func (iter ProcessCollectionIterator) Response() ProcessCollection {
  3675  	return iter.page.Response()
  3676  }
  3677  
  3678  // Value returns the current value or a zero-initialized value if the
  3679  // iterator has advanced beyond the end of the collection.
  3680  func (iter ProcessCollectionIterator) Value() Process {
  3681  	if !iter.page.NotDone() {
  3682  		return Process{}
  3683  	}
  3684  	return iter.page.Values()[iter.i]
  3685  }
  3686  
  3687  // Creates a new instance of the ProcessCollectionIterator type.
  3688  func NewProcessCollectionIterator(page ProcessCollectionPage) ProcessCollectionIterator {
  3689  	return ProcessCollectionIterator{page: page}
  3690  }
  3691  
  3692  // IsEmpty returns true if the ListResult contains no values.
  3693  func (pc ProcessCollection) IsEmpty() bool {
  3694  	return pc.Value == nil || len(*pc.Value) == 0
  3695  }
  3696  
  3697  // hasNextLink returns true if the NextLink is not empty.
  3698  func (pc ProcessCollection) hasNextLink() bool {
  3699  	return pc.NextLink != nil && len(*pc.NextLink) != 0
  3700  }
  3701  
  3702  // processCollectionPreparer prepares a request to retrieve the next set of results.
  3703  // It returns nil if no more results exist.
  3704  func (pc ProcessCollection) processCollectionPreparer(ctx context.Context) (*http.Request, error) {
  3705  	if !pc.hasNextLink() {
  3706  		return nil, nil
  3707  	}
  3708  	return autorest.Prepare((&http.Request{}).WithContext(ctx),
  3709  		autorest.AsJSON(),
  3710  		autorest.AsGet(),
  3711  		autorest.WithBaseURL(to.String(pc.NextLink)))
  3712  }
  3713  
  3714  // ProcessCollectionPage contains a page of Process values.
  3715  type ProcessCollectionPage struct {
  3716  	fn func(context.Context, ProcessCollection) (ProcessCollection, error)
  3717  	pc ProcessCollection
  3718  }
  3719  
  3720  // NextWithContext advances to the next page of values.  If there was an error making
  3721  // the request the page does not advance and the error is returned.
  3722  func (page *ProcessCollectionPage) NextWithContext(ctx context.Context) (err error) {
  3723  	if tracing.IsEnabled() {
  3724  		ctx = tracing.StartSpan(ctx, fqdn+"/ProcessCollectionPage.NextWithContext")
  3725  		defer func() {
  3726  			sc := -1
  3727  			if page.Response().Response.Response != nil {
  3728  				sc = page.Response().Response.Response.StatusCode
  3729  			}
  3730  			tracing.EndSpan(ctx, sc, err)
  3731  		}()
  3732  	}
  3733  	for {
  3734  		next, err := page.fn(ctx, page.pc)
  3735  		if err != nil {
  3736  			return err
  3737  		}
  3738  		page.pc = next
  3739  		if !next.hasNextLink() || !next.IsEmpty() {
  3740  			break
  3741  		}
  3742  	}
  3743  	return nil
  3744  }
  3745  
  3746  // Next advances to the next page of values.  If there was an error making
  3747  // the request the page does not advance and the error is returned.
  3748  // Deprecated: Use NextWithContext() instead.
  3749  func (page *ProcessCollectionPage) Next() error {
  3750  	return page.NextWithContext(context.Background())
  3751  }
  3752  
  3753  // NotDone returns true if the page enumeration should be started or is not yet complete.
  3754  func (page ProcessCollectionPage) NotDone() bool {
  3755  	return !page.pc.IsEmpty()
  3756  }
  3757  
  3758  // Response returns the raw server response from the last page request.
  3759  func (page ProcessCollectionPage) Response() ProcessCollection {
  3760  	return page.pc
  3761  }
  3762  
  3763  // Values returns the slice of values for the current page or nil if there are no values.
  3764  func (page ProcessCollectionPage) Values() []Process {
  3765  	if page.pc.IsEmpty() {
  3766  		return nil
  3767  	}
  3768  	return *page.pc.Value
  3769  }
  3770  
  3771  // Creates a new instance of the ProcessCollectionPage type.
  3772  func NewProcessCollectionPage(cur ProcessCollection, getNextPage func(context.Context, ProcessCollection) (ProcessCollection, error)) ProcessCollectionPage {
  3773  	return ProcessCollectionPage{
  3774  		fn: getNextPage,
  3775  		pc: cur,
  3776  	}
  3777  }
  3778  
  3779  // ProcessDetails describes process metadata.
  3780  type ProcessDetails struct {
  3781  	// PersistentKey - A unique identifier for a process, generally resilient to process restart, computed by Service Map.
  3782  	PersistentKey *string `json:"persistentKey,omitempty"`
  3783  	// PoolID - Represents the identity of the process pool assigned to the process by Dependency Agent.
  3784  	PoolID *int32 `json:"poolId,omitempty"`
  3785  	// FirstPid - The Operating System Process Identifier (PID) of the first process in this process pool.
  3786  	FirstPid *int32 `json:"firstPid,omitempty"`
  3787  	// Description - Process description.
  3788  	Description *string `json:"description,omitempty"`
  3789  	// CompanyName - Name of company that created the process executable.
  3790  	CompanyName *string `json:"companyName,omitempty"`
  3791  	// InternalName - Internal process name.
  3792  	InternalName *string `json:"internalName,omitempty"`
  3793  	// ProductName - Product name.
  3794  	ProductName *string `json:"productName,omitempty"`
  3795  	// ProductVersion - Product version.
  3796  	ProductVersion *string `json:"productVersion,omitempty"`
  3797  	// FileVersion - File version.
  3798  	FileVersion *string `json:"fileVersion,omitempty"`
  3799  	// CommandLine - Process command line.
  3800  	CommandLine *string `json:"commandLine,omitempty"`
  3801  	// ExecutablePath - Process executable path.
  3802  	ExecutablePath *string `json:"executablePath,omitempty"`
  3803  	// WorkingDirectory - Process workingDirectory.
  3804  	WorkingDirectory *string `json:"workingDirectory,omitempty"`
  3805  	// Services - Collection of services hosted by this Process (Windows only).
  3806  	Services *[]ProcessHostedService `json:"services,omitempty"`
  3807  	// ZoneName - Process zone name (Linux only).
  3808  	ZoneName *string `json:"zoneName,omitempty"`
  3809  }
  3810  
  3811  // ProcessHostedService a service hosted by a process.
  3812  type ProcessHostedService struct {
  3813  	// Name - The name of the service.
  3814  	Name *string `json:"name,omitempty"`
  3815  	// DisplayName - The service's display name.
  3816  	DisplayName *string `json:"displayName,omitempty"`
  3817  }
  3818  
  3819  // BasicProcessHostingConfiguration describes the hosting configuration of a process.
  3820  type BasicProcessHostingConfiguration interface {
  3821  	AsAzureProcessHostingConfiguration() (*AzureProcessHostingConfiguration, bool)
  3822  	AsProcessHostingConfiguration() (*ProcessHostingConfiguration, bool)
  3823  }
  3824  
  3825  // ProcessHostingConfiguration describes the hosting configuration of a process.
  3826  type ProcessHostingConfiguration struct {
  3827  	// Provider - The hosting provider of the VM. Possible values include: 'Provider1Azure'
  3828  	Provider Provider1 `json:"provider,omitempty"`
  3829  	// Kind - Possible values include: 'KindBasicProcessHostingConfigurationKindProcessHostingConfiguration', 'KindBasicProcessHostingConfigurationKindProviderazure'
  3830  	Kind KindBasicProcessHostingConfiguration `json:"kind,omitempty"`
  3831  }
  3832  
  3833  func unmarshalBasicProcessHostingConfiguration(body []byte) (BasicProcessHostingConfiguration, error) {
  3834  	var m map[string]interface{}
  3835  	err := json.Unmarshal(body, &m)
  3836  	if err != nil {
  3837  		return nil, err
  3838  	}
  3839  
  3840  	switch m["kind"] {
  3841  	case string(KindBasicProcessHostingConfigurationKindProviderazure):
  3842  		var aphc AzureProcessHostingConfiguration
  3843  		err := json.Unmarshal(body, &aphc)
  3844  		return aphc, err
  3845  	default:
  3846  		var phc ProcessHostingConfiguration
  3847  		err := json.Unmarshal(body, &phc)
  3848  		return phc, err
  3849  	}
  3850  }
  3851  func unmarshalBasicProcessHostingConfigurationArray(body []byte) ([]BasicProcessHostingConfiguration, error) {
  3852  	var rawMessages []*json.RawMessage
  3853  	err := json.Unmarshal(body, &rawMessages)
  3854  	if err != nil {
  3855  		return nil, err
  3856  	}
  3857  
  3858  	phcArray := make([]BasicProcessHostingConfiguration, len(rawMessages))
  3859  
  3860  	for index, rawMessage := range rawMessages {
  3861  		phc, err := unmarshalBasicProcessHostingConfiguration(*rawMessage)
  3862  		if err != nil {
  3863  			return nil, err
  3864  		}
  3865  		phcArray[index] = phc
  3866  	}
  3867  	return phcArray, nil
  3868  }
  3869  
  3870  // MarshalJSON is the custom marshaler for ProcessHostingConfiguration.
  3871  func (phc ProcessHostingConfiguration) MarshalJSON() ([]byte, error) {
  3872  	phc.Kind = KindBasicProcessHostingConfigurationKindProcessHostingConfiguration
  3873  	objectMap := make(map[string]interface{})
  3874  	if phc.Provider != "" {
  3875  		objectMap["provider"] = phc.Provider
  3876  	}
  3877  	if phc.Kind != "" {
  3878  		objectMap["kind"] = phc.Kind
  3879  	}
  3880  	return json.Marshal(objectMap)
  3881  }
  3882  
  3883  // AsAzureProcessHostingConfiguration is the BasicProcessHostingConfiguration implementation for ProcessHostingConfiguration.
  3884  func (phc ProcessHostingConfiguration) AsAzureProcessHostingConfiguration() (*AzureProcessHostingConfiguration, bool) {
  3885  	return nil, false
  3886  }
  3887  
  3888  // AsProcessHostingConfiguration is the BasicProcessHostingConfiguration implementation for ProcessHostingConfiguration.
  3889  func (phc ProcessHostingConfiguration) AsProcessHostingConfiguration() (*ProcessHostingConfiguration, bool) {
  3890  	return &phc, true
  3891  }
  3892  
  3893  // AsBasicProcessHostingConfiguration is the BasicProcessHostingConfiguration implementation for ProcessHostingConfiguration.
  3894  func (phc ProcessHostingConfiguration) AsBasicProcessHostingConfiguration() (BasicProcessHostingConfiguration, bool) {
  3895  	return &phc, true
  3896  }
  3897  
  3898  // ProcessProperties resource properties.
  3899  type ProcessProperties struct {
  3900  	// Timestamp - UTC date and time when this process resource was updated in the system
  3901  	Timestamp *date.Time `json:"timestamp,omitempty"`
  3902  	// MonitoringState - Specifies whether the process is actively monitored or discovered. Possible values include: 'Monitored', 'Discovered'
  3903  	MonitoringState MonitoringState `json:"monitoringState,omitempty"`
  3904  	// Machine - Machine hosting this process.
  3905  	Machine BasicResourceReference `json:"machine,omitempty"`
  3906  	// ExecutableName - The name of the process executable
  3907  	ExecutableName *string `json:"executableName,omitempty"`
  3908  	// DisplayName - Name to use for display purposes
  3909  	DisplayName *string `json:"displayName,omitempty"`
  3910  	// StartTime - UTC date and time when the process started
  3911  	StartTime *date.Time `json:"startTime,omitempty"`
  3912  	// Role - The inferred role of this process based on its name, command line, etc. Possible values include: 'WebServer', 'AppServer', 'DatabaseServer', 'LdapServer', 'SmbServer'
  3913  	Role ProcessRole `json:"role,omitempty"`
  3914  	// Group - The name of the product or suite of the process. The group is determined by its executable name, command line, etc.
  3915  	Group *string `json:"group,omitempty"`
  3916  	// Details - Process metadata (command line, product name, etc.).
  3917  	Details *ProcessDetails `json:"details,omitempty"`
  3918  	// User - Information about the account under which the process is executing.
  3919  	User *ProcessUser `json:"user,omitempty"`
  3920  	// ClientOf - Present only for a discovered process acting as a client of a monitored process/machine/port. References the monitored process/machine/port that this process is a client of.
  3921  	ClientOf BasicResourceReference `json:"clientOf,omitempty"`
  3922  	// AcceptorOf - Present only for a discovered process acting as a server. References the port on which the discovered process is accepting.
  3923  	AcceptorOf BasicResourceReference `json:"acceptorOf,omitempty"`
  3924  	// Hosting - Information about the hosting environment
  3925  	Hosting BasicProcessHostingConfiguration `json:"hosting,omitempty"`
  3926  }
  3927  
  3928  // UnmarshalJSON is the custom unmarshaler for ProcessProperties struct.
  3929  func (p *ProcessProperties) UnmarshalJSON(body []byte) error {
  3930  	var m map[string]*json.RawMessage
  3931  	err := json.Unmarshal(body, &m)
  3932  	if err != nil {
  3933  		return err
  3934  	}
  3935  	for k, v := range m {
  3936  		switch k {
  3937  		case "timestamp":
  3938  			if v != nil {
  3939  				var timestamp date.Time
  3940  				err = json.Unmarshal(*v, &timestamp)
  3941  				if err != nil {
  3942  					return err
  3943  				}
  3944  				p.Timestamp = &timestamp
  3945  			}
  3946  		case "monitoringState":
  3947  			if v != nil {
  3948  				var monitoringState MonitoringState
  3949  				err = json.Unmarshal(*v, &monitoringState)
  3950  				if err != nil {
  3951  					return err
  3952  				}
  3953  				p.MonitoringState = monitoringState
  3954  			}
  3955  		case "machine":
  3956  			if v != nil {
  3957  				machine, err := unmarshalBasicResourceReference(*v)
  3958  				if err != nil {
  3959  					return err
  3960  				}
  3961  				p.Machine = machine
  3962  			}
  3963  		case "executableName":
  3964  			if v != nil {
  3965  				var executableName string
  3966  				err = json.Unmarshal(*v, &executableName)
  3967  				if err != nil {
  3968  					return err
  3969  				}
  3970  				p.ExecutableName = &executableName
  3971  			}
  3972  		case "displayName":
  3973  			if v != nil {
  3974  				var displayName string
  3975  				err = json.Unmarshal(*v, &displayName)
  3976  				if err != nil {
  3977  					return err
  3978  				}
  3979  				p.DisplayName = &displayName
  3980  			}
  3981  		case "startTime":
  3982  			if v != nil {
  3983  				var startTime date.Time
  3984  				err = json.Unmarshal(*v, &startTime)
  3985  				if err != nil {
  3986  					return err
  3987  				}
  3988  				p.StartTime = &startTime
  3989  			}
  3990  		case "role":
  3991  			if v != nil {
  3992  				var role ProcessRole
  3993  				err = json.Unmarshal(*v, &role)
  3994  				if err != nil {
  3995  					return err
  3996  				}
  3997  				p.Role = role
  3998  			}
  3999  		case "group":
  4000  			if v != nil {
  4001  				var group string
  4002  				err = json.Unmarshal(*v, &group)
  4003  				if err != nil {
  4004  					return err
  4005  				}
  4006  				p.Group = &group
  4007  			}
  4008  		case "details":
  4009  			if v != nil {
  4010  				var details ProcessDetails
  4011  				err = json.Unmarshal(*v, &details)
  4012  				if err != nil {
  4013  					return err
  4014  				}
  4015  				p.Details = &details
  4016  			}
  4017  		case "user":
  4018  			if v != nil {
  4019  				var userVar ProcessUser
  4020  				err = json.Unmarshal(*v, &userVar)
  4021  				if err != nil {
  4022  					return err
  4023  				}
  4024  				p.User = &userVar
  4025  			}
  4026  		case "clientOf":
  4027  			if v != nil {
  4028  				clientOf, err := unmarshalBasicResourceReference(*v)
  4029  				if err != nil {
  4030  					return err
  4031  				}
  4032  				p.ClientOf = clientOf
  4033  			}
  4034  		case "acceptorOf":
  4035  			if v != nil {
  4036  				acceptorOf, err := unmarshalBasicResourceReference(*v)
  4037  				if err != nil {
  4038  					return err
  4039  				}
  4040  				p.AcceptorOf = acceptorOf
  4041  			}
  4042  		case "hosting":
  4043  			if v != nil {
  4044  				hosting, err := unmarshalBasicProcessHostingConfiguration(*v)
  4045  				if err != nil {
  4046  					return err
  4047  				}
  4048  				p.Hosting = hosting
  4049  			}
  4050  		}
  4051  	}
  4052  
  4053  	return nil
  4054  }
  4055  
  4056  // ProcessReference reference to a process.
  4057  type ProcessReference struct {
  4058  	// ProcessReferenceProperties - Resource properties.
  4059  	*ProcessReferenceProperties `json:"properties,omitempty"`
  4060  	// ID - Resource URI.
  4061  	ID *string `json:"id,omitempty"`
  4062  	// Type - READ-ONLY; Resource type qualifier.
  4063  	Type *string `json:"type,omitempty"`
  4064  	// Name - READ-ONLY; Resource name.
  4065  	Name *string `json:"name,omitempty"`
  4066  	// Kind - Possible values include: 'KindResourceReference', 'KindRefmachine', 'KindRefprocess', 'KindRefport', 'KindRefmachinewithhints', 'KindRefclientgroup'
  4067  	Kind Kind `json:"kind,omitempty"`
  4068  }
  4069  
  4070  // MarshalJSON is the custom marshaler for ProcessReference.
  4071  func (pr ProcessReference) MarshalJSON() ([]byte, error) {
  4072  	pr.Kind = KindRefprocess
  4073  	objectMap := make(map[string]interface{})
  4074  	if pr.ProcessReferenceProperties != nil {
  4075  		objectMap["properties"] = pr.ProcessReferenceProperties
  4076  	}
  4077  	if pr.ID != nil {
  4078  		objectMap["id"] = pr.ID
  4079  	}
  4080  	if pr.Kind != "" {
  4081  		objectMap["kind"] = pr.Kind
  4082  	}
  4083  	return json.Marshal(objectMap)
  4084  }
  4085  
  4086  // AsMachineReference is the BasicResourceReference implementation for ProcessReference.
  4087  func (pr ProcessReference) AsMachineReference() (*MachineReference, bool) {
  4088  	return nil, false
  4089  }
  4090  
  4091  // AsProcessReference is the BasicResourceReference implementation for ProcessReference.
  4092  func (pr ProcessReference) AsProcessReference() (*ProcessReference, bool) {
  4093  	return &pr, true
  4094  }
  4095  
  4096  // AsPortReference is the BasicResourceReference implementation for ProcessReference.
  4097  func (pr ProcessReference) AsPortReference() (*PortReference, bool) {
  4098  	return nil, false
  4099  }
  4100  
  4101  // AsMachineReferenceWithHints is the BasicResourceReference implementation for ProcessReference.
  4102  func (pr ProcessReference) AsMachineReferenceWithHints() (*MachineReferenceWithHints, bool) {
  4103  	return nil, false
  4104  }
  4105  
  4106  // AsClientGroupReference is the BasicResourceReference implementation for ProcessReference.
  4107  func (pr ProcessReference) AsClientGroupReference() (*ClientGroupReference, bool) {
  4108  	return nil, false
  4109  }
  4110  
  4111  // AsResourceReference is the BasicResourceReference implementation for ProcessReference.
  4112  func (pr ProcessReference) AsResourceReference() (*ResourceReference, bool) {
  4113  	return nil, false
  4114  }
  4115  
  4116  // AsBasicResourceReference is the BasicResourceReference implementation for ProcessReference.
  4117  func (pr ProcessReference) AsBasicResourceReference() (BasicResourceReference, bool) {
  4118  	return &pr, true
  4119  }
  4120  
  4121  // UnmarshalJSON is the custom unmarshaler for ProcessReference struct.
  4122  func (pr *ProcessReference) UnmarshalJSON(body []byte) error {
  4123  	var m map[string]*json.RawMessage
  4124  	err := json.Unmarshal(body, &m)
  4125  	if err != nil {
  4126  		return err
  4127  	}
  4128  	for k, v := range m {
  4129  		switch k {
  4130  		case "properties":
  4131  			if v != nil {
  4132  				var processReferenceProperties ProcessReferenceProperties
  4133  				err = json.Unmarshal(*v, &processReferenceProperties)
  4134  				if err != nil {
  4135  					return err
  4136  				}
  4137  				pr.ProcessReferenceProperties = &processReferenceProperties
  4138  			}
  4139  		case "id":
  4140  			if v != nil {
  4141  				var ID string
  4142  				err = json.Unmarshal(*v, &ID)
  4143  				if err != nil {
  4144  					return err
  4145  				}
  4146  				pr.ID = &ID
  4147  			}
  4148  		case "type":
  4149  			if v != nil {
  4150  				var typeVar string
  4151  				err = json.Unmarshal(*v, &typeVar)
  4152  				if err != nil {
  4153  					return err
  4154  				}
  4155  				pr.Type = &typeVar
  4156  			}
  4157  		case "name":
  4158  			if v != nil {
  4159  				var name string
  4160  				err = json.Unmarshal(*v, &name)
  4161  				if err != nil {
  4162  					return err
  4163  				}
  4164  				pr.Name = &name
  4165  			}
  4166  		case "kind":
  4167  			if v != nil {
  4168  				var kind Kind
  4169  				err = json.Unmarshal(*v, &kind)
  4170  				if err != nil {
  4171  					return err
  4172  				}
  4173  				pr.Kind = kind
  4174  			}
  4175  		}
  4176  	}
  4177  
  4178  	return nil
  4179  }
  4180  
  4181  // ProcessReferenceProperties resource properties.
  4182  type ProcessReferenceProperties struct {
  4183  	// Machine - READ-ONLY; Machine hosting the process.
  4184  	Machine *MachineReference `json:"machine,omitempty"`
  4185  }
  4186  
  4187  // MarshalJSON is the custom marshaler for ProcessReferenceProperties.
  4188  func (pr ProcessReferenceProperties) MarshalJSON() ([]byte, error) {
  4189  	objectMap := make(map[string]interface{})
  4190  	return json.Marshal(objectMap)
  4191  }
  4192  
  4193  // ProcessUser describes the user under which a process is running.
  4194  type ProcessUser struct {
  4195  	// UserName - User name under which the process is running.
  4196  	UserName *string `json:"userName,omitempty"`
  4197  	// UserDomain - Domain name for the user.
  4198  	UserDomain *string `json:"userDomain,omitempty"`
  4199  }
  4200  
  4201  // BasicRelationship a typed relationship between two entities.
  4202  type BasicRelationship interface {
  4203  	AsConnection() (*Connection, bool)
  4204  	AsAcceptor() (*Acceptor, bool)
  4205  	AsRelationship() (*Relationship, bool)
  4206  }
  4207  
  4208  // Relationship a typed relationship between two entities.
  4209  type Relationship struct {
  4210  	// Kind - Possible values include: 'KindRelationship', 'KindRelconnection', 'KindRelacceptor'
  4211  	Kind KindBasicRelationship `json:"kind,omitempty"`
  4212  	// ID - READ-ONLY; Resource identifier.
  4213  	ID *string `json:"id,omitempty"`
  4214  	// Type - READ-ONLY; Resource type.
  4215  	Type *string `json:"type,omitempty"`
  4216  	// Name - READ-ONLY; Resource name.
  4217  	Name *string `json:"name,omitempty"`
  4218  }
  4219  
  4220  func unmarshalBasicRelationship(body []byte) (BasicRelationship, error) {
  4221  	var m map[string]interface{}
  4222  	err := json.Unmarshal(body, &m)
  4223  	if err != nil {
  4224  		return nil, err
  4225  	}
  4226  
  4227  	switch m["kind"] {
  4228  	case string(KindRelconnection):
  4229  		var c Connection
  4230  		err := json.Unmarshal(body, &c)
  4231  		return c, err
  4232  	case string(KindRelacceptor):
  4233  		var a Acceptor
  4234  		err := json.Unmarshal(body, &a)
  4235  		return a, err
  4236  	default:
  4237  		var r Relationship
  4238  		err := json.Unmarshal(body, &r)
  4239  		return r, err
  4240  	}
  4241  }
  4242  func unmarshalBasicRelationshipArray(body []byte) ([]BasicRelationship, error) {
  4243  	var rawMessages []*json.RawMessage
  4244  	err := json.Unmarshal(body, &rawMessages)
  4245  	if err != nil {
  4246  		return nil, err
  4247  	}
  4248  
  4249  	rArray := make([]BasicRelationship, len(rawMessages))
  4250  
  4251  	for index, rawMessage := range rawMessages {
  4252  		r, err := unmarshalBasicRelationship(*rawMessage)
  4253  		if err != nil {
  4254  			return nil, err
  4255  		}
  4256  		rArray[index] = r
  4257  	}
  4258  	return rArray, nil
  4259  }
  4260  
  4261  // MarshalJSON is the custom marshaler for Relationship.
  4262  func (r Relationship) MarshalJSON() ([]byte, error) {
  4263  	r.Kind = KindRelationship
  4264  	objectMap := make(map[string]interface{})
  4265  	if r.Kind != "" {
  4266  		objectMap["kind"] = r.Kind
  4267  	}
  4268  	return json.Marshal(objectMap)
  4269  }
  4270  
  4271  // AsConnection is the BasicRelationship implementation for Relationship.
  4272  func (r Relationship) AsConnection() (*Connection, bool) {
  4273  	return nil, false
  4274  }
  4275  
  4276  // AsAcceptor is the BasicRelationship implementation for Relationship.
  4277  func (r Relationship) AsAcceptor() (*Acceptor, bool) {
  4278  	return nil, false
  4279  }
  4280  
  4281  // AsRelationship is the BasicRelationship implementation for Relationship.
  4282  func (r Relationship) AsRelationship() (*Relationship, bool) {
  4283  	return &r, true
  4284  }
  4285  
  4286  // AsBasicRelationship is the BasicRelationship implementation for Relationship.
  4287  func (r Relationship) AsBasicRelationship() (BasicRelationship, bool) {
  4288  	return &r, true
  4289  }
  4290  
  4291  // RelationshipProperties relationship properties.
  4292  type RelationshipProperties struct {
  4293  	// Source - Source resource of the relationship.
  4294  	Source BasicResourceReference `json:"source,omitempty"`
  4295  	// Destination - Destination resource of the relationship.
  4296  	Destination BasicResourceReference `json:"destination,omitempty"`
  4297  	// StartTime - Relationship start time.
  4298  	StartTime *date.Time `json:"startTime,omitempty"`
  4299  	// EndTime - Relationship end time.
  4300  	EndTime *date.Time `json:"endTime,omitempty"`
  4301  }
  4302  
  4303  // UnmarshalJSON is the custom unmarshaler for RelationshipProperties struct.
  4304  func (rp *RelationshipProperties) UnmarshalJSON(body []byte) error {
  4305  	var m map[string]*json.RawMessage
  4306  	err := json.Unmarshal(body, &m)
  4307  	if err != nil {
  4308  		return err
  4309  	}
  4310  	for k, v := range m {
  4311  		switch k {
  4312  		case "source":
  4313  			if v != nil {
  4314  				source, err := unmarshalBasicResourceReference(*v)
  4315  				if err != nil {
  4316  					return err
  4317  				}
  4318  				rp.Source = source
  4319  			}
  4320  		case "destination":
  4321  			if v != nil {
  4322  				destination, err := unmarshalBasicResourceReference(*v)
  4323  				if err != nil {
  4324  					return err
  4325  				}
  4326  				rp.Destination = destination
  4327  			}
  4328  		case "startTime":
  4329  			if v != nil {
  4330  				var startTime date.Time
  4331  				err = json.Unmarshal(*v, &startTime)
  4332  				if err != nil {
  4333  					return err
  4334  				}
  4335  				rp.StartTime = &startTime
  4336  			}
  4337  		case "endTime":
  4338  			if v != nil {
  4339  				var endTime date.Time
  4340  				err = json.Unmarshal(*v, &endTime)
  4341  				if err != nil {
  4342  					return err
  4343  				}
  4344  				rp.EndTime = &endTime
  4345  			}
  4346  		}
  4347  	}
  4348  
  4349  	return nil
  4350  }
  4351  
  4352  // Resource resource model definition.
  4353  type Resource struct {
  4354  	// ID - READ-ONLY; Resource identifier.
  4355  	ID *string `json:"id,omitempty"`
  4356  	// Type - READ-ONLY; Resource type.
  4357  	Type *string `json:"type,omitempty"`
  4358  	// Name - READ-ONLY; Resource name.
  4359  	Name *string `json:"name,omitempty"`
  4360  }
  4361  
  4362  // MarshalJSON is the custom marshaler for Resource.
  4363  func (r Resource) MarshalJSON() ([]byte, error) {
  4364  	objectMap := make(map[string]interface{})
  4365  	return json.Marshal(objectMap)
  4366  }
  4367  
  4368  // BasicResourceReference represents a reference to another resource.
  4369  type BasicResourceReference interface {
  4370  	AsMachineReference() (*MachineReference, bool)
  4371  	AsProcessReference() (*ProcessReference, bool)
  4372  	AsPortReference() (*PortReference, bool)
  4373  	AsMachineReferenceWithHints() (*MachineReferenceWithHints, bool)
  4374  	AsClientGroupReference() (*ClientGroupReference, bool)
  4375  	AsResourceReference() (*ResourceReference, bool)
  4376  }
  4377  
  4378  // ResourceReference represents a reference to another resource.
  4379  type ResourceReference struct {
  4380  	// ID - Resource URI.
  4381  	ID *string `json:"id,omitempty"`
  4382  	// Type - READ-ONLY; Resource type qualifier.
  4383  	Type *string `json:"type,omitempty"`
  4384  	// Name - READ-ONLY; Resource name.
  4385  	Name *string `json:"name,omitempty"`
  4386  	// Kind - Possible values include: 'KindResourceReference', 'KindRefmachine', 'KindRefprocess', 'KindRefport', 'KindRefmachinewithhints', 'KindRefclientgroup'
  4387  	Kind Kind `json:"kind,omitempty"`
  4388  }
  4389  
  4390  func unmarshalBasicResourceReference(body []byte) (BasicResourceReference, error) {
  4391  	var m map[string]interface{}
  4392  	err := json.Unmarshal(body, &m)
  4393  	if err != nil {
  4394  		return nil, err
  4395  	}
  4396  
  4397  	switch m["kind"] {
  4398  	case string(KindRefmachine):
  4399  		var mr MachineReference
  4400  		err := json.Unmarshal(body, &mr)
  4401  		return mr, err
  4402  	case string(KindRefprocess):
  4403  		var pr ProcessReference
  4404  		err := json.Unmarshal(body, &pr)
  4405  		return pr, err
  4406  	case string(KindRefport):
  4407  		var pr PortReference
  4408  		err := json.Unmarshal(body, &pr)
  4409  		return pr, err
  4410  	case string(KindRefmachinewithhints):
  4411  		var mrwh MachineReferenceWithHints
  4412  		err := json.Unmarshal(body, &mrwh)
  4413  		return mrwh, err
  4414  	case string(KindRefclientgroup):
  4415  		var cgr ClientGroupReference
  4416  		err := json.Unmarshal(body, &cgr)
  4417  		return cgr, err
  4418  	default:
  4419  		var rr ResourceReference
  4420  		err := json.Unmarshal(body, &rr)
  4421  		return rr, err
  4422  	}
  4423  }
  4424  func unmarshalBasicResourceReferenceArray(body []byte) ([]BasicResourceReference, error) {
  4425  	var rawMessages []*json.RawMessage
  4426  	err := json.Unmarshal(body, &rawMessages)
  4427  	if err != nil {
  4428  		return nil, err
  4429  	}
  4430  
  4431  	rrArray := make([]BasicResourceReference, len(rawMessages))
  4432  
  4433  	for index, rawMessage := range rawMessages {
  4434  		rr, err := unmarshalBasicResourceReference(*rawMessage)
  4435  		if err != nil {
  4436  			return nil, err
  4437  		}
  4438  		rrArray[index] = rr
  4439  	}
  4440  	return rrArray, nil
  4441  }
  4442  
  4443  // MarshalJSON is the custom marshaler for ResourceReference.
  4444  func (rr ResourceReference) MarshalJSON() ([]byte, error) {
  4445  	rr.Kind = KindResourceReference
  4446  	objectMap := make(map[string]interface{})
  4447  	if rr.ID != nil {
  4448  		objectMap["id"] = rr.ID
  4449  	}
  4450  	if rr.Kind != "" {
  4451  		objectMap["kind"] = rr.Kind
  4452  	}
  4453  	return json.Marshal(objectMap)
  4454  }
  4455  
  4456  // AsMachineReference is the BasicResourceReference implementation for ResourceReference.
  4457  func (rr ResourceReference) AsMachineReference() (*MachineReference, bool) {
  4458  	return nil, false
  4459  }
  4460  
  4461  // AsProcessReference is the BasicResourceReference implementation for ResourceReference.
  4462  func (rr ResourceReference) AsProcessReference() (*ProcessReference, bool) {
  4463  	return nil, false
  4464  }
  4465  
  4466  // AsPortReference is the BasicResourceReference implementation for ResourceReference.
  4467  func (rr ResourceReference) AsPortReference() (*PortReference, bool) {
  4468  	return nil, false
  4469  }
  4470  
  4471  // AsMachineReferenceWithHints is the BasicResourceReference implementation for ResourceReference.
  4472  func (rr ResourceReference) AsMachineReferenceWithHints() (*MachineReferenceWithHints, bool) {
  4473  	return nil, false
  4474  }
  4475  
  4476  // AsClientGroupReference is the BasicResourceReference implementation for ResourceReference.
  4477  func (rr ResourceReference) AsClientGroupReference() (*ClientGroupReference, bool) {
  4478  	return nil, false
  4479  }
  4480  
  4481  // AsResourceReference is the BasicResourceReference implementation for ResourceReference.
  4482  func (rr ResourceReference) AsResourceReference() (*ResourceReference, bool) {
  4483  	return &rr, true
  4484  }
  4485  
  4486  // AsBasicResourceReference is the BasicResourceReference implementation for ResourceReference.
  4487  func (rr ResourceReference) AsBasicResourceReference() (BasicResourceReference, bool) {
  4488  	return &rr, true
  4489  }
  4490  
  4491  // SingleMachineDependencyMapRequest specifies the computation of a single server dependency map. A single
  4492  // server dependency map includes all direct dependencies of a given machine.
  4493  type SingleMachineDependencyMapRequest struct {
  4494  	// MachineID - URI of machine resource for which to generate the map.
  4495  	MachineID *string `json:"machineId,omitempty"`
  4496  	// StartTime - Map interval start time.
  4497  	StartTime *date.Time `json:"startTime,omitempty"`
  4498  	// EndTime - Map interval end time.
  4499  	EndTime *date.Time `json:"endTime,omitempty"`
  4500  	// Kind - Possible values include: 'KindMapRequest', 'KindMapsingleMachineDependency', 'KindMultipleMachinesMapRequest', 'KindMapmachineListDependency', 'KindMapmachineGroupDependency'
  4501  	Kind KindBasicMapRequest `json:"kind,omitempty"`
  4502  }
  4503  
  4504  // MarshalJSON is the custom marshaler for SingleMachineDependencyMapRequest.
  4505  func (smdmr SingleMachineDependencyMapRequest) MarshalJSON() ([]byte, error) {
  4506  	smdmr.Kind = KindMapsingleMachineDependency
  4507  	objectMap := make(map[string]interface{})
  4508  	if smdmr.MachineID != nil {
  4509  		objectMap["machineId"] = smdmr.MachineID
  4510  	}
  4511  	if smdmr.StartTime != nil {
  4512  		objectMap["startTime"] = smdmr.StartTime
  4513  	}
  4514  	if smdmr.EndTime != nil {
  4515  		objectMap["endTime"] = smdmr.EndTime
  4516  	}
  4517  	if smdmr.Kind != "" {
  4518  		objectMap["kind"] = smdmr.Kind
  4519  	}
  4520  	return json.Marshal(objectMap)
  4521  }
  4522  
  4523  // AsSingleMachineDependencyMapRequest is the BasicMapRequest implementation for SingleMachineDependencyMapRequest.
  4524  func (smdmr SingleMachineDependencyMapRequest) AsSingleMachineDependencyMapRequest() (*SingleMachineDependencyMapRequest, bool) {
  4525  	return &smdmr, true
  4526  }
  4527  
  4528  // AsMultipleMachinesMapRequest is the BasicMapRequest implementation for SingleMachineDependencyMapRequest.
  4529  func (smdmr SingleMachineDependencyMapRequest) AsMultipleMachinesMapRequest() (*MultipleMachinesMapRequest, bool) {
  4530  	return nil, false
  4531  }
  4532  
  4533  // AsBasicMultipleMachinesMapRequest is the BasicMapRequest implementation for SingleMachineDependencyMapRequest.
  4534  func (smdmr SingleMachineDependencyMapRequest) AsBasicMultipleMachinesMapRequest() (BasicMultipleMachinesMapRequest, bool) {
  4535  	return nil, false
  4536  }
  4537  
  4538  // AsMachineListMapRequest is the BasicMapRequest implementation for SingleMachineDependencyMapRequest.
  4539  func (smdmr SingleMachineDependencyMapRequest) AsMachineListMapRequest() (*MachineListMapRequest, bool) {
  4540  	return nil, false
  4541  }
  4542  
  4543  // AsMachineGroupMapRequest is the BasicMapRequest implementation for SingleMachineDependencyMapRequest.
  4544  func (smdmr SingleMachineDependencyMapRequest) AsMachineGroupMapRequest() (*MachineGroupMapRequest, bool) {
  4545  	return nil, false
  4546  }
  4547  
  4548  // AsMapRequest is the BasicMapRequest implementation for SingleMachineDependencyMapRequest.
  4549  func (smdmr SingleMachineDependencyMapRequest) AsMapRequest() (*MapRequest, bool) {
  4550  	return nil, false
  4551  }
  4552  
  4553  // AsBasicMapRequest is the BasicMapRequest implementation for SingleMachineDependencyMapRequest.
  4554  func (smdmr SingleMachineDependencyMapRequest) AsBasicMapRequest() (BasicMapRequest, bool) {
  4555  	return &smdmr, true
  4556  }
  4557  
  4558  // Summary base for all resource summaries.
  4559  type Summary struct {
  4560  	// ID - READ-ONLY; Resource identifier.
  4561  	ID *string `json:"id,omitempty"`
  4562  	// Type - READ-ONLY; Resource type.
  4563  	Type *string `json:"type,omitempty"`
  4564  	// Name - READ-ONLY; Resource name.
  4565  	Name *string `json:"name,omitempty"`
  4566  }
  4567  
  4568  // MarshalJSON is the custom marshaler for Summary.
  4569  func (s Summary) MarshalJSON() ([]byte, error) {
  4570  	objectMap := make(map[string]interface{})
  4571  	return json.Marshal(objectMap)
  4572  }
  4573  
  4574  // SummaryProperties base for all summaries.
  4575  type SummaryProperties struct {
  4576  	// StartTime - Summary interval start time.
  4577  	StartTime *date.Time `json:"startTime,omitempty"`
  4578  	// EndTime - Summary interval end time.
  4579  	EndTime *date.Time `json:"endTime,omitempty"`
  4580  }
  4581  
  4582  // Timezone describes a timezone.
  4583  type Timezone struct {
  4584  	// FullName - Timezone full name.
  4585  	FullName *string `json:"fullName,omitempty"`
  4586  }
  4587  
  4588  // VirtualMachineConfiguration describes the virtualization-related configuration of a machine.
  4589  type VirtualMachineConfiguration struct {
  4590  	// VirtualMachineType - Specifies the virtualization technology used by the machine (hyperv, vmware, etc.). Possible values include: 'VirtualMachineTypeUnknown', 'VirtualMachineTypeHyperv', 'VirtualMachineTypeLdom', 'VirtualMachineTypeLpar', 'VirtualMachineTypeVmware', 'VirtualMachineTypeVirtualPc', 'VirtualMachineTypeXen'
  4591  	VirtualMachineType VirtualMachineType `json:"virtualMachineType,omitempty"`
  4592  	// NativeMachineID - The unique identifier of the virtual machine as reported by the underlying virtualization system.
  4593  	NativeMachineID *string `json:"nativeMachineId,omitempty"`
  4594  	// VirtualMachineName - The Name of the virtual machine.
  4595  	VirtualMachineName *string `json:"virtualMachineName,omitempty"`
  4596  	// NativeHostMachineID - The unique identifier of the host of this virtual machine as reported by the underlying virtualization system.
  4597  	NativeHostMachineID *string `json:"nativeHostMachineId,omitempty"`
  4598  }
  4599  

View as plain text