diff --git a/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go b/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go index 384663046779..ecf45105c080 100644 --- a/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go +++ b/services/preview/security/mgmt/v1.0/security/devicesecuritygroups.go @@ -42,10 +42,11 @@ func NewDeviceSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID str return DeviceSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// CreateOrUpdate creates or updates the device security group on a specified IoT hub resource. +// CreateOrUpdate use this method to creates or updates the device security group on a specified IoT Hub resource. // Parameters: // resourceID - the identifier of the resource. -// deviceSecurityGroupName - the name of the security group. Please notice that the name is case insensitive. +// deviceSecurityGroupName - the name of the device security group. Note that the name of the device security +// group is case insensitive. // deviceSecurityGroup - security group object. func (client DeviceSecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup DeviceSecurityGroup) (result DeviceSecurityGroup, err error) { if tracing.IsEnabled() { @@ -119,10 +120,11 @@ func (client DeviceSecurityGroupsClient) CreateOrUpdateResponder(resp *http.Resp return } -// Delete deletes the security group +// Delete user this method to deletes the device security group. // Parameters: // resourceID - the identifier of the resource. -// deviceSecurityGroupName - the name of the security group. Please notice that the name is case insensitive. +// deviceSecurityGroupName - the name of the device security group. Note that the name of the device security +// group is case insensitive. func (client DeviceSecurityGroupsClient) Delete(ctx context.Context, resourceID string, deviceSecurityGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupsClient.Delete") @@ -192,10 +194,11 @@ func (client DeviceSecurityGroupsClient) DeleteResponder(resp *http.Response) (r return } -// Get gets the device security group for the specified IoT hub resource. +// Get use this method to get the device security group for the specified IoT Hub resource. // Parameters: // resourceID - the identifier of the resource. -// deviceSecurityGroupName - the name of the security group. Please notice that the name is case insensitive. +// deviceSecurityGroupName - the name of the device security group. Note that the name of the device security +// group is case insensitive. func (client DeviceSecurityGroupsClient) Get(ctx context.Context, resourceID string, deviceSecurityGroupName string) (result DeviceSecurityGroup, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupsClient.Get") @@ -266,7 +269,7 @@ func (client DeviceSecurityGroupsClient) GetResponder(resp *http.Response) (resu return } -// List gets the list of device security groups for the specified IoT hub resource. +// List use this method get the list of device security groups for the specified IoT Hub resource. // Parameters: // resourceID - the identifier of the resource. func (client DeviceSecurityGroupsClient) List(ctx context.Context, resourceID string) (result DeviceSecurityGroupListPage, err error) { diff --git a/services/preview/security/mgmt/v1.0/security/enums.go b/services/preview/security/mgmt/v1.0/security/enums.go index 4a3cbf485556..06b18db40bf9 100644 --- a/services/preview/security/mgmt/v1.0/security/enums.go +++ b/services/preview/security/mgmt/v1.0/security/enums.go @@ -339,11 +339,13 @@ const ( Alerts EventSource = "Alerts" // Assessments ... Assessments EventSource = "Assessments" + // SubAssessments ... + SubAssessments EventSource = "SubAssessments" ) // PossibleEventSourceValues returns an array of possible values for the EventSource const type. func PossibleEventSourceValues() []EventSource { - return []EventSource{Alerts, Assessments} + return []EventSource{Alerts, Assessments, SubAssessments} } // Exe enumerates the values for exe. @@ -738,6 +740,67 @@ func PossibleRuleStateValues() []RuleState { return []RuleState{RuleStateDisabled, RuleStateEnabled, RuleStateExpired} } +// RuleType enumerates the values for rule type. +type RuleType string + +const ( + // RuleTypeActiveConnectionsNotInAllowedRange ... + RuleTypeActiveConnectionsNotInAllowedRange RuleType = "ActiveConnectionsNotInAllowedRange" + // RuleTypeAllowlistCustomAlertRule ... + RuleTypeAllowlistCustomAlertRule RuleType = "AllowlistCustomAlertRule" + // RuleTypeAmqpC2DMessagesNotInAllowedRange ... + RuleTypeAmqpC2DMessagesNotInAllowedRange RuleType = "AmqpC2DMessagesNotInAllowedRange" + // RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange ... + RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange RuleType = "AmqpC2DRejectedMessagesNotInAllowedRange" + // RuleTypeAmqpD2CMessagesNotInAllowedRange ... + RuleTypeAmqpD2CMessagesNotInAllowedRange RuleType = "AmqpD2CMessagesNotInAllowedRange" + // RuleTypeConnectionToIPNotAllowed ... + RuleTypeConnectionToIPNotAllowed RuleType = "ConnectionToIpNotAllowed" + // RuleTypeCustomAlertRule ... + RuleTypeCustomAlertRule RuleType = "CustomAlertRule" + // RuleTypeDenylistCustomAlertRule ... + RuleTypeDenylistCustomAlertRule RuleType = "DenylistCustomAlertRule" + // RuleTypeDirectMethodInvokesNotInAllowedRange ... + RuleTypeDirectMethodInvokesNotInAllowedRange RuleType = "DirectMethodInvokesNotInAllowedRange" + // RuleTypeFailedLocalLoginsNotInAllowedRange ... + RuleTypeFailedLocalLoginsNotInAllowedRange RuleType = "FailedLocalLoginsNotInAllowedRange" + // RuleTypeFileUploadsNotInAllowedRange ... + RuleTypeFileUploadsNotInAllowedRange RuleType = "FileUploadsNotInAllowedRange" + // RuleTypeHTTPC2DMessagesNotInAllowedRange ... + RuleTypeHTTPC2DMessagesNotInAllowedRange RuleType = "HttpC2DMessagesNotInAllowedRange" + // RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange ... + RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange RuleType = "HttpC2DRejectedMessagesNotInAllowedRange" + // RuleTypeHTTPD2CMessagesNotInAllowedRange ... + RuleTypeHTTPD2CMessagesNotInAllowedRange RuleType = "HttpD2CMessagesNotInAllowedRange" + // RuleTypeListCustomAlertRule ... + RuleTypeListCustomAlertRule RuleType = "ListCustomAlertRule" + // RuleTypeLocalUserNotAllowed ... + RuleTypeLocalUserNotAllowed RuleType = "LocalUserNotAllowed" + // RuleTypeMqttC2DMessagesNotInAllowedRange ... + RuleTypeMqttC2DMessagesNotInAllowedRange RuleType = "MqttC2DMessagesNotInAllowedRange" + // RuleTypeMqttC2DRejectedMessagesNotInAllowedRange ... + RuleTypeMqttC2DRejectedMessagesNotInAllowedRange RuleType = "MqttC2DRejectedMessagesNotInAllowedRange" + // RuleTypeMqttD2CMessagesNotInAllowedRange ... + RuleTypeMqttD2CMessagesNotInAllowedRange RuleType = "MqttD2CMessagesNotInAllowedRange" + // RuleTypeProcessNotAllowed ... + RuleTypeProcessNotAllowed RuleType = "ProcessNotAllowed" + // RuleTypeQueuePurgesNotInAllowedRange ... + RuleTypeQueuePurgesNotInAllowedRange RuleType = "QueuePurgesNotInAllowedRange" + // RuleTypeThresholdCustomAlertRule ... + RuleTypeThresholdCustomAlertRule RuleType = "ThresholdCustomAlertRule" + // RuleTypeTimeWindowCustomAlertRule ... + RuleTypeTimeWindowCustomAlertRule RuleType = "TimeWindowCustomAlertRule" + // RuleTypeTwinUpdatesNotInAllowedRange ... + RuleTypeTwinUpdatesNotInAllowedRange RuleType = "TwinUpdatesNotInAllowedRange" + // RuleTypeUnauthorizedOperationsNotInAllowedRange ... + RuleTypeUnauthorizedOperationsNotInAllowedRange RuleType = "UnauthorizedOperationsNotInAllowedRange" +) + +// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{RuleTypeActiveConnectionsNotInAllowedRange, RuleTypeAllowlistCustomAlertRule, RuleTypeAmqpC2DMessagesNotInAllowedRange, RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange, RuleTypeAmqpD2CMessagesNotInAllowedRange, RuleTypeConnectionToIPNotAllowed, RuleTypeCustomAlertRule, RuleTypeDenylistCustomAlertRule, RuleTypeDirectMethodInvokesNotInAllowedRange, RuleTypeFailedLocalLoginsNotInAllowedRange, RuleTypeFileUploadsNotInAllowedRange, RuleTypeHTTPC2DMessagesNotInAllowedRange, RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange, RuleTypeHTTPD2CMessagesNotInAllowedRange, RuleTypeListCustomAlertRule, RuleTypeLocalUserNotAllowed, RuleTypeMqttC2DMessagesNotInAllowedRange, RuleTypeMqttC2DRejectedMessagesNotInAllowedRange, RuleTypeMqttD2CMessagesNotInAllowedRange, RuleTypeProcessNotAllowed, RuleTypeQueuePurgesNotInAllowedRange, RuleTypeThresholdCustomAlertRule, RuleTypeTimeWindowCustomAlertRule, RuleTypeTwinUpdatesNotInAllowedRange, RuleTypeUnauthorizedOperationsNotInAllowedRange} +} + // Script enumerates the values for script. type Script string diff --git a/services/preview/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index eabfb8955f70..dfdf7b2ccadb 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -101,6 +101,196 @@ type AadSolutionProperties struct { ConnectivityState AadConnectivityState `json:"connectivityState,omitempty"` } +// ActiveConnectionsNotInAllowedRange number of active connections is not in allowed range. +type ActiveConnectionsNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) MarshalJSON() ([]byte, error) { + acniar.RuleType = RuleTypeActiveConnectionsNotInAllowedRange + objectMap := make(map[string]interface{}) + if acniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = acniar.TimeWindowSize + } + if acniar.MinThreshold != nil { + objectMap["minThreshold"] = acniar.MinThreshold + } + if acniar.MaxThreshold != nil { + objectMap["maxThreshold"] = acniar.MaxThreshold + } + if acniar.IsEnabled != nil { + objectMap["isEnabled"] = acniar.IsEnabled + } + if acniar.RuleType != "" { + objectMap["ruleType"] = acniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &acniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &acniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return &acniar, true +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for ActiveConnectionsNotInAllowedRange. +func (acniar ActiveConnectionsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &acniar, true +} + // AdaptiveNetworkHardening the resource whose properties describes the Adaptive Network Hardening settings for // some Azure resource type AdaptiveNetworkHardening struct { @@ -1430,8 +1620,17 @@ type AllowedConnectionsResourceProperties struct { ConnectableResources *[]ConnectableResource `json:"connectableResources,omitempty"` } +// BasicAllowlistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is +// allowed. +type BasicAllowlistCustomAlertRule interface { + AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) + AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) + AsProcessNotAllowed() (*ProcessNotAllowed, bool) + AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) +} + // AllowlistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is -// allowed +// allowed. type AllowlistCustomAlertRule struct { // AllowlistValues - The values to allow. The format of the values depends on the rule type. AllowlistValues *[]string `json:"allowlistValues,omitempty"` @@ -1441,14 +1640,60 @@ type AllowlistCustomAlertRule struct { DisplayName *string `json:"displayName,omitempty"` // Description - READ-ONLY; The description of the custom alert. Description *string `json:"description,omitempty"` - // IsEnabled - Whether the custom alert is enabled. + // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - The type of the custom alert rule. - RuleType *string `json:"ruleType,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +func unmarshalBasicAllowlistCustomAlertRule(body []byte) (BasicAllowlistCustomAlertRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ruleType"] { + case string(RuleTypeConnectionToIPNotAllowed): + var ctina ConnectionToIPNotAllowed + err := json.Unmarshal(body, &ctina) + return ctina, err + case string(RuleTypeLocalUserNotAllowed): + var luna LocalUserNotAllowed + err := json.Unmarshal(body, &luna) + return luna, err + case string(RuleTypeProcessNotAllowed): + var pna ProcessNotAllowed + err := json.Unmarshal(body, &pna) + return pna, err + default: + var acar AllowlistCustomAlertRule + err := json.Unmarshal(body, &acar) + return acar, err + } +} +func unmarshalBasicAllowlistCustomAlertRuleArray(body []byte) ([]BasicAllowlistCustomAlertRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + acarArray := make([]BasicAllowlistCustomAlertRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + acar, err := unmarshalBasicAllowlistCustomAlertRule(*rawMessage) + if err != nil { + return nil, err + } + acarArray[index] = acar + } + return acarArray, nil } // MarshalJSON is the custom marshaler for AllowlistCustomAlertRule. func (acar AllowlistCustomAlertRule) MarshalJSON() ([]byte, error) { + acar.RuleType = RuleTypeAllowlistCustomAlertRule objectMap := make(map[string]interface{}) if acar.AllowlistValues != nil { objectMap["allowlistValues"] = acar.AllowlistValues @@ -1456,564 +1701,4752 @@ func (acar AllowlistCustomAlertRule) MarshalJSON() ([]byte, error) { if acar.IsEnabled != nil { objectMap["isEnabled"] = acar.IsEnabled } - if acar.RuleType != nil { + if acar.RuleType != "" { objectMap["ruleType"] = acar.RuleType } return json.Marshal(objectMap) } -// AppWhitelistingGroup ... -type AppWhitelistingGroup struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *AppWhitelistingGroupData `json:"properties,omitempty"` +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AppWhitelistingGroup. -func (awg AppWhitelistingGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if awg.AppWhitelistingGroupData != nil { - objectMap["properties"] = awg.AppWhitelistingGroupData - } - return json.Marshal(objectMap) +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for AppWhitelistingGroup struct. -func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - awg.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - awg.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - awg.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - awg.Location = &location - } - case "properties": - if v != nil { - var appWhitelistingGroupData AppWhitelistingGroupData - err = json.Unmarshal(*v, &appWhitelistingGroupData) - if err != nil { - return err - } - awg.AppWhitelistingGroupData = &appWhitelistingGroupData - } - } - } +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} - return nil +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false } -// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure -// Security Center to be allowed -type AppWhitelistingGroupData struct { - // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' - EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` - ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` - // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' - ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` - // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' - RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` - Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` - // SourceSystem - Possible values include: 'SourceSystemAzureAppLocker', 'SourceSystemAzureAuditD', 'SourceSystemNonAzureAppLocker', 'SourceSystemNonAzureAuditD', 'SourceSystemNone' - SourceSystem SourceSystem `json:"sourceSystem,omitempty"` - VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` - PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return &acar, true } -// AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by Azure -// Security Center to be allowed -type AppWhitelistingGroups struct { - autorest.Response `json:"-"` - Value *[]AppWhitelistingGroup `json:"value,omitempty"` +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return &acar, true } -// AppWhitelistingIssueSummary represents a summary of the alerts of the VM/server group -type AppWhitelistingIssueSummary struct { - // Issue - Possible values include: 'ViolationsAudited', 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', 'RulesViolatedManually' - Issue Issue `json:"issue,omitempty"` - // NumberOfVms - The number of machines in the VM/server group that have this alert - NumberOfVms *float64 `json:"numberOfVms,omitempty"` +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy -type AppWhitelistingPutGroupData struct { - // EnforcementMode - The enforcement mode of the group. Can also be defined per collection type by using ProtectionMode. Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce', 'EnforcementMode1None' - EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` - // ProtectionMode - The protection mode of the group per collection type. Can also be defined for all collection types by using EnforcementMode - ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` - VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` - PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// AscLocation the ASC location of the subscription is in the "name" field -type AscLocation struct { - autorest.Response `json:"-"` - Properties interface{} `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &acar, true } -// MarshalJSON is the custom marshaler for AscLocation. -func (al AscLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if al.Properties != nil { - objectMap["properties"] = al.Properties - } - return json.Marshal(objectMap) +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// AscLocationList list of locations where ASC saves your data -type AscLocationList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY - Value *[]AscLocation `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// AscLocationListIterator provides access to a complete listing of AscLocation values. -type AscLocationListIterator struct { - i int - page AscLocationListPage +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AscLocationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AscLocationListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AscLocationListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AscLocationListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter AscLocationListIterator) Response() AscLocationList { - return iter.page.Response() +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AscLocationListIterator) Value() AscLocation { - if !iter.page.NotDone() { - return AscLocation{} - } - return iter.page.Values()[iter.i] +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the AscLocationListIterator type. -func NewAscLocationListIterator(page AscLocationListPage) AscLocationListIterator { - return AscLocationListIterator{page: page} +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (all AscLocationList) IsEmpty() bool { - return all.Value == nil || len(*all.Value) == 0 +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (all AscLocationList) hasNextLink() bool { - return all.NextLink != nil && len(*all.NextLink) != 0 +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// ascLocationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (all AscLocationList) ascLocationListPreparer(ctx context.Context) (*http.Request, error) { - if !all.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(all.NextLink))) +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// AscLocationListPage contains a page of AscLocation values. -type AscLocationListPage struct { - fn func(context.Context, AscLocationList) (AscLocationList, error) - all AscLocationList +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AscLocationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AscLocationListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.all) - if err != nil { - return err - } - page.all = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AscLocationListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AscLocationListPage) NotDone() bool { - return !page.all.IsEmpty() +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page AscLocationListPage) Response() AscLocationList { - return page.all +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page AscLocationListPage) Values() []AscLocation { - if page.all.IsEmpty() { - return nil - } - return *page.all.Value +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the AscLocationListPage type. -func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) (AscLocationList, error)) AscLocationListPage { - return AscLocationListPage{fn: getNextPage} +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace -type AtaExternalSecuritySolution struct { - Properties *AtaSolutionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` +// AsCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) MarshalJSON() ([]byte, error) { - aess.Kind = KindATA +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for AllowlistCustomAlertRule. +func (acar AllowlistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &acar, true +} + +// AmqpC2DMessagesNotInAllowedRange number of cloud to device messages (AMQP protocol) is not in allowed range. +type AmqpC2DMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + acmniar.RuleType = RuleTypeAmqpC2DMessagesNotInAllowedRange objectMap := make(map[string]interface{}) - if aess.Properties != nil { - objectMap["properties"] = aess.Properties + if acmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = acmniar.TimeWindowSize } - if aess.Kind != "" { - objectMap["kind"] = aess.Kind + if acmniar.MinThreshold != nil { + objectMap["minThreshold"] = acmniar.MinThreshold + } + if acmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = acmniar.MaxThreshold + } + if acmniar.IsEnabled != nil { + objectMap["isEnabled"] = acmniar.IsEnabled + } + if acmniar.RuleType != "" { + objectMap["ruleType"] = acmniar.RuleType } return json.Marshal(objectMap) } -// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { - return &aess, true +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &acmniar, true } -// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &acmniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. -func (aess AtaExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { - return &aess, true +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// AtaSolutionProperties ... -type AtaSolutionProperties struct { - LastEventReceived *string `json:"lastEventReceived,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - DeviceVendor *string `json:"deviceVendor,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AtaSolutionProperties. -func (asp AtaSolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asp.LastEventReceived != nil { - objectMap["lastEventReceived"] = asp.LastEventReceived - } - if asp.DeviceVendor != nil { - objectMap["deviceVendor"] = asp.DeviceVendor - } - if asp.DeviceType != nil { - objectMap["deviceType"] = asp.DeviceType - } - if asp.Workspace != nil { - objectMap["workspace"] = asp.Workspace - } - for k, v := range asp.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for AtaSolutionProperties struct. -func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "lastEventReceived": - if v != nil { - var lastEventReceived string - err = json.Unmarshal(*v, &lastEventReceived) - if err != nil { - return err - } - asp.LastEventReceived = &lastEventReceived - } - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return &acmniar, true +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DMessagesNotInAllowedRange. +func (acmniar AmqpC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &acmniar, true +} + +// AmqpC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (AMQP protocol) is not +// in allowed range. +type AmqpC2DRejectedMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + acrmniar.RuleType = RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange + objectMap := make(map[string]interface{}) + if acrmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = acrmniar.TimeWindowSize + } + if acrmniar.MinThreshold != nil { + objectMap["minThreshold"] = acrmniar.MinThreshold + } + if acrmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = acrmniar.MaxThreshold + } + if acrmniar.IsEnabled != nil { + objectMap["isEnabled"] = acrmniar.IsEnabled + } + if acrmniar.RuleType != "" { + objectMap["ruleType"] = acrmniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &acrmniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &acrmniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return &acrmniar, true +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for AmqpC2DRejectedMessagesNotInAllowedRange. +func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &acrmniar, true +} + +// AmqpD2CMessagesNotInAllowedRange number of device to cloud messages (AMQP protocol) is not in allowed range. +type AmqpD2CMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + admniar.RuleType = RuleTypeAmqpD2CMessagesNotInAllowedRange + objectMap := make(map[string]interface{}) + if admniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = admniar.TimeWindowSize + } + if admniar.MinThreshold != nil { + objectMap["minThreshold"] = admniar.MinThreshold + } + if admniar.MaxThreshold != nil { + objectMap["maxThreshold"] = admniar.MaxThreshold + } + if admniar.IsEnabled != nil { + objectMap["isEnabled"] = admniar.IsEnabled + } + if admniar.RuleType != "" { + objectMap["ruleType"] = admniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &admniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &admniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return &admniar, true +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for AmqpD2CMessagesNotInAllowedRange. +func (admniar AmqpD2CMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &admniar, true +} + +// AppWhitelistingGroup ... +type AppWhitelistingGroup struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *AppWhitelistingGroupData `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppWhitelistingGroup. +func (awg AppWhitelistingGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if awg.AppWhitelistingGroupData != nil { + objectMap["properties"] = awg.AppWhitelistingGroupData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppWhitelistingGroup struct. +func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + awg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + awg.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + awg.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + awg.Location = &location + } + case "properties": + if v != nil { + var appWhitelistingGroupData AppWhitelistingGroupData + err = json.Unmarshal(*v, &appWhitelistingGroupData) + if err != nil { + return err + } + awg.AppWhitelistingGroupData = &appWhitelistingGroupData + } + } + } + + return nil +} + +// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure +// Security Center to be allowed +type AppWhitelistingGroupData struct { + // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' + EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` + // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' + ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` + // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' + RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` + Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` + // SourceSystem - Possible values include: 'SourceSystemAzureAppLocker', 'SourceSystemAzureAuditD', 'SourceSystemNonAzureAppLocker', 'SourceSystemNonAzureAuditD', 'SourceSystemNone' + SourceSystem SourceSystem `json:"sourceSystem,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + +// AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by Azure +// Security Center to be allowed +type AppWhitelistingGroups struct { + autorest.Response `json:"-"` + Value *[]AppWhitelistingGroup `json:"value,omitempty"` +} + +// AppWhitelistingIssueSummary represents a summary of the alerts of the VM/server group +type AppWhitelistingIssueSummary struct { + // Issue - Possible values include: 'ViolationsAudited', 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', 'RulesViolatedManually' + Issue Issue `json:"issue,omitempty"` + // NumberOfVms - The number of machines in the VM/server group that have this alert + NumberOfVms *float64 `json:"numberOfVms,omitempty"` +} + +// AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy +type AppWhitelistingPutGroupData struct { + // EnforcementMode - The enforcement mode of the group. Can also be defined per collection type by using ProtectionMode. Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce', 'EnforcementMode1None' + EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` + // ProtectionMode - The protection mode of the group per collection type. Can also be defined for all collection types by using EnforcementMode + ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` + VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` + PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` +} + +// AscLocation the ASC location of the subscription is in the "name" field +type AscLocation struct { + autorest.Response `json:"-"` + Properties interface{} `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AscLocation. +func (al AscLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if al.Properties != nil { + objectMap["properties"] = al.Properties + } + return json.Marshal(objectMap) +} + +// AscLocationList list of locations where ASC saves your data +type AscLocationList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY + Value *[]AscLocation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AscLocationListIterator provides access to a complete listing of AscLocation values. +type AscLocationListIterator struct { + i int + page AscLocationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AscLocationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AscLocationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AscLocationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AscLocationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AscLocationListIterator) Response() AscLocationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AscLocationListIterator) Value() AscLocation { + if !iter.page.NotDone() { + return AscLocation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AscLocationListIterator type. +func NewAscLocationListIterator(page AscLocationListPage) AscLocationListIterator { + return AscLocationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (all AscLocationList) IsEmpty() bool { + return all.Value == nil || len(*all.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (all AscLocationList) hasNextLink() bool { + return all.NextLink != nil && len(*all.NextLink) != 0 +} + +// ascLocationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (all AscLocationList) ascLocationListPreparer(ctx context.Context) (*http.Request, error) { + if !all.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(all.NextLink))) +} + +// AscLocationListPage contains a page of AscLocation values. +type AscLocationListPage struct { + fn func(context.Context, AscLocationList) (AscLocationList, error) + all AscLocationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AscLocationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AscLocationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.all) + if err != nil { + return err + } + page.all = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AscLocationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AscLocationListPage) NotDone() bool { + return !page.all.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AscLocationListPage) Response() AscLocationList { + return page.all +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AscLocationListPage) Values() []AscLocation { + if page.all.IsEmpty() { + return nil + } + return *page.all.Value +} + +// Creates a new instance of the AscLocationListPage type. +func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) (AscLocationList, error)) AscLocationListPage { + return AscLocationListPage{fn: getNextPage} +} + +// AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace +type AtaExternalSecuritySolution struct { + Properties *AtaSolutionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' + Kind KindEnum `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) MarshalJSON() ([]byte, error) { + aess.Kind = KindATA + objectMap := make(map[string]interface{}) + if aess.Properties != nil { + objectMap["properties"] = aess.Properties + } + if aess.Kind != "" { + objectMap["kind"] = aess.Kind + } + return json.Marshal(objectMap) +} + +// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { + return nil, false +} + +// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { + return &aess, true +} + +// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { + return nil, false +} + +// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { + return nil, false +} + +// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. +func (aess AtaExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { + return &aess, true +} + +// AtaSolutionProperties ... +type AtaSolutionProperties struct { + LastEventReceived *string `json:"lastEventReceived,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + DeviceVendor *string `json:"deviceVendor,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +} + +// MarshalJSON is the custom marshaler for AtaSolutionProperties. +func (asp AtaSolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.LastEventReceived != nil { + objectMap["lastEventReceived"] = asp.LastEventReceived + } + if asp.DeviceVendor != nil { + objectMap["deviceVendor"] = asp.DeviceVendor + } + if asp.DeviceType != nil { + objectMap["deviceType"] = asp.DeviceType + } + if asp.Workspace != nil { + objectMap["workspace"] = asp.Workspace + } + for k, v := range asp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AtaSolutionProperties struct. +func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "lastEventReceived": + if v != nil { + var lastEventReceived string + err = json.Unmarshal(*v, &lastEventReceived) + if err != nil { + return err + } + asp.LastEventReceived = &lastEventReceived + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if asp.AdditionalProperties == nil { + asp.AdditionalProperties = make(map[string]interface{}) + } + asp.AdditionalProperties[k] = additionalProperties + } + case "deviceVendor": + if v != nil { + var deviceVendor string + err = json.Unmarshal(*v, &deviceVendor) + if err != nil { + return err + } + asp.DeviceVendor = &deviceVendor + } + case "deviceType": + if v != nil { + var deviceType string + err = json.Unmarshal(*v, &deviceType) + if err != nil { + return err + } + asp.DeviceType = &deviceType + } + case "workspace": + if v != nil { + var workspace ConnectedWorkspace + err = json.Unmarshal(*v, &workspace) + if err != nil { + return err + } + asp.Workspace = &workspace + } + } + } + + return nil +} + +// BasicAuthenticationDetailsProperties settings for cloud authentication management +type BasicAuthenticationDetailsProperties interface { + AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) + AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) + AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) + AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) +} + +// AuthenticationDetailsProperties settings for cloud authentication management +type AuthenticationDetailsProperties struct { + // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' + AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` + // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. + GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +func unmarshalBasicAuthenticationDetailsProperties(body []byte) (BasicAuthenticationDetailsProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["authenticationType"] { + case string(AuthenticationTypeAwsCreds): + var acadp AwsCredsAuthenticationDetailsProperties + err := json.Unmarshal(body, &acadp) + return acadp, err + case string(AuthenticationTypeAwsAssumeRole): + var aaradp AwAssumeRoleAuthenticationDetailsProperties + err := json.Unmarshal(body, &aaradp) + return aaradp, err + case string(AuthenticationTypeGcpCredentials): + var gcdp GcpCredentialsDetailsProperties + err := json.Unmarshal(body, &gcdp) + return gcdp, err + default: + var adp AuthenticationDetailsProperties + err := json.Unmarshal(body, &adp) + return adp, err + } +} +func unmarshalBasicAuthenticationDetailsPropertiesArray(body []byte) ([]BasicAuthenticationDetailsProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + adpArray := make([]BasicAuthenticationDetailsProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + adp, err := unmarshalBasicAuthenticationDetailsProperties(*rawMessage) + if err != nil { + return nil, err + } + adpArray[index] = adp + } + return adpArray, nil +} + +// MarshalJSON is the custom marshaler for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { + adp.AuthenticationType = AuthenticationTypeAuthenticationDetailsProperties + objectMap := make(map[string]interface{}) + if adp.AuthenticationType != "" { + objectMap["authenticationType"] = adp.AuthenticationType + } + return json.Marshal(objectMap) +} + +// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { + return nil, false +} + +// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { + return &adp, true +} + +// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. +func (adp AuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { + return &adp, true +} + +// Automation the security automation resource. +type Automation struct { + autorest.Response `json:"-"` + // AutomationProperties - Security automation data + *AutomationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` + // Tags - A list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Automation. +func (a Automation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AutomationProperties != nil { + objectMap["properties"] = a.AutomationProperties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.Kind != nil { + objectMap["kind"] = a.Kind + } + if a.Etag != nil { + objectMap["etag"] = a.Etag + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Automation struct. +func (a *Automation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var automationProperties AutomationProperties + err = json.Unmarshal(*v, &automationProperties) + if err != nil { + return err + } + a.AutomationProperties = &automationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + a.Kind = &kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + a.Etag = &etag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + } + } + + return nil +} + +// BasicAutomationAction the action that should be triggered. +type BasicAutomationAction interface { + AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) + AsAutomationActionEventHub() (*AutomationActionEventHub, bool) + AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) + AsAutomationAction() (*AutomationAction, bool) +} + +// AutomationAction the action that should be triggered. +type AutomationAction struct { + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +func unmarshalBasicAutomationAction(body []byte) (BasicAutomationAction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["actionType"] { + case string(ActionTypeLogicApp): + var aala AutomationActionLogicApp + err := json.Unmarshal(body, &aala) + return aala, err + case string(ActionTypeEventHub): + var aaeh AutomationActionEventHub + err := json.Unmarshal(body, &aaeh) + return aaeh, err + case string(ActionTypeWorkspace): + var aaw AutomationActionWorkspace + err := json.Unmarshal(body, &aaw) + return aaw, err + default: + var aa AutomationAction + err := json.Unmarshal(body, &aa) + return aa, err + } +} +func unmarshalBasicAutomationActionArray(body []byte) ([]BasicAutomationAction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + aaArray := make([]BasicAutomationAction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + aa, err := unmarshalBasicAutomationAction(*rawMessage) + if err != nil { + return nil, err + } + aaArray[index] = aa + } + return aaArray, nil +} + +// MarshalJSON is the custom marshaler for AutomationAction. +func (aa AutomationAction) MarshalJSON() ([]byte, error) { + aa.ActionType = ActionTypeAutomationAction + objectMap := make(map[string]interface{}) + if aa.ActionType != "" { + objectMap["actionType"] = aa.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsAutomationAction() (*AutomationAction, bool) { + return &aa, true +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationAction. +func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aa, true +} + +// AutomationActionEventHub the target Event Hub to which event data will be exported. To learn more about +// Security Center continuous export capabilities, visit https://aka.ms/ASCExportLearnMore +type AutomationActionEventHub struct { + // EventHubResourceID - The target Event Hub Azure Resource ID. + EventHubResourceID *string `json:"eventHubResourceId,omitempty"` + // SasPolicyName - READ-ONLY; The target Event Hub SAS policy name. + SasPolicyName *string `json:"sasPolicyName,omitempty"` + // ConnectionString - The target Event Hub connection string (it will not be included in any response). + ConnectionString *string `json:"connectionString,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) MarshalJSON() ([]byte, error) { + aaeh.ActionType = ActionTypeEventHub + objectMap := make(map[string]interface{}) + if aaeh.EventHubResourceID != nil { + objectMap["eventHubResourceId"] = aaeh.EventHubResourceID + } + if aaeh.ConnectionString != nil { + objectMap["connectionString"] = aaeh.ConnectionString + } + if aaeh.ActionType != "" { + objectMap["actionType"] = aaeh.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return &aaeh, true +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. +func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaeh, true +} + +// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Security +// Center's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore +type AutomationActionLogicApp struct { + // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` + // URI - The Logic App trigger URI endpoint (it will not be included in any response). + URI *string `json:"uri,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) MarshalJSON() ([]byte, error) { + aala.ActionType = ActionTypeLogicApp + objectMap := make(map[string]interface{}) + if aala.LogicAppResourceID != nil { + objectMap["logicAppResourceId"] = aala.LogicAppResourceID + } + if aala.URI != nil { + objectMap["uri"] = aala.URI + } + if aala.ActionType != "" { + objectMap["actionType"] = aala.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return &aala, true +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return nil, false +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. +func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aala, true +} + +// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security alerts +// data will reside in the 'SecurityAlert' table and the assessments data will reside in the +// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to +// view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled +// on that workspace. To learn more about Security Center continuous export capabilities, visit +// https://aka.ms/ASCExportLearnMore +type AutomationActionWorkspace struct { + // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. + WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` + // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) MarshalJSON() ([]byte, error) { + aaw.ActionType = ActionTypeWorkspace + objectMap := make(map[string]interface{}) + if aaw.WorkspaceResourceID != nil { + objectMap["workspaceResourceId"] = aaw.WorkspaceResourceID + } + if aaw.ActionType != "" { + objectMap["actionType"] = aaw.ActionType + } + return json.Marshal(objectMap) +} + +// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { + return nil, false +} + +// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { + return nil, false +} + +// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { + return &aaw, true +} + +// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsAutomationAction() (*AutomationAction, bool) { + return nil, false +} + +// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. +func (aaw AutomationActionWorkspace) AsBasicAutomationAction() (BasicAutomationAction, bool) { + return &aaw, true +} + +// AutomationList list of security automations response. +type AutomationList struct { + autorest.Response `json:"-"` + // Value - The list of security automations under the given scope. + Value *[]Automation `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutomationList. +func (al AutomationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if al.Value != nil { + objectMap["value"] = al.Value + } + return json.Marshal(objectMap) +} + +// AutomationListIterator provides access to a complete listing of Automation values. +type AutomationListIterator struct { + i int + page AutomationListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AutomationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AutomationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AutomationListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AutomationListIterator) Response() AutomationList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AutomationListIterator) Value() Automation { + if !iter.page.NotDone() { + return Automation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AutomationListIterator type. +func NewAutomationListIterator(page AutomationListPage) AutomationListIterator { + return AutomationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AutomationList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (al AutomationList) hasNextLink() bool { + return al.NextLink != nil && len(*al.NextLink) != 0 +} + +// automationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AutomationList) automationListPreparer(ctx context.Context) (*http.Request, error) { + if !al.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// AutomationListPage contains a page of Automation values. +type AutomationListPage struct { + fn func(context.Context, AutomationList) (AutomationList, error) + al AutomationList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AutomationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.al) + if err != nil { + return err + } + page.al = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AutomationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AutomationListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AutomationListPage) Response() AutomationList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AutomationListPage) Values() []Automation { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AutomationListPage type. +func NewAutomationListPage(getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { + return AutomationListPage{fn: getNextPage} +} + +// AutomationProperties a set of properties that defines the behavior of the automation configuration. To learn +// more about the supported security events data models schemas - please visit +// https://aka.ms/ASCAutomationSchemas. +type AutomationProperties struct { + // Description - The security automation description. + Description *string `json:"description,omitempty"` + // IsEnabled - Indicates whether the security automation is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` + // Scopes - A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. + Scopes *[]AutomationScope `json:"scopes,omitempty"` + // Sources - A collection of the source event types which evaluate the security automation set of rules. + Sources *[]AutomationSource `json:"sources,omitempty"` + // Actions - A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. + Actions *[]BasicAutomationAction `json:"actions,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AutomationProperties struct. +func (ap *AutomationProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ap.Description = &description + } + case "isEnabled": + if v != nil { + var isEnabled bool + err = json.Unmarshal(*v, &isEnabled) + if err != nil { + return err + } + ap.IsEnabled = &isEnabled + } + case "scopes": + if v != nil { + var scopes []AutomationScope + err = json.Unmarshal(*v, &scopes) + if err != nil { + return err + } + ap.Scopes = &scopes + } + case "sources": + if v != nil { + var sources []AutomationSource + err = json.Unmarshal(*v, &sources) + if err != nil { + return err + } + ap.Sources = &sources + } + case "actions": + if v != nil { + actions, err := unmarshalBasicAutomationActionArray(*v) + if err != nil { + return err + } + ap.Actions = &actions + } + } + } + + return nil +} + +// AutomationRuleSet a rule set which evaluates all its rules upon an event interception. Only when all the +// included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions. +type AutomationRuleSet struct { + Rules *[]AutomationTriggeringRule `json:"rules,omitempty"` +} + +// AutomationScope a single automation scope. +type AutomationScope struct { + // Description - The resources scope description. + Description *string `json:"description,omitempty"` + // ScopePath - The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs). + ScopePath *string `json:"scopePath,omitempty"` +} + +// AutomationSource the source event types which evaluate the security automation set of rules. For example - +// security alerts and security assessments. To learn more about the supported security events data models +// schemas - please visit https://aka.ms/ASCAutomationSchemas. +type AutomationSource struct { + // EventSource - A valid event source type. Possible values include: 'Assessments', 'SubAssessments', 'Alerts' + EventSource EventSource `json:"eventSource,omitempty"` + // RuleSets - A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). + RuleSets *[]AutomationRuleSet `json:"ruleSets,omitempty"` +} + +// AutomationTriggeringRule a rule which is evaluated upon event interception. The rule is configured by +// comparing a specific value from the event model to an expected value. This comparison is done by using one +// of the supported operators set. +type AutomationTriggeringRule struct { + // PropertyJPath - The JPath of the entity model property that should be checked. + PropertyJPath *string `json:"propertyJPath,omitempty"` + // PropertyType - The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. Possible values include: 'String', 'Integer', 'Number', 'Boolean' + PropertyType PropertyType `json:"propertyType,omitempty"` + // ExpectedValue - The expected value. + ExpectedValue *string `json:"expectedValue,omitempty"` + // Operator - A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. Possible values include: 'Equals', 'GreaterThan', 'GreaterThanOrEqualTo', 'LesserThan', 'LesserThanOrEqualTo', 'NotEquals', 'Contains', 'StartsWith', 'EndsWith' + Operator Operator `json:"operator,omitempty"` +} + +// AutomationValidationStatus the security automation model state property bag. +type AutomationValidationStatus struct { + autorest.Response `json:"-"` + // IsValid - Indicates whether the model is valid or not. + IsValid *bool `json:"isValid,omitempty"` + // Message - The validation message. + Message *string `json:"message,omitempty"` +} + +// AutoProvisioningSetting auto provisioning setting +type AutoProvisioningSetting struct { + autorest.Response `json:"-"` + // AutoProvisioningSettingProperties - Auto provisioning setting data + *AutoProvisioningSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutoProvisioningSetting. +func (aps AutoProvisioningSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aps.AutoProvisioningSettingProperties != nil { + objectMap["properties"] = aps.AutoProvisioningSettingProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AutoProvisioningSetting struct. +func (aps *AutoProvisioningSetting) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var autoProvisioningSettingProperties AutoProvisioningSettingProperties + err = json.Unmarshal(*v, &autoProvisioningSettingProperties) + if err != nil { + return err + } + aps.AutoProvisioningSettingProperties = &autoProvisioningSettingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + aps.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aps.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + aps.Type = &typeVar + } + } + } + + return nil +} + +// AutoProvisioningSettingList list of all the auto provisioning settings response +type AutoProvisioningSettingList struct { + autorest.Response `json:"-"` + // Value - List of all the auto provisioning settings + Value *[]AutoProvisioningSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AutoProvisioningSettingList. +func (apsl AutoProvisioningSettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apsl.Value != nil { + objectMap["value"] = apsl.Value + } + return json.Marshal(objectMap) +} + +// AutoProvisioningSettingListIterator provides access to a complete listing of AutoProvisioningSetting values. +type AutoProvisioningSettingListIterator struct { + i int + page AutoProvisioningSettingListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AutoProvisioningSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoProvisioningSettingListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AutoProvisioningSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AutoProvisioningSettingListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AutoProvisioningSettingListIterator) Response() AutoProvisioningSettingList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AutoProvisioningSettingListIterator) Value() AutoProvisioningSetting { + if !iter.page.NotDone() { + return AutoProvisioningSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AutoProvisioningSettingListIterator type. +func NewAutoProvisioningSettingListIterator(page AutoProvisioningSettingListPage) AutoProvisioningSettingListIterator { + return AutoProvisioningSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (apsl AutoProvisioningSettingList) IsEmpty() bool { + return apsl.Value == nil || len(*apsl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (apsl AutoProvisioningSettingList) hasNextLink() bool { + return apsl.NextLink != nil && len(*apsl.NextLink) != 0 +} + +// autoProvisioningSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (apsl AutoProvisioningSettingList) autoProvisioningSettingListPreparer(ctx context.Context) (*http.Request, error) { + if !apsl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(apsl.NextLink))) +} + +// AutoProvisioningSettingListPage contains a page of AutoProvisioningSetting values. +type AutoProvisioningSettingListPage struct { + fn func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error) + apsl AutoProvisioningSettingList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AutoProvisioningSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AutoProvisioningSettingListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.apsl) + if err != nil { + return err + } + page.apsl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AutoProvisioningSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AutoProvisioningSettingListPage) NotDone() bool { + return !page.apsl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AutoProvisioningSettingListPage) Response() AutoProvisioningSettingList { + return page.apsl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AutoProvisioningSettingListPage) Values() []AutoProvisioningSetting { + if page.apsl.IsEmpty() { + return nil + } + return *page.apsl.Value +} + +// Creates a new instance of the AutoProvisioningSettingListPage type. +func NewAutoProvisioningSettingListPage(getNextPage func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error)) AutoProvisioningSettingListPage { + return AutoProvisioningSettingListPage{fn: getNextPage} +} + +// AutoProvisioningSettingProperties describes properties of an auto provisioning setting +type AutoProvisioningSettingProperties struct { + // AutoProvision - Describes what kind of security agent provisioning action to take. Possible values include: 'AutoProvisionOn', 'AutoProvisionOff' + AutoProvision AutoProvision `json:"autoProvision,omitempty"` +} + +// AwAssumeRoleAuthenticationDetailsProperties AWS cloud account connector based assume role, the role enables +// delegating access to your AWS resources. The role is composed of role arn and external id, for more details, +// refer to Creating a +// Role to Delegate Permissions to an IAM User (write only) +type AwAssumeRoleAuthenticationDetailsProperties struct { + // AccountID - READ-ONLY; The ID of the cloud account + AccountID *string `json:"accountId,omitempty"` + // AwsAssumeRoleArn - Assumed role ID is an identifier that you can use to create temporary security credentials. + AwsAssumeRoleArn *string `json:"awsAssumeRoleArn,omitempty"` + // AwsExternalID - A unique identifier that is required when you assume a role in another account. + AwsExternalID *string `json:"awsExternalId,omitempty"` + // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' + AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` + // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. + GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwAssumeRoleAuthenticationDetailsProperties. +func (aaradp AwAssumeRoleAuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { + aaradp.AuthenticationType = AuthenticationTypeAwsAssumeRole + objectMap := make(map[string]interface{}) + if aaradp.AwsAssumeRoleArn != nil { + objectMap["awsAssumeRoleArn"] = aaradp.AwsAssumeRoleArn + } + if aaradp.AwsExternalID != nil { + objectMap["awsExternalId"] = aaradp.AwsExternalID + } + if aaradp.AuthenticationType != "" { + objectMap["authenticationType"] = aaradp.AuthenticationType + } + return json.Marshal(objectMap) +} + +// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. +func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. +func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { + return &aaradp, true +} + +// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. +func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { + return nil, false +} + +// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. +func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. +func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { + return &aaradp, true +} + +// AwsCredsAuthenticationDetailsProperties AWS cloud account connector based credentials, the credentials is +// composed of access key id and secret key, for more details, refer to Creating an IAM User in Your +// AWS Account (write only) +type AwsCredsAuthenticationDetailsProperties struct { + // AccountID - READ-ONLY; The ID of the cloud account + AccountID *string `json:"accountId,omitempty"` + // AwsAccessKeyID - Public key element of the AWS credential object (write only) + AwsAccessKeyID *string `json:"awsAccessKeyId,omitempty"` + // AwsSecretAccessKey - Secret key element of the AWS credential object (write only) + AwsSecretAccessKey *string `json:"awsSecretAccessKey,omitempty"` + // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' + AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` + // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. + GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwsCredsAuthenticationDetailsProperties. +func (acadp AwsCredsAuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { + acadp.AuthenticationType = AuthenticationTypeAwsCreds + objectMap := make(map[string]interface{}) + if acadp.AwsAccessKeyID != nil { + objectMap["awsAccessKeyId"] = acadp.AwsAccessKeyID + } + if acadp.AwsSecretAccessKey != nil { + objectMap["awsSecretAccessKey"] = acadp.AwsSecretAccessKey + } + if acadp.AuthenticationType != "" { + objectMap["authenticationType"] = acadp.AuthenticationType + } + return json.Marshal(objectMap) +} + +// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. +func (acadp AwsCredsAuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { + return &acadp, true +} + +// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. +func (acadp AwsCredsAuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. +func (acadp AwsCredsAuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { + return nil, false +} + +// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. +func (acadp AwsCredsAuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. +func (acadp AwsCredsAuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { + return &acadp, true +} + +// AzureResourceDetails details of the Azure resource that was assessed +type AzureResourceDetails struct { + // ID - READ-ONLY; Azure resource Id of the assessed resource + ID *string `json:"id,omitempty"` + // Source - Possible values include: 'SourceResourceDetails', 'SourceOnPremiseSQL', 'SourceOnPremise', 'SourceAzure' + Source Source `json:"source,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureResourceDetails. +func (ard AzureResourceDetails) MarshalJSON() ([]byte, error) { + ard.Source = SourceAzure + objectMap := make(map[string]interface{}) + if ard.Source != "" { + objectMap["source"] = ard.Source + } + return json.Marshal(objectMap) +} + +// AsOnPremiseSQLResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsOnPremiseSQLResourceDetails() (*OnPremiseSQLResourceDetails, bool) { + return nil, false +} + +// AsOnPremiseResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsOnPremiseResourceDetails() (*OnPremiseResourceDetails, bool) { + return nil, false +} + +// AsBasicOnPremiseResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsBasicOnPremiseResourceDetails() (BasicOnPremiseResourceDetails, bool) { + return nil, false +} + +// AsAzureResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { + return &ard, true +} + +// AsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { + return nil, false +} + +// AsBasicResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. +func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { + return &ard, true +} + +// AzureResourceLink describes an Azure resource with kind +type AzureResourceLink struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` +} + +// AzureTrackedResourceLocation describes an Azure resource with location +type AzureTrackedResourceLocation struct { + // Location - Location where the resource is stored + Location *string `json:"location,omitempty"` +} + +// CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace +type CefExternalSecuritySolution struct { + Properties *CefSolutionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' + Kind KindEnum `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for CefExternalSecuritySolution. +func (cess CefExternalSecuritySolution) MarshalJSON() ([]byte, error) { + cess.Kind = KindCEF + objectMap := make(map[string]interface{}) + if cess.Properties != nil { + objectMap["properties"] = cess.Properties + } + if cess.Kind != "" { + objectMap["kind"] = cess.Kind + } + return json.Marshal(objectMap) +} + +// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. +func (cess CefExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { + return &cess, true +} + +// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. +func (cess CefExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { + return nil, false +} + +// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. +func (cess CefExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { + return nil, false +} + +// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. +func (cess CefExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { + return nil, false +} + +// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. +func (cess CefExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { + return &cess, true +} + +// CefSolutionProperties ... +type CefSolutionProperties struct { + Hostname *string `json:"hostname,omitempty"` + Agent *string `json:"agent,omitempty"` + LastEventReceived *string `json:"lastEventReceived,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + DeviceVendor *string `json:"deviceVendor,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +} + +// MarshalJSON is the custom marshaler for CefSolutionProperties. +func (csp CefSolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csp.Hostname != nil { + objectMap["hostname"] = csp.Hostname + } + if csp.Agent != nil { + objectMap["agent"] = csp.Agent + } + if csp.LastEventReceived != nil { + objectMap["lastEventReceived"] = csp.LastEventReceived + } + if csp.DeviceVendor != nil { + objectMap["deviceVendor"] = csp.DeviceVendor + } + if csp.DeviceType != nil { + objectMap["deviceType"] = csp.DeviceType + } + if csp.Workspace != nil { + objectMap["workspace"] = csp.Workspace + } + for k, v := range csp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CefSolutionProperties struct. +func (csp *CefSolutionProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "hostname": + if v != nil { + var hostname string + err = json.Unmarshal(*v, &hostname) + if err != nil { + return err + } + csp.Hostname = &hostname + } + case "agent": + if v != nil { + var agent string + err = json.Unmarshal(*v, &agent) + if err != nil { + return err + } + csp.Agent = &agent + } + case "lastEventReceived": + if v != nil { + var lastEventReceived string + err = json.Unmarshal(*v, &lastEventReceived) + if err != nil { + return err + } + csp.LastEventReceived = &lastEventReceived + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if csp.AdditionalProperties == nil { + csp.AdditionalProperties = make(map[string]interface{}) + } + csp.AdditionalProperties[k] = additionalProperties + } + case "deviceVendor": + if v != nil { + var deviceVendor string + err = json.Unmarshal(*v, &deviceVendor) + if err != nil { + return err + } + csp.DeviceVendor = &deviceVendor + } + case "deviceType": + if v != nil { + var deviceType string + err = json.Unmarshal(*v, &deviceType) + if err != nil { + return err + } + csp.DeviceType = &deviceType + } + case "workspace": + if v != nil { + var workspace ConnectedWorkspace + err = json.Unmarshal(*v, &workspace) + if err != nil { + return err + } + csp.Workspace = &workspace + } + } + } + + return nil +} + +// CloudError error response structure. +type CloudError struct { + // CloudErrorBody - Error data + *CloudErrorBody `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudError. +func (ce CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ce.CloudErrorBody != nil { + objectMap["error"] = ce.CloudErrorBody + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CloudError struct. +func (ce *CloudError) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "error": + if v != nil { + var cloudErrorBody CloudErrorBody + err = json.Unmarshal(*v, &cloudErrorBody) + if err != nil { + return err + } + ce.CloudErrorBody = &cloudErrorBody + } + } + } + + return nil +} + +// CloudErrorBody error details. +type CloudErrorBody struct { + // Code - READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` +} + +// Compliance compliance of a scope +type Compliance struct { + autorest.Response `json:"-"` + // ComplianceProperties - Compliance data + *ComplianceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Compliance. +func (c Compliance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ComplianceProperties != nil { + objectMap["properties"] = c.ComplianceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Compliance struct. +func (c *Compliance) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var complianceProperties ComplianceProperties + err = json.Unmarshal(*v, &complianceProperties) + if err != nil { + return err + } + c.ComplianceProperties = &complianceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ComplianceList list of Compliance objects response +type ComplianceList struct { + autorest.Response `json:"-"` + // Value - List of Compliance objects + Value *[]Compliance `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ComplianceList. +func (cl ComplianceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cl.Value != nil { + objectMap["value"] = cl.Value + } + return json.Marshal(objectMap) +} + +// ComplianceListIterator provides access to a complete listing of Compliance values. +type ComplianceListIterator struct { + i int + page ComplianceListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ComplianceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ComplianceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ComplianceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ComplianceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ComplianceListIterator) Response() ComplianceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ComplianceListIterator) Value() Compliance { + if !iter.page.NotDone() { + return Compliance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ComplianceListIterator type. +func NewComplianceListIterator(page ComplianceListPage) ComplianceListIterator { + return ComplianceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ComplianceList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl ComplianceList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// complianceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ComplianceList) complianceListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ComplianceListPage contains a page of Compliance values. +type ComplianceListPage struct { + fn func(context.Context, ComplianceList) (ComplianceList, error) + cl ComplianceList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ComplianceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ComplianceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cl) + if err != nil { + return err + } + page.cl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ComplianceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ComplianceListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ComplianceListPage) Response() ComplianceList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ComplianceListPage) Values() []Compliance { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ComplianceListPage type. +func NewComplianceListPage(getNextPage func(context.Context, ComplianceList) (ComplianceList, error)) ComplianceListPage { + return ComplianceListPage{fn: getNextPage} +} + +// ComplianceProperties the Compliance score (percentage) of a Subscription is a sum of all Resources' +// Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') +// Policy Definitions out of all Policy Definitions applicable to a given resource. +type ComplianceProperties struct { + // AssessmentTimestampUtcDate - READ-ONLY; The timestamp when the Compliance calculation was conducted. + AssessmentTimestampUtcDate *date.Time `json:"assessmentTimestampUtcDate,omitempty"` + // ResourceCount - READ-ONLY; The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation). + ResourceCount *int32 `json:"resourceCount,omitempty"` + // AssessmentResult - READ-ONLY; An array of segment, which is the actually the compliance assessment. + AssessmentResult *[]ComplianceSegment `json:"assessmentResult,omitempty"` +} + +// ComplianceSegment a segment of a compliance assessment. +type ComplianceSegment struct { + // SegmentType - READ-ONLY; The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. + SegmentType *string `json:"segmentType,omitempty"` + // Percentage - READ-ONLY; The size (%) of the segment. + Percentage *float64 `json:"percentage,omitempty"` +} + +// ConnectableResource describes the allowed inbound and outbound traffic of an Azure resource +type ConnectableResource struct { + // ID - READ-ONLY; The Azure resource id + ID *string `json:"id,omitempty"` + // InboundConnectedResources - READ-ONLY; The list of Azure resources that the resource has inbound allowed connection from + InboundConnectedResources *[]ConnectedResource `json:"inboundConnectedResources,omitempty"` + // OutboundConnectedResources - READ-ONLY; The list of Azure resources that the resource has outbound allowed connection to + OutboundConnectedResources *[]ConnectedResource `json:"outboundConnectedResources,omitempty"` +} + +// ConnectedResource describes properties of a connected resource +type ConnectedResource struct { + // ConnectedResourceID - READ-ONLY; The Azure resource id of the connected resource + ConnectedResourceID *string `json:"connectedResourceId,omitempty"` + // TCPPorts - READ-ONLY; The allowed tcp ports + TCPPorts *string `json:"tcpPorts,omitempty"` + // UDPPorts - READ-ONLY; The allowed udp ports + UDPPorts *string `json:"udpPorts,omitempty"` +} + +// ConnectedWorkspace ... +type ConnectedWorkspace struct { + // ID - Azure resource ID of the connected OMS workspace + ID *string `json:"id,omitempty"` +} + +// ConnectionToIPNotAllowed outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or +// ipv6 range in CIDR notation. +type ConnectionToIPNotAllowed struct { + // AllowlistValues - The values to allow. The format of the values depends on the rule type. + AllowlistValues *[]string `json:"allowlistValues,omitempty"` + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) MarshalJSON() ([]byte, error) { + ctina.RuleType = RuleTypeConnectionToIPNotAllowed + objectMap := make(map[string]interface{}) + if ctina.AllowlistValues != nil { + objectMap["allowlistValues"] = ctina.AllowlistValues + } + if ctina.IsEnabled != nil { + objectMap["isEnabled"] = ctina.IsEnabled + } + if ctina.RuleType != "" { + objectMap["ruleType"] = ctina.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return &ctina, true +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &ctina, true +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return &ctina, true +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for ConnectionToIPNotAllowed. +func (ctina ConnectionToIPNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &ctina, true +} + +// ConnectorSetting the connector setting +type ConnectorSetting struct { + autorest.Response `json:"-"` + // ConnectorSettingProperties - Connector setting data + *ConnectorSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectorSetting. +func (cs ConnectorSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.ConnectorSettingProperties != nil { + objectMap["properties"] = cs.ConnectorSettingProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConnectorSetting struct. +func (cs *ConnectorSetting) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var connectorSettingProperties ConnectorSettingProperties + err = json.Unmarshal(*v, &connectorSettingProperties) + if err != nil { + return err + } + cs.ConnectorSettingProperties = &connectorSettingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + } + } + + return nil +} + +// ConnectorSettingList for a subscription, list of all cloud account connectors and their settings +type ConnectorSettingList struct { + autorest.Response `json:"-"` + // Value - List of all the cloud account connector settings + Value *[]ConnectorSetting `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectorSettingList. +func (csl ConnectorSettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csl.Value != nil { + objectMap["value"] = csl.Value + } + return json.Marshal(objectMap) +} + +// ConnectorSettingListIterator provides access to a complete listing of ConnectorSetting values. +type ConnectorSettingListIterator struct { + i int + page ConnectorSettingListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ConnectorSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorSettingListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ConnectorSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConnectorSettingListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ConnectorSettingListIterator) Response() ConnectorSettingList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ConnectorSettingListIterator) Value() ConnectorSetting { + if !iter.page.NotDone() { + return ConnectorSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConnectorSettingListIterator type. +func NewConnectorSettingListIterator(page ConnectorSettingListPage) ConnectorSettingListIterator { + return ConnectorSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (csl ConnectorSettingList) IsEmpty() bool { + return csl.Value == nil || len(*csl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (csl ConnectorSettingList) hasNextLink() bool { + return csl.NextLink != nil && len(*csl.NextLink) != 0 +} + +// connectorSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (csl ConnectorSettingList) connectorSettingListPreparer(ctx context.Context) (*http.Request, error) { + if !csl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(csl.NextLink))) +} + +// ConnectorSettingListPage contains a page of ConnectorSetting values. +type ConnectorSettingListPage struct { + fn func(context.Context, ConnectorSettingList) (ConnectorSettingList, error) + csl ConnectorSettingList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ConnectorSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorSettingListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.csl) + if err != nil { + return err + } + page.csl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ConnectorSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConnectorSettingListPage) NotDone() bool { + return !page.csl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConnectorSettingListPage) Response() ConnectorSettingList { + return page.csl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConnectorSettingListPage) Values() []ConnectorSetting { + if page.csl.IsEmpty() { + return nil + } + return *page.csl.Value +} + +// Creates a new instance of the ConnectorSettingListPage type. +func NewConnectorSettingListPage(getNextPage func(context.Context, ConnectorSettingList) (ConnectorSettingList, error)) ConnectorSettingListPage { + return ConnectorSettingListPage{fn: getNextPage} +} + +// ConnectorSettingProperties describes properties of an connector setting +type ConnectorSettingProperties struct { + // HybridComputeSettings - Settings for hybrid compute management, these settings are relevant only Arc autoProvision (Hybrid Compute). + HybridComputeSettings *HybridComputeSettingsProperties `json:"hybridComputeSettings,omitempty"` + // AuthenticationDetails - Settings for authentication management, these settings are relevant only for the cloud connector. + AuthenticationDetails BasicAuthenticationDetailsProperties `json:"authenticationDetails,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ConnectorSettingProperties struct. +func (csp *ConnectorSettingProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "hybridComputeSettings": + if v != nil { + var hybridComputeSettings HybridComputeSettingsProperties + err = json.Unmarshal(*v, &hybridComputeSettings) + if err != nil { + return err + } + csp.HybridComputeSettings = &hybridComputeSettings + } + case "authenticationDetails": + if v != nil { + authenticationDetails, err := unmarshalBasicAuthenticationDetailsProperties(*v) + if err != nil { + return err + } + csp.AuthenticationDetails = authenticationDetails + } + } + } + + return nil +} + +// Contact contact details for security issues +type Contact struct { + autorest.Response `json:"-"` + // ContactProperties - Security contact data + *ContactProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Contact. +func (c Contact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.ContactProperties != nil { + objectMap["properties"] = c.ContactProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Contact struct. +func (c *Contact) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var contactProperties ContactProperties + err = json.Unmarshal(*v, &contactProperties) + if err != nil { + return err + } + c.ContactProperties = &contactProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ContactList list of security contacts response +type ContactList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of security contacts + Value *[]Contact `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// ContactListIterator provides access to a complete listing of Contact values. +type ContactListIterator struct { + i int + page ContactListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ContactListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContactListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ContactListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ContactListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ContactListIterator) Response() ContactList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ContactListIterator) Value() Contact { + if !iter.page.NotDone() { + return Contact{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ContactListIterator type. +func NewContactListIterator(page ContactListPage) ContactListIterator { + return ContactListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cl ContactList) IsEmpty() bool { + return cl.Value == nil || len(*cl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cl ContactList) hasNextLink() bool { + return cl.NextLink != nil && len(*cl.NextLink) != 0 +} + +// contactListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cl ContactList) contactListPreparer(ctx context.Context) (*http.Request, error) { + if !cl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cl.NextLink))) +} + +// ContactListPage contains a page of Contact values. +type ContactListPage struct { + fn func(context.Context, ContactList) (ContactList, error) + cl ContactList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ContactListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContactListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cl) + if err != nil { + return err + } + page.cl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ContactListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ContactListPage) NotDone() bool { + return !page.cl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ContactListPage) Response() ContactList { + return page.cl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ContactListPage) Values() []Contact { + if page.cl.IsEmpty() { + return nil + } + return *page.cl.Value +} + +// Creates a new instance of the ContactListPage type. +func NewContactListPage(getNextPage func(context.Context, ContactList) (ContactList, error)) ContactListPage { + return ContactListPage{fn: getNextPage} +} + +// ContactProperties describes security contact properties +type ContactProperties struct { + // Email - The email of this security contact + Email *string `json:"email,omitempty"` + // Phone - The phone number of this security contact + Phone *string `json:"phone,omitempty"` + // AlertNotifications - Whether to send security alerts notifications to the security contact. Possible values include: 'On', 'Off' + AlertNotifications AlertNotifications `json:"alertNotifications,omitempty"` + // AlertsToAdmins - Whether to send security alerts notifications to subscription admins. Possible values include: 'AlertsToAdminsOn', 'AlertsToAdminsOff' + AlertsToAdmins AlertsToAdmins `json:"alertsToAdmins,omitempty"` +} + +// ContainerRegistryVulnerabilityProperties additional context fields for container registry Vulnerability +// assessment +type ContainerRegistryVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability + Type *string `json:"type,omitempty"` + // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object + Cvss map[string]*CVSS `json:"cvss"` + // Patchable - READ-ONLY; Indicates whether a patch is available or not + Patchable *bool `json:"patchable,omitempty"` + // Cve - READ-ONLY; List of CVEs + Cve *[]CVE `json:"cve,omitempty"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // RepositoryName - READ-ONLY; Name of the repository which the vulnerable image belongs to + RepositoryName *string `json:"repositoryName,omitempty"` + // ImageDigest - READ-ONLY; Digest of the vulnerable image + ImageDigest *string `json:"imageDigest,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { + crvp.AssessedResourceType = AssessedResourceTypeContainerRegistryVulnerability + objectMap := make(map[string]interface{}) + if crvp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = crvp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { + return &crvp, true +} + +// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { + return nil, false +} + +// AsBasicAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. +func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { + return &crvp, true +} + +// BasicCustomAlertRule a custom alert rule. +type BasicCustomAlertRule interface { + AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) + AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) + AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) + AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) + AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) + AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) + AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) + AsListCustomAlertRule() (*ListCustomAlertRule, bool) + AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) + AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) + AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) + AsProcessNotAllowed() (*ProcessNotAllowed, bool) + AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) + AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) + AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) + AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) + AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) + AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) + AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) + AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) + AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) + AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) + AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) + AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) + AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) + AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) + AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) + AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) + AsCustomAlertRule() (*CustomAlertRule, bool) +} + +// CustomAlertRule a custom alert rule. +type CustomAlertRule struct { + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +func unmarshalBasicCustomAlertRule(body []byte) (BasicCustomAlertRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ruleType"] { + case string(RuleTypeThresholdCustomAlertRule): + var tcar ThresholdCustomAlertRule + err := json.Unmarshal(body, &tcar) + return tcar, err + case string(RuleTypeTimeWindowCustomAlertRule): + var twcar TimeWindowCustomAlertRule + err := json.Unmarshal(body, &twcar) + return twcar, err + case string(RuleTypeAllowlistCustomAlertRule): + var acar AllowlistCustomAlertRule + err := json.Unmarshal(body, &acar) + return acar, err + case string(RuleTypeDenylistCustomAlertRule): + var dcar DenylistCustomAlertRule + err := json.Unmarshal(body, &dcar) + return dcar, err + case string(RuleTypeListCustomAlertRule): + var lcar ListCustomAlertRule + err := json.Unmarshal(body, &lcar) + return lcar, err + case string(RuleTypeConnectionToIPNotAllowed): + var ctina ConnectionToIPNotAllowed + err := json.Unmarshal(body, &ctina) + return ctina, err + case string(RuleTypeLocalUserNotAllowed): + var luna LocalUserNotAllowed + err := json.Unmarshal(body, &luna) + return luna, err + case string(RuleTypeProcessNotAllowed): + var pna ProcessNotAllowed + err := json.Unmarshal(body, &pna) + return pna, err + case string(RuleTypeActiveConnectionsNotInAllowedRange): + var acniar ActiveConnectionsNotInAllowedRange + err := json.Unmarshal(body, &acniar) + return acniar, err + case string(RuleTypeAmqpC2DMessagesNotInAllowedRange): + var acmniar AmqpC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &acmniar) + return acmniar, err + case string(RuleTypeMqttC2DMessagesNotInAllowedRange): + var mcmniar MqttC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &mcmniar) + return mcmniar, err + case string(RuleTypeHTTPC2DMessagesNotInAllowedRange): + var hcmniar HTTPC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &hcmniar) + return hcmniar, err + case string(RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange): + var acrmniar AmqpC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &acrmniar) + return acrmniar, err + case string(RuleTypeMqttC2DRejectedMessagesNotInAllowedRange): + var mcrmniar MqttC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &mcrmniar) + return mcrmniar, err + case string(RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange): + var hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &hcrmniar) + return hcrmniar, err + case string(RuleTypeAmqpD2CMessagesNotInAllowedRange): + var admniar AmqpD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &admniar) + return admniar, err + case string(RuleTypeMqttD2CMessagesNotInAllowedRange): + var mdmniar MqttD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &mdmniar) + return mdmniar, err + case string(RuleTypeHTTPD2CMessagesNotInAllowedRange): + var hdmniar HTTPD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &hdmniar) + return hdmniar, err + case string(RuleTypeDirectMethodInvokesNotInAllowedRange): + var dminiar DirectMethodInvokesNotInAllowedRange + err := json.Unmarshal(body, &dminiar) + return dminiar, err + case string(RuleTypeFailedLocalLoginsNotInAllowedRange): + var fllniar FailedLocalLoginsNotInAllowedRange + err := json.Unmarshal(body, &fllniar) + return fllniar, err + case string(RuleTypeFileUploadsNotInAllowedRange): + var funiar FileUploadsNotInAllowedRange + err := json.Unmarshal(body, &funiar) + return funiar, err + case string(RuleTypeQueuePurgesNotInAllowedRange): + var qpniar QueuePurgesNotInAllowedRange + err := json.Unmarshal(body, &qpniar) + return qpniar, err + case string(RuleTypeTwinUpdatesNotInAllowedRange): + var tuniar TwinUpdatesNotInAllowedRange + err := json.Unmarshal(body, &tuniar) + return tuniar, err + case string(RuleTypeUnauthorizedOperationsNotInAllowedRange): + var uoniar UnauthorizedOperationsNotInAllowedRange + err := json.Unmarshal(body, &uoniar) + return uoniar, err + default: + var car CustomAlertRule + err := json.Unmarshal(body, &car) + return car, err + } +} +func unmarshalBasicCustomAlertRuleArray(body []byte) ([]BasicCustomAlertRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + carArray := make([]BasicCustomAlertRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + car, err := unmarshalBasicCustomAlertRule(*rawMessage) + if err != nil { + return nil, err + } + carArray[index] = car + } + return carArray, nil +} + +// MarshalJSON is the custom marshaler for CustomAlertRule. +func (car CustomAlertRule) MarshalJSON() ([]byte, error) { + car.RuleType = RuleTypeCustomAlertRule + objectMap := make(map[string]interface{}) + if car.IsEnabled != nil { + objectMap["isEnabled"] = car.IsEnabled + } + if car.RuleType != "" { + objectMap["ruleType"] = car.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return &car, true +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for CustomAlertRule. +func (car CustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &car, true +} + +// CVE CVE details +type CVE struct { + // Title - READ-ONLY; CVE title + Title *string `json:"title,omitempty"` + // Link - READ-ONLY; Link url + Link *string `json:"link,omitempty"` +} + +// CVSS CVSS details +type CVSS struct { + // Base - READ-ONLY; CVSS base + Base *float64 `json:"base,omitempty"` +} + +// DataExportSetting represents a data export setting +type DataExportSetting struct { + // DataExportSettingProperties - Data export setting data + *DataExportSettingProperties `json:"properties,omitempty"` + // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' + Kind SettingKind `json:"kind,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataExportSetting. +func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if desVar.DataExportSettingProperties != nil { + objectMap["properties"] = desVar.DataExportSettingProperties + } + if desVar.Kind != "" { + objectMap["kind"] = desVar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. +func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var dataExportSettingProperties DataExportSettingProperties + err = json.Unmarshal(*v, &dataExportSettingProperties) + if err != nil { + return err + } + desVar.DataExportSettingProperties = &dataExportSettingProperties + } + case "kind": + if v != nil { + var kind SettingKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + desVar.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + desVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + desVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + desVar.Type = &typeVar + } + } + } + + return nil +} + +// DataExportSettingProperties the data export setting properties +type DataExportSettingProperties struct { + // Enabled - Is the data export setting is enabled + Enabled *bool `json:"enabled,omitempty"` +} + +// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is +// denied. +type DenylistCustomAlertRule struct { + // DenylistValues - The values to deny. The format of the values depends on the rule type. + DenylistValues *[]string `json:"denylistValues,omitempty"` + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { + dcar.RuleType = RuleTypeDenylistCustomAlertRule + objectMap := make(map[string]interface{}) + if dcar.DenylistValues != nil { + objectMap["denylistValues"] = dcar.DenylistValues + } + if dcar.IsEnabled != nil { + objectMap["isEnabled"] = dcar.IsEnabled + } + if dcar.RuleType != "" { + objectMap["ruleType"] = dcar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return &dcar, true +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &dcar, true +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DenylistCustomAlertRule. +func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dcar, true +} + +// DeviceSecurityGroup the device security group resource +type DeviceSecurityGroup struct { + autorest.Response `json:"-"` + // DeviceSecurityGroupProperties - Device Security group data + *DeviceSecurityGroupProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeviceSecurityGroup. +func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsg.DeviceSecurityGroupProperties != nil { + objectMap["properties"] = dsg.DeviceSecurityGroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. +func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deviceSecurityGroupProperties DeviceSecurityGroupProperties + err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + if err != nil { return err } - if asp.AdditionalProperties == nil { - asp.AdditionalProperties = make(map[string]interface{}) + dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err } - asp.AdditionalProperties[k] = additionalProperties + dsg.ID = &ID } - case "deviceVendor": + case "name": if v != nil { - var deviceVendor string - err = json.Unmarshal(*v, &deviceVendor) + var name string + err = json.Unmarshal(*v, &name) if err != nil { return err } - asp.DeviceVendor = &deviceVendor + dsg.Name = &name } - case "deviceType": + case "type": if v != nil { - var deviceType string - err = json.Unmarshal(*v, &deviceType) + var typeVar string + err = json.Unmarshal(*v, &typeVar) if err != nil { return err } - asp.DeviceType = &deviceType + dsg.Type = &typeVar } - case "workspace": + } + } + + return nil +} + +// DeviceSecurityGroupList list of device security groups +type DeviceSecurityGroupList struct { + autorest.Response `json:"-"` + // Value - List of device security group objects + Value *[]DeviceSecurityGroup `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. +func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dsgl.Value != nil { + objectMap["value"] = dsgl.Value + } + return json.Marshal(objectMap) +} + +// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. +type DeviceSecurityGroupListIterator struct { + i int + page DeviceSecurityGroupListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DeviceSecurityGroupListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeviceSecurityGroupListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { + if !iter.page.NotDone() { + return DeviceSecurityGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DeviceSecurityGroupListIterator type. +func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { + return DeviceSecurityGroupListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsgl DeviceSecurityGroupList) IsEmpty() bool { + return dsgl.Value == nil || len(*dsgl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dsgl DeviceSecurityGroupList) hasNextLink() bool { + return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 +} + +// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { + if !dsgl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsgl.NextLink))) +} + +// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. +type DeviceSecurityGroupListPage struct { + fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) + dsgl DeviceSecurityGroupList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dsgl) + if err != nil { + return err + } + page.dsgl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DeviceSecurityGroupListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeviceSecurityGroupListPage) NotDone() bool { + return !page.dsgl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { + return page.dsgl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { + if page.dsgl.IsEmpty() { + return nil + } + return *page.dsgl.Value +} + +// Creates a new instance of the DeviceSecurityGroupListPage type. +func NewDeviceSecurityGroupListPage(getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { + return DeviceSecurityGroupListPage{fn: getNextPage} +} + +// DeviceSecurityGroupProperties describes properties of a security group. +type DeviceSecurityGroupProperties struct { + // ThresholdRules - The list of custom alert threshold rules. + ThresholdRules *[]BasicThresholdCustomAlertRule `json:"thresholdRules,omitempty"` + // TimeWindowRules - The list of custom alert time-window rules. + TimeWindowRules *[]BasicTimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` + // AllowlistRules - The allow-list custom alert rules. + AllowlistRules *[]BasicAllowlistCustomAlertRule `json:"allowlistRules,omitempty"` + // DenylistRules - The deny-list custom alert rules. + DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroupProperties struct. +func (dsgp *DeviceSecurityGroupProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "thresholdRules": if v != nil { - var workspace ConnectedWorkspace - err = json.Unmarshal(*v, &workspace) + thresholdRules, err := unmarshalBasicThresholdCustomAlertRuleArray(*v) if err != nil { return err } - asp.Workspace = &workspace + dsgp.ThresholdRules = &thresholdRules + } + case "timeWindowRules": + if v != nil { + timeWindowRules, err := unmarshalBasicTimeWindowCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.TimeWindowRules = &timeWindowRules + } + case "allowlistRules": + if v != nil { + allowlistRules, err := unmarshalBasicAllowlistCustomAlertRuleArray(*v) + if err != nil { + return err + } + dsgp.AllowlistRules = &allowlistRules + } + case "denylistRules": + if v != nil { + var denylistRules []DenylistCustomAlertRule + err = json.Unmarshal(*v, &denylistRules) + if err != nil { + return err + } + dsgp.DenylistRules = &denylistRules } } } - return nil + return nil +} + +// DirectMethodInvokesNotInAllowedRange number of direct method invokes is not in allowed range. +type DirectMethodInvokesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { + dminiar.RuleType = RuleTypeDirectMethodInvokesNotInAllowedRange + objectMap := make(map[string]interface{}) + if dminiar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = dminiar.TimeWindowSize + } + if dminiar.MinThreshold != nil { + objectMap["minThreshold"] = dminiar.MinThreshold + } + if dminiar.MaxThreshold != nil { + objectMap["maxThreshold"] = dminiar.MaxThreshold + } + if dminiar.IsEnabled != nil { + objectMap["isEnabled"] = dminiar.IsEnabled + } + if dminiar.RuleType != "" { + objectMap["ruleType"] = dminiar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// BasicAuthenticationDetailsProperties settings for cloud authentication management -type BasicAuthenticationDetailsProperties interface { - AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) - AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) - AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) - AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &dminiar, true } -// AuthenticationDetailsProperties settings for cloud authentication management -type AuthenticationDetailsProperties struct { - // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' - AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` - // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. - GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` - // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -func unmarshalBasicAuthenticationDetailsProperties(body []byte) (BasicAuthenticationDetailsProperties, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &dminiar, true +} - switch m["authenticationType"] { - case string(AuthenticationTypeAwsCreds): - var acadp AwsCredsAuthenticationDetailsProperties - err := json.Unmarshal(body, &acadp) - return acadp, err - case string(AuthenticationTypeAwsAssumeRole): - var aaradp AwAssumeRoleAuthenticationDetailsProperties - err := json.Unmarshal(body, &aaradp) - return aaradp, err - case string(AuthenticationTypeGcpCredentials): - var gcdp GcpCredentialsDetailsProperties - err := json.Unmarshal(body, &gcdp) - return gcdp, err - default: - var adp AuthenticationDetailsProperties - err := json.Unmarshal(body, &adp) - return adp, err - } +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -func unmarshalBasicAuthenticationDetailsPropertiesArray(body []byte) ([]BasicAuthenticationDetailsProperties, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) - if err != nil { - return nil, err - } - adpArray := make([]BasicAuthenticationDetailsProperties, len(rawMessages)) +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} - for index, rawMessage := range rawMessages { - adp, err := unmarshalBasicAuthenticationDetailsProperties(*rawMessage) - if err != nil { - return nil, err - } - adpArray[index] = adp - } - return adpArray, nil +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { - adp.AuthenticationType = AuthenticationTypeAuthenticationDetailsProperties - objectMap := make(map[string]interface{}) - if adp.AuthenticationType != "" { - objectMap["authenticationType"] = adp.AuthenticationType - } - return json.Marshal(objectMap) +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { return nil, false } -// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { - return &adp, true +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AuthenticationDetailsProperties. -func (adp AuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { - return &adp, true +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// Automation the security automation resource. -type Automation struct { +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return &dminiar, true +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for DirectMethodInvokesNotInAllowedRange. +func (dminiar DirectMethodInvokesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &dminiar, true +} + +// DiscoveredSecuritySolution ... +type DiscoveredSecuritySolution struct { autorest.Response `json:"-"` - // AutomationProperties - Security automation data - *AutomationProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -2021,35 +6454,21 @@ type Automation struct { // Type - READ-ONLY; Resource type Type *string `json:"type,omitempty"` // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Kind of the resource - Kind *string `json:"kind,omitempty"` - // Etag - Entity tag is used for comparing two or more entities from the same requested resource. - Etag *string `json:"etag,omitempty"` - // Tags - A list of key value pairs that describe the resource. - Tags map[string]*string `json:"tags"` + Location *string `json:"location,omitempty"` + *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for Automation. -func (a Automation) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. +func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if a.AutomationProperties != nil { - objectMap["properties"] = a.AutomationProperties - } - if a.Kind != nil { - objectMap["kind"] = a.Kind - } - if a.Etag != nil { - objectMap["etag"] = a.Etag - } - if a.Tags != nil { - objectMap["tags"] = a.Tags + if dss.DiscoveredSecuritySolutionProperties != nil { + objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Automation struct. -func (a *Automation) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. +func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2057,15 +6476,6 @@ func (a *Automation) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - var automationProperties AutomationProperties - err = json.Unmarshal(*v, &automationProperties) - if err != nil { - return err - } - a.AutomationProperties = &automationProperties - } case "id": if v != nil { var ID string @@ -2073,7 +6483,7 @@ func (a *Automation) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.ID = &ID + dss.ID = &ID } case "name": if v != nil { @@ -2082,7 +6492,7 @@ func (a *Automation) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Name = &name + dss.Name = &name } case "type": if v != nil { @@ -2091,7 +6501,7 @@ func (a *Automation) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Type = &typeVar + dss.Type = &typeVar } case "location": if v != nil { @@ -2100,34 +6510,16 @@ func (a *Automation) UnmarshalJSON(body []byte) error { if err != nil { return err } - a.Location = &location - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - a.Kind = &kind - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - a.Etag = &etag + dss.Location = &location } - case "tags": + case "properties": if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) + var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties + err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) if err != nil { return err } - a.Tags = tags + dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties } } } @@ -2135,286 +6527,369 @@ func (a *Automation) UnmarshalJSON(body []byte) error { return nil } -// BasicAutomationAction the action that should be triggered. -type BasicAutomationAction interface { - AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) - AsAutomationActionEventHub() (*AutomationActionEventHub, bool) - AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) - AsAutomationAction() (*AutomationAction, bool) +// DiscoveredSecuritySolutionList ... +type DiscoveredSecuritySolutionList struct { + autorest.Response `json:"-"` + Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` } -// AutomationAction the action that should be triggered. -type AutomationAction struct { - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` +// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. +func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dssl.Value != nil { + objectMap["value"] = dssl.Value + } + return json.Marshal(objectMap) } -func unmarshalBasicAutomationAction(body []byte) (BasicAutomationAction, error) { - var m map[string]interface{} - err := json.Unmarshal(body, &m) - if err != nil { - return nil, err - } +// DiscoveredSecuritySolutionListIterator provides access to a complete listing of DiscoveredSecuritySolution +// values. +type DiscoveredSecuritySolutionListIterator struct { + i int + page DiscoveredSecuritySolutionListPage +} - switch m["actionType"] { - case string(ActionTypeLogicApp): - var aala AutomationActionLogicApp - err := json.Unmarshal(body, &aala) - return aala, err - case string(ActionTypeEventHub): - var aaeh AutomationActionEventHub - err := json.Unmarshal(body, &aaeh) - return aaeh, err - case string(ActionTypeWorkspace): - var aaw AutomationActionWorkspace - err := json.Unmarshal(body, &aaw) - return aaw, err - default: - var aa AutomationAction - err := json.Unmarshal(body, &aa) - return aa, err +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } -} -func unmarshalBasicAutomationActionArray(body []byte) ([]BasicAutomationAction, error) { - var rawMessages []*json.RawMessage - err := json.Unmarshal(body, &rawMessages) + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) if err != nil { - return nil, err + iter.i-- + return err } + iter.i = 0 + return nil +} - aaArray := make([]BasicAutomationAction, len(rawMessages)) +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiscoveredSecuritySolutionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} - for index, rawMessage := range rawMessages { - aa, err := unmarshalBasicAutomationAction(*rawMessage) - if err != nil { - return nil, err - } - aaArray[index] = aa - } - return aaArray, nil +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// MarshalJSON is the custom marshaler for AutomationAction. -func (aa AutomationAction) MarshalJSON() ([]byte, error) { - aa.ActionType = ActionTypeAutomationAction - objectMap := make(map[string]interface{}) - if aa.ActionType != "" { - objectMap["actionType"] = aa.ActionType - } - return json.Marshal(objectMap) +// Response returns the raw server response from the last page request. +func (iter DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { + return iter.page.Response() } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { - return nil, false +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { + if !iter.page.NotDone() { + return DiscoveredSecuritySolution{} + } + return iter.page.Values()[iter.i] } -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { - return nil, false +// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. +func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { + return DiscoveredSecuritySolutionListIterator{page: page} } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { - return nil, false +// IsEmpty returns true if the ListResult contains no values. +func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { + return dssl.Value == nil || len(*dssl.Value) == 0 } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsAutomationAction() (*AutomationAction, bool) { - return &aa, true +// hasNextLink returns true if the NextLink is not empty. +func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { + return dssl.NextLink != nil && len(*dssl.NextLink) != 0 } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationAction. -func (aa AutomationAction) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aa, true +// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !dssl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dssl.NextLink))) } -// AutomationActionEventHub the target Event Hub to which event data will be exported. To learn more about -// Security Center continuous export capabilities, visit https://aka.ms/ASCExportLearnMore -type AutomationActionEventHub struct { - // EventHubResourceID - The target Event Hub Azure Resource ID. - EventHubResourceID *string `json:"eventHubResourceId,omitempty"` - // SasPolicyName - READ-ONLY; The target Event Hub SAS policy name. - SasPolicyName *string `json:"sasPolicyName,omitempty"` - // ConnectionString - The target Event Hub connection string (it will not be included in any response). - ConnectionString *string `json:"connectionString,omitempty"` - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` +// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. +type DiscoveredSecuritySolutionListPage struct { + fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) + dssl DiscoveredSecuritySolutionList } -// MarshalJSON is the custom marshaler for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) MarshalJSON() ([]byte, error) { - aaeh.ActionType = ActionTypeEventHub - objectMap := make(map[string]interface{}) - if aaeh.EventHubResourceID != nil { - objectMap["eventHubResourceId"] = aaeh.EventHubResourceID - } - if aaeh.ConnectionString != nil { - objectMap["connectionString"] = aaeh.ConnectionString +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if aaeh.ActionType != "" { - objectMap["actionType"] = aaeh.ActionType + for { + next, err := page.fn(ctx, page.dssl) + if err != nil { + return err + } + page.dssl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } } - return json.Marshal(objectMap) + return nil } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { - return nil, false +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiscoveredSecuritySolutionListPage) Next() error { + return page.NextWithContext(context.Background()) } -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { - return &aaeh, true +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiscoveredSecuritySolutionListPage) NotDone() bool { + return !page.dssl.IsEmpty() } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { - return nil, false +// Response returns the raw server response from the last page request. +func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { + return page.dssl } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsAutomationAction() (*AutomationAction, bool) { - return nil, false +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { + if page.dssl.IsEmpty() { + return nil + } + return *page.dssl.Value } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionEventHub. -func (aaeh AutomationActionEventHub) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aaeh, true +// Creates a new instance of the DiscoveredSecuritySolutionListPage type. +func NewDiscoveredSecuritySolutionListPage(getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { + return DiscoveredSecuritySolutionListPage{fn: getNextPage} } -// AutomationActionLogicApp the logic app action that should be triggered. To learn more about Security -// Center's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore -type AutomationActionLogicApp struct { - // LogicAppResourceID - The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App - LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` - // URI - The Logic App trigger URI endpoint (it will not be included in any response). - URI *string `json:"uri,omitempty"` - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` +// DiscoveredSecuritySolutionProperties ... +type DiscoveredSecuritySolutionProperties struct { + // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' + SecurityFamily Family `json:"securityFamily,omitempty"` + // Offer - The security solutions' image offer + Offer *string `json:"offer,omitempty"` + // Publisher - The security solutions' image publisher + Publisher *string `json:"publisher,omitempty"` + // Sku - The security solutions' image sku + Sku *string `json:"sku,omitempty"` } -// MarshalJSON is the custom marshaler for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) MarshalJSON() ([]byte, error) { - aala.ActionType = ActionTypeLogicApp - objectMap := make(map[string]interface{}) - if aala.LogicAppResourceID != nil { - objectMap["logicAppResourceId"] = aala.LogicAppResourceID - } - if aala.URI != nil { - objectMap["uri"] = aala.URI - } - if aala.ActionType != "" { - objectMap["actionType"] = aala.ActionType - } - return json.Marshal(objectMap) +// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface +type EffectiveNetworkSecurityGroups struct { + // NetworkInterface - The Azure resource ID of the network interface + NetworkInterface *string `json:"networkInterface,omitempty"` + // NetworkSecurityGroups - The Network Security Groups effective on the network interface + NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { - return &aala, true +// ETag entity tag is used for comparing two or more entities from the same requested resource. +type ETag struct { + // Etag - Entity tag is used for comparing two or more entities from the same requested resource. + Etag *string `json:"etag,omitempty"` } -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { - return nil, false +// BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends +// information to an OMS workspace and whose data is displayed by Azure Security Center. +type BasicExternalSecuritySolution interface { + AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) + AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) + AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) + AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { - return nil, false +// ExternalSecuritySolution represents a security solution external to Azure Security Center which sends +// information to an OMS workspace and whose data is displayed by Azure Security Center. +type ExternalSecuritySolution struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' + Kind KindEnum `json:"kind,omitempty"` } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsAutomationAction() (*AutomationAction, bool) { - return nil, false -} +func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionLogicApp. -func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aala, true + switch m["kind"] { + case string(KindCEF): + var cess CefExternalSecuritySolution + err := json.Unmarshal(body, &cess) + return cess, err + case string(KindATA): + var aess AtaExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + case string(KindAAD): + var aess AadExternalSecuritySolution + err := json.Unmarshal(body, &aess) + return aess, err + default: + var ess ExternalSecuritySolution + err := json.Unmarshal(body, &ess) + return ess, err + } } +func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } -// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security alerts -// data will reside in the 'SecurityAlert' table and the assessments data will reside in the -// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to -// view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled -// on that workspace. To learn more about Security Center continuous export capabilities, visit -// https://aka.ms/ASCExportLearnMore -type AutomationActionWorkspace struct { - // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. - WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` - // ActionType - Possible values include: 'ActionTypeAutomationAction', 'ActionTypeLogicApp', 'ActionTypeEventHub', 'ActionTypeWorkspace' - ActionType ActionType `json:"actionType,omitempty"` + essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) + if err != nil { + return nil, err + } + essArray[index] = ess + } + return essArray, nil } -// MarshalJSON is the custom marshaler for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) MarshalJSON() ([]byte, error) { - aaw.ActionType = ActionTypeWorkspace +// MarshalJSON is the custom marshaler for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { + ess.Kind = KindExternalSecuritySolution objectMap := make(map[string]interface{}) - if aaw.WorkspaceResourceID != nil { - objectMap["workspaceResourceId"] = aaw.WorkspaceResourceID - } - if aaw.ActionType != "" { - objectMap["actionType"] = aaw.ActionType + if ess.Kind != "" { + objectMap["kind"] = ess.Kind } return json.Marshal(objectMap) } -// AsAutomationActionLogicApp is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationActionLogicApp() (*AutomationActionLogicApp, bool) { +// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { return nil, false } -// AsAutomationActionEventHub is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationActionEventHub() (*AutomationActionEventHub, bool) { +// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { return nil, false } -// AsAutomationActionWorkspace is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationActionWorkspace() (*AutomationActionWorkspace, bool) { - return &aaw, true +// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { + return nil, false } -// AsAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsAutomationAction() (*AutomationAction, bool) { - return nil, false +// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { + return &ess, true } -// AsBasicAutomationAction is the BasicAutomationAction implementation for AutomationActionWorkspace. -func (aaw AutomationActionWorkspace) AsBasicAutomationAction() (BasicAutomationAction, bool) { - return &aaw, true +// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. +func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { + return &ess, true } -// AutomationList list of security automations response. -type AutomationList struct { +// ExternalSecuritySolutionKind1 describes an Azure resource with kind +type ExternalSecuritySolutionKind1 struct { + // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' + Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` +} + +// ExternalSecuritySolutionList ... +type ExternalSecuritySolutionList struct { autorest.Response `json:"-"` - // Value - The list of security automations under the given scope. - Value *[]Automation `json:"value,omitempty"` + Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for AutomationList. -func (al AutomationList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. +func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if al.Value != nil { - objectMap["value"] = al.Value + if essl.Value != nil { + objectMap["value"] = essl.Value } return json.Marshal(objectMap) } -// AutomationListIterator provides access to a complete listing of Automation values. -type AutomationListIterator struct { +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. +func (essl *ExternalSecuritySolutionList) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "value": + if v != nil { + value, err := unmarshalBasicExternalSecuritySolutionArray(*v) + if err != nil { + return err + } + essl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + essl.NextLink = &nextLink + } + } + } + + return nil +} + +// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution +// values. +type ExternalSecuritySolutionListIterator struct { i int - page AutomationListPage + page ExternalSecuritySolutionListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *AutomationListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -2439,67 +6914,67 @@ func (iter *AutomationListIterator) NextWithContext(ctx context.Context) (err er // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *AutomationListIterator) Next() error { +func (iter *ExternalSecuritySolutionListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AutomationListIterator) NotDone() bool { +func (iter ExternalSecuritySolutionListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter AutomationListIterator) Response() AutomationList { +func (iter ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter AutomationListIterator) Value() Automation { +func (iter ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { if !iter.page.NotDone() { - return Automation{} + return ExternalSecuritySolution{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the AutomationListIterator type. -func NewAutomationListIterator(page AutomationListPage) AutomationListIterator { - return AutomationListIterator{page: page} +// Creates a new instance of the ExternalSecuritySolutionListIterator type. +func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { + return ExternalSecuritySolutionListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (al AutomationList) IsEmpty() bool { - return al.Value == nil || len(*al.Value) == 0 +func (essl ExternalSecuritySolutionList) IsEmpty() bool { + return essl.Value == nil || len(*essl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (al AutomationList) hasNextLink() bool { - return al.NextLink != nil && len(*al.NextLink) != 0 +func (essl ExternalSecuritySolutionList) hasNextLink() bool { + return essl.NextLink != nil && len(*essl.NextLink) != 0 } -// automationListPreparer prepares a request to retrieve the next set of results. +// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (al AutomationList) automationListPreparer(ctx context.Context) (*http.Request, error) { - if !al.hasNextLink() { +func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { + if !essl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(al.NextLink))) + autorest.WithBaseURL(to.String(essl.NextLink))) } -// AutomationListPage contains a page of Automation values. -type AutomationListPage struct { - fn func(context.Context, AutomationList) (AutomationList, error) - al AutomationList +// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. +type ExternalSecuritySolutionListPage struct { + fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) + essl ExternalSecuritySolutionList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *AutomationListPage) NextWithContext(ctx context.Context) (err error) { +func (page *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutomationListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -2509,11 +6984,11 @@ func (page *AutomationListPage) NextWithContext(ctx context.Context) (err error) }() } for { - next, err := page.fn(ctx, page.al) + next, err := page.fn(ctx, page.essl) if err != nil { return err } - page.al = next + page.essl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -2524,51 +6999,79 @@ func (page *AutomationListPage) NextWithContext(ctx context.Context) (err error) // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *AutomationListPage) Next() error { +func (page *ExternalSecuritySolutionListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AutomationListPage) NotDone() bool { - return !page.al.IsEmpty() +func (page ExternalSecuritySolutionListPage) NotDone() bool { + return !page.essl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { + return page.essl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { + if page.essl.IsEmpty() { + return nil + } + return *page.essl.Value +} + +// Creates a new instance of the ExternalSecuritySolutionListPage type. +func NewExternalSecuritySolutionListPage(getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { + return ExternalSecuritySolutionListPage{fn: getNextPage} } -// Response returns the raw server response from the last page request. -func (page AutomationListPage) Response() AutomationList { - return page.al +// ExternalSecuritySolutionModel ... +type ExternalSecuritySolutionModel struct { + autorest.Response `json:"-"` + Value BasicExternalSecuritySolution `json:"value,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page AutomationListPage) Values() []Automation { - if page.al.IsEmpty() { - return nil +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. +func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { + ess, err := unmarshalBasicExternalSecuritySolution(body) + if err != nil { + return err } - return *page.al.Value + essm.Value = ess + + return nil } -// Creates a new instance of the AutomationListPage type. -func NewAutomationListPage(getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { - return AutomationListPage{fn: getNextPage} +// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) +type ExternalSecuritySolutionProperties struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + DeviceVendor *string `json:"deviceVendor,omitempty"` + DeviceType *string `json:"deviceType,omitempty"` + Workspace *ConnectedWorkspace `json:"workspace,omitempty"` } -// AutomationProperties a set of properties that defines the behavior of the automation configuration. To learn -// more about the supported security events data models schemas - please visit -// https://aka.ms/ASCAutomationSchemas. -type AutomationProperties struct { - // Description - The security automation description. - Description *string `json:"description,omitempty"` - // IsEnabled - Indicates whether the security automation is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - // Scopes - A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. - Scopes *[]AutomationScope `json:"scopes,omitempty"` - // Sources - A collection of the source event types which evaluate the security automation set of rules. - Sources *[]AutomationSource `json:"sources,omitempty"` - // Actions - A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. - Actions *[]BasicAutomationAction `json:"actions,omitempty"` +// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. +func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if essp.DeviceVendor != nil { + objectMap["deviceVendor"] = essp.DeviceVendor + } + if essp.DeviceType != nil { + objectMap["deviceType"] = essp.DeviceType + } + if essp.Workspace != nil { + objectMap["workspace"] = essp.Workspace + } + for k, v := range essp.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for AutomationProperties struct. -func (ap *AutomationProperties) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. +func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -2576,49 +7079,44 @@ func (ap *AutomationProperties) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "description": + default: if v != nil { - var description string - err = json.Unmarshal(*v, &description) + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) if err != nil { return err } - ap.Description = &description - } - case "isEnabled": - if v != nil { - var isEnabled bool - err = json.Unmarshal(*v, &isEnabled) - if err != nil { - return err + if essp.AdditionalProperties == nil { + essp.AdditionalProperties = make(map[string]interface{}) } - ap.IsEnabled = &isEnabled + essp.AdditionalProperties[k] = additionalProperties } - case "scopes": + case "deviceVendor": if v != nil { - var scopes []AutomationScope - err = json.Unmarshal(*v, &scopes) + var deviceVendor string + err = json.Unmarshal(*v, &deviceVendor) if err != nil { return err } - ap.Scopes = &scopes + essp.DeviceVendor = &deviceVendor } - case "sources": + case "deviceType": if v != nil { - var sources []AutomationSource - err = json.Unmarshal(*v, &sources) + var deviceType string + err = json.Unmarshal(*v, &deviceType) if err != nil { return err } - ap.Sources = &sources + essp.DeviceType = &deviceType } - case "actions": + case "workspace": if v != nil { - actions, err := unmarshalBasicAutomationActionArray(*v) + var workspace ConnectedWorkspace + err = json.Unmarshal(*v, &workspace) if err != nil { return err } - ap.Actions = &actions + essp.Workspace = &workspace } } } @@ -2626,1719 +7124,1112 @@ func (ap *AutomationProperties) UnmarshalJSON(body []byte) error { return nil } -// AutomationRuleSet a rule set which evaluates all its rules upon an event interception. Only when all the -// included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions. -type AutomationRuleSet struct { - Rules *[]AutomationTriggeringRule `json:"rules,omitempty"` +// FailedLocalLoginsNotInAllowedRange number of failed local logins is not in allowed range. +type FailedLocalLoginsNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` } -// AutomationScope a single automation scope. -type AutomationScope struct { - // Description - The resources scope description. - Description *string `json:"description,omitempty"` - // ScopePath - The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs). - ScopePath *string `json:"scopePath,omitempty"` +// MarshalJSON is the custom marshaler for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { + fllniar.RuleType = RuleTypeFailedLocalLoginsNotInAllowedRange + objectMap := make(map[string]interface{}) + if fllniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = fllniar.TimeWindowSize + } + if fllniar.MinThreshold != nil { + objectMap["minThreshold"] = fllniar.MinThreshold + } + if fllniar.MaxThreshold != nil { + objectMap["maxThreshold"] = fllniar.MaxThreshold + } + if fllniar.IsEnabled != nil { + objectMap["isEnabled"] = fllniar.IsEnabled + } + if fllniar.RuleType != "" { + objectMap["ruleType"] = fllniar.RuleType + } + return json.Marshal(objectMap) } -// AutomationSource the source event types which evaluate the security automation set of rules. For example - -// security alerts and security assessments. To learn more about the supported security events data models -// schemas - please visit https://aka.ms/ASCAutomationSchemas. -type AutomationSource struct { - // EventSource - A valid event source type. Possible values include: 'Assessments', 'Alerts' - EventSource EventSource `json:"eventSource,omitempty"` - // RuleSets - A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). - RuleSets *[]AutomationRuleSet `json:"ruleSets,omitempty"` +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// AutomationTriggeringRule a rule which is evaluated upon event interception. The rule is configured by -// comparing a specific value from the event model to an expected value. This comparison is done by using one -// of the supported operators set. -type AutomationTriggeringRule struct { - // PropertyJPath - The JPath of the entity model property that should be checked. - PropertyJPath *string `json:"propertyJPath,omitempty"` - // PropertyType - The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. Possible values include: 'String', 'Integer', 'Number', 'Boolean' - PropertyType PropertyType `json:"propertyType,omitempty"` - // ExpectedValue - The expected value. - ExpectedValue *string `json:"expectedValue,omitempty"` - // Operator - A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. Possible values include: 'Equals', 'GreaterThan', 'GreaterThanOrEqualTo', 'LesserThan', 'LesserThanOrEqualTo', 'NotEquals', 'Contains', 'StartsWith', 'EndsWith' - Operator Operator `json:"operator,omitempty"` +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &fllniar, true } -// AutomationValidationStatus the security automation model state property bag. -type AutomationValidationStatus struct { - autorest.Response `json:"-"` - // IsValid - Indicates whether the model is valid or not. - IsValid *bool `json:"isValid,omitempty"` - // Message - The validation message. - Message *string `json:"message,omitempty"` +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// AutoProvisioningSetting auto provisioning setting -type AutoProvisioningSetting struct { - autorest.Response `json:"-"` - // AutoProvisioningSettingProperties - Auto provisioning setting data - *AutoProvisioningSettingProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &fllniar, true } -// MarshalJSON is the custom marshaler for AutoProvisioningSetting. -func (aps AutoProvisioningSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if aps.AutoProvisioningSettingProperties != nil { - objectMap["properties"] = aps.AutoProvisioningSettingProperties - } - return json.Marshal(objectMap) +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for AutoProvisioningSetting struct. -func (aps *AutoProvisioningSetting) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var autoProvisioningSettingProperties AutoProvisioningSettingProperties - err = json.Unmarshal(*v, &autoProvisioningSettingProperties) - if err != nil { - return err - } - aps.AutoProvisioningSettingProperties = &autoProvisioningSettingProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - aps.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - aps.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - aps.Type = &typeVar - } - } - } +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} - return nil +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// AutoProvisioningSettingList list of all the auto provisioning settings response -type AutoProvisioningSettingList struct { - autorest.Response `json:"-"` - // Value - List of all the auto provisioning settings - Value *[]AutoProvisioningSetting `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AutoProvisioningSettingList. -func (apsl AutoProvisioningSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if apsl.Value != nil { - objectMap["value"] = apsl.Value - } - return json.Marshal(objectMap) +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// AutoProvisioningSettingListIterator provides access to a complete listing of AutoProvisioningSetting values. -type AutoProvisioningSettingListIterator struct { - i int - page AutoProvisioningSettingListPage +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AutoProvisioningSettingListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutoProvisioningSettingListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AutoProvisioningSettingListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AutoProvisioningSettingListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter AutoProvisioningSettingListIterator) Response() AutoProvisioningSettingList { - return iter.page.Response() +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AutoProvisioningSettingListIterator) Value() AutoProvisioningSetting { - if !iter.page.NotDone() { - return AutoProvisioningSetting{} - } - return iter.page.Values()[iter.i] +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the AutoProvisioningSettingListIterator type. -func NewAutoProvisioningSettingListIterator(page AutoProvisioningSettingListPage) AutoProvisioningSettingListIterator { - return AutoProvisioningSettingListIterator{page: page} +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (apsl AutoProvisioningSettingList) IsEmpty() bool { - return apsl.Value == nil || len(*apsl.Value) == 0 +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (apsl AutoProvisioningSettingList) hasNextLink() bool { - return apsl.NextLink != nil && len(*apsl.NextLink) != 0 +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// autoProvisioningSettingListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (apsl AutoProvisioningSettingList) autoProvisioningSettingListPreparer(ctx context.Context) (*http.Request, error) { - if !apsl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(apsl.NextLink))) +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// AutoProvisioningSettingListPage contains a page of AutoProvisioningSetting values. -type AutoProvisioningSettingListPage struct { - fn func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error) - apsl AutoProvisioningSettingList +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AutoProvisioningSettingListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AutoProvisioningSettingListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.apsl) - if err != nil { - return err - } - page.apsl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AutoProvisioningSettingListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return &fllniar, true } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AutoProvisioningSettingListPage) NotDone() bool { - return !page.apsl.IsEmpty() +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page AutoProvisioningSettingListPage) Response() AutoProvisioningSettingList { - return page.apsl +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page AutoProvisioningSettingListPage) Values() []AutoProvisioningSetting { - if page.apsl.IsEmpty() { - return nil - } - return *page.apsl.Value +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the AutoProvisioningSettingListPage type. -func NewAutoProvisioningSettingListPage(getNextPage func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error)) AutoProvisioningSettingListPage { - return AutoProvisioningSettingListPage{fn: getNextPage} +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// AutoProvisioningSettingProperties describes properties of an auto provisioning setting -type AutoProvisioningSettingProperties struct { - // AutoProvision - Describes what kind of security agent provisioning action to take. Possible values include: 'AutoProvisionOn', 'AutoProvisionOff' - AutoProvision AutoProvision `json:"autoProvision,omitempty"` +// AsCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// AwAssumeRoleAuthenticationDetailsProperties AWS cloud account connector based assume role, the role enables -// delegating access to your AWS resources. The role is composed of role arn and external id, for more details, -// refer to Creating a -// Role to Delegate Permissions to an IAM User (write only) -type AwAssumeRoleAuthenticationDetailsProperties struct { - // AccountID - READ-ONLY; The ID of the cloud account - AccountID *string `json:"accountId,omitempty"` - // AwsAssumeRoleArn - Assumed role ID is an identifier that you can use to create temporary security credentials. - AwsAssumeRoleArn *string `json:"awsAssumeRoleArn,omitempty"` - // AwsExternalID - A unique identifier that is required when you assume a role in another account. - AwsExternalID *string `json:"awsExternalId,omitempty"` - // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' - AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` - // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. - GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` - // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FailedLocalLoginsNotInAllowedRange. +func (fllniar FailedLocalLoginsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &fllniar, true } -// MarshalJSON is the custom marshaler for AwAssumeRoleAuthenticationDetailsProperties. -func (aaradp AwAssumeRoleAuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { - aaradp.AuthenticationType = AuthenticationTypeAwsAssumeRole +// FileUploadsNotInAllowedRange number of file uploads is not in allowed range. +type FileUploadsNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) MarshalJSON() ([]byte, error) { + funiar.RuleType = RuleTypeFileUploadsNotInAllowedRange objectMap := make(map[string]interface{}) - if aaradp.AwsAssumeRoleArn != nil { - objectMap["awsAssumeRoleArn"] = aaradp.AwsAssumeRoleArn + if funiar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = funiar.TimeWindowSize } - if aaradp.AwsExternalID != nil { - objectMap["awsExternalId"] = aaradp.AwsExternalID + if funiar.MinThreshold != nil { + objectMap["minThreshold"] = funiar.MinThreshold } - if aaradp.AuthenticationType != "" { - objectMap["authenticationType"] = aaradp.AuthenticationType + if funiar.MaxThreshold != nil { + objectMap["maxThreshold"] = funiar.MaxThreshold + } + if funiar.IsEnabled != nil { + objectMap["isEnabled"] = funiar.IsEnabled + } + if funiar.RuleType != "" { + objectMap["ruleType"] = funiar.RuleType } return json.Marshal(objectMap) } -// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. -func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. -func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { - return &aaradp, true +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &funiar, true } -// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. -func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. -func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &funiar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwAssumeRoleAuthenticationDetailsProperties. -func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { - return &aaradp, true +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// AwsCredsAuthenticationDetailsProperties AWS cloud account connector based credentials, the credentials is -// composed of access key id and secret key, for more details, refer to Creating an IAM User in Your -// AWS Account (write only) -type AwsCredsAuthenticationDetailsProperties struct { - // AccountID - READ-ONLY; The ID of the cloud account - AccountID *string `json:"accountId,omitempty"` - // AwsAccessKeyID - Public key element of the AWS credential object (write only) - AwsAccessKeyID *string `json:"awsAccessKeyId,omitempty"` - // AwsSecretAccessKey - Secret key element of the AWS credential object (write only) - AwsSecretAccessKey *string `json:"awsSecretAccessKey,omitempty"` - // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' - AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` - // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. - GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` - // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AwsCredsAuthenticationDetailsProperties. -func (acadp AwsCredsAuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { - acadp.AuthenticationType = AuthenticationTypeAwsCreds - objectMap := make(map[string]interface{}) - if acadp.AwsAccessKeyID != nil { - objectMap["awsAccessKeyId"] = acadp.AwsAccessKeyID - } - if acadp.AwsSecretAccessKey != nil { - objectMap["awsSecretAccessKey"] = acadp.AwsSecretAccessKey - } - if acadp.AuthenticationType != "" { - objectMap["authenticationType"] = acadp.AuthenticationType - } - return json.Marshal(objectMap) +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. -func (acadp AwsCredsAuthenticationDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { - return &acadp, true +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. -func (acadp AwsCredsAuthenticationDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { return nil, false } -// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. -func (acadp AwsCredsAuthenticationDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { return nil, false } -// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. -func (acadp AwsCredsAuthenticationDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { return nil, false } -// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for AwsCredsAuthenticationDetailsProperties. -func (acadp AwsCredsAuthenticationDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { - return &acadp, true +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// AzureResourceDetails details of the Azure resource that was assessed -type AzureResourceDetails struct { - // ID - READ-ONLY; Azure resource Id of the assessed resource - ID *string `json:"id,omitempty"` - // Source - Possible values include: 'SourceResourceDetails', 'SourceOnPremiseSQL', 'SourceOnPremise', 'SourceAzure' - Source Source `json:"source,omitempty"` +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for AzureResourceDetails. -func (ard AzureResourceDetails) MarshalJSON() ([]byte, error) { - ard.Source = SourceAzure - objectMap := make(map[string]interface{}) - if ard.Source != "" { - objectMap["source"] = ard.Source - } - return json.Marshal(objectMap) +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// AsOnPremiseSQLResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. -func (ard AzureResourceDetails) AsOnPremiseSQLResourceDetails() (*OnPremiseSQLResourceDetails, bool) { +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsOnPremiseResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. -func (ard AzureResourceDetails) AsOnPremiseResourceDetails() (*OnPremiseResourceDetails, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsBasicOnPremiseResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. -func (ard AzureResourceDetails) AsBasicOnPremiseResourceDetails() (BasicOnPremiseResourceDetails, bool) { +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsAzureResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. -func (ard AzureResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { - return &ard, true +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// AsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. -func (ard AzureResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsBasicResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. -func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { - return &ard, true +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// AzureResourceLink describes an Azure resource with kind -type AzureResourceLink struct { - // ID - READ-ONLY; Azure resource Id - ID *string `json:"id,omitempty"` +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace -type CefExternalSecuritySolution struct { - Properties *CefSolutionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for CefExternalSecuritySolution. -func (cess CefExternalSecuritySolution) MarshalJSON() ([]byte, error) { - cess.Kind = KindCEF - objectMap := make(map[string]interface{}) - if cess.Properties != nil { - objectMap["properties"] = cess.Properties - } - if cess.Kind != "" { - objectMap["kind"] = cess.Kind - } - return json.Marshal(objectMap) +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return &funiar, true } -// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. -func (cess CefExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { - return &cess, true +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. -func (cess CefExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { return nil, false } -// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. -func (cess CefExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { return nil, false } -// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. -func (cess CefExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { +// AsCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { return nil, false } -// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. -func (cess CefExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { - return &cess, true +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for FileUploadsNotInAllowedRange. +func (funiar FileUploadsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &funiar, true } -// CefSolutionProperties ... -type CefSolutionProperties struct { - Hostname *string `json:"hostname,omitempty"` - Agent *string `json:"agent,omitempty"` - LastEventReceived *string `json:"lastEventReceived,omitempty"` - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - DeviceVendor *string `json:"deviceVendor,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +// GcpCredentialsDetailsProperties GCP cloud account connector based service to service credentials, the +// credentials is composed of organization id and json api key (write only) +type GcpCredentialsDetailsProperties struct { + // OrganizationID - The Organization ID of the GCP cloud account + OrganizationID *string `json:"organizationId,omitempty"` + // Type - Type field of the API key (write only) + Type *string `json:"type,omitempty"` + // ProjectID - Project Id field of the API key (write only) + ProjectID *string `json:"projectId,omitempty"` + // PrivateKeyID - Private key Id field of the API key (write only) + PrivateKeyID *string `json:"privateKeyId,omitempty"` + // PrivateKey - Private key field of the API key (write only) + PrivateKey *string `json:"privateKey,omitempty"` + // ClientEmail - Client email field of the API key (write only) + ClientEmail *string `json:"clientEmail,omitempty"` + // ClientID - Client Id field of the API key (write only) + ClientID *string `json:"clientId,omitempty"` + // AuthURI - Auth Uri field of the API key (write only) + AuthURI *string `json:"authUri,omitempty"` + // TokenURI - Token Uri field of the API key (write only) + TokenURI *string `json:"tokenUri,omitempty"` + // AuthProviderX509CertURL - Auth provider x509 certificate url field of the API key (write only) + AuthProviderX509CertURL *string `json:"authProviderX509CertUrl,omitempty"` + // ClientX509CertURL - Client x509 certificate url field of the API key (write only) + ClientX509CertURL *string `json:"clientX509CertUrl,omitempty"` + // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' + AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` + // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. + GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` + // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` } -// MarshalJSON is the custom marshaler for CefSolutionProperties. -func (csp CefSolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { + gcdp.AuthenticationType = AuthenticationTypeGcpCredentials objectMap := make(map[string]interface{}) - if csp.Hostname != nil { - objectMap["hostname"] = csp.Hostname + if gcdp.OrganizationID != nil { + objectMap["organizationId"] = gcdp.OrganizationID } - if csp.Agent != nil { - objectMap["agent"] = csp.Agent + if gcdp.Type != nil { + objectMap["type"] = gcdp.Type } - if csp.LastEventReceived != nil { - objectMap["lastEventReceived"] = csp.LastEventReceived + if gcdp.ProjectID != nil { + objectMap["projectId"] = gcdp.ProjectID } - if csp.DeviceVendor != nil { - objectMap["deviceVendor"] = csp.DeviceVendor + if gcdp.PrivateKeyID != nil { + objectMap["privateKeyId"] = gcdp.PrivateKeyID } - if csp.DeviceType != nil { - objectMap["deviceType"] = csp.DeviceType + if gcdp.PrivateKey != nil { + objectMap["privateKey"] = gcdp.PrivateKey } - if csp.Workspace != nil { - objectMap["workspace"] = csp.Workspace + if gcdp.ClientEmail != nil { + objectMap["clientEmail"] = gcdp.ClientEmail } - for k, v := range csp.AdditionalProperties { - objectMap[k] = v + if gcdp.ClientID != nil { + objectMap["clientId"] = gcdp.ClientID + } + if gcdp.AuthURI != nil { + objectMap["authUri"] = gcdp.AuthURI + } + if gcdp.TokenURI != nil { + objectMap["tokenUri"] = gcdp.TokenURI + } + if gcdp.AuthProviderX509CertURL != nil { + objectMap["authProviderX509CertUrl"] = gcdp.AuthProviderX509CertURL + } + if gcdp.ClientX509CertURL != nil { + objectMap["clientX509CertUrl"] = gcdp.ClientX509CertURL + } + if gcdp.AuthenticationType != "" { + objectMap["authenticationType"] = gcdp.AuthenticationType } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for CefSolutionProperties struct. -func (csp *CefSolutionProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "hostname": - if v != nil { - var hostname string - err = json.Unmarshal(*v, &hostname) - if err != nil { - return err - } - csp.Hostname = &hostname - } - case "agent": - if v != nil { - var agent string - err = json.Unmarshal(*v, &agent) - if err != nil { - return err - } - csp.Agent = &agent - } - case "lastEventReceived": - if v != nil { - var lastEventReceived string - err = json.Unmarshal(*v, &lastEventReceived) - if err != nil { - return err - } - csp.LastEventReceived = &lastEventReceived - } - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if csp.AdditionalProperties == nil { - csp.AdditionalProperties = make(map[string]interface{}) - } - csp.AdditionalProperties[k] = additionalProperties - } - case "deviceVendor": - if v != nil { - var deviceVendor string - err = json.Unmarshal(*v, &deviceVendor) - if err != nil { - return err - } - csp.DeviceVendor = &deviceVendor - } - case "deviceType": - if v != nil { - var deviceType string - err = json.Unmarshal(*v, &deviceType) - if err != nil { - return err - } - csp.DeviceType = &deviceType - } - case "workspace": - if v != nil { - var workspace ConnectedWorkspace - err = json.Unmarshal(*v, &workspace) - if err != nil { - return err - } - csp.Workspace = &workspace - } - } - } +// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { + return nil, false +} - return nil +// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { + return nil, false } -// CloudError error response structure. -type CloudError struct { - // CloudErrorBody - Error data - *CloudErrorBody `json:"error,omitempty"` +// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { + return &gcdp, true +} + +// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { + return nil, false +} + +// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. +func (gcdp GcpCredentialsDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { + return &gcdp, true +} + +// HTTPC2DMessagesNotInAllowedRange number of cloud to device messages (HTTP protocol) is not in allowed range. +type HTTPC2DMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for CloudError. -func (ce CloudError) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + hcmniar.RuleType = RuleTypeHTTPC2DMessagesNotInAllowedRange objectMap := make(map[string]interface{}) - if ce.CloudErrorBody != nil { - objectMap["error"] = ce.CloudErrorBody + if hcmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = hcmniar.TimeWindowSize } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for CloudError struct. -func (ce *CloudError) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err + if hcmniar.MinThreshold != nil { + objectMap["minThreshold"] = hcmniar.MinThreshold } - for k, v := range m { - switch k { - case "error": - if v != nil { - var cloudErrorBody CloudErrorBody - err = json.Unmarshal(*v, &cloudErrorBody) - if err != nil { - return err - } - ce.CloudErrorBody = &cloudErrorBody - } - } + if hcmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = hcmniar.MaxThreshold + } + if hcmniar.IsEnabled != nil { + objectMap["isEnabled"] = hcmniar.IsEnabled } + if hcmniar.RuleType != "" { + objectMap["ruleType"] = hcmniar.RuleType + } + return json.Marshal(objectMap) +} - return nil +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// CloudErrorBody error details. -type CloudErrorBody struct { - // Code - READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty"` - // Message - READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty"` +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &hcmniar, true } -// Compliance compliance of a scope -type Compliance struct { - autorest.Response `json:"-"` - // ComplianceProperties - Compliance data - *ComplianceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for Compliance. -func (c Compliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ComplianceProperties != nil { - objectMap["properties"] = c.ComplianceProperties - } - return json.Marshal(objectMap) +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &hcmniar, true } -// UnmarshalJSON is the custom unmarshaler for Compliance struct. -func (c *Compliance) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var complianceProperties ComplianceProperties - err = json.Unmarshal(*v, &complianceProperties) - if err != nil { - return err - } - c.ComplianceProperties = &complianceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} - return nil +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// ComplianceList list of Compliance objects response -type ComplianceList struct { - autorest.Response `json:"-"` - // Value - List of Compliance objects - Value *[]Compliance `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ComplianceList. -func (cl ComplianceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if cl.Value != nil { - objectMap["value"] = cl.Value - } - return json.Marshal(objectMap) +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// ComplianceListIterator provides access to a complete listing of Compliance values. -type ComplianceListIterator struct { - i int - page ComplianceListPage +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ComplianceListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComplianceListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ComplianceListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ComplianceListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ComplianceListIterator) Response() ComplianceList { - return iter.page.Response() +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ComplianceListIterator) Value() Compliance { - if !iter.page.NotDone() { - return Compliance{} - } - return iter.page.Values()[iter.i] +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ComplianceListIterator type. -func NewComplianceListIterator(page ComplianceListPage) ComplianceListIterator { - return ComplianceListIterator{page: page} +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (cl ComplianceList) IsEmpty() bool { - return cl.Value == nil || len(*cl.Value) == 0 +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return &hcmniar, true } -// hasNextLink returns true if the NextLink is not empty. -func (cl ComplianceList) hasNextLink() bool { - return cl.NextLink != nil && len(*cl.NextLink) != 0 +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// complianceListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cl ComplianceList) complianceListPreparer(ctx context.Context) (*http.Request, error) { - if !cl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cl.NextLink))) +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// ComplianceListPage contains a page of Compliance values. -type ComplianceListPage struct { - fn func(context.Context, ComplianceList) (ComplianceList, error) - cl ComplianceList +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ComplianceListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ComplianceListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cl) - if err != nil { - return err - } - page.cl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ComplianceListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ComplianceListPage) NotDone() bool { - return !page.cl.IsEmpty() +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page ComplianceListPage) Response() ComplianceList { - return page.cl +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ComplianceListPage) Values() []Compliance { - if page.cl.IsEmpty() { - return nil - } - return *page.cl.Value +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ComplianceListPage type. -func NewComplianceListPage(getNextPage func(context.Context, ComplianceList) (ComplianceList, error)) ComplianceListPage { - return ComplianceListPage{fn: getNextPage} +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// ComplianceProperties the Compliance score (percentage) of a Subscription is a sum of all Resources' -// Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') -// Policy Definitions out of all Policy Definitions applicable to a given resource. -type ComplianceProperties struct { - // AssessmentTimestampUtcDate - READ-ONLY; The timestamp when the Compliance calculation was conducted. - AssessmentTimestampUtcDate *date.Time `json:"assessmentTimestampUtcDate,omitempty"` - // ResourceCount - READ-ONLY; The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation). - ResourceCount *int32 `json:"resourceCount,omitempty"` - // AssessmentResult - READ-ONLY; An array of segment, which is the actually the compliance assessment. - AssessmentResult *[]ComplianceSegment `json:"assessmentResult,omitempty"` +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// ComplianceSegment a segment of a compliance assessment. -type ComplianceSegment struct { - // SegmentType - READ-ONLY; The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - SegmentType *string `json:"segmentType,omitempty"` - // Percentage - READ-ONLY; The size (%) of the segment. - Percentage *float64 `json:"percentage,omitempty"` +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// ConnectableResource describes the allowed inbound and outbound traffic of an Azure resource -type ConnectableResource struct { - // ID - READ-ONLY; The Azure resource id - ID *string `json:"id,omitempty"` - // InboundConnectedResources - READ-ONLY; The list of Azure resources that the resource has inbound allowed connection from - InboundConnectedResources *[]ConnectedResource `json:"inboundConnectedResources,omitempty"` - // OutboundConnectedResources - READ-ONLY; The list of Azure resources that the resource has outbound allowed connection to - OutboundConnectedResources *[]ConnectedResource `json:"outboundConnectedResources,omitempty"` +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// ConnectedResource describes properties of a connected resource -type ConnectedResource struct { - // ConnectedResourceID - READ-ONLY; The Azure resource id of the connected resource - ConnectedResourceID *string `json:"connectedResourceId,omitempty"` - // TCPPorts - READ-ONLY; The allowed tcp ports - TCPPorts *string `json:"tcpPorts,omitempty"` - // UDPPorts - READ-ONLY; The allowed udp ports - UDPPorts *string `json:"udpPorts,omitempty"` +// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// ConnectedWorkspace ... -type ConnectedWorkspace struct { - // ID - Azure resource ID of the connected OMS workspace - ID *string `json:"id,omitempty"` +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DMessagesNotInAllowedRange. +func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &hcmniar, true } -// ConnectorSetting the connector setting -type ConnectorSetting struct { - autorest.Response `json:"-"` - // ConnectorSettingProperties - Connector setting data - *ConnectorSettingProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` +// HTTPC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (HTTP protocol) is not +// in allowed range. +type HTTPC2DRejectedMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for ConnectorSetting. -func (cs ConnectorSetting) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + hcrmniar.RuleType = RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange objectMap := make(map[string]interface{}) - if cs.ConnectorSettingProperties != nil { - objectMap["properties"] = cs.ConnectorSettingProperties + if hcrmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = hcrmniar.TimeWindowSize + } + if hcrmniar.MinThreshold != nil { + objectMap["minThreshold"] = hcrmniar.MinThreshold + } + if hcrmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = hcrmniar.MaxThreshold + } + if hcrmniar.IsEnabled != nil { + objectMap["isEnabled"] = hcrmniar.IsEnabled + } + if hcrmniar.RuleType != "" { + objectMap["ruleType"] = hcrmniar.RuleType } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ConnectorSetting struct. -func (cs *ConnectorSetting) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var connectorSettingProperties ConnectorSettingProperties - err = json.Unmarshal(*v, &connectorSettingProperties) - if err != nil { - return err - } - cs.ConnectorSettingProperties = &connectorSettingProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - cs.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - cs.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - cs.Type = &typeVar - } - } - } +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} - return nil +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &hcrmniar, true } -// ConnectorSettingList for a subscription, list of all cloud account connectors and their settings -type ConnectorSettingList struct { - autorest.Response `json:"-"` - // Value - List of all the cloud account connector settings - Value *[]ConnectorSetting `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ConnectorSettingList. -func (csl ConnectorSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if csl.Value != nil { - objectMap["value"] = csl.Value - } - return json.Marshal(objectMap) +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &hcrmniar, true } -// ConnectorSettingListIterator provides access to a complete listing of ConnectorSetting values. -type ConnectorSettingListIterator struct { - i int - page ConnectorSettingListPage +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ConnectorSettingListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorSettingListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ConnectorSettingListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ConnectorSettingListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ConnectorSettingListIterator) Response() ConnectorSettingList { - return iter.page.Response() +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ConnectorSettingListIterator) Value() ConnectorSetting { - if !iter.page.NotDone() { - return ConnectorSetting{} - } - return iter.page.Values()[iter.i] +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// Creates a new instance of the ConnectorSettingListIterator type. -func NewConnectorSettingListIterator(page ConnectorSettingListPage) ConnectorSettingListIterator { - return ConnectorSettingListIterator{page: page} +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (csl ConnectorSettingList) IsEmpty() bool { - return csl.Value == nil || len(*csl.Value) == 0 +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (csl ConnectorSettingList) hasNextLink() bool { - return csl.NextLink != nil && len(*csl.NextLink) != 0 +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// connectorSettingListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (csl ConnectorSettingList) connectorSettingListPreparer(ctx context.Context) (*http.Request, error) { - if !csl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(csl.NextLink))) +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// ConnectorSettingListPage contains a page of ConnectorSetting values. -type ConnectorSettingListPage struct { - fn func(context.Context, ConnectorSettingList) (ConnectorSettingList, error) - csl ConnectorSettingList +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ConnectorSettingListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ConnectorSettingListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.csl) - if err != nil { - return err - } - page.csl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ConnectorSettingListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ConnectorSettingListPage) NotDone() bool { - return !page.csl.IsEmpty() +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return &hcrmniar, true } -// Response returns the raw server response from the last page request. -func (page ConnectorSettingListPage) Response() ConnectorSettingList { - return page.csl +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ConnectorSettingListPage) Values() []ConnectorSetting { - if page.csl.IsEmpty() { - return nil - } - return *page.csl.Value +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ConnectorSettingListPage type. -func NewConnectorSettingListPage(getNextPage func(context.Context, ConnectorSettingList) (ConnectorSettingList, error)) ConnectorSettingListPage { - return ConnectorSettingListPage{fn: getNextPage} +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// ConnectorSettingProperties describes properties of an connector setting -type ConnectorSettingProperties struct { - // HybridComputeSettings - Settings for hybrid compute management, these settings are relevant only Arc autoProvision (Hybrid Compute). - HybridComputeSettings *HybridComputeSettingsProperties `json:"hybridComputeSettings,omitempty"` - // AuthenticationDetails - Settings for authentication management, these settings are relevant only for the cloud connector. - AuthenticationDetails BasicAuthenticationDetailsProperties `json:"authenticationDetails,omitempty"` +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ConnectorSettingProperties struct. -func (csp *ConnectorSettingProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "hybridComputeSettings": - if v != nil { - var hybridComputeSettings HybridComputeSettingsProperties - err = json.Unmarshal(*v, &hybridComputeSettings) - if err != nil { - return err - } - csp.HybridComputeSettings = &hybridComputeSettings - } - case "authenticationDetails": - if v != nil { - authenticationDetails, err := unmarshalBasicAuthenticationDetailsProperties(*v) - if err != nil { - return err - } - csp.AuthenticationDetails = authenticationDetails - } - } - } +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} - return nil +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// Contact contact details for security issues -type Contact struct { - autorest.Response `json:"-"` - // ContactProperties - Security contact data - *ContactProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for Contact. -func (c Contact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if c.ContactProperties != nil { - objectMap["properties"] = c.ContactProperties - } - return json.Marshal(objectMap) +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for Contact struct. -func (c *Contact) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var contactProperties ContactProperties - err = json.Unmarshal(*v, &contactProperties) - if err != nil { - return err - } - c.ContactProperties = &contactProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - c.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - c.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - c.Type = &typeVar - } - } - } +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} - return nil +// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// ContactList list of security contacts response -type ContactList struct { - autorest.Response `json:"-"` - // Value - READ-ONLY; List of security contacts - Value *[]Contact `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPC2DRejectedMessagesNotInAllowedRange. +func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &hcrmniar, true } -// ContactListIterator provides access to a complete listing of Contact values. -type ContactListIterator struct { - i int - page ContactListPage +// HTTPD2CMessagesNotInAllowedRange number of device to cloud messages (HTTP protocol) is not in allowed range. +type HTTPD2CMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ContactListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContactListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + hdmniar.RuleType = RuleTypeHTTPD2CMessagesNotInAllowedRange + objectMap := make(map[string]interface{}) + if hdmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = hdmniar.TimeWindowSize } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if hdmniar.MinThreshold != nil { + objectMap["minThreshold"] = hdmniar.MinThreshold } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if hdmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = hdmniar.MaxThreshold } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ContactListIterator) Next() error { - return iter.NextWithContext(context.Background()) + if hdmniar.IsEnabled != nil { + objectMap["isEnabled"] = hdmniar.IsEnabled + } + if hdmniar.RuleType != "" { + objectMap["ruleType"] = hdmniar.RuleType + } + return json.Marshal(objectMap) } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ContactListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter ContactListIterator) Response() ContactList { - return iter.page.Response() +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &hdmniar, true } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ContactListIterator) Value() Contact { - if !iter.page.NotDone() { - return Contact{} - } - return iter.page.Values()[iter.i] +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// Creates a new instance of the ContactListIterator type. -func NewContactListIterator(page ContactListPage) ContactListIterator { - return ContactListIterator{page: page} +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &hdmniar, true } -// IsEmpty returns true if the ListResult contains no values. -func (cl ContactList) IsEmpty() bool { - return cl.Value == nil || len(*cl.Value) == 0 +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (cl ContactList) hasNextLink() bool { - return cl.NextLink != nil && len(*cl.NextLink) != 0 +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// contactListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (cl ContactList) contactListPreparer(ctx context.Context) (*http.Request, error) { - if !cl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(cl.NextLink))) +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// ContactListPage contains a page of Contact values. -type ContactListPage struct { - fn func(context.Context, ContactList) (ContactList, error) - cl ContactList +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ContactListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ContactListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.cl) - if err != nil { - return err - } - page.cl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ContactListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ContactListPage) NotDone() bool { - return !page.cl.IsEmpty() +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page ContactListPage) Response() ContactList { - return page.cl +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ContactListPage) Values() []Contact { - if page.cl.IsEmpty() { - return nil - } - return *page.cl.Value +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ContactListPage type. -func NewContactListPage(getNextPage func(context.Context, ContactList) (ContactList, error)) ContactListPage { - return ContactListPage{fn: getNextPage} +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// ContactProperties describes security contact properties -type ContactProperties struct { - // Email - The email of this security contact - Email *string `json:"email,omitempty"` - // Phone - The phone number of this security contact - Phone *string `json:"phone,omitempty"` - // AlertNotifications - Whether to send security alerts notifications to the security contact. Possible values include: 'On', 'Off' - AlertNotifications AlertNotifications `json:"alertNotifications,omitempty"` - // AlertsToAdmins - Whether to send security alerts notifications to subscription admins. Possible values include: 'AlertsToAdminsOn', 'AlertsToAdminsOff' - AlertsToAdmins AlertsToAdmins `json:"alertsToAdmins,omitempty"` +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// ContainerRegistryVulnerabilityProperties additional context fields for container registry Vulnerability -// assessment -type ContainerRegistryVulnerabilityProperties struct { - // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability - Type *string `json:"type,omitempty"` - // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object - Cvss map[string]*CVSS `json:"cvss"` - // Patchable - READ-ONLY; Indicates whether a patch is available or not - Patchable *bool `json:"patchable,omitempty"` - // Cve - READ-ONLY; List of CVEs - Cve *[]CVE `json:"cve,omitempty"` - // PublishedTime - READ-ONLY; Published time - PublishedTime *date.Time `json:"publishedTime,omitempty"` - // VendorReferences - READ-ONLY - VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` - // RepositoryName - READ-ONLY; Name of the repository which the vulnerable image belongs to - RepositoryName *string `json:"repositoryName,omitempty"` - // ImageDigest - READ-ONLY; Digest of the vulnerable image - ImageDigest *string `json:"imageDigest,omitempty"` - // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' - AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ContainerRegistryVulnerabilityProperties. -func (crvp ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { - crvp.AssessedResourceType = AssessedResourceTypeContainerRegistryVulnerability - objectMap := make(map[string]interface{}) - if crvp.AssessedResourceType != "" { - objectMap["assessedResourceType"] = crvp.AssessedResourceType - } - return json.Marshal(objectMap) +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. -func (crvp ContainerRegistryVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { return nil, false } -// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. -func (crvp ContainerRegistryVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { - return &crvp, true +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. -func (crvp ContainerRegistryVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. -func (crvp ContainerRegistryVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { return nil, false } -// AsBasicAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. -func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { - return &crvp, true +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return &hdmniar, true } -// CustomAlertRule a custom alert rule -type CustomAlertRule struct { - // DisplayName - READ-ONLY; The display name of the custom alert. - DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; The description of the custom alert. - Description *string `json:"description,omitempty"` - // IsEnabled - Whether the custom alert is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - The type of the custom alert rule. - RuleType *string `json:"ruleType,omitempty"` +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for CustomAlertRule. -func (car CustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if car.IsEnabled != nil { - objectMap["isEnabled"] = car.IsEnabled - } - if car.RuleType != nil { - objectMap["ruleType"] = car.RuleType - } - return json.Marshal(objectMap) +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// CVE CVE details -type CVE struct { - // Title - READ-ONLY; CVE title - Title *string `json:"title,omitempty"` - // Link - READ-ONLY; Link url - Link *string `json:"link,omitempty"` +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// CVSS CVSS details -type CVSS struct { - // Base - READ-ONLY; CVSS base - Base *float64 `json:"base,omitempty"` +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// DataExportSetting represents a data export setting -type DataExportSetting struct { - // DataExportSettingProperties - Data export setting data - *DataExportSettingProperties `json:"properties,omitempty"` - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for DataExportSetting. -func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if desVar.DataExportSettingProperties != nil { - objectMap["properties"] = desVar.DataExportSettingProperties - } - if desVar.Kind != "" { - objectMap["kind"] = desVar.Kind - } - return json.Marshal(objectMap) +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. -func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var dataExportSettingProperties DataExportSettingProperties - err = json.Unmarshal(*v, &dataExportSettingProperties) - if err != nil { - return err - } - desVar.DataExportSettingProperties = &dataExportSettingProperties - } - case "kind": - if v != nil { - var kind SettingKind - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - desVar.Kind = kind - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - desVar.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - desVar.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - desVar.Type = &typeVar - } - } - } - - return nil +// AsCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// DataExportSettingProperties the data export setting properties -type DataExportSettingProperties struct { - // Enabled - Is the data export setting is enabled - Enabled *bool `json:"enabled,omitempty"` +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for HTTPD2CMessagesNotInAllowedRange. +func (hdmniar HTTPD2CMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &hdmniar, true } -// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is -// denied -type DenylistCustomAlertRule struct { - // DenylistValues - The values to deny. The format of the values depends on the rule type. - DenylistValues *[]string `json:"denylistValues,omitempty"` - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' - ValueType ValueType `json:"valueType,omitempty"` - // DisplayName - READ-ONLY; The display name of the custom alert. - DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; The description of the custom alert. - Description *string `json:"description,omitempty"` - // IsEnabled - Whether the custom alert is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - The type of the custom alert rule. - RuleType *string `json:"ruleType,omitempty"` +// HybridComputeSettingsProperties settings for hybrid compute management +type HybridComputeSettingsProperties struct { + // HybridComputeProvisioningState - READ-ONLY; State of the service principal and its secret. Possible values include: 'HybridComputeProvisioningStateValid', 'HybridComputeProvisioningStateInvalid', 'HybridComputeProvisioningStateExpired' + HybridComputeProvisioningState HybridComputeProvisioningState `json:"hybridComputeProvisioningState,omitempty"` + // AutoProvision - Whether or not to automatically install Azure Arc (hybrid compute) agents on machines. Possible values include: 'AutoProvisionOn', 'AutoProvisionOff' + AutoProvision AutoProvision `json:"autoProvision,omitempty"` + // ResourceGroupName - The name of the resource group where Arc (Hybrid Compute) connectors are connected. + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + // Region - The location where the meta data of machines will be stored + Region *string `json:"region,omitempty"` + // ProxyServer - For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. + ProxyServer *ProxyServerProperties `json:"proxyServer,omitempty"` + // ServicePrincipal - An object to access resources that are secured by an Azure AD tenant. + ServicePrincipal *ServicePrincipalProperties `json:"servicePrincipal,omitempty"` } -// MarshalJSON is the custom marshaler for DenylistCustomAlertRule. -func (dcar DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for HybridComputeSettingsProperties. +func (hcsp HybridComputeSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dcar.DenylistValues != nil { - objectMap["denylistValues"] = dcar.DenylistValues + if hcsp.AutoProvision != "" { + objectMap["autoProvision"] = hcsp.AutoProvision } - if dcar.IsEnabled != nil { - objectMap["isEnabled"] = dcar.IsEnabled + if hcsp.ResourceGroupName != nil { + objectMap["resourceGroupName"] = hcsp.ResourceGroupName } - if dcar.RuleType != nil { - objectMap["ruleType"] = dcar.RuleType + if hcsp.Region != nil { + objectMap["region"] = hcsp.Region + } + if hcsp.ProxyServer != nil { + objectMap["proxyServer"] = hcsp.ProxyServer + } + if hcsp.ServicePrincipal != nil { + objectMap["servicePrincipal"] = hcsp.ServicePrincipal } return json.Marshal(objectMap) } -// DeviceSecurityGroup the device security group resource -type DeviceSecurityGroup struct { +// InformationProtectionKeyword the information type keyword. +type InformationProtectionKeyword struct { + // Pattern - The keyword pattern. + Pattern *string `json:"pattern,omitempty"` + // Custom - Indicates whether the keyword is custom or not. + Custom *bool `json:"custom,omitempty"` + // CanBeNumeric - Indicates whether the keyword can be applied on numeric types or not. + CanBeNumeric *bool `json:"canBeNumeric,omitempty"` + // Excluded - Indicates whether the keyword is excluded or not. + Excluded *bool `json:"excluded,omitempty"` +} + +// InformationProtectionPolicy information protection policy. +type InformationProtectionPolicy struct { autorest.Response `json:"-"` - // DeviceSecurityGroupProperties - Device Security group data - *DeviceSecurityGroupProperties `json:"properties,omitempty"` + // InformationProtectionPolicyProperties - Information protection policy data + *InformationProtectionPolicyProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -4347,17 +8238,17 @@ type DeviceSecurityGroup struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DeviceSecurityGroup. -func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for InformationProtectionPolicy. +func (ipp InformationProtectionPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dsg.DeviceSecurityGroupProperties != nil { - objectMap["properties"] = dsg.DeviceSecurityGroupProperties + if ipp.InformationProtectionPolicyProperties != nil { + objectMap["properties"] = ipp.InformationProtectionPolicyProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. -func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for InformationProtectionPolicy struct. +func (ipp *InformationProtectionPolicy) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4367,12 +8258,12 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var deviceSecurityGroupProperties DeviceSecurityGroupProperties - err = json.Unmarshal(*v, &deviceSecurityGroupProperties) + var informationProtectionPolicyProperties InformationProtectionPolicyProperties + err = json.Unmarshal(*v, &informationProtectionPolicyProperties) if err != nil { return err } - dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties + ipp.InformationProtectionPolicyProperties = &informationProtectionPolicyProperties } case "id": if v != nil { @@ -4381,7 +8272,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.ID = &ID + ipp.ID = &ID } case "name": if v != nil { @@ -4390,7 +8281,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.Name = &name + ipp.Name = &name } case "type": if v != nil { @@ -4399,7 +8290,7 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { if err != nil { return err } - dsg.Type = &typeVar + ipp.Type = &typeVar } } } @@ -4407,35 +8298,36 @@ func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { return nil } -// DeviceSecurityGroupList list of device security groups -type DeviceSecurityGroupList struct { +// InformationProtectionPolicyList information protection policies response. +type InformationProtectionPolicyList struct { autorest.Response `json:"-"` - // Value - List of device security group objects - Value *[]DeviceSecurityGroup `json:"value,omitempty"` + // Value - List of information protection policies. + Value *[]InformationProtectionPolicy `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for DeviceSecurityGroupList. -func (dsgl DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for InformationProtectionPolicyList. +func (ippl InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dsgl.Value != nil { - objectMap["value"] = dsgl.Value + if ippl.Value != nil { + objectMap["value"] = ippl.Value } return json.Marshal(objectMap) } -// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. -type DeviceSecurityGroupListIterator struct { +// InformationProtectionPolicyListIterator provides access to a complete listing of InformationProtectionPolicy +// values. +type InformationProtectionPolicyListIterator struct { i int - page DeviceSecurityGroupListPage + page InformationProtectionPolicyListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *InformationProtectionPolicyListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4460,67 +8352,67 @@ func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *DeviceSecurityGroupListIterator) Next() error { +func (iter *InformationProtectionPolicyListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DeviceSecurityGroupListIterator) NotDone() bool { +func (iter InformationProtectionPolicyListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { +func (iter InformationProtectionPolicyListIterator) Response() InformationProtectionPolicyList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { +func (iter InformationProtectionPolicyListIterator) Value() InformationProtectionPolicy { if !iter.page.NotDone() { - return DeviceSecurityGroup{} + return InformationProtectionPolicy{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DeviceSecurityGroupListIterator type. -func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { - return DeviceSecurityGroupListIterator{page: page} +// Creates a new instance of the InformationProtectionPolicyListIterator type. +func NewInformationProtectionPolicyListIterator(page InformationProtectionPolicyListPage) InformationProtectionPolicyListIterator { + return InformationProtectionPolicyListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dsgl DeviceSecurityGroupList) IsEmpty() bool { - return dsgl.Value == nil || len(*dsgl.Value) == 0 +func (ippl InformationProtectionPolicyList) IsEmpty() bool { + return ippl.Value == nil || len(*ippl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (dsgl DeviceSecurityGroupList) hasNextLink() bool { - return dsgl.NextLink != nil && len(*dsgl.NextLink) != 0 +func (ippl InformationProtectionPolicyList) hasNextLink() bool { + return ippl.NextLink != nil && len(*ippl.NextLink) != 0 } -// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. +// informationProtectionPolicyListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { - if !dsgl.hasNextLink() { +func (ippl InformationProtectionPolicyList) informationProtectionPolicyListPreparer(ctx context.Context) (*http.Request, error) { + if !ippl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dsgl.NextLink))) + autorest.WithBaseURL(to.String(ippl.NextLink))) } -// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. -type DeviceSecurityGroupListPage struct { - fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) - dsgl DeviceSecurityGroupList +// InformationProtectionPolicyListPage contains a page of InformationProtectionPolicy values. +type InformationProtectionPolicyListPage struct { + fn func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error) + ippl InformationProtectionPolicyList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { +func (page *InformationProtectionPolicyListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4530,11 +8422,11 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e }() } for { - next, err := page.fn(ctx, page.dsgl) + next, err := page.fn(ctx, page.ippl) if err != nil { return err } - page.dsgl = next + page.ippl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -4545,157 +8437,103 @@ func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (e // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *DeviceSecurityGroupListPage) Next() error { +func (page *InformationProtectionPolicyListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DeviceSecurityGroupListPage) NotDone() bool { - return !page.dsgl.IsEmpty() +func (page InformationProtectionPolicyListPage) NotDone() bool { + return !page.ippl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { - return page.dsgl +func (page InformationProtectionPolicyListPage) Response() InformationProtectionPolicyList { + return page.ippl } // Values returns the slice of values for the current page or nil if there are no values. -func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { - if page.dsgl.IsEmpty() { +func (page InformationProtectionPolicyListPage) Values() []InformationProtectionPolicy { + if page.ippl.IsEmpty() { return nil } - return *page.dsgl.Value -} - -// Creates a new instance of the DeviceSecurityGroupListPage type. -func NewDeviceSecurityGroupListPage(getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { - return DeviceSecurityGroupListPage{fn: getNextPage} + return *page.ippl.Value } -// DeviceSecurityGroupProperties describes properties of a security group. -type DeviceSecurityGroupProperties struct { - // ThresholdRules - A list of threshold custom alert rules. - ThresholdRules *[]ThresholdCustomAlertRule `json:"thresholdRules,omitempty"` - // TimeWindowRules - A list of time window custom alert rules. - TimeWindowRules *[]TimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` - // AllowlistRules - A list of allow-list custom alert rules. - AllowlistRules *[]AllowlistCustomAlertRule `json:"allowlistRules,omitempty"` - // DenylistRules - A list of deny-list custom alert rules. - DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` +// Creates a new instance of the InformationProtectionPolicyListPage type. +func NewInformationProtectionPolicyListPage(getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { + return InformationProtectionPolicyListPage{fn: getNextPage} } -// DiscoveredSecuritySolution ... -type DiscoveredSecuritySolution struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` +// InformationProtectionPolicyProperties describes properties of an information protection policy. +type InformationProtectionPolicyProperties struct { + // LastModifiedUtc - READ-ONLY; Describes the last UTC time the policy was modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // Version - READ-ONLY; Describes the version of the policy. + Version *string `json:"version,omitempty"` + // Labels - Dictionary of sensitivity labels. + Labels map[string]*SensitivityLabel `json:"labels"` + // InformationTypes - The sensitivity information types. + InformationTypes map[string]*InformationType `json:"informationTypes"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. -func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for InformationProtectionPolicyProperties. +func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dss.DiscoveredSecuritySolutionProperties != nil { - objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties + if ippp.Labels != nil { + objectMap["labels"] = ippp.Labels + } + if ippp.InformationTypes != nil { + objectMap["informationTypes"] = ippp.InformationTypes } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. -func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - dss.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - dss.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - dss.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - dss.Location = &location - } - case "properties": - if v != nil { - var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties - err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) - if err != nil { - return err - } - dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties - } - } - } - - return nil +// InformationType the information type. +type InformationType struct { + // DisplayName - The name of the information type. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the information type. + Description *string `json:"description,omitempty"` + // Order - The order of the information type. + Order *int32 `json:"order,omitempty"` + // RecommendedLabelID - The recommended label id to be associated with this information type. + RecommendedLabelID *uuid.UUID `json:"recommendedLabelId,omitempty"` + // Enabled - Indicates whether the information type is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Custom - Indicates whether the information type is custom or not. + Custom *bool `json:"custom,omitempty"` + // Keywords - The information type keywords. + Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` } -// DiscoveredSecuritySolutionList ... -type DiscoveredSecuritySolutionList struct { +// JitNetworkAccessPoliciesList ... +type JitNetworkAccessPoliciesList struct { autorest.Response `json:"-"` - Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` + Value *[]JitNetworkAccessPolicy `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for DiscoveredSecuritySolutionList. -func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for JitNetworkAccessPoliciesList. +func (jnapl JitNetworkAccessPoliciesList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dssl.Value != nil { - objectMap["value"] = dssl.Value + if jnapl.Value != nil { + objectMap["value"] = jnapl.Value } return json.Marshal(objectMap) } -// DiscoveredSecuritySolutionListIterator provides access to a complete listing of DiscoveredSecuritySolution -// values. -type DiscoveredSecuritySolutionListIterator struct { +// JitNetworkAccessPoliciesListIterator provides access to a complete listing of JitNetworkAccessPolicy values. +type JitNetworkAccessPoliciesListIterator struct { i int - page DiscoveredSecuritySolutionListPage + page JitNetworkAccessPoliciesListPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *JitNetworkAccessPoliciesListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4720,67 +8558,67 @@ func (iter *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context. // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *DiscoveredSecuritySolutionListIterator) Next() error { +func (iter *JitNetworkAccessPoliciesListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { +func (iter JitNetworkAccessPoliciesListIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { +func (iter JitNetworkAccessPoliciesListIterator) Response() JitNetworkAccessPoliciesList { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { +func (iter JitNetworkAccessPoliciesListIterator) Value() JitNetworkAccessPolicy { if !iter.page.NotDone() { - return DiscoveredSecuritySolution{} + return JitNetworkAccessPolicy{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. -func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { - return DiscoveredSecuritySolutionListIterator{page: page} +// Creates a new instance of the JitNetworkAccessPoliciesListIterator type. +func NewJitNetworkAccessPoliciesListIterator(page JitNetworkAccessPoliciesListPage) JitNetworkAccessPoliciesListIterator { + return JitNetworkAccessPoliciesListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { - return dssl.Value == nil || len(*dssl.Value) == 0 +func (jnapl JitNetworkAccessPoliciesList) IsEmpty() bool { + return jnapl.Value == nil || len(*jnapl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (dssl DiscoveredSecuritySolutionList) hasNextLink() bool { - return dssl.NextLink != nil && len(*dssl.NextLink) != 0 +func (jnapl JitNetworkAccessPoliciesList) hasNextLink() bool { + return jnapl.NextLink != nil && len(*jnapl.NextLink) != 0 } -// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. +// jitNetworkAccessPoliciesListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !dssl.hasNextLink() { +func (jnapl JitNetworkAccessPoliciesList) jitNetworkAccessPoliciesListPreparer(ctx context.Context) (*http.Request, error) { + if !jnapl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dssl.NextLink))) + autorest.WithBaseURL(to.String(jnapl.NextLink))) } -// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. -type DiscoveredSecuritySolutionListPage struct { - fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) - dssl DiscoveredSecuritySolutionList +// JitNetworkAccessPoliciesListPage contains a page of JitNetworkAccessPolicy values. +type JitNetworkAccessPoliciesListPage struct { + fn func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error) + jnapl JitNetworkAccessPoliciesList } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { +func (page *JitNetworkAccessPoliciesListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4790,11 +8628,11 @@ func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Cont }() } for { - next, err := page.fn(ctx, page.dssl) + next, err := page.fn(ctx, page.jnapl) if err != nil { return err } - page.dssl = next + page.jnapl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -4805,1299 +8643,1240 @@ func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Cont // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *DiscoveredSecuritySolutionListPage) Next() error { +func (page *JitNetworkAccessPoliciesListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiscoveredSecuritySolutionListPage) NotDone() bool { - return !page.dssl.IsEmpty() +func (page JitNetworkAccessPoliciesListPage) NotDone() bool { + return !page.jnapl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { - return page.dssl +func (page JitNetworkAccessPoliciesListPage) Response() JitNetworkAccessPoliciesList { + return page.jnapl } // Values returns the slice of values for the current page or nil if there are no values. -func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { - if page.dssl.IsEmpty() { +func (page JitNetworkAccessPoliciesListPage) Values() []JitNetworkAccessPolicy { + if page.jnapl.IsEmpty() { return nil } - return *page.dssl.Value + return *page.jnapl.Value } -// Creates a new instance of the DiscoveredSecuritySolutionListPage type. -func NewDiscoveredSecuritySolutionListPage(getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { - return DiscoveredSecuritySolutionListPage{fn: getNextPage} +// Creates a new instance of the JitNetworkAccessPoliciesListPage type. +func NewJitNetworkAccessPoliciesListPage(getNextPage func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error)) JitNetworkAccessPoliciesListPage { + return JitNetworkAccessPoliciesListPage{fn: getNextPage} } -// DiscoveredSecuritySolutionProperties ... -type DiscoveredSecuritySolutionProperties struct { - // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' - SecurityFamily Family `json:"securityFamily,omitempty"` - // Offer - The security solutions' image offer - Offer *string `json:"offer,omitempty"` - // Publisher - The security solutions' image publisher - Publisher *string `json:"publisher,omitempty"` - // Sku - The security solutions' image sku - Sku *string `json:"sku,omitempty"` +// JitNetworkAccessPolicy ... +type JitNetworkAccessPolicy struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` + *JitNetworkAccessPolicyProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for JitNetworkAccessPolicy. +func (jnap JitNetworkAccessPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jnap.Kind != nil { + objectMap["kind"] = jnap.Kind + } + if jnap.JitNetworkAccessPolicyProperties != nil { + objectMap["properties"] = jnap.JitNetworkAccessPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for JitNetworkAccessPolicy struct. +func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + jnap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + jnap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + jnap.Type = &typeVar + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + jnap.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + jnap.Location = &location + } + case "properties": + if v != nil { + var jitNetworkAccessPolicyProperties JitNetworkAccessPolicyProperties + err = json.Unmarshal(*v, &jitNetworkAccessPolicyProperties) + if err != nil { + return err + } + jnap.JitNetworkAccessPolicyProperties = &jitNetworkAccessPolicyProperties + } + } + } + + return nil +} + +// JitNetworkAccessPolicyInitiatePort ... +type JitNetworkAccessPolicyInitiatePort struct { + Number *int32 `json:"number,omitempty"` + // AllowedSourceAddressPrefix - Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request. + AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` + // EndTimeUtc - The time to close the request in UTC + EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` +} + +// JitNetworkAccessPolicyInitiateRequest ... +type JitNetworkAccessPolicyInitiateRequest struct { + // VirtualMachines - A list of virtual machines & ports to open access for + VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` +} + +// JitNetworkAccessPolicyInitiateVirtualMachine ... +type JitNetworkAccessPolicyInitiateVirtualMachine struct { + // ID - Resource ID of the virtual machine that is linked to this policy + ID *string `json:"id,omitempty"` + // Ports - The ports to open for the resource with the `id` + Ports *[]JitNetworkAccessPolicyInitiatePort `json:"ports,omitempty"` +} + +// JitNetworkAccessPolicyProperties ... +type JitNetworkAccessPolicyProperties struct { + // VirtualMachines - Configurations for Microsoft.Compute/virtualMachines resource type. + VirtualMachines *[]JitNetworkAccessPolicyVirtualMachine `json:"virtualMachines,omitempty"` + Requests *[]JitNetworkAccessRequest `json:"requests,omitempty"` + // ProvisioningState - READ-ONLY; Gets the provisioning state of the Just-in-Time policy. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for JitNetworkAccessPolicyProperties. +func (jnapp JitNetworkAccessPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jnapp.VirtualMachines != nil { + objectMap["virtualMachines"] = jnapp.VirtualMachines + } + if jnapp.Requests != nil { + objectMap["requests"] = jnapp.Requests + } + return json.Marshal(objectMap) +} + +// JitNetworkAccessPolicyVirtualMachine ... +type JitNetworkAccessPolicyVirtualMachine struct { + // ID - Resource ID of the virtual machine that is linked to this policy + ID *string `json:"id,omitempty"` + // Ports - Port configurations for the virtual machine + Ports *[]JitNetworkAccessPortRule `json:"ports,omitempty"` + // PublicIPAddress - Public IP address of the Azure Firewall that is linked to this policy, if applicable + PublicIPAddress *string `json:"publicIpAddress,omitempty"` +} + +// JitNetworkAccessPortRule ... +type JitNetworkAccessPortRule struct { + Number *int32 `json:"number,omitempty"` + // Protocol - Possible values include: 'TCP', 'UDP', 'All' + Protocol Protocol `json:"protocol,omitempty"` + // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". + AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` + // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. + AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"` + // MaxRequestAccessDuration - Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day + MaxRequestAccessDuration *string `json:"maxRequestAccessDuration,omitempty"` +} + +// JitNetworkAccessRequest ... +type JitNetworkAccessRequest struct { + autorest.Response `json:"-"` + VirtualMachines *[]JitNetworkAccessRequestVirtualMachine `json:"virtualMachines,omitempty"` + // StartTimeUtc - The start time of the request in UTC + StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` + // Requestor - The identity of the person who made the request + Requestor *string `json:"requestor,omitempty"` + // Justification - The justification for making the initiate request + Justification *string `json:"justification,omitempty"` +} + +// JitNetworkAccessRequestPort ... +type JitNetworkAccessRequestPort struct { + Number *int32 `json:"number,omitempty"` + // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". + AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` + // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. + AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"` + // EndTimeUtc - The date & time at which the request ends in UTC + EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` + // Status - The status of the port. Possible values include: 'Revoked', 'Initiated' + Status Status `json:"status,omitempty"` + // StatusReason - A description of why the `status` has its value. Possible values include: 'StatusReasonExpired', 'StatusReasonUserRequested', 'StatusReasonNewerRequestInitiated' + StatusReason StatusReason `json:"statusReason,omitempty"` + // MappedPort - The port which is mapped to this port's `number` in the Azure Firewall, if applicable + MappedPort *int32 `json:"mappedPort,omitempty"` } -// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface -type EffectiveNetworkSecurityGroups struct { - // NetworkInterface - The Azure resource ID of the network interface - NetworkInterface *string `json:"networkInterface,omitempty"` - // NetworkSecurityGroups - The Network Security Groups effective on the network interface - NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` +// JitNetworkAccessRequestVirtualMachine ... +type JitNetworkAccessRequestVirtualMachine struct { + // ID - Resource ID of the virtual machine that is linked to this policy + ID *string `json:"id,omitempty"` + // Ports - The ports that were opened for the virtual machine + Ports *[]JitNetworkAccessRequestPort `json:"ports,omitempty"` } -// ETag entity tag is used for comparing two or more entities from the same requested resource. -type ETag struct { - // Etag - Entity tag is used for comparing two or more entities from the same requested resource. - Etag *string `json:"etag,omitempty"` +// Kind describes an Azure resource with kind +type Kind struct { + // Kind - Kind of the resource + Kind *string `json:"kind,omitempty"` } -// BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type BasicExternalSecuritySolution interface { - AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) - AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) - AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) - AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) +// BasicListCustomAlertRule a List custom alert rule. +type BasicListCustomAlertRule interface { + AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) + AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) + AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) + AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) + AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) + AsProcessNotAllowed() (*ProcessNotAllowed, bool) + AsListCustomAlertRule() (*ListCustomAlertRule, bool) } -// ExternalSecuritySolution represents a security solution external to Azure Security Center which sends -// information to an OMS workspace and whose data is displayed by Azure Security Center. -type ExternalSecuritySolution struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` +// ListCustomAlertRule a List custom alert rule. +type ListCustomAlertRule struct { + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` } -func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { +func unmarshalBasicListCustomAlertRule(body []byte) (BasicListCustomAlertRule, error) { var m map[string]interface{} err := json.Unmarshal(body, &m) if err != nil { return nil, err } - switch m["kind"] { - case string(KindCEF): - var cess CefExternalSecuritySolution - err := json.Unmarshal(body, &cess) - return cess, err - case string(KindATA): - var aess AtaExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err - case string(KindAAD): - var aess AadExternalSecuritySolution - err := json.Unmarshal(body, &aess) - return aess, err + switch m["ruleType"] { + case string(RuleTypeAllowlistCustomAlertRule): + var acar AllowlistCustomAlertRule + err := json.Unmarshal(body, &acar) + return acar, err + case string(RuleTypeDenylistCustomAlertRule): + var dcar DenylistCustomAlertRule + err := json.Unmarshal(body, &dcar) + return dcar, err + case string(RuleTypeConnectionToIPNotAllowed): + var ctina ConnectionToIPNotAllowed + err := json.Unmarshal(body, &ctina) + return ctina, err + case string(RuleTypeLocalUserNotAllowed): + var luna LocalUserNotAllowed + err := json.Unmarshal(body, &luna) + return luna, err + case string(RuleTypeProcessNotAllowed): + var pna ProcessNotAllowed + err := json.Unmarshal(body, &pna) + return pna, err default: - var ess ExternalSecuritySolution - err := json.Unmarshal(body, &ess) - return ess, err + var lcar ListCustomAlertRule + err := json.Unmarshal(body, &lcar) + return lcar, err } } -func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { +func unmarshalBasicListCustomAlertRuleArray(body []byte) ([]BasicListCustomAlertRule, error) { var rawMessages []*json.RawMessage err := json.Unmarshal(body, &rawMessages) if err != nil { return nil, err } - essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) + lcarArray := make([]BasicListCustomAlertRule, len(rawMessages)) for index, rawMessage := range rawMessages { - ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) + lcar, err := unmarshalBasicListCustomAlertRule(*rawMessage) if err != nil { return nil, err } - essArray[index] = ess + lcarArray[index] = lcar } - return essArray, nil + return lcarArray, nil } -// MarshalJSON is the custom marshaler for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { - ess.Kind = KindExternalSecuritySolution +// MarshalJSON is the custom marshaler for ListCustomAlertRule. +func (lcar ListCustomAlertRule) MarshalJSON() ([]byte, error) { + lcar.RuleType = RuleTypeListCustomAlertRule objectMap := make(map[string]interface{}) - if ess.Kind != "" { - objectMap["kind"] = ess.Kind + if lcar.IsEnabled != nil { + objectMap["isEnabled"] = lcar.IsEnabled + } + if lcar.RuleType != "" { + objectMap["ruleType"] = lcar.RuleType } return json.Marshal(objectMap) } -// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { return nil, false } -// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { - return &ess, true +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false } -// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. -func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { - return &ess, true +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// ExternalSecuritySolutionKind1 describes an Azure resource with kind -type ExternalSecuritySolutionKind1 struct { - // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' - Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// ExternalSecuritySolutionList ... -type ExternalSecuritySolutionList struct { - autorest.Response `json:"-"` - Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ExternalSecuritySolutionList. -func (essl ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return &lcar, true +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &lcar, true +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for ListCustomAlertRule. +func (lcar ListCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &lcar, true +} + +// LocalUserNotAllowed login by a local user that isn't allowed. Allow list consists of login names to allow. +type LocalUserNotAllowed struct { + // AllowlistValues - The values to allow. The format of the values depends on the rule type. + AllowlistValues *[]string `json:"allowlistValues,omitempty"` + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) MarshalJSON() ([]byte, error) { + luna.RuleType = RuleTypeLocalUserNotAllowed objectMap := make(map[string]interface{}) - if essl.Value != nil { - objectMap["value"] = essl.Value + if luna.AllowlistValues != nil { + objectMap["allowlistValues"] = luna.AllowlistValues + } + if luna.IsEnabled != nil { + objectMap["isEnabled"] = luna.IsEnabled + } + if luna.RuleType != "" { + objectMap["ruleType"] = luna.RuleType } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. -func (essl *ExternalSecuritySolutionList) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "value": - if v != nil { - value, err := unmarshalBasicExternalSecuritySolutionArray(*v) - if err != nil { - return err - } - essl.Value = &value - } - case "nextLink": - if v != nil { - var nextLink string - err = json.Unmarshal(*v, &nextLink) - if err != nil { - return err - } - essl.NextLink = &nextLink - } - } - } +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} - return nil +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false } -// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution -// values. -type ExternalSecuritySolutionListIterator struct { - i int - page ExternalSecuritySolutionListPage +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return &luna, true +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &luna, true } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ExternalSecuritySolutionListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ExternalSecuritySolutionListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return &luna, true } -// Response returns the raw server response from the last page request. -func (iter ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { - return iter.page.Response() +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { - if !iter.page.NotDone() { - return ExternalSecuritySolution{} - } - return iter.page.Values()[iter.i] +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ExternalSecuritySolutionListIterator type. -func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { - return ExternalSecuritySolutionListIterator{page: page} +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (essl ExternalSecuritySolutionList) IsEmpty() bool { - return essl.Value == nil || len(*essl.Value) == 0 +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (essl ExternalSecuritySolutionList) hasNextLink() bool { - return essl.NextLink != nil && len(*essl.NextLink) != 0 +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { - if !essl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(essl.NextLink))) +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. -type ExternalSecuritySolutionListPage struct { - fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) - essl ExternalSecuritySolutionList +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.essl) - if err != nil { - return err - } - page.essl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ExternalSecuritySolutionListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ExternalSecuritySolutionListPage) NotDone() bool { - return !page.essl.IsEmpty() +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { - return page.essl +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { - if page.essl.IsEmpty() { - return nil - } - return *page.essl.Value +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the ExternalSecuritySolutionListPage type. -func NewExternalSecuritySolutionListPage(getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { - return ExternalSecuritySolutionListPage{fn: getNextPage} +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// ExternalSecuritySolutionModel ... -type ExternalSecuritySolutionModel struct { - autorest.Response `json:"-"` - Value BasicExternalSecuritySolution `json:"value,omitempty"` +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. -func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { - ess, err := unmarshalBasicExternalSecuritySolution(body) - if err != nil { - return err - } - essm.Value = ess +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} - return nil +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) -type ExternalSecuritySolutionProperties struct { - // AdditionalProperties - Unmatched properties from the message are deserialized this collection - AdditionalProperties map[string]interface{} `json:""` - DeviceVendor *string `json:"deviceVendor,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - Workspace *ConnectedWorkspace `json:"workspace,omitempty"` +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. -func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if essp.DeviceVendor != nil { - objectMap["deviceVendor"] = essp.DeviceVendor - } - if essp.DeviceType != nil { - objectMap["deviceType"] = essp.DeviceType - } - if essp.Workspace != nil { - objectMap["workspace"] = essp.Workspace - } - for k, v := range essp.AdditionalProperties { - objectMap[k] = v - } - return json.Marshal(objectMap) +// AsCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. -func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - default: - if v != nil { - var additionalProperties interface{} - err = json.Unmarshal(*v, &additionalProperties) - if err != nil { - return err - } - if essp.AdditionalProperties == nil { - essp.AdditionalProperties = make(map[string]interface{}) - } - essp.AdditionalProperties[k] = additionalProperties - } - case "deviceVendor": - if v != nil { - var deviceVendor string - err = json.Unmarshal(*v, &deviceVendor) - if err != nil { - return err - } - essp.DeviceVendor = &deviceVendor - } - case "deviceType": - if v != nil { - var deviceType string - err = json.Unmarshal(*v, &deviceType) - if err != nil { - return err - } - essp.DeviceType = &deviceType - } - case "workspace": - if v != nil { - var workspace ConnectedWorkspace - err = json.Unmarshal(*v, &workspace) - if err != nil { - return err - } - essp.Workspace = &workspace - } - } - } +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for LocalUserNotAllowed. +func (luna LocalUserNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &luna, true +} - return nil +// Location describes an Azure resource with location +type Location struct { + // Location - READ-ONLY; Location where the resource is stored + Location *string `json:"location,omitempty"` } -// GcpCredentialsDetailsProperties GCP cloud account connector based service to service credentials, the -// credentials is composed of organization id and json api key (write only) -type GcpCredentialsDetailsProperties struct { - // OrganizationID - The Organization ID of the GCP cloud account - OrganizationID *string `json:"organizationId,omitempty"` - // Type - Type field of the API key (write only) - Type *string `json:"type,omitempty"` - // ProjectID - Project Id field of the API key (write only) - ProjectID *string `json:"projectId,omitempty"` - // PrivateKeyID - Private key Id field of the API key (write only) - PrivateKeyID *string `json:"privateKeyId,omitempty"` - // PrivateKey - Private key field of the API key (write only) - PrivateKey *string `json:"privateKey,omitempty"` - // ClientEmail - Client email field of the API key (write only) - ClientEmail *string `json:"clientEmail,omitempty"` - // ClientID - Client Id field of the API key (write only) - ClientID *string `json:"clientId,omitempty"` - // AuthURI - Auth Uri field of the API key (write only) - AuthURI *string `json:"authUri,omitempty"` - // TokenURI - Token Uri field of the API key (write only) - TokenURI *string `json:"tokenUri,omitempty"` - // AuthProviderX509CertURL - Auth provider x509 certificate url field of the API key (write only) - AuthProviderX509CertURL *string `json:"authProviderX509CertUrl,omitempty"` - // ClientX509CertURL - Client x509 certificate url field of the API key (write only) - ClientX509CertURL *string `json:"clientX509CertUrl,omitempty"` - // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' - AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` - // GrantedPermissions - READ-ONLY; The permissions detected in the cloud account. - GrantedPermissions *[]PermissionProperty `json:"grantedPermissions,omitempty"` - // AuthenticationType - Possible values include: 'AuthenticationTypeAuthenticationDetailsProperties', 'AuthenticationTypeAwsCreds', 'AuthenticationTypeAwsAssumeRole', 'AuthenticationTypeGcpCredentials' - AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` +// MqttC2DMessagesNotInAllowedRange number of cloud to device messages (MQTT protocol) is not in allowed range. +type MqttC2DMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` } -// MarshalJSON is the custom marshaler for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { - gcdp.AuthenticationType = AuthenticationTypeGcpCredentials +// MarshalJSON is the custom marshaler for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + mcmniar.RuleType = RuleTypeMqttC2DMessagesNotInAllowedRange objectMap := make(map[string]interface{}) - if gcdp.OrganizationID != nil { - objectMap["organizationId"] = gcdp.OrganizationID - } - if gcdp.Type != nil { - objectMap["type"] = gcdp.Type - } - if gcdp.ProjectID != nil { - objectMap["projectId"] = gcdp.ProjectID - } - if gcdp.PrivateKeyID != nil { - objectMap["privateKeyId"] = gcdp.PrivateKeyID - } - if gcdp.PrivateKey != nil { - objectMap["privateKey"] = gcdp.PrivateKey - } - if gcdp.ClientEmail != nil { - objectMap["clientEmail"] = gcdp.ClientEmail - } - if gcdp.ClientID != nil { - objectMap["clientId"] = gcdp.ClientID - } - if gcdp.AuthURI != nil { - objectMap["authUri"] = gcdp.AuthURI + if mcmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = mcmniar.TimeWindowSize } - if gcdp.TokenURI != nil { - objectMap["tokenUri"] = gcdp.TokenURI + if mcmniar.MinThreshold != nil { + objectMap["minThreshold"] = mcmniar.MinThreshold } - if gcdp.AuthProviderX509CertURL != nil { - objectMap["authProviderX509CertUrl"] = gcdp.AuthProviderX509CertURL + if mcmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = mcmniar.MaxThreshold } - if gcdp.ClientX509CertURL != nil { - objectMap["clientX509CertUrl"] = gcdp.ClientX509CertURL + if mcmniar.IsEnabled != nil { + objectMap["isEnabled"] = mcmniar.IsEnabled } - if gcdp.AuthenticationType != "" { - objectMap["authenticationType"] = gcdp.AuthenticationType + if mcmniar.RuleType != "" { + objectMap["ruleType"] = mcmniar.RuleType } return json.Marshal(objectMap) } -// AsAwsCredsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAwsCredsAuthenticationDetailsProperties() (*AwsCredsAuthenticationDetailsProperties, bool) { +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { return nil, false } -// AsAwAssumeRoleAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAwAssumeRoleAuthenticationDetailsProperties() (*AwAssumeRoleAuthenticationDetailsProperties, bool) { +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &mcmniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { return nil, false } -// AsGcpCredentialsDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsGcpCredentialsDetailsProperties() (*GcpCredentialsDetailsProperties, bool) { - return &gcdp, true +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &mcmniar, true } -// AsAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsAuthenticationDetailsProperties() (*AuthenticationDetailsProperties, bool) { +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { return nil, false } -// AsBasicAuthenticationDetailsProperties is the BasicAuthenticationDetailsProperties implementation for GcpCredentialsDetailsProperties. -func (gcdp GcpCredentialsDetailsProperties) AsBasicAuthenticationDetailsProperties() (BasicAuthenticationDetailsProperties, bool) { - return &gcdp, true +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// HybridComputeSettingsProperties settings for hybrid compute management -type HybridComputeSettingsProperties struct { - // HybridComputeProvisioningState - READ-ONLY; State of the service principal and its secret. Possible values include: 'HybridComputeProvisioningStateValid', 'HybridComputeProvisioningStateInvalid', 'HybridComputeProvisioningStateExpired' - HybridComputeProvisioningState HybridComputeProvisioningState `json:"hybridComputeProvisioningState,omitempty"` - // AutoProvision - Whether or not to automatically install Azure Arc (hybrid compute) agents on machines. Possible values include: 'AutoProvisionOn', 'AutoProvisionOff' - AutoProvision AutoProvision `json:"autoProvision,omitempty"` - // ResourceGroupName - The name of the resource group where Arc (Hybrid Compute) connectors are connected. - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // Region - The location where the meta data of machines will be stored - Region *string `json:"region,omitempty"` - // ProxyServer - For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. - ProxyServer *ProxyServerProperties `json:"proxyServer,omitempty"` - // ServicePrincipal - An object to access resources that are secured by an Azure AD tenant. - ServicePrincipal *ServicePrincipalProperties `json:"servicePrincipal,omitempty"` +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for HybridComputeSettingsProperties. -func (hcsp HybridComputeSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if hcsp.AutoProvision != "" { - objectMap["autoProvision"] = hcsp.AutoProvision - } - if hcsp.ResourceGroupName != nil { - objectMap["resourceGroupName"] = hcsp.ResourceGroupName - } - if hcsp.Region != nil { - objectMap["region"] = hcsp.Region - } - if hcsp.ProxyServer != nil { - objectMap["proxyServer"] = hcsp.ProxyServer - } - if hcsp.ServicePrincipal != nil { - objectMap["servicePrincipal"] = hcsp.ServicePrincipal - } - return json.Marshal(objectMap) +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// InformationProtectionKeyword the information type keyword. -type InformationProtectionKeyword struct { - // Pattern - The keyword pattern. - Pattern *string `json:"pattern,omitempty"` - // Custom - Indicates whether the keyword is custom or not. - Custom *bool `json:"custom,omitempty"` - // CanBeNumeric - Indicates whether the keyword can be applied on numeric types or not. - CanBeNumeric *bool `json:"canBeNumeric,omitempty"` - // Excluded - Indicates whether the keyword is excluded or not. - Excluded *bool `json:"excluded,omitempty"` +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// InformationProtectionPolicy information protection policy. -type InformationProtectionPolicy struct { - autorest.Response `json:"-"` - // InformationProtectionPolicyProperties - Information protection policy data - *InformationProtectionPolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for InformationProtectionPolicy. -func (ipp InformationProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ipp.InformationProtectionPolicyProperties != nil { - objectMap["properties"] = ipp.InformationProtectionPolicyProperties - } - return json.Marshal(objectMap) +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for InformationProtectionPolicy struct. -func (ipp *InformationProtectionPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var informationProtectionPolicyProperties InformationProtectionPolicyProperties - err = json.Unmarshal(*v, &informationProtectionPolicyProperties) - if err != nil { - return err - } - ipp.InformationProtectionPolicyProperties = &informationProtectionPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ipp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ipp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ipp.Type = &typeVar - } - } - } +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} - return nil +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// InformationProtectionPolicyList information protection policies response. -type InformationProtectionPolicyList struct { - autorest.Response `json:"-"` - // Value - List of information protection policies. - Value *[]InformationProtectionPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for InformationProtectionPolicyList. -func (ippl InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return &mcmniar, true +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DMessagesNotInAllowedRange. +func (mcmniar MqttC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &mcmniar, true +} + +// MqttC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (MQTT protocol) is not +// in allowed range. +type MqttC2DRejectedMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + mcrmniar.RuleType = RuleTypeMqttC2DRejectedMessagesNotInAllowedRange objectMap := make(map[string]interface{}) - if ippl.Value != nil { - objectMap["value"] = ippl.Value + if mcrmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = mcrmniar.TimeWindowSize + } + if mcrmniar.MinThreshold != nil { + objectMap["minThreshold"] = mcrmniar.MinThreshold + } + if mcrmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = mcrmniar.MaxThreshold + } + if mcrmniar.IsEnabled != nil { + objectMap["isEnabled"] = mcrmniar.IsEnabled + } + if mcrmniar.RuleType != "" { + objectMap["ruleType"] = mcrmniar.RuleType } return json.Marshal(objectMap) } -// InformationProtectionPolicyListIterator provides access to a complete listing of InformationProtectionPolicy -// values. -type InformationProtectionPolicyListIterator struct { - i int - page InformationProtectionPolicyListPage +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &mcrmniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &mcrmniar, true } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *InformationProtectionPolicyListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *InformationProtectionPolicyListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter InformationProtectionPolicyListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter InformationProtectionPolicyListIterator) Response() InformationProtectionPolicyList { - return iter.page.Response() +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter InformationProtectionPolicyListIterator) Value() InformationProtectionPolicy { - if !iter.page.NotDone() { - return InformationProtectionPolicy{} - } - return iter.page.Values()[iter.i] +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// Creates a new instance of the InformationProtectionPolicyListIterator type. -func NewInformationProtectionPolicyListIterator(page InformationProtectionPolicyListPage) InformationProtectionPolicyListIterator { - return InformationProtectionPolicyListIterator{page: page} +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (ippl InformationProtectionPolicyList) IsEmpty() bool { - return ippl.Value == nil || len(*ippl.Value) == 0 +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// hasNextLink returns true if the NextLink is not empty. -func (ippl InformationProtectionPolicyList) hasNextLink() bool { - return ippl.NextLink != nil && len(*ippl.NextLink) != 0 +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// informationProtectionPolicyListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ippl InformationProtectionPolicyList) informationProtectionPolicyListPreparer(ctx context.Context) (*http.Request, error) { - if !ippl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ippl.NextLink))) +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// InformationProtectionPolicyListPage contains a page of InformationProtectionPolicy values. -type InformationProtectionPolicyListPage struct { - fn func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error) - ippl InformationProtectionPolicyList +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *InformationProtectionPolicyListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.ippl) - if err != nil { - return err - } - page.ippl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *InformationProtectionPolicyListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page InformationProtectionPolicyListPage) NotDone() bool { - return !page.ippl.IsEmpty() +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page InformationProtectionPolicyListPage) Response() InformationProtectionPolicyList { - return page.ippl +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return &mcrmniar, true } -// Values returns the slice of values for the current page or nil if there are no values. -func (page InformationProtectionPolicyListPage) Values() []InformationProtectionPolicy { - if page.ippl.IsEmpty() { - return nil - } - return *page.ippl.Value +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// Creates a new instance of the InformationProtectionPolicyListPage type. -func NewInformationProtectionPolicyListPage(getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { - return InformationProtectionPolicyListPage{fn: getNextPage} +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// InformationProtectionPolicyProperties describes properties of an information protection policy. -type InformationProtectionPolicyProperties struct { - // LastModifiedUtc - READ-ONLY; Describes the last UTC time the policy was modified. - LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` - // Version - READ-ONLY; Describes the version of the policy. - Version *string `json:"version,omitempty"` - // Labels - Dictionary of sensitivity labels. - Labels map[string]*SensitivityLabel `json:"labels"` - // InformationTypes - The sensitivity information types. - InformationTypes map[string]*InformationType `json:"informationTypes"` +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for InformationProtectionPolicyProperties. -func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ippp.Labels != nil { - objectMap["labels"] = ippp.Labels - } - if ippp.InformationTypes != nil { - objectMap["informationTypes"] = ippp.InformationTypes - } - return json.Marshal(objectMap) +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// InformationType the information type. -type InformationType struct { - // DisplayName - The name of the information type. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the information type. - Description *string `json:"description,omitempty"` - // Order - The order of the information type. - Order *int32 `json:"order,omitempty"` - // RecommendedLabelID - The recommended label id to be associated with this information type. - RecommendedLabelID *uuid.UUID `json:"recommendedLabelId,omitempty"` - // Enabled - Indicates whether the information type is enabled or not. - Enabled *bool `json:"enabled,omitempty"` - // Custom - Indicates whether the information type is custom or not. - Custom *bool `json:"custom,omitempty"` - // Keywords - The information type keywords. - Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessPoliciesList ... -type JitNetworkAccessPoliciesList struct { - autorest.Response `json:"-"` - Value *[]JitNetworkAccessPolicy `json:"value,omitempty"` - // NextLink - READ-ONLY; The URI to fetch the next page. - NextLink *string `json:"nextLink,omitempty"` +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for JitNetworkAccessPoliciesList. -func (jnapl JitNetworkAccessPoliciesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jnapl.Value != nil { - objectMap["value"] = jnapl.Value - } - return json.Marshal(objectMap) +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessPoliciesListIterator provides access to a complete listing of JitNetworkAccessPolicy values. -type JitNetworkAccessPoliciesListIterator struct { - i int - page JitNetworkAccessPoliciesListPage +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *JitNetworkAccessPoliciesListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *JitNetworkAccessPoliciesListIterator) Next() error { - return iter.NextWithContext(context.Background()) +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter JitNetworkAccessPoliciesListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// AsCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (iter JitNetworkAccessPoliciesListIterator) Response() JitNetworkAccessPoliciesList { - return iter.page.Response() +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for MqttC2DRejectedMessagesNotInAllowedRange. +func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &mcrmniar, true } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter JitNetworkAccessPoliciesListIterator) Value() JitNetworkAccessPolicy { - if !iter.page.NotDone() { - return JitNetworkAccessPolicy{} +// MqttD2CMessagesNotInAllowedRange number of device to cloud messages (MQTT protocol) is not in allowed range. +type MqttD2CMessagesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + mdmniar.RuleType = RuleTypeMqttD2CMessagesNotInAllowedRange + objectMap := make(map[string]interface{}) + if mdmniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = mdmniar.TimeWindowSize } - return iter.page.Values()[iter.i] + if mdmniar.MinThreshold != nil { + objectMap["minThreshold"] = mdmniar.MinThreshold + } + if mdmniar.MaxThreshold != nil { + objectMap["maxThreshold"] = mdmniar.MaxThreshold + } + if mdmniar.IsEnabled != nil { + objectMap["isEnabled"] = mdmniar.IsEnabled + } + if mdmniar.RuleType != "" { + objectMap["ruleType"] = mdmniar.RuleType + } + return json.Marshal(objectMap) } -// Creates a new instance of the JitNetworkAccessPoliciesListIterator type. -func NewJitNetworkAccessPoliciesListIterator(page JitNetworkAccessPoliciesListPage) JitNetworkAccessPoliciesListIterator { - return JitNetworkAccessPoliciesListIterator{page: page} +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false } -// IsEmpty returns true if the ListResult contains no values. -func (jnapl JitNetworkAccessPoliciesList) IsEmpty() bool { - return jnapl.Value == nil || len(*jnapl.Value) == 0 +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &mdmniar, true } -// hasNextLink returns true if the NextLink is not empty. -func (jnapl JitNetworkAccessPoliciesList) hasNextLink() bool { - return jnapl.NextLink != nil && len(*jnapl.NextLink) != 0 +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false } -// jitNetworkAccessPoliciesListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (jnapl JitNetworkAccessPoliciesList) jitNetworkAccessPoliciesListPreparer(ctx context.Context) (*http.Request, error) { - if !jnapl.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(jnapl.NextLink))) +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &mdmniar, true } -// JitNetworkAccessPoliciesListPage contains a page of JitNetworkAccessPolicy values. -type JitNetworkAccessPoliciesListPage struct { - fn func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error) - jnapl JitNetworkAccessPoliciesList +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false } -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *JitNetworkAccessPoliciesListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.jnapl) - if err != nil { - return err - } - page.jnapl = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false } -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *JitNetworkAccessPoliciesListPage) Next() error { - return page.NextWithContext(context.Background()) +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page JitNetworkAccessPoliciesListPage) NotDone() bool { - return !page.jnapl.IsEmpty() +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false } -// Response returns the raw server response from the last page request. -func (page JitNetworkAccessPoliciesListPage) Response() JitNetworkAccessPoliciesList { - return page.jnapl +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false } -// Values returns the slice of values for the current page or nil if there are no values. -func (page JitNetworkAccessPoliciesListPage) Values() []JitNetworkAccessPolicy { - if page.jnapl.IsEmpty() { - return nil - } - return *page.jnapl.Value +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false } -// Creates a new instance of the JitNetworkAccessPoliciesListPage type. -func NewJitNetworkAccessPoliciesListPage(getNextPage func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error)) JitNetworkAccessPoliciesListPage { - return JitNetworkAccessPoliciesListPage{fn: getNextPage} +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false } -// JitNetworkAccessPolicy ... -type JitNetworkAccessPolicy struct { - autorest.Response `json:"-"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` - // Kind - Kind of the resource - Kind *string `json:"kind,omitempty"` - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` - *JitNetworkAccessPolicyProperties `json:"properties,omitempty"` +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for JitNetworkAccessPolicy. -func (jnap JitNetworkAccessPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jnap.Kind != nil { - objectMap["kind"] = jnap.Kind - } - if jnap.JitNetworkAccessPolicyProperties != nil { - objectMap["properties"] = jnap.JitNetworkAccessPolicyProperties - } - return json.Marshal(objectMap) +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false } -// UnmarshalJSON is the custom unmarshaler for JitNetworkAccessPolicy struct. -func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - jnap.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - jnap.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - jnap.Type = &typeVar - } - case "kind": - if v != nil { - var kind string - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - jnap.Kind = &kind - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - jnap.Location = &location - } - case "properties": - if v != nil { - var jitNetworkAccessPolicyProperties JitNetworkAccessPolicyProperties - err = json.Unmarshal(*v, &jitNetworkAccessPolicyProperties) - if err != nil { - return err - } - jnap.JitNetworkAccessPolicyProperties = &jitNetworkAccessPolicyProperties - } - } - } +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} - return nil +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessPolicyInitiatePort ... -type JitNetworkAccessPolicyInitiatePort struct { - Number *int32 `json:"number,omitempty"` - // AllowedSourceAddressPrefix - Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request. - AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` - // EndTimeUtc - The time to close the request in UTC - EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessPolicyInitiateRequest ... -type JitNetworkAccessPolicyInitiateRequest struct { - // VirtualMachines - A list of virtual machines & ports to open access for - VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` - // Justification - The justification for making the initiate request - Justification *string `json:"justification,omitempty"` +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessPolicyInitiateVirtualMachine ... -type JitNetworkAccessPolicyInitiateVirtualMachine struct { - // ID - Resource ID of the virtual machine that is linked to this policy - ID *string `json:"id,omitempty"` - // Ports - The ports to open for the resource with the `id` - Ports *[]JitNetworkAccessPolicyInitiatePort `json:"ports,omitempty"` +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessPolicyProperties ... -type JitNetworkAccessPolicyProperties struct { - // VirtualMachines - Configurations for Microsoft.Compute/virtualMachines resource type. - VirtualMachines *[]JitNetworkAccessPolicyVirtualMachine `json:"virtualMachines,omitempty"` - Requests *[]JitNetworkAccessRequest `json:"requests,omitempty"` - // ProvisioningState - READ-ONLY; Gets the provisioning state of the Just-in-Time policy. - ProvisioningState *string `json:"provisioningState,omitempty"` +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for JitNetworkAccessPolicyProperties. -func (jnapp JitNetworkAccessPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if jnapp.VirtualMachines != nil { - objectMap["virtualMachines"] = jnapp.VirtualMachines - } - if jnapp.Requests != nil { - objectMap["requests"] = jnapp.Requests - } - return json.Marshal(objectMap) +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessPolicyVirtualMachine ... -type JitNetworkAccessPolicyVirtualMachine struct { - // ID - Resource ID of the virtual machine that is linked to this policy - ID *string `json:"id,omitempty"` - // Ports - Port configurations for the virtual machine - Ports *[]JitNetworkAccessPortRule `json:"ports,omitempty"` - // PublicIPAddress - Public IP address of the Azure Firewall that is linked to this policy, if applicable - PublicIPAddress *string `json:"publicIpAddress,omitempty"` +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return &mdmniar, true } -// JitNetworkAccessPortRule ... -type JitNetworkAccessPortRule struct { - Number *int32 `json:"number,omitempty"` - // Protocol - Possible values include: 'TCP', 'UDP', 'All' - Protocol Protocol `json:"protocol,omitempty"` - // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` - // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"` - // MaxRequestAccessDuration - Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day - MaxRequestAccessDuration *string `json:"maxRequestAccessDuration,omitempty"` +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessRequest ... -type JitNetworkAccessRequest struct { - autorest.Response `json:"-"` - VirtualMachines *[]JitNetworkAccessRequestVirtualMachine `json:"virtualMachines,omitempty"` - // StartTimeUtc - The start time of the request in UTC - StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` - // Requestor - The identity of the person who made the request - Requestor *string `json:"requestor,omitempty"` - // Justification - The justification for making the initiate request - Justification *string `json:"justification,omitempty"` +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessRequestPort ... -type JitNetworkAccessRequestPort struct { - Number *int32 `json:"number,omitempty"` - // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` - // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"` - // EndTimeUtc - The date & time at which the request ends in UTC - EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` - // Status - The status of the port. Possible values include: 'Revoked', 'Initiated' - Status Status `json:"status,omitempty"` - // StatusReason - A description of why the `status` has its value. Possible values include: 'StatusReasonExpired', 'StatusReasonUserRequested', 'StatusReasonNewerRequestInitiated' - StatusReason StatusReason `json:"statusReason,omitempty"` - // MappedPort - The port which is mapped to this port's `number` in the Azure Firewall, if applicable - MappedPort *int32 `json:"mappedPort,omitempty"` +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false } -// JitNetworkAccessRequestVirtualMachine ... -type JitNetworkAccessRequestVirtualMachine struct { - // ID - Resource ID of the virtual machine that is linked to this policy - ID *string `json:"id,omitempty"` - // Ports - The ports that were opened for the virtual machine - Ports *[]JitNetworkAccessRequestPort `json:"ports,omitempty"` +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false } -// Kind describes an Azure resource with kind -type Kind struct { - // Kind - Kind of the resource - Kind *string `json:"kind,omitempty"` +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false } -// ListCustomAlertRule a List custom alert rule -type ListCustomAlertRule struct { - // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' - ValueType ValueType `json:"valueType,omitempty"` - // DisplayName - READ-ONLY; The display name of the custom alert. - DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; The description of the custom alert. - Description *string `json:"description,omitempty"` - // IsEnabled - Whether the custom alert is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - The type of the custom alert rule. - RuleType *string `json:"ruleType,omitempty"` +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for ListCustomAlertRule. -func (lcar ListCustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lcar.IsEnabled != nil { - objectMap["isEnabled"] = lcar.IsEnabled - } - if lcar.RuleType != nil { - objectMap["ruleType"] = lcar.RuleType - } - return json.Marshal(objectMap) +// AsCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false } -// Location describes an Azure resource with location -type Location struct { - // Location - READ-ONLY; Location where the resource is stored - Location *string `json:"location,omitempty"` +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for MqttD2CMessagesNotInAllowedRange. +func (mdmniar MqttD2CMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &mdmniar, true } // BasicOnPremiseResourceDetails details of the On Premise resource that was assessed @@ -6743,6 +10522,188 @@ type PricingProperties struct { PricingTier PricingTier `json:"pricingTier,omitempty"` } +// ProcessNotAllowed execution of a process that isn't allowed. Allow list consists of process names to allow. +type ProcessNotAllowed struct { + // AllowlistValues - The values to allow. The format of the values depends on the rule type. + AllowlistValues *[]string `json:"allowlistValues,omitempty"` + // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'ValueTypeIPCidr', 'ValueTypeString' + ValueType ValueType `json:"valueType,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessNotAllowed. +func (pna ProcessNotAllowed) MarshalJSON() ([]byte, error) { + pna.RuleType = RuleTypeProcessNotAllowed + objectMap := make(map[string]interface{}) + if pna.AllowlistValues != nil { + objectMap["allowlistValues"] = pna.AllowlistValues + } + if pna.IsEnabled != nil { + objectMap["isEnabled"] = pna.IsEnabled + } + if pna.RuleType != "" { + objectMap["ruleType"] = pna.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return &pna, true +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return &pna, true +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return &pna, true +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for ProcessNotAllowed. +func (pna ProcessNotAllowed) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &pna, true +} + // ProtectionMode the protection mode of the collection/file types. Exe/Msi/Script are used for Windows, // Executable is used for Linux. type ProtectionMode struct { @@ -6777,6 +10738,196 @@ type PublisherInfo struct { Version *string `json:"version,omitempty"` } +// QueuePurgesNotInAllowedRange number of device queue purges is not in allowed range. +type QueuePurgesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) MarshalJSON() ([]byte, error) { + qpniar.RuleType = RuleTypeQueuePurgesNotInAllowedRange + objectMap := make(map[string]interface{}) + if qpniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = qpniar.TimeWindowSize + } + if qpniar.MinThreshold != nil { + objectMap["minThreshold"] = qpniar.MinThreshold + } + if qpniar.MaxThreshold != nil { + objectMap["maxThreshold"] = qpniar.MaxThreshold + } + if qpniar.IsEnabled != nil { + objectMap["isEnabled"] = qpniar.IsEnabled + } + if qpniar.RuleType != "" { + objectMap["ruleType"] = qpniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &qpniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &qpniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return &qpniar, true +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for QueuePurgesNotInAllowedRange. +func (qpniar QueuePurgesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &qpniar, true +} + // RegulatoryComplianceAssessment regulatory compliance assessment details and state type RegulatoryComplianceAssessment struct { autorest.Response `json:"-"` @@ -7754,6 +11905,8 @@ type ScoreDetails struct { Max *int32 `json:"max,omitempty"` // Current - READ-ONLY; Current score Current *float64 `json:"current,omitempty"` + // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point + Percentage *float64 `json:"percentage,omitempty"` } // SecureScoreControlDefinitionItem information about the security control. @@ -8238,6 +12391,8 @@ type SecureScoreControlScore struct { Max *int32 `json:"max,omitempty"` // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 Current *float64 `json:"current,omitempty"` + // Percentage - READ-ONLY; Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point + Percentage *float64 `json:"percentage,omitempty"` } // SecureScoreControlScoreDetails calculation result data in control level @@ -8251,8 +12406,10 @@ type SecureScoreControlScoreDetails struct { // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control - NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` - Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` + NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` + // Weight - READ-ONLY; The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions. + Weight *int64 `json:"weight,omitempty"` + Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` } // MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. @@ -8321,6 +12478,15 @@ func (sscsd *SecureScoreControlScoreDetails) UnmarshalJSON(body []byte) error { } sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount } + case "weight": + if v != nil { + var weight int64 + err = json.Unmarshal(*v, &weight) + if err != nil { + return err + } + sscsd.Weight = &weight + } case "definition": if v != nil { var definition SecureScoreControlDefinitionItem @@ -8412,6 +12578,8 @@ type SecureScoreItemProperties struct { DisplayName *string `json:"displayName,omitempty"` // ScoreDetails - READ-ONLY; score object *ScoreDetails `json:"score,omitempty"` + // Weight - READ-ONLY; The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions. + Weight *int64 `json:"weight,omitempty"` } // MarshalJSON is the custom marshaler for SecureScoreItemProperties. @@ -8447,6 +12615,15 @@ func (ssip *SecureScoreItemProperties) UnmarshalJSON(body []byte) error { } ssip.ScoreDetails = &scoreDetails } + case "weight": + if v != nil { + var weight int64 + err = json.Unmarshal(*v, &weight) + if err != nil { + return err + } + ssip.Weight = &weight + } } } @@ -9638,6 +13815,30 @@ func (tp TaskProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// BasicThresholdCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is +// within the given range. +type BasicThresholdCustomAlertRule interface { + AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) + AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) + AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) + AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) + AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) + AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) + AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) + AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) + AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) + AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) + AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) + AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) + AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) + AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) + AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) + AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) + AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) + AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) + AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) +} + // ThresholdCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is // within the given range. type ThresholdCustomAlertRule struct { @@ -9649,14 +13850,116 @@ type ThresholdCustomAlertRule struct { DisplayName *string `json:"displayName,omitempty"` // Description - READ-ONLY; The description of the custom alert. Description *string `json:"description,omitempty"` - // IsEnabled - Whether the custom alert is enabled. + // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - The type of the custom alert rule. - RuleType *string `json:"ruleType,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +func unmarshalBasicThresholdCustomAlertRule(body []byte) (BasicThresholdCustomAlertRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ruleType"] { + case string(RuleTypeTimeWindowCustomAlertRule): + var twcar TimeWindowCustomAlertRule + err := json.Unmarshal(body, &twcar) + return twcar, err + case string(RuleTypeActiveConnectionsNotInAllowedRange): + var acniar ActiveConnectionsNotInAllowedRange + err := json.Unmarshal(body, &acniar) + return acniar, err + case string(RuleTypeAmqpC2DMessagesNotInAllowedRange): + var acmniar AmqpC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &acmniar) + return acmniar, err + case string(RuleTypeMqttC2DMessagesNotInAllowedRange): + var mcmniar MqttC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &mcmniar) + return mcmniar, err + case string(RuleTypeHTTPC2DMessagesNotInAllowedRange): + var hcmniar HTTPC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &hcmniar) + return hcmniar, err + case string(RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange): + var acrmniar AmqpC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &acrmniar) + return acrmniar, err + case string(RuleTypeMqttC2DRejectedMessagesNotInAllowedRange): + var mcrmniar MqttC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &mcrmniar) + return mcrmniar, err + case string(RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange): + var hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &hcrmniar) + return hcrmniar, err + case string(RuleTypeAmqpD2CMessagesNotInAllowedRange): + var admniar AmqpD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &admniar) + return admniar, err + case string(RuleTypeMqttD2CMessagesNotInAllowedRange): + var mdmniar MqttD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &mdmniar) + return mdmniar, err + case string(RuleTypeHTTPD2CMessagesNotInAllowedRange): + var hdmniar HTTPD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &hdmniar) + return hdmniar, err + case string(RuleTypeDirectMethodInvokesNotInAllowedRange): + var dminiar DirectMethodInvokesNotInAllowedRange + err := json.Unmarshal(body, &dminiar) + return dminiar, err + case string(RuleTypeFailedLocalLoginsNotInAllowedRange): + var fllniar FailedLocalLoginsNotInAllowedRange + err := json.Unmarshal(body, &fllniar) + return fllniar, err + case string(RuleTypeFileUploadsNotInAllowedRange): + var funiar FileUploadsNotInAllowedRange + err := json.Unmarshal(body, &funiar) + return funiar, err + case string(RuleTypeQueuePurgesNotInAllowedRange): + var qpniar QueuePurgesNotInAllowedRange + err := json.Unmarshal(body, &qpniar) + return qpniar, err + case string(RuleTypeTwinUpdatesNotInAllowedRange): + var tuniar TwinUpdatesNotInAllowedRange + err := json.Unmarshal(body, &tuniar) + return tuniar, err + case string(RuleTypeUnauthorizedOperationsNotInAllowedRange): + var uoniar UnauthorizedOperationsNotInAllowedRange + err := json.Unmarshal(body, &uoniar) + return uoniar, err + default: + var tcar ThresholdCustomAlertRule + err := json.Unmarshal(body, &tcar) + return tcar, err + } +} +func unmarshalBasicThresholdCustomAlertRuleArray(body []byte) ([]BasicThresholdCustomAlertRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tcarArray := make([]BasicThresholdCustomAlertRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tcar, err := unmarshalBasicThresholdCustomAlertRule(*rawMessage) + if err != nil { + return nil, err + } + tcarArray[index] = tcar + } + return tcarArray, nil } // MarshalJSON is the custom marshaler for ThresholdCustomAlertRule. func (tcar ThresholdCustomAlertRule) MarshalJSON() ([]byte, error) { + tcar.RuleType = RuleTypeThresholdCustomAlertRule objectMap := make(map[string]interface{}) if tcar.MinThreshold != nil { objectMap["minThreshold"] = tcar.MinThreshold @@ -9667,50 +13970,470 @@ func (tcar ThresholdCustomAlertRule) MarshalJSON() ([]byte, error) { if tcar.IsEnabled != nil { objectMap["isEnabled"] = tcar.IsEnabled } - if tcar.RuleType != nil { + if tcar.RuleType != "" { objectMap["ruleType"] = tcar.RuleType } return json.Marshal(objectMap) } -// TimeWindowCustomAlertRule a custom alert rule that checks if the number of activities (depends on the custom -// alert type) in a time window is within the given range. -type TimeWindowCustomAlertRule struct { - // DisplayName - READ-ONLY; The display name of the custom alert. - DisplayName *string `json:"displayName,omitempty"` - // Description - READ-ONLY; The description of the custom alert. - Description *string `json:"description,omitempty"` - // IsEnabled - Whether the custom alert is enabled. - IsEnabled *bool `json:"isEnabled,omitempty"` - // RuleType - The type of the custom alert rule. - RuleType *string `json:"ruleType,omitempty"` - // MinThreshold - The minimum threshold. - MinThreshold *int32 `json:"minThreshold,omitempty"` - // MaxThreshold - The maximum threshold. - MaxThreshold *int32 `json:"maxThreshold,omitempty"` - // TimeWindowSize - The time window size in iso8601 format. - TimeWindowSize *string `json:"timeWindowSize,omitempty"` +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return &tcar, true +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &tcar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for ThresholdCustomAlertRule. +func (tcar ThresholdCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &tcar, true +} + +// BasicTimeWindowCustomAlertRule a custom alert rule that checks if the number of activities (depends on the custom +// alert type) in a time window is within the given range. +type BasicTimeWindowCustomAlertRule interface { + AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) + AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) + AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) + AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) + AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) + AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) + AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) + AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) + AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) + AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) + AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) + AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) + AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) + AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) + AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) + AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) + AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) +} + +// TimeWindowCustomAlertRule a custom alert rule that checks if the number of activities (depends on the custom +// alert type) in a time window is within the given range. +type TimeWindowCustomAlertRule struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +func unmarshalBasicTimeWindowCustomAlertRule(body []byte) (BasicTimeWindowCustomAlertRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["ruleType"] { + case string(RuleTypeActiveConnectionsNotInAllowedRange): + var acniar ActiveConnectionsNotInAllowedRange + err := json.Unmarshal(body, &acniar) + return acniar, err + case string(RuleTypeAmqpC2DMessagesNotInAllowedRange): + var acmniar AmqpC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &acmniar) + return acmniar, err + case string(RuleTypeMqttC2DMessagesNotInAllowedRange): + var mcmniar MqttC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &mcmniar) + return mcmniar, err + case string(RuleTypeHTTPC2DMessagesNotInAllowedRange): + var hcmniar HTTPC2DMessagesNotInAllowedRange + err := json.Unmarshal(body, &hcmniar) + return hcmniar, err + case string(RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange): + var acrmniar AmqpC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &acrmniar) + return acrmniar, err + case string(RuleTypeMqttC2DRejectedMessagesNotInAllowedRange): + var mcrmniar MqttC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &mcrmniar) + return mcrmniar, err + case string(RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange): + var hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange + err := json.Unmarshal(body, &hcrmniar) + return hcrmniar, err + case string(RuleTypeAmqpD2CMessagesNotInAllowedRange): + var admniar AmqpD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &admniar) + return admniar, err + case string(RuleTypeMqttD2CMessagesNotInAllowedRange): + var mdmniar MqttD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &mdmniar) + return mdmniar, err + case string(RuleTypeHTTPD2CMessagesNotInAllowedRange): + var hdmniar HTTPD2CMessagesNotInAllowedRange + err := json.Unmarshal(body, &hdmniar) + return hdmniar, err + case string(RuleTypeDirectMethodInvokesNotInAllowedRange): + var dminiar DirectMethodInvokesNotInAllowedRange + err := json.Unmarshal(body, &dminiar) + return dminiar, err + case string(RuleTypeFailedLocalLoginsNotInAllowedRange): + var fllniar FailedLocalLoginsNotInAllowedRange + err := json.Unmarshal(body, &fllniar) + return fllniar, err + case string(RuleTypeFileUploadsNotInAllowedRange): + var funiar FileUploadsNotInAllowedRange + err := json.Unmarshal(body, &funiar) + return funiar, err + case string(RuleTypeQueuePurgesNotInAllowedRange): + var qpniar QueuePurgesNotInAllowedRange + err := json.Unmarshal(body, &qpniar) + return qpniar, err + case string(RuleTypeTwinUpdatesNotInAllowedRange): + var tuniar TwinUpdatesNotInAllowedRange + err := json.Unmarshal(body, &tuniar) + return tuniar, err + case string(RuleTypeUnauthorizedOperationsNotInAllowedRange): + var uoniar UnauthorizedOperationsNotInAllowedRange + err := json.Unmarshal(body, &uoniar) + return uoniar, err + default: + var twcar TimeWindowCustomAlertRule + err := json.Unmarshal(body, &twcar) + return twcar, err + } +} +func unmarshalBasicTimeWindowCustomAlertRuleArray(body []byte) ([]BasicTimeWindowCustomAlertRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + twcarArray := make([]BasicTimeWindowCustomAlertRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + twcar, err := unmarshalBasicTimeWindowCustomAlertRule(*rawMessage) + if err != nil { + return nil, err + } + twcarArray[index] = twcar + } + return twcarArray, nil +} + +// MarshalJSON is the custom marshaler for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) MarshalJSON() ([]byte, error) { + twcar.RuleType = RuleTypeTimeWindowCustomAlertRule + objectMap := make(map[string]interface{}) + if twcar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = twcar.TimeWindowSize + } + if twcar.MinThreshold != nil { + objectMap["minThreshold"] = twcar.MinThreshold + } + if twcar.MaxThreshold != nil { + objectMap["maxThreshold"] = twcar.MaxThreshold + } + if twcar.IsEnabled != nil { + objectMap["isEnabled"] = twcar.IsEnabled + } + if twcar.RuleType != "" { + objectMap["ruleType"] = twcar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &twcar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return &twcar, true +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &twcar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false } -// MarshalJSON is the custom marshaler for TimeWindowCustomAlertRule. -func (twcar TimeWindowCustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if twcar.IsEnabled != nil { - objectMap["isEnabled"] = twcar.IsEnabled - } - if twcar.RuleType != nil { - objectMap["ruleType"] = twcar.RuleType - } - if twcar.MinThreshold != nil { - objectMap["minThreshold"] = twcar.MinThreshold - } - if twcar.MaxThreshold != nil { - objectMap["maxThreshold"] = twcar.MaxThreshold - } - if twcar.TimeWindowSize != nil { - objectMap["timeWindowSize"] = twcar.TimeWindowSize - } - return json.Marshal(objectMap) +// AsCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for TimeWindowCustomAlertRule. +func (twcar TimeWindowCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &twcar, true } // TopologyList ... @@ -9998,7 +14721,7 @@ type TrackedResource struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type Type *string `json:"type,omitempty"` - // Location - READ-ONLY; Location where the resource is stored + // Location - Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Kind of the resource Kind *string `json:"kind,omitempty"` @@ -10011,6 +14734,9 @@ type TrackedResource struct { // MarshalJSON is the custom marshaler for TrackedResource. func (tr TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if tr.Location != nil { + objectMap["location"] = tr.Location + } if tr.Kind != nil { objectMap["kind"] = tr.Kind } @@ -10023,6 +14749,386 @@ func (tr TrackedResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// TwinUpdatesNotInAllowedRange number of twin updates is not in allowed range. +type TwinUpdatesNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) MarshalJSON() ([]byte, error) { + tuniar.RuleType = RuleTypeTwinUpdatesNotInAllowedRange + objectMap := make(map[string]interface{}) + if tuniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = tuniar.TimeWindowSize + } + if tuniar.MinThreshold != nil { + objectMap["minThreshold"] = tuniar.MinThreshold + } + if tuniar.MaxThreshold != nil { + objectMap["maxThreshold"] = tuniar.MaxThreshold + } + if tuniar.IsEnabled != nil { + objectMap["isEnabled"] = tuniar.IsEnabled + } + if tuniar.RuleType != "" { + objectMap["ruleType"] = tuniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &tuniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &tuniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return &tuniar, true +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return nil, false +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for TwinUpdatesNotInAllowedRange. +func (tuniar TwinUpdatesNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &tuniar, true +} + +// UnauthorizedOperationsNotInAllowedRange number of unauthorized operations is not in allowed range. +type UnauthorizedOperationsNotInAllowedRange struct { + // TimeWindowSize - The time window size in iso8601 format. + TimeWindowSize *string `json:"timeWindowSize,omitempty"` + // MinThreshold - The minimum threshold. + MinThreshold *int32 `json:"minThreshold,omitempty"` + // MaxThreshold - The maximum threshold. + MaxThreshold *int32 `json:"maxThreshold,omitempty"` + // DisplayName - READ-ONLY; The display name of the custom alert. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; The description of the custom alert. + Description *string `json:"description,omitempty"` + // IsEnabled - Status of the custom alert. + IsEnabled *bool `json:"isEnabled,omitempty"` + // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' + RuleType RuleType `json:"ruleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) MarshalJSON() ([]byte, error) { + uoniar.RuleType = RuleTypeUnauthorizedOperationsNotInAllowedRange + objectMap := make(map[string]interface{}) + if uoniar.TimeWindowSize != nil { + objectMap["timeWindowSize"] = uoniar.TimeWindowSize + } + if uoniar.MinThreshold != nil { + objectMap["minThreshold"] = uoniar.MinThreshold + } + if uoniar.MaxThreshold != nil { + objectMap["maxThreshold"] = uoniar.MaxThreshold + } + if uoniar.IsEnabled != nil { + objectMap["isEnabled"] = uoniar.IsEnabled + } + if uoniar.RuleType != "" { + objectMap["ruleType"] = uoniar.RuleType + } + return json.Marshal(objectMap) +} + +// AsThresholdCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsThresholdCustomAlertRule() (*ThresholdCustomAlertRule, bool) { + return nil, false +} + +// AsBasicThresholdCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsBasicThresholdCustomAlertRule() (BasicThresholdCustomAlertRule, bool) { + return &uoniar, true +} + +// AsTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsTimeWindowCustomAlertRule() (*TimeWindowCustomAlertRule, bool) { + return nil, false +} + +// AsBasicTimeWindowCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsBasicTimeWindowCustomAlertRule() (BasicTimeWindowCustomAlertRule, bool) { + return &uoniar, true +} + +// AsAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsAllowlistCustomAlertRule() (*AllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsBasicAllowlistCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsBasicAllowlistCustomAlertRule() (BasicAllowlistCustomAlertRule, bool) { + return nil, false +} + +// AsDenylistCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsDenylistCustomAlertRule() (*DenylistCustomAlertRule, bool) { + return nil, false +} + +// AsListCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsListCustomAlertRule() (*ListCustomAlertRule, bool) { + return nil, false +} + +// AsBasicListCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsBasicListCustomAlertRule() (BasicListCustomAlertRule, bool) { + return nil, false +} + +// AsConnectionToIPNotAllowed is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsConnectionToIPNotAllowed() (*ConnectionToIPNotAllowed, bool) { + return nil, false +} + +// AsLocalUserNotAllowed is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsLocalUserNotAllowed() (*LocalUserNotAllowed, bool) { + return nil, false +} + +// AsProcessNotAllowed is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsProcessNotAllowed() (*ProcessNotAllowed, bool) { + return nil, false +} + +// AsActiveConnectionsNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsActiveConnectionsNotInAllowedRange() (*ActiveConnectionsNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsAmqpC2DMessagesNotInAllowedRange() (*AmqpC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsMqttC2DMessagesNotInAllowedRange() (*MqttC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsHTTPC2DMessagesNotInAllowedRange() (*HTTPC2DMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsAmqpC2DRejectedMessagesNotInAllowedRange() (*AmqpC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsMqttC2DRejectedMessagesNotInAllowedRange() (*MqttC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPC2DRejectedMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsHTTPC2DRejectedMessagesNotInAllowedRange() (*HTTPC2DRejectedMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsAmqpD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsAmqpD2CMessagesNotInAllowedRange() (*AmqpD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsMqttD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsMqttD2CMessagesNotInAllowedRange() (*MqttD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsHTTPD2CMessagesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsHTTPD2CMessagesNotInAllowedRange() (*HTTPD2CMessagesNotInAllowedRange, bool) { + return nil, false +} + +// AsDirectMethodInvokesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsDirectMethodInvokesNotInAllowedRange() (*DirectMethodInvokesNotInAllowedRange, bool) { + return nil, false +} + +// AsFailedLocalLoginsNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsFailedLocalLoginsNotInAllowedRange() (*FailedLocalLoginsNotInAllowedRange, bool) { + return nil, false +} + +// AsFileUploadsNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsFileUploadsNotInAllowedRange() (*FileUploadsNotInAllowedRange, bool) { + return nil, false +} + +// AsQueuePurgesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsQueuePurgesNotInAllowedRange() (*QueuePurgesNotInAllowedRange, bool) { + return nil, false +} + +// AsTwinUpdatesNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsTwinUpdatesNotInAllowedRange() (*TwinUpdatesNotInAllowedRange, bool) { + return nil, false +} + +// AsUnauthorizedOperationsNotInAllowedRange is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsUnauthorizedOperationsNotInAllowedRange() (*UnauthorizedOperationsNotInAllowedRange, bool) { + return &uoniar, true +} + +// AsCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsCustomAlertRule() (*CustomAlertRule, bool) { + return nil, false +} + +// AsBasicCustomAlertRule is the BasicCustomAlertRule implementation for UnauthorizedOperationsNotInAllowedRange. +func (uoniar UnauthorizedOperationsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustomAlertRule, bool) { + return &uoniar, true +} + // UserRecommendation represents a user that is recommended to be allowed for a certain rule type UserRecommendation struct { // Username - Represents a user that is recommended to be allowed for a certain rule