diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md b/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md index 339ae62394f1..01ec07e90e94 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md @@ -1,5 +1,712 @@ # Release History +## 0.2.0 (2022-04-12) +### Breaking Changes + +- Function `*ThreatIntelligenceIndicatorClient.QueryIndicators` return value(s) have been changed from `(*ThreatIntelligenceIndicatorClientQueryIndicatorsPager)` to `(*runtime.Pager[ThreatIntelligenceIndicatorClientQueryIndicatorsResponse])` +- Function `*WatchlistItemsClient.List` return value(s) have been changed from `(*WatchlistItemsClientListPager)` to `(*runtime.Pager[WatchlistItemsClientListResponse])` +- Function `*IncidentCommentsClient.List` return value(s) have been changed from `(*IncidentCommentsClientListPager)` to `(*runtime.Pager[IncidentCommentsClientListResponse])` +- Function `*MetadataClient.List` return value(s) have been changed from `(*MetadataClientListPager)` to `(*runtime.Pager[MetadataClientListResponse])` +- Function `*ThreatIntelligenceIndicatorClient.CreateIndicator` parameter(s) have been changed from `(context.Context, string, string, ThreatIntelligenceIndicatorModelForRequestBody, *ThreatIntelligenceIndicatorClientCreateIndicatorOptions)` to `(context.Context, string, string, ThreatIntelligenceIndicatorModel, *ThreatIntelligenceIndicatorClientCreateIndicatorOptions)` +- Function `NewAutomationRulesClient` return value(s) have been changed from `(*AutomationRulesClient)` to `(*AutomationRulesClient, error)` +- Function `NewAlertRulesClient` return value(s) have been changed from `(*AlertRulesClient)` to `(*AlertRulesClient, error)` +- Function `*EntityQueriesClient.List` return value(s) have been changed from `(*EntityQueriesClientListPager)` to `(*runtime.Pager[EntityQueriesClientListResponse])` +- Function `NewSentinelOnboardingStatesClient` return value(s) have been changed from `(*SentinelOnboardingStatesClient)` to `(*SentinelOnboardingStatesClient, error)` +- Function `NewEntityRelationsClient` return value(s) have been changed from `(*EntityRelationsClient)` to `(*EntityRelationsClient, error)` +- Function `*AlertRulesClient.List` return value(s) have been changed from `(*AlertRulesClientListPager)` to `(*runtime.Pager[AlertRulesClientListResponse])` +- Function `*DataConnectorsClient.List` return value(s) have been changed from `(*DataConnectorsClientListPager)` to `(*runtime.Pager[DataConnectorsClientListResponse])` +- Function `NewWatchlistItemsClient` return value(s) have been changed from `(*WatchlistItemsClient)` to `(*WatchlistItemsClient, error)` +- Function `*WatchlistsClient.List` return value(s) have been changed from `(*WatchlistsClientListPager)` to `(*runtime.Pager[WatchlistsClientListResponse])` +- Function `NewMetadataClient` return value(s) have been changed from `(*MetadataClient)` to `(*MetadataClient, error)` +- Function `NewBookmarkRelationsClient` return value(s) have been changed from `(*BookmarkRelationsClient)` to `(*BookmarkRelationsClient, error)` +- Function `NewSourceControlsClient` return value(s) have been changed from `(*SourceControlsClient)` to `(*SourceControlsClient, error)` +- Function `NewThreatIntelligenceIndicatorMetricsClient` return value(s) have been changed from `(*ThreatIntelligenceIndicatorMetricsClient)` to `(*ThreatIntelligenceIndicatorMetricsClient, error)` +- Function `*ThreatIntelligenceIndicatorClient.Create` parameter(s) have been changed from `(context.Context, string, string, string, ThreatIntelligenceIndicatorModelForRequestBody, *ThreatIntelligenceIndicatorClientCreateOptions)` to `(context.Context, string, string, string, ThreatIntelligenceIndicatorModel, *ThreatIntelligenceIndicatorClientCreateOptions)` +- Function `*EntityQueryTemplatesClient.List` return value(s) have been changed from `(*EntityQueryTemplatesClientListPager)` to `(*runtime.Pager[EntityQueryTemplatesClientListResponse])` +- Function `*EntitiesClient.List` return value(s) have been changed from `(*EntitiesClientListPager)` to `(*runtime.Pager[EntitiesClientListResponse])` +- Function `*BookmarkRelationsClient.List` return value(s) have been changed from `(*BookmarkRelationsClientListPager)` to `(*runtime.Pager[BookmarkRelationsClientListResponse])` +- Function `*BookmarksClient.List` return value(s) have been changed from `(*BookmarksClientListPager)` to `(*runtime.Pager[BookmarksClientListResponse])` +- Function `NewThreatIntelligenceIndicatorClient` return value(s) have been changed from `(*ThreatIntelligenceIndicatorClient)` to `(*ThreatIntelligenceIndicatorClient, error)` +- Function `*ActionsClient.ListByAlertRule` return value(s) have been changed from `(*ActionsClientListByAlertRulePager)` to `(*runtime.Pager[ActionsClientListByAlertRuleResponse])` +- Function `NewProductSettingsClient` return value(s) have been changed from `(*ProductSettingsClient)` to `(*ProductSettingsClient, error)` +- Function `NewThreatIntelligenceIndicatorsClient` return value(s) have been changed from `(*ThreatIntelligenceIndicatorsClient)` to `(*ThreatIntelligenceIndicatorsClient, error)` +- Function `NewDataConnectorsCheckRequirementsClient` return value(s) have been changed from `(*DataConnectorsCheckRequirementsClient)` to `(*DataConnectorsCheckRequirementsClient, error)` +- Function `NewDataConnectorsClient` return value(s) have been changed from `(*DataConnectorsClient)` to `(*DataConnectorsClient, error)` +- Function `NewSourceControlClient` return value(s) have been changed from `(*SourceControlClient)` to `(*SourceControlClient, error)` +- Function `*AlertRuleTemplatesClient.List` return value(s) have been changed from `(*AlertRuleTemplatesClientListPager)` to `(*runtime.Pager[AlertRuleTemplatesClientListResponse])` +- Function `*IncidentsClient.List` return value(s) have been changed from `(*IncidentsClientListPager)` to `(*runtime.Pager[IncidentsClientListResponse])` +- Function `NewDomainWhoisClient` return value(s) have been changed from `(*DomainWhoisClient)` to `(*DomainWhoisClient, error)` +- Function `*OfficeConsentsClient.List` return value(s) have been changed from `(*OfficeConsentsClientListPager)` to `(*runtime.Pager[OfficeConsentsClientListResponse])` +- Function `NewBookmarkClient` return value(s) have been changed from `(*BookmarkClient)` to `(*BookmarkClient, error)` +- Function `NewIncidentsClient` return value(s) have been changed from `(*IncidentsClient)` to `(*IncidentsClient, error)` +- Function `NewEntitiesGetTimelineClient` return value(s) have been changed from `(*EntitiesGetTimelineClient)` to `(*EntitiesGetTimelineClient, error)` +- Function `NewBookmarksClient` return value(s) have been changed from `(*BookmarksClient)` to `(*BookmarksClient, error)` +- Function `NewEntityQueriesClient` return value(s) have been changed from `(*EntityQueriesClient)` to `(*EntityQueriesClient, error)` +- Function `*IncidentRelationsClient.List` return value(s) have been changed from `(*IncidentRelationsClientListPager)` to `(*runtime.Pager[IncidentRelationsClientListResponse])` +- Function `*ThreatIntelligenceIndicatorClient.ReplaceTags` parameter(s) have been changed from `(context.Context, string, string, string, ThreatIntelligenceIndicatorModelForRequestBody, *ThreatIntelligenceIndicatorClientReplaceTagsOptions)` to `(context.Context, string, string, string, ThreatIntelligenceIndicatorModel, *ThreatIntelligenceIndicatorClientReplaceTagsOptions)` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `NewIPGeodataClient` return value(s) have been changed from `(*IPGeodataClient)` to `(*IPGeodataClient, error)` +- Function `NewOfficeConsentsClient` return value(s) have been changed from `(*OfficeConsentsClient)` to `(*OfficeConsentsClient, error)` +- Function `NewActionsClient` return value(s) have been changed from `(*ActionsClient)` to `(*ActionsClient, error)` +- Function `NewIncidentRelationsClient` return value(s) have been changed from `(*IncidentRelationsClient)` to `(*IncidentRelationsClient, error)` +- Function `*SourceControlsClient.List` return value(s) have been changed from `(*SourceControlsClientListPager)` to `(*runtime.Pager[SourceControlsClientListResponse])` +- Function `NewWatchlistsClient` return value(s) have been changed from `(*WatchlistsClient)` to `(*WatchlistsClient, error)` +- Function `NewEntitiesClient` return value(s) have been changed from `(*EntitiesClient)` to `(*EntitiesClient, error)` +- Function `*ThreatIntelligenceIndicatorsClient.List` return value(s) have been changed from `(*ThreatIntelligenceIndicatorsClientListPager)` to `(*runtime.Pager[ThreatIntelligenceIndicatorsClientListResponse])` +- Function `NewIncidentCommentsClient` return value(s) have been changed from `(*IncidentCommentsClient)` to `(*IncidentCommentsClient, error)` +- Function `*SourceControlClient.ListRepositories` return value(s) have been changed from `(*SourceControlClientListRepositoriesPager)` to `(*runtime.Pager[SourceControlClientListRepositoriesResponse])` +- Function `NewEntitiesRelationsClient` return value(s) have been changed from `(*EntitiesRelationsClient)` to `(*EntitiesRelationsClient, error)` +- Function `*EntitiesRelationsClient.List` return value(s) have been changed from `(*EntitiesRelationsClientListPager)` to `(*runtime.Pager[EntitiesRelationsClientListResponse])` +- Function `NewAlertRuleTemplatesClient` return value(s) have been changed from `(*AlertRuleTemplatesClient)` to `(*AlertRuleTemplatesClient, error)` +- Function `NewEntityQueryTemplatesClient` return value(s) have been changed from `(*EntityQueryTemplatesClient)` to `(*EntityQueryTemplatesClient, error)` +- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsClientListPager)` to `(*runtime.Pager[OperationsClientListResponse])` +- Function `*AutomationRulesClient.List` return value(s) have been changed from `(*AutomationRulesClientListPager)` to `(*runtime.Pager[AutomationRulesClientListResponse])` +- Type of `WatchlistItemProperties.ItemsKeyValue` has been changed from `interface{}` to `map[string]interface{}` +- Type of `WatchlistItemProperties.EntityMapping` has been changed from `interface{}` to `map[string]interface{}` +- Type of `WatchlistProperties.Source` has been changed from `*Source` to `*string` +- Const `IncidentLabelTypeSystem` has been removed +- Const `SourceLocalFile` has been removed +- Const `SourceRemoteStorage` has been removed +- Function `*IncidentsClientListPager.PageResponse` has been removed +- Function `EntityKind.ToPtr` has been removed +- Function `*ThreatIntelligenceIndicatorModelForRequestBody.UnmarshalJSON` has been removed +- Function `*DataConnectorsClientListPager.NextPage` has been removed +- Function `*ThreatIntelligenceInformation.GetThreatIntelligenceResourceKind` has been removed +- Function `*ThreatIntelligenceIndicatorsClientListPager.NextPage` has been removed +- Function `*AlertRulesClientCreateOrUpdateResult.UnmarshalJSON` has been removed +- Function `*EntitiesClientListPager.PageResponse` has been removed +- Function `IncidentLabelType.ToPtr` has been removed +- Function `*EntityQueryTemplatesClientListPager.Err` has been removed +- Function `EntityItemQueryKind.ToPtr` has been removed +- Function `AlertSeverity.ToPtr` has been removed +- Function `*WatchlistItemsClientListPager.PageResponse` has been removed +- Function `*WatchlistItemsClientListPager.Err` has been removed +- Function `*AutomationRulesClientListPager.PageResponse` has been removed +- Function `*EntityQueriesClientListPager.NextPage` has been removed +- Function `ConfidenceLevel.ToPtr` has been removed +- Function `*OfficeConsentsClientListPager.Err` has been removed +- Function `Source.ToPtr` has been removed +- Function `GetInsightsErrorKind.ToPtr` has been removed +- Function `FileHashAlgorithm.ToPtr` has been removed +- Function `DataConnectorKind.ToPtr` has been removed +- Function `*EntitiesRelationsClientListPager.NextPage` has been removed +- Function `ElevationToken.ToPtr` has been removed +- Function `*IncidentsClientListPager.NextPage` has been removed +- Function `MatchingMethod.ToPtr` has been removed +- Function `*IncidentCommentsClientListPager.PageResponse` has been removed +- Function `QueryBasedAlertRuleProperties.MarshalJSON` has been removed +- Function `DataConnectorLicenseState.ToPtr` has been removed +- Function `*WatchlistsClientListPager.NextPage` has been removed +- Function `MicrosoftSecurityProductName.ToPtr` has been removed +- Function `*ActionsClientListByAlertRulePager.PageResponse` has been removed +- Function `*MetadataClientListPager.Err` has been removed +- Function `Kind.ToPtr` has been removed +- Function `*BookmarkRelationsClientListPager.PageResponse` has been removed +- Function `EventGroupingAggregationKind.ToPtr` has been removed +- Function `TemplateStatus.ToPtr` has been removed +- Function `ConnectAuthKind.ToPtr` has been removed +- Function `*AlertRuleTemplatesClientListPager.Err` has been removed +- Function `ThreatIntelligenceResourceKindEnum.ToPtr` has been removed +- Function `CustomEntityQueryKind.ToPtr` has been removed +- Function `SupportTier.ToPtr` has been removed +- Function `*AlertRuleTemplatesClientGetResult.UnmarshalJSON` has been removed +- Function `DeliveryAction.ToPtr` has been removed +- Function `IncidentStatus.ToPtr` has been removed +- Function `OSFamily.ToPtr` has been removed +- Function `*EntitiesClientListPager.NextPage` has been removed +- Function `SKUKind.ToPtr` has been removed +- Function `OutputType.ToPtr` has been removed +- Function `*AutomationRulesClient.ManualTriggerPlaybook` has been removed +- Function `SourceKind.ToPtr` has been removed +- Function `*OfficeConsentsClientListPager.NextPage` has been removed +- Function `RegistryHive.ToPtr` has been removed +- Function `Enum15.ToPtr` has been removed +- Function `*DataConnectorsClientGetResult.UnmarshalJSON` has been removed +- Function `AntispamMailDirection.ToPtr` has been removed +- Function `*MetadataClientListPager.PageResponse` has been removed +- Function `PermissionProviderScope.ToPtr` has been removed +- Function `ActionType.ToPtr` has been removed +- Function `RepoType.ToPtr` has been removed +- Function `*BookmarkRelationsClientListPager.Err` has been removed +- Function `*ThreatIntelligenceInformation.UnmarshalJSON` has been removed +- Function `*ThreatIntelligenceIndicatorsClientListPager.Err` has been removed +- Function `*DataConnectorsClientListPager.PageResponse` has been removed +- Function `AlertStatus.ToPtr` has been removed +- Function `SettingType.ToPtr` has been removed +- Function `*ThreatIntelligenceIndicatorsClientListPager.PageResponse` has been removed +- Function `EntityQueryTemplateKind.ToPtr` has been removed +- Function `*AlertRuleTemplatesClientListPager.NextPage` has been removed +- Function `EntityMappingType.ToPtr` has been removed +- Function `Operator.ToPtr` has been removed +- Function `SettingKind.ToPtr` has been removed +- Function `*ActionsClientListByAlertRulePager.Err` has been removed +- Function `CreatedByType.ToPtr` has been removed +- Function `*IncidentCommentsClientListPager.NextPage` has been removed +- Function `EntityQueryKind.ToPtr` has been removed +- Function `TriggersOn.ToPtr` has been removed +- Function `*AlertRulesClientListPager.NextPage` has been removed +- Function `*ProductSettingsClientUpdateResult.UnmarshalJSON` has been removed +- Function `*OperationsClientListPager.NextPage` has been removed +- Function `DataConnectorAuthorizationState.ToPtr` has been removed +- Function `*SourceControlsClientListPager.Err` has been removed +- Function `*EntityQueryTemplatesClientListPager.PageResponse` has been removed +- Function `AutomationRulePropertyConditionSupportedProperty.ToPtr` has been removed +- Function `*AutomationRulesClientListPager.Err` has been removed +- Function `*MetadataClientListPager.NextPage` has been removed +- Function `*BookmarksClientListPager.Err` has been removed +- Function `*IncidentRelationsClientListPager.Err` has been removed +- Function `*EntityQueryTemplatesClientGetResult.UnmarshalJSON` has been removed +- Function `TriggerOperator.ToPtr` has been removed +- Function `DeliveryLocation.ToPtr` has been removed +- Function `IncidentSeverity.ToPtr` has been removed +- Function `EntityType.ToPtr` has been removed +- Function `*IncidentRelationsClientListPager.NextPage` has been removed +- Function `*EntitiesClientGetResult.UnmarshalJSON` has been removed +- Function `EntityTimelineKind.ToPtr` has been removed +- Function `*BookmarksClientListPager.PageResponse` has been removed +- Function `IncidentClassification.ToPtr` has been removed +- Function `*BookmarkRelationsClientListPager.NextPage` has been removed +- Function `PollingFrequency.ToPtr` has been removed +- Function `*BookmarksClientListPager.NextPage` has been removed +- Function `*ThreatIntelligenceIndicatorClientQueryIndicatorsPager.NextPage` has been removed +- Function `ThreatIntelligenceIndicatorModelForRequestBody.MarshalJSON` has been removed +- Function `ProviderName.ToPtr` has been removed +- Function `AlertRuleKind.ToPtr` has been removed +- Function `IncidentClassificationReason.ToPtr` has been removed +- Function `*DataConnectorsClientListPager.Err` has been removed +- Function `*EntityQueryTemplatesClientListPager.NextPage` has been removed +- Function `*OfficeConsentsClientListPager.PageResponse` has been removed +- Function `*DataConnectorsClientCreateOrUpdateResult.UnmarshalJSON` has been removed +- Function `TriggersWhen.ToPtr` has been removed +- Function `*ThreatIntelligenceIndicatorClientReplaceTagsResult.UnmarshalJSON` has been removed +- Function `OwnerType.ToPtr` has been removed +- Function `*EntitiesRelationsClientListPager.PageResponse` has been removed +- Function `*AlertRulesClientListPager.PageResponse` has been removed +- Function `*AlertRulesClientGetResult.UnmarshalJSON` has been removed +- Function `*EntityQueriesClientGetResult.UnmarshalJSON` has been removed +- Function `*ActionsClientListByAlertRulePager.NextPage` has been removed +- Function `*AlertRulesClientListPager.Err` has been removed +- Function `KillChainIntent.ToPtr` has been removed +- Function `RegistryValueKind.ToPtr` has been removed +- Function `*ThreatIntelligenceIndicatorClientCreateIndicatorResult.UnmarshalJSON` has been removed +- Function `AutomationRulePropertyConditionSupportedOperator.ToPtr` has been removed +- Function `DataTypeState.ToPtr` has been removed +- Function `*SourceControlClientListRepositoriesPager.PageResponse` has been removed +- Function `AttackTactic.ToPtr` has been removed +- Function `*OperationsClientListPager.PageResponse` has been removed +- Function `*ThreatIntelligenceIndicatorClientCreateResult.UnmarshalJSON` has been removed +- Function `*IncidentCommentsClientListPager.Err` has been removed +- Function `*SourceControlClientListRepositoriesPager.Err` has been removed +- Function `*EntityQueriesClientListPager.PageResponse` has been removed +- Function `*SourceControlClientListRepositoriesPager.NextPage` has been removed +- Function `*EntitiesClientListPager.Err` has been removed +- Function `*WatchlistsClientListPager.PageResponse` has been removed +- Function `ContentType.ToPtr` has been removed +- Function `*WatchlistItemsClientListPager.NextPage` has been removed +- Function `ConnectivityType.ToPtr` has been removed +- Function `*EntityQueriesClientListPager.Err` has been removed +- Function `*OperationsClientListPager.Err` has been removed +- Function `UebaDataSources.ToPtr` has been removed +- Function `AlertDetail.ToPtr` has been removed +- Function `*ThreatIntelligenceIndicatorClientQueryIndicatorsPager.Err` has been removed +- Function `*ProductSettingsClientGetResult.UnmarshalJSON` has been removed +- Function `*IncidentsClientListPager.Err` has been removed +- Function `PossibleSourceValues` has been removed +- Function `*ThreatIntelligenceIndicatorModelForRequestBody.GetThreatIntelligenceResourceKind` has been removed +- Function `*SourceControlsClientListPager.NextPage` has been removed +- Function `ThreatIntelligenceInformation.MarshalJSON` has been removed +- Function `*EntityQueriesClientCreateOrUpdateResult.UnmarshalJSON` has been removed +- Function `ThreatIntelligenceSortingCriteriaEnum.ToPtr` has been removed +- Function `*IncidentRelationsClientListPager.PageResponse` has been removed +- Function `*ThreatIntelligenceIndicatorClientGetResult.UnmarshalJSON` has been removed +- Function `*QueryBasedAlertRuleProperties.UnmarshalJSON` has been removed +- Function `Enum13.ToPtr` has been removed +- Function `*ThreatIntelligenceIndicatorClientQueryIndicatorsPager.PageResponse` has been removed +- Function `*AutomationRulesClientListPager.NextPage` has been removed +- Function `*SourceControlsClientListPager.PageResponse` has been removed +- Function `ConfidenceScoreStatus.ToPtr` has been removed +- Function `*ThreatIntelligenceIndicatorModel.GetThreatIntelligenceResourceKind` has been removed +- Function `*WatchlistsClientListPager.Err` has been removed +- Function `*AlertRuleTemplatesClientListPager.PageResponse` has been removed +- Function `ConditionType.ToPtr` has been removed +- Function `*EntitiesRelationsClientListPager.Err` has been removed +- Function `*ThreatIntelligenceResourceKind.GetThreatIntelligenceResourceKind` has been removed +- Struct `ActionsClientCreateOrUpdateResult` has been removed +- Struct `ActionsClientGetResult` has been removed +- Struct `ActionsClientListByAlertRulePager` has been removed +- Struct `ActionsClientListByAlertRuleResult` has been removed +- Struct `AlertRuleTemplatesClientGetResult` has been removed +- Struct `AlertRuleTemplatesClientListPager` has been removed +- Struct `AlertRuleTemplatesClientListResult` has been removed +- Struct `AlertRulesClientCreateOrUpdateResult` has been removed +- Struct `AlertRulesClientGetResult` has been removed +- Struct `AlertRulesClientListPager` has been removed +- Struct `AlertRulesClientListResult` has been removed +- Struct `AutomationRulesClientCreateOrUpdateResult` has been removed +- Struct `AutomationRulesClientDeleteResult` has been removed +- Struct `AutomationRulesClientGetResult` has been removed +- Struct `AutomationRulesClientListPager` has been removed +- Struct `AutomationRulesClientListResult` has been removed +- Struct `AutomationRulesClientManualTriggerPlaybookOptions` has been removed +- Struct `AutomationRulesClientManualTriggerPlaybookResponse` has been removed +- Struct `AutomationRulesClientManualTriggerPlaybookResult` has been removed +- Struct `BookmarkClientExpandResult` has been removed +- Struct `BookmarkRelationsClientCreateOrUpdateResult` has been removed +- Struct `BookmarkRelationsClientGetResult` has been removed +- Struct `BookmarkRelationsClientListPager` has been removed +- Struct `BookmarkRelationsClientListResult` has been removed +- Struct `BookmarksClientCreateOrUpdateResult` has been removed +- Struct `BookmarksClientGetResult` has been removed +- Struct `BookmarksClientListPager` has been removed +- Struct `BookmarksClientListResult` has been removed +- Struct `DataConnectorsCheckRequirementsClientPostResult` has been removed +- Struct `DataConnectorsClientCreateOrUpdateResult` has been removed +- Struct `DataConnectorsClientGetResult` has been removed +- Struct `DataConnectorsClientListPager` has been removed +- Struct `DataConnectorsClientListResult` has been removed +- Struct `DomainWhoisClientGetResult` has been removed +- Struct `EntitiesClientExpandResult` has been removed +- Struct `EntitiesClientGetInsightsResult` has been removed +- Struct `EntitiesClientGetResult` has been removed +- Struct `EntitiesClientListPager` has been removed +- Struct `EntitiesClientListResult` has been removed +- Struct `EntitiesClientQueriesResult` has been removed +- Struct `EntitiesGetTimelineClientListResult` has been removed +- Struct `EntitiesRelationsClientListPager` has been removed +- Struct `EntitiesRelationsClientListResult` has been removed +- Struct `EntityQueriesClientCreateOrUpdateResult` has been removed +- Struct `EntityQueriesClientGetResult` has been removed +- Struct `EntityQueriesClientListPager` has been removed +- Struct `EntityQueriesClientListResult` has been removed +- Struct `EntityQueryTemplatesClientGetResult` has been removed +- Struct `EntityQueryTemplatesClientListPager` has been removed +- Struct `EntityQueryTemplatesClientListResult` has been removed +- Struct `EntityRelationsClientGetRelationResult` has been removed +- Struct `IPGeodataClientGetResult` has been removed +- Struct `IncidentCommentsClientCreateOrUpdateResult` has been removed +- Struct `IncidentCommentsClientGetResult` has been removed +- Struct `IncidentCommentsClientListPager` has been removed +- Struct `IncidentCommentsClientListResult` has been removed +- Struct `IncidentRelationsClientCreateOrUpdateResult` has been removed +- Struct `IncidentRelationsClientGetResult` has been removed +- Struct `IncidentRelationsClientListPager` has been removed +- Struct `IncidentRelationsClientListResult` has been removed +- Struct `IncidentsClientCreateOrUpdateResult` has been removed +- Struct `IncidentsClientCreateTeamResult` has been removed +- Struct `IncidentsClientGetResult` has been removed +- Struct `IncidentsClientListAlertsResult` has been removed +- Struct `IncidentsClientListBookmarksResult` has been removed +- Struct `IncidentsClientListEntitiesResult` has been removed +- Struct `IncidentsClientListPager` has been removed +- Struct `IncidentsClientListResult` has been removed +- Struct `MetadataClientCreateResult` has been removed +- Struct `MetadataClientGetResult` has been removed +- Struct `MetadataClientListPager` has been removed +- Struct `MetadataClientListResult` has been removed +- Struct `MetadataClientUpdateResult` has been removed +- Struct `OfficeConsentsClientGetResult` has been removed +- Struct `OfficeConsentsClientListPager` has been removed +- Struct `OfficeConsentsClientListResult` has been removed +- Struct `OperationsClientListPager` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `ProductSettingsClientGetResult` has been removed +- Struct `ProductSettingsClientListResult` has been removed +- Struct `ProductSettingsClientUpdateResult` has been removed +- Struct `QueryBasedAlertRuleProperties` has been removed +- Struct `SentinelOnboardingStatesClientCreateResult` has been removed +- Struct `SentinelOnboardingStatesClientGetResult` has been removed +- Struct `SentinelOnboardingStatesClientListResult` has been removed +- Struct `SourceControlClientListRepositoriesPager` has been removed +- Struct `SourceControlClientListRepositoriesResult` has been removed +- Struct `SourceControlsClientCreateResult` has been removed +- Struct `SourceControlsClientGetResult` has been removed +- Struct `SourceControlsClientListPager` has been removed +- Struct `SourceControlsClientListResult` has been removed +- Struct `ThreatIntelligenceIndicatorClientCreateIndicatorResult` has been removed +- Struct `ThreatIntelligenceIndicatorClientCreateResult` has been removed +- Struct `ThreatIntelligenceIndicatorClientGetResult` has been removed +- Struct `ThreatIntelligenceIndicatorClientQueryIndicatorsPager` has been removed +- Struct `ThreatIntelligenceIndicatorClientQueryIndicatorsResult` has been removed +- Struct `ThreatIntelligenceIndicatorClientReplaceTagsResult` has been removed +- Struct `ThreatIntelligenceIndicatorMetricsClientListResult` has been removed +- Struct `ThreatIntelligenceIndicatorModelForRequestBody` has been removed +- Struct `ThreatIntelligenceIndicatorsClientListPager` has been removed +- Struct `ThreatIntelligenceIndicatorsClientListResult` has been removed +- Struct `ThreatIntelligenceResourceKind` has been removed +- Struct `WatchlistItemsClientCreateOrUpdateResult` has been removed +- Struct `WatchlistItemsClientGetResult` has been removed +- Struct `WatchlistItemsClientListPager` has been removed +- Struct `WatchlistItemsClientListResult` has been removed +- Struct `WatchlistsClientCreateOrUpdateResult` has been removed +- Struct `WatchlistsClientGetResult` has been removed +- Struct `WatchlistsClientListPager` has been removed +- Struct `WatchlistsClientListResult` has been removed +- Field `SourceControlsClientListResult` of struct `SourceControlsClientListResponse` has been removed +- Field `RawResponse` of struct `SourceControlsClientListResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorClientDeleteResponse` has been removed +- Field `AlertRulesClientListResult` of struct `AlertRulesClientListResponse` has been removed +- Field `RawResponse` of struct `AlertRulesClientListResponse` has been removed +- Field `RawResponse` of struct `EntityQueriesClientDeleteResponse` has been removed +- Field `SourceControlsClientGetResult` of struct `SourceControlsClientGetResponse` has been removed +- Field `RawResponse` of struct `SourceControlsClientGetResponse` has been removed +- Field `DataConnectorsClientGetResult` of struct `DataConnectorsClientGetResponse` has been removed +- Field `RawResponse` of struct `DataConnectorsClientGetResponse` has been removed +- Field `EntityQueriesClientCreateOrUpdateResult` of struct `EntityQueriesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `EntityQueriesClientCreateOrUpdateResponse` has been removed +- Field `IncidentCommentsClientGetResult` of struct `IncidentCommentsClientGetResponse` has been removed +- Field `RawResponse` of struct `IncidentCommentsClientGetResponse` has been removed +- Field `OfficeConsentsClientGetResult` of struct `OfficeConsentsClientGetResponse` has been removed +- Field `RawResponse` of struct `OfficeConsentsClientGetResponse` has been removed +- Field `IsEnabled` of struct `EntityAnalyticsProperties` has been removed +- Field `RawResponse` of struct `BookmarksClientDeleteResponse` has been removed +- Field `DomainWhoisClientGetResult` of struct `DomainWhoisClientGetResponse` has been removed +- Field `RawResponse` of struct `DomainWhoisClientGetResponse` has been removed +- Field `IncidentRelationsClientGetResult` of struct `IncidentRelationsClientGetResponse` has been removed +- Field `RawResponse` of struct `IncidentRelationsClientGetResponse` has been removed +- Field `MetadataClientCreateResult` of struct `MetadataClientCreateResponse` has been removed +- Field `RawResponse` of struct `MetadataClientCreateResponse` has been removed +- Field `OfficeConsentsClientListResult` of struct `OfficeConsentsClientListResponse` has been removed +- Field `RawResponse` of struct `OfficeConsentsClientListResponse` has been removed +- Field `SourceControlsClientCreateResult` of struct `SourceControlsClientCreateResponse` has been removed +- Field `RawResponse` of struct `SourceControlsClientCreateResponse` has been removed +- Field `IncidentCommentsClientListResult` of struct `IncidentCommentsClientListResponse` has been removed +- Field `RawResponse` of struct `IncidentCommentsClientListResponse` has been removed +- Field `RawResponse` of struct `DataConnectorsClientConnectResponse` has been removed +- Field `RawResponse` of struct `MetadataClientDeleteResponse` has been removed +- Field `EntityQueriesClientListResult` of struct `EntityQueriesClientListResponse` has been removed +- Field `RawResponse` of struct `EntityQueriesClientListResponse` has been removed +- Field `IncidentRelationsClientCreateOrUpdateResult` of struct `IncidentRelationsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `IncidentRelationsClientCreateOrUpdateResponse` has been removed +- Field `EntityQueryTemplatesClientGetResult` of struct `EntityQueryTemplatesClientGetResponse` has been removed +- Field `RawResponse` of struct `EntityQueryTemplatesClientGetResponse` has been removed +- Field `EntityRelationsClientGetRelationResult` of struct `EntityRelationsClientGetRelationResponse` has been removed +- Field `RawResponse` of struct `EntityRelationsClientGetRelationResponse` has been removed +- Field `WatchlistItemsCount` of struct `WatchlistProperties` has been removed +- Field `IncidentsClientCreateOrUpdateResult` of struct `IncidentsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientCreateOrUpdateResponse` has been removed +- Field `SentinelOnboardingStatesClientGetResult` of struct `SentinelOnboardingStatesClientGetResponse` has been removed +- Field `RawResponse` of struct `SentinelOnboardingStatesClientGetResponse` has been removed +- Field `WatchlistsClientGetResult` of struct `WatchlistsClientGetResponse` has been removed +- Field `RawResponse` of struct `WatchlistsClientGetResponse` has been removed +- Field `BookmarksClientGetResult` of struct `BookmarksClientGetResponse` has been removed +- Field `RawResponse` of struct `BookmarksClientGetResponse` has been removed +- Field `EntitiesGetTimelineClientListResult` of struct `EntitiesGetTimelineClientListResponse` has been removed +- Field `RawResponse` of struct `EntitiesGetTimelineClientListResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientDeleteResponse` has been removed +- Field `AlertRuleTemplatesClientGetResult` of struct `AlertRuleTemplatesClientGetResponse` has been removed +- Field `RawResponse` of struct `AlertRuleTemplatesClientGetResponse` has been removed +- Field `IncidentsClientListEntitiesResult` of struct `IncidentsClientListEntitiesResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientListEntitiesResponse` has been removed +- Field `ProductSettingsClientUpdateResult` of struct `ProductSettingsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ProductSettingsClientUpdateResponse` has been removed +- Field `ThreatIntelligenceIndicatorClientCreateIndicatorResult` of struct `ThreatIntelligenceIndicatorClientCreateIndicatorResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorClientCreateIndicatorResponse` has been removed +- Field `ThreatIntelligenceIndicatorClientQueryIndicatorsResult` of struct `ThreatIntelligenceIndicatorClientQueryIndicatorsResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorClientQueryIndicatorsResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorClientAppendTagsResponse` has been removed +- Field `SentinelOnboardingStatesClientListResult` of struct `SentinelOnboardingStatesClientListResponse` has been removed +- Field `RawResponse` of struct `SentinelOnboardingStatesClientListResponse` has been removed +- Field `IncidentRelationsClientListResult` of struct `IncidentRelationsClientListResponse` has been removed +- Field `RawResponse` of struct `IncidentRelationsClientListResponse` has been removed +- Field `RawResponse` of struct `DataConnectorsClientDeleteResponse` has been removed +- Field `AlertRulesClientGetResult` of struct `AlertRulesClientGetResponse` has been removed +- Field `RawResponse` of struct `AlertRulesClientGetResponse` has been removed +- Field `EntitiesRelationsClientListResult` of struct `EntitiesRelationsClientListResponse` has been removed +- Field `RawResponse` of struct `EntitiesRelationsClientListResponse` has been removed +- Field `WatchlistItemsClientCreateOrUpdateResult` of struct `WatchlistItemsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `WatchlistItemsClientCreateOrUpdateResponse` has been removed +- Field `AutomationRulesClientDeleteResult` of struct `AutomationRulesClientDeleteResponse` has been removed +- Field `RawResponse` of struct `AutomationRulesClientDeleteResponse` has been removed +- Field `IncidentsClientListBookmarksResult` of struct `IncidentsClientListBookmarksResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientListBookmarksResponse` has been removed +- Field `BookmarkRelationsClientListResult` of struct `BookmarkRelationsClientListResponse` has been removed +- Field `RawResponse` of struct `BookmarkRelationsClientListResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `IncidentsClientListResult` of struct `IncidentsClientListResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientListResponse` has been removed +- Field `DataConnectorsClientCreateOrUpdateResult` of struct `DataConnectorsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `DataConnectorsClientCreateOrUpdateResponse` has been removed +- Field `MetadataClientUpdateResult` of struct `MetadataClientUpdateResponse` has been removed +- Field `RawResponse` of struct `MetadataClientUpdateResponse` has been removed +- Field `BookmarkRelationsClientCreateOrUpdateResult` of struct `BookmarkRelationsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `BookmarkRelationsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `BookmarkRelationsClientDeleteResponse` has been removed +- Field `RawResponse` of struct `WatchlistItemsClientDeleteResponse` has been removed +- Field `BookmarksClientCreateOrUpdateResult` of struct `BookmarksClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `BookmarksClientCreateOrUpdateResponse` has been removed +- Field `IncidentsClientGetResult` of struct `IncidentsClientGetResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientGetResponse` has been removed +- Field `RawResponse` of struct `SentinelOnboardingStatesClientDeleteResponse` has been removed +- Field `EntitiesClientExpandResult` of struct `EntitiesClientExpandResponse` has been removed +- Field `RawResponse` of struct `EntitiesClientExpandResponse` has been removed +- Field `EntitiesClientGetResult` of struct `EntitiesClientGetResponse` has been removed +- Field `RawResponse` of struct `EntitiesClientGetResponse` has been removed +- Field `ProductSettingsClientGetResult` of struct `ProductSettingsClientGetResponse` has been removed +- Field `RawResponse` of struct `ProductSettingsClientGetResponse` has been removed +- Field `ProductSettingsClientListResult` of struct `ProductSettingsClientListResponse` has been removed +- Field `RawResponse` of struct `ProductSettingsClientListResponse` has been removed +- Field `RawResponse` of struct `IncidentCommentsClientDeleteResponse` has been removed +- Field `EntitiesClientListResult` of struct `EntitiesClientListResponse` has been removed +- Field `RawResponse` of struct `EntitiesClientListResponse` has been removed +- Field `WatchlistItemsClientListResult` of struct `WatchlistItemsClientListResponse` has been removed +- Field `RawResponse` of struct `WatchlistItemsClientListResponse` has been removed +- Field `RawResponse` of struct `ActionsClientDeleteResponse` has been removed +- Field `ThreatIntelligenceIndicatorsClientListResult` of struct `ThreatIntelligenceIndicatorsClientListResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorsClientListResponse` has been removed +- Field `RawResponse` of struct `ProductSettingsClientDeleteResponse` has been removed +- Field `EntityQueryTemplatesClientListResult` of struct `EntityQueryTemplatesClientListResponse` has been removed +- Field `RawResponse` of struct `EntityQueryTemplatesClientListResponse` has been removed +- Field `BookmarkClientExpandResult` of struct `BookmarkClientExpandResponse` has been removed +- Field `RawResponse` of struct `BookmarkClientExpandResponse` has been removed +- Field `AutomationRulesClientListResult` of struct `AutomationRulesClientListResponse` has been removed +- Field `RawResponse` of struct `AutomationRulesClientListResponse` has been removed +- Field `EntitiesClientQueriesResult` of struct `EntitiesClientQueriesResponse` has been removed +- Field `RawResponse` of struct `EntitiesClientQueriesResponse` has been removed +- Field `BookmarkRelationsClientGetResult` of struct `BookmarkRelationsClientGetResponse` has been removed +- Field `RawResponse` of struct `BookmarkRelationsClientGetResponse` has been removed +- Field `IncidentCommentsClientCreateOrUpdateResult` of struct `IncidentCommentsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `IncidentCommentsClientCreateOrUpdateResponse` has been removed +- Field `WatchlistItemsClientGetResult` of struct `WatchlistItemsClientGetResponse` has been removed +- Field `RawResponse` of struct `WatchlistItemsClientGetResponse` has been removed +- Field `ThreatIntelligenceIndicatorClientCreateResult` of struct `ThreatIntelligenceIndicatorClientCreateResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorClientCreateResponse` has been removed +- Field `MetadataClientListResult` of struct `MetadataClientListResponse` has been removed +- Field `RawResponse` of struct `MetadataClientListResponse` has been removed +- Field `ActionsClientGetResult` of struct `ActionsClientGetResponse` has been removed +- Field `RawResponse` of struct `ActionsClientGetResponse` has been removed +- Field `RawResponse` of struct `OfficeConsentsClientDeleteResponse` has been removed +- Field `MetadataClientGetResult` of struct `MetadataClientGetResponse` has been removed +- Field `RawResponse` of struct `MetadataClientGetResponse` has been removed +- Field `IncidentsClientListAlertsResult` of struct `IncidentsClientListAlertsResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientListAlertsResponse` has been removed +- Field `ThreatIntelligenceIndicatorClientReplaceTagsResult` of struct `ThreatIntelligenceIndicatorClientReplaceTagsResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorClientReplaceTagsResponse` has been removed +- Field `ActionsClientCreateOrUpdateResult` of struct `ActionsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ActionsClientCreateOrUpdateResponse` has been removed +- Field `DataConnectorsClientListResult` of struct `DataConnectorsClientListResponse` has been removed +- Field `RawResponse` of struct `DataConnectorsClientListResponse` has been removed +- Field `IPGeodataClientGetResult` of struct `IPGeodataClientGetResponse` has been removed +- Field `RawResponse` of struct `IPGeodataClientGetResponse` has been removed +- Field `WatchlistsClientListResult` of struct `WatchlistsClientListResponse` has been removed +- Field `RawResponse` of struct `WatchlistsClientListResponse` has been removed +- Field `BookmarksClientListResult` of struct `BookmarksClientListResponse` has been removed +- Field `RawResponse` of struct `BookmarksClientListResponse` has been removed +- Field `AlertRulesClientCreateOrUpdateResult` of struct `AlertRulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `AlertRulesClientCreateOrUpdateResponse` has been removed +- Field `ThreatIntelligenceIndicatorMetricsClientListResult` of struct `ThreatIntelligenceIndicatorMetricsClientListResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorMetricsClientListResponse` has been removed +- Field `RawResponse` of struct `DataConnectorsClientDisconnectResponse` has been removed +- Field `EntitiesClientGetInsightsResult` of struct `EntitiesClientGetInsightsResponse` has been removed +- Field `RawResponse` of struct `EntitiesClientGetInsightsResponse` has been removed +- Field `RawResponse` of struct `AlertRulesClientDeleteResponse` has been removed +- Field `RawResponse` of struct `IncidentRelationsClientDeleteResponse` has been removed +- Field `DataConnectorsCheckRequirementsClientPostResult` of struct `DataConnectorsCheckRequirementsClientPostResponse` has been removed +- Field `RawResponse` of struct `DataConnectorsCheckRequirementsClientPostResponse` has been removed +- Field `SentinelOnboardingStatesClientCreateResult` of struct `SentinelOnboardingStatesClientCreateResponse` has been removed +- Field `RawResponse` of struct `SentinelOnboardingStatesClientCreateResponse` has been removed +- Field `WatchlistsClientCreateOrUpdateResult` of struct `WatchlistsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `WatchlistsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `WatchlistsClientDeleteResponse` has been removed +- Field `RawResponse` of struct `SourceControlsClientDeleteResponse` has been removed +- Field `AutomationRulesClientGetResult` of struct `AutomationRulesClientGetResponse` has been removed +- Field `RawResponse` of struct `AutomationRulesClientGetResponse` has been removed +- Field `ThreatIntelligenceIndicatorClientGetResult` of struct `ThreatIntelligenceIndicatorClientGetResponse` has been removed +- Field `RawResponse` of struct `ThreatIntelligenceIndicatorClientGetResponse` has been removed +- Field `SourceControlClientListRepositoriesResult` of struct `SourceControlClientListRepositoriesResponse` has been removed +- Field `RawResponse` of struct `SourceControlClientListRepositoriesResponse` has been removed +- Field `ActionsClientListByAlertRuleResult` of struct `ActionsClientListByAlertRuleResponse` has been removed +- Field `RawResponse` of struct `ActionsClientListByAlertRuleResponse` has been removed +- Field `AlertRuleTemplatesClientListResult` of struct `AlertRuleTemplatesClientListResponse` has been removed +- Field `RawResponse` of struct `AlertRuleTemplatesClientListResponse` has been removed +- Field `AutomationRulesClientCreateOrUpdateResult` of struct `AutomationRulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `AutomationRulesClientCreateOrUpdateResponse` has been removed +- Field `EntityQueriesClientGetResult` of struct `EntityQueriesClientGetResponse` has been removed +- Field `RawResponse` of struct `EntityQueriesClientGetResponse` has been removed +- Field `IncidentsClientCreateTeamResult` of struct `IncidentsClientCreateTeamResponse` has been removed +- Field `RawResponse` of struct `IncidentsClientCreateTeamResponse` has been removed + +### Features Added + +- New const `VersionV1` +- New const `SourceTypeRemoteStorage` +- New const `DeploymentResultCanceled` +- New const `EntityProvidersActiveDirectory` +- New const `IncidentLabelTypeAutoAssigned` +- New const `DeploymentStateQueued` +- New const `DeploymentStateInProgress` +- New const `DeploymentFetchStatusUnauthorized` +- New const `VersionV2` +- New const `KindAzureFunction` +- New const `KindAutomationRule` +- New const `DeploymentFetchStatusNotFound` +- New const `DeploymentFetchStatusSuccess` +- New const `DeploymentStateCompleted` +- New const `DeploymentResultSuccess` +- New const `SourceTypeLocalFile` +- New const `DeploymentResultFailed` +- New const `EntityProvidersAzureActiveDirectory` +- New const `DeploymentStateCanceling` +- New const `KindLogicAppsCustomConnector` +- New const `DataConnectorKindIOT` +- New function `*ProductSettingsClientUpdateResponse.UnmarshalJSON([]byte) error` +- New function `ScheduledAlertRuleCommonProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleDeploymentResultValues() []DeploymentResult` +- New function `*ThreatIntelligenceIndicatorClientCreateResponse.UnmarshalJSON([]byte) error` +- New function `*IoTDataConnector.UnmarshalJSON([]byte) error` +- New function `*EntitiesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `*DataConnectorsClientGetResponse.UnmarshalJSON([]byte) error` +- New function `*DataConnectorsClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New function `*EntityQueriesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `*EntityQueriesClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New function `EntityAnalyticsProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleVersionValues() []Version` +- New function `*IncidentsClient.RunPlaybook(context.Context, string, string, string, *IncidentsClientRunPlaybookOptions) (IncidentsClientRunPlaybookResponse, error)` +- New function `*IoTCheckRequirements.UnmarshalJSON([]byte) error` +- New function `*Deployment.UnmarshalJSON([]byte) error` +- New function `IoTDataConnector.MarshalJSON() ([]byte, error)` +- New function `*ThreatIntelligenceIndicatorClientCreateIndicatorResponse.UnmarshalJSON([]byte) error` +- New function `*AlertRuleTemplatesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `*AlertRulesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `PossibleEntityProvidersValues() []EntityProviders` +- New function `PossibleDeploymentFetchStatusValues() []DeploymentFetchStatus` +- New function `*ThreatIntelligenceIndicatorClientReplaceTagsResponse.UnmarshalJSON([]byte) error` +- New function `*IoTDataConnector.GetDataConnector() *DataConnector` +- New function `*ThreatIntelligenceIndicatorClientGetResponse.UnmarshalJSON([]byte) error` +- New function `IoTCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*IoTCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `PossibleDeploymentStateValues() []DeploymentState` +- New function `*ProductSettingsClientGetResponse.UnmarshalJSON([]byte) error` +- New function `PossibleSourceTypeValues() []SourceType` +- New function `Deployment.MarshalJSON() ([]byte, error)` +- New function `*EntityQueryTemplatesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `*AlertRulesClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New struct `AzureDevOpsResourceInfo` +- New struct `CloudError` +- New struct `CloudErrorBody` +- New struct `Deployment` +- New struct `DeploymentInfo` +- New struct `GitHubResourceInfo` +- New struct `IncidentsClientRunPlaybookOptions` +- New struct `IncidentsClientRunPlaybookResponse` +- New struct `IoTCheckRequirements` +- New struct `IoTCheckRequirementsProperties` +- New struct `IoTDataConnector` +- New struct `IoTDataConnectorProperties` +- New struct `RepositoryResourceInfo` +- New struct `SKU` +- New struct `Webhook` +- New anonymous field `Relation` in struct `IncidentRelationsClientCreateOrUpdateResponse` +- New anonymous field `SettingsClassification` in struct `ProductSettingsClientGetResponse` +- New anonymous field `EntityQueryList` in struct `EntityQueriesClientListResponse` +- New anonymous field `WatchlistItemList` in struct `WatchlistItemsClientListResponse` +- New anonymous field `DataConnectorList` in struct `DataConnectorsClientListResponse` +- New anonymous field `RelationList` in struct `EntitiesRelationsClientListResponse` +- New anonymous field `IncidentAlertList` in struct `IncidentsClientListAlertsResponse` +- New anonymous field `ThreatIntelligenceInformationList` in struct `ThreatIntelligenceIndicatorsClientListResponse` +- New anonymous field `RelationList` in struct `IncidentRelationsClientListResponse` +- New anonymous field `Relation` in struct `BookmarkRelationsClientGetResponse` +- New anonymous field `ThreatIntelligenceInformationList` in struct `ThreatIntelligenceIndicatorClientQueryIndicatorsResponse` +- New anonymous field `IncidentComment` in struct `IncidentCommentsClientCreateOrUpdateResponse` +- New anonymous field `EnrichmentIPGeodata` in struct `IPGeodataClientGetResponse` +- New anonymous field `WatchlistList` in struct `WatchlistsClientListResponse` +- New field `LastDeploymentInfo` in struct `SourceControlProperties` +- New field `Version` in struct `SourceControlProperties` +- New field `RepositoryResourceInfo` in struct `SourceControlProperties` +- New anonymous field `EntityExpandResponse` in struct `EntitiesClientExpandResponse` +- New anonymous field `ThreatIntelligenceInformationClassification` in struct `ThreatIntelligenceIndicatorClientGetResponse` +- New anonymous field `MetadataModel` in struct `MetadataClientGetResponse` +- New anonymous field `Watchlist` in struct `WatchlistsClientGetResponse` +- New anonymous field `TeamInformation` in struct `IncidentsClientCreateTeamResponse` +- New anonymous field `IncidentComment` in struct `IncidentCommentsClientGetResponse` +- New anonymous field `BookmarkList` in struct `BookmarksClientListResponse` +- New anonymous field `SourceControl` in struct `SourceControlsClientGetResponse` +- New anonymous field `Incident` in struct `IncidentsClientCreateOrUpdateResponse` +- New anonymous field `AutomationRule` in struct `AutomationRulesClientCreateOrUpdateResponse` +- New anonymous field `IncidentEntitiesResponse` in struct `IncidentsClientListEntitiesResponse` +- New anonymous field `AlertRuleClassification` in struct `AlertRulesClientCreateOrUpdateResponse` +- New field `AzureAsyncOperation` in struct `WatchlistsClientDeleteResponse` +- New anonymous field `Watchlist` in struct `WatchlistsClientCreateOrUpdateResponse` +- New field `AzureAsyncOperation` in struct `WatchlistsClientCreateOrUpdateResponse` +- New anonymous field `SentinelOnboardingState` in struct `SentinelOnboardingStatesClientGetResponse` +- New anonymous field `IncidentCommentList` in struct `IncidentCommentsClientListResponse` +- New anonymous field `EntityTimelineResponse` in struct `EntitiesGetTimelineClientListResponse` +- New field `EntityProviders` in struct `EntityAnalyticsProperties` +- New anonymous field `OperationsList` in struct `OperationsClientListResponse` +- New anonymous field `ActionsList` in struct `ActionsClientListByAlertRuleResponse` +- New anonymous field `MetadataList` in struct `MetadataClientListResponse` +- New anonymous field `ThreatIntelligenceMetricsList` in struct `ThreatIntelligenceIndicatorMetricsClientListResponse` +- New anonymous field `ActionResponse` in struct `ActionsClientCreateOrUpdateResponse` +- New anonymous field `DataConnectorRequirementsState` in struct `DataConnectorsCheckRequirementsClientPostResponse` +- New anonymous field `DataConnectorClassification` in struct `DataConnectorsClientGetResponse` +- New anonymous field `AlertRuleTemplatesList` in struct `AlertRuleTemplatesClientListResponse` +- New anonymous field `IncidentList` in struct `IncidentsClientListResponse` +- New anonymous field `AlertRulesList` in struct `AlertRulesClientListResponse` +- New anonymous field `SourceControl` in struct `SourceControlsClientCreateResponse` +- New field `CustomVersion` in struct `MetadataProperties` +- New field `PreviewImagesDark` in struct `MetadataProperties` +- New field `ContentSchemaVersion` in struct `MetadataProperties` +- New field `PreviewImages` in struct `MetadataProperties` +- New field `ThreatAnalysisTactics` in struct `MetadataProperties` +- New field `ThreatAnalysisTechniques` in struct `MetadataProperties` +- New field `Icon` in struct `MetadataProperties` +- New anonymous field `EntityList` in struct `EntitiesClientListResponse` +- New anonymous field `IncidentBookmarkList` in struct `IncidentsClientListBookmarksResponse` +- New anonymous field `MetadataModel` in struct `MetadataClientUpdateResponse` +- New anonymous field `AutomationRule` in struct `AutomationRulesClientGetResponse` +- New anonymous field `RepoList` in struct `SourceControlClientListRepositoriesResponse` +- New anonymous field `EntityQueryClassification` in struct `EntityQueriesClientCreateOrUpdateResponse` +- New field `SourceType` in struct `WatchlistProperties` +- New anonymous field `Bookmark` in struct `BookmarksClientGetResponse` +- New anonymous field `Bookmark` in struct `BookmarksClientCreateOrUpdateResponse` +- New anonymous field `ThreatIntelligenceInformationClassification` in struct `ThreatIntelligenceIndicatorClientCreateIndicatorResponse` +- New field `PreviewImagesDark` in struct `MetadataPropertiesPatch` +- New field `ThreatAnalysisTechniques` in struct `MetadataPropertiesPatch` +- New field `CustomVersion` in struct `MetadataPropertiesPatch` +- New field `ContentSchemaVersion` in struct `MetadataPropertiesPatch` +- New field `Icon` in struct `MetadataPropertiesPatch` +- New field `PreviewImages` in struct `MetadataPropertiesPatch` +- New field `ThreatAnalysisTactics` in struct `MetadataPropertiesPatch` +- New anonymous field `Relation` in struct `BookmarkRelationsClientCreateOrUpdateResponse` +- New anonymous field `OfficeConsentList` in struct `OfficeConsentsClientListResponse` +- New anonymous field `ThreatIntelligenceInformationClassification` in struct `ThreatIntelligenceIndicatorClientCreateResponse` +- New field `SkipToken` in struct `WatchlistItemsClientListOptions` +- New field `SkipToken` in struct `WatchlistsClientListOptions` +- New anonymous field `EntityQueryTemplateList` in struct `EntityQueryTemplatesClientListResponse` +- New anonymous field `WatchlistItem` in struct `WatchlistItemsClientGetResponse` +- New anonymous field `EntityGetInsightsResponse` in struct `EntitiesClientGetInsightsResponse` +- New anonymous field `ThreatIntelligenceInformationClassification` in struct `ThreatIntelligenceIndicatorClientReplaceTagsResponse` +- New anonymous field `AlertRuleClassification` in struct `AlertRulesClientGetResponse` +- New anonymous field `RelationList` in struct `BookmarkRelationsClientListResponse` +- New anonymous field `SentinelOnboardingState` in struct `SentinelOnboardingStatesClientCreateResponse` +- New anonymous field `AlertRuleTemplateClassification` in struct `AlertRuleTemplatesClientGetResponse` +- New anonymous field `Relation` in struct `IncidentRelationsClientGetResponse` +- New field `EntityMappings` in struct `ScheduledAlertRuleCommonProperties` +- New field `Severity` in struct `ScheduledAlertRuleCommonProperties` +- New field `AlertDetailsOverride` in struct `ScheduledAlertRuleCommonProperties` +- New field `CustomDetails` in struct `ScheduledAlertRuleCommonProperties` +- New field `Query` in struct `ScheduledAlertRuleCommonProperties` +- New anonymous field `EnrichmentDomainWhois` in struct `DomainWhoisClientGetResponse` +- New anonymous field `AutomationRulesList` in struct `AutomationRulesClientListResponse` +- New anonymous field `EntityQueryTemplateClassification` in struct `EntityQueryTemplatesClientGetResponse` +- New anonymous field `OfficeConsent` in struct `OfficeConsentsClientGetResponse` +- New anonymous field `SettingsClassification` in struct `ProductSettingsClientUpdateResponse` +- New anonymous field `MetadataModel` in struct `MetadataClientCreateResponse` +- New anonymous field `GetQueriesResponse` in struct `EntitiesClientQueriesResponse` +- New anonymous field `DataConnectorClassification` in struct `DataConnectorsClientCreateOrUpdateResponse` +- New anonymous field `WatchlistItem` in struct `WatchlistItemsClientCreateOrUpdateResponse` +- New field `Interface` in struct `AutomationRulesClientDeleteResponse` +- New anonymous field `EntityQueryClassification` in struct `EntityQueriesClientGetResponse` +- New anonymous field `ActionResponse` in struct `ActionsClientGetResponse` +- New anonymous field `EntityClassification` in struct `EntitiesClientGetResponse` +- New anonymous field `Incident` in struct `IncidentsClientGetResponse` +- New anonymous field `SourceControlList` in struct `SourceControlsClientListResponse` +- New anonymous field `SettingList` in struct `ProductSettingsClientListResponse` +- New anonymous field `SentinelOnboardingStatesList` in struct `SentinelOnboardingStatesClientListResponse` +- New anonymous field `Relation` in struct `EntityRelationsClientGetRelationResponse` +- New anonymous field `BookmarkExpandResponse` in struct `BookmarkClientExpandResponse` + + ## 0.1.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md b/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md index 4f619c03fccb..cd7d534fa4e7 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/b4d04639424e84aa9aa60e00255ff1c82167f090/specification/securityinsights/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/b4d04639424e84aa9aa60e00255ff1c82167f090/specification/securityinsights/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/securityinsights/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/securityinsights/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.1.1 +module-version: 0.2.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/go.mod b/sdk/resourcemanager/securityinsights/armsecurityinsights/go.mod index 08b90f5d8c93..bb914f62f89d 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/go.mod +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/go.mod @@ -1,8 +1,11 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights -go 1.16 +go 1.18 + +require github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1 + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + golang.org/x/net v0.0.0-20210610132358-84b48f89b13b // indirect + golang.org/x/text v0.3.6 // indirect ) diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/go.sum b/sdk/resourcemanager/securityinsights/armsecurityinsights/go.sum index 27c9bd79d559..a7eaa30576c1 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/go.sum +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/go.sum @@ -1,29 +1,11 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1 h1:RxemzI2cHD0A8WyMqHu/UnDjfpGES/cmjtPbQoktWqs= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.1/go.mod h1:+nVKciyKD2J9TyVcEQ82Bo9b+3F92PiQfHrIE/zqLqM= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -31,32 +13,20 @@ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5Cc github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNmw2api+jEfxLoykJVice/E= -golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210610132358-84b48f89b13b h1:k+E048sYJHyVnsr1GDrRZWQ32D2C7lWs9JRc0bel53A= golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_actions_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_actions_client_test.go deleted file mode 100644 index d78e851af9d4..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_actions_client_test.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/actions/GetAllActionsByAlertRule.json -func ExampleActionsClient_ListByAlertRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewActionsClient("", cred, nil) - pager := client.ListByAlertRule("", - "", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/actions/GetActionOfAlertRuleById.json -func ExampleActionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewActionsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ActionsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/actions/CreateActionOfAlertRule.json -func ExampleActionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewActionsClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - "", - armsecurityinsights.ActionRequest{ - Etag: to.StringPtr(""), - Properties: &armsecurityinsights.ActionRequestProperties{ - LogicAppResourceID: to.StringPtr(""), - TriggerURI: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ActionsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/actions/DeleteActionOfAlertRule.json -func ExampleActionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewActionsClient("", cred, nil) - _, err = client.Delete(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertrules_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertrules_client_test.go deleted file mode 100644 index ec95a1e400d8..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertrules_client_test.go +++ /dev/null @@ -1,334 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/alertRules/GetAllAlertRules.json -func ExampleAlertRulesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAlertRulesClient("", cred, nil) - pager := client.List("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/alertRules/GetFusionAlertRule.json -func ExampleAlertRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAlertRulesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AlertRulesClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.json -func ExampleAlertRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAlertRulesClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - &armsecurityinsights.FusionAlertRule{ - Etag: to.StringPtr(""), - Kind: armsecurityinsights.AlertRuleKind("Fusion").ToPtr(), - Properties: &armsecurityinsights.FusionAlertRuleProperties{ - AlertRuleTemplateName: to.StringPtr(""), - Enabled: to.BoolPtr(true), - SourceSettings: []*armsecurityinsights.FusionSourceSettings{ - { - Enabled: to.BoolPtr(true), - SourceName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SourceName: to.StringPtr(""), - SourceSubTypes: []*armsecurityinsights.FusionSourceSubTypeSetting{ - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }, - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ - Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("High").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Medium").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Low").ToPtr(), - }, - { - Enabled: to.BoolPtr(true), - Severity: armsecurityinsights.AlertSeverity("Informational").ToPtr(), - }}, - }, - SourceSubTypeName: to.StringPtr(""), - }}, - }, - { - Enabled: to.BoolPtr(true), - SourceName: to.StringPtr(""), - SourceSubTypes: []*armsecurityinsights.FusionSourceSubTypeSetting{ - { - Enabled: to.BoolPtr(true), - SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{}, - SourceSubTypeName: to.StringPtr(""), - }}, - }}, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AlertRulesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/alertRules/DeleteAlertRule.json -func ExampleAlertRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAlertRulesClient("", cred, nil) - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertruletemplates_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertruletemplates_client_test.go deleted file mode 100644 index b539634c172a..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertruletemplates_client_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json -func ExampleAlertRuleTemplatesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAlertRuleTemplatesClient("", cred, nil) - pager := client.List("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json -func ExampleAlertRuleTemplatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAlertRuleTemplatesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AlertRuleTemplatesClientGetResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_automationrules_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_automationrules_client_test.go deleted file mode 100644 index e7ca7cdf8642..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_automationrules_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/automationRules/AutomationRules_Get.json -func ExampleAutomationRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAutomationRulesClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AutomationRulesClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/automationRules/AutomationRules_CreateOrUpdate.json -func ExampleAutomationRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAutomationRulesClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - &armsecurityinsights.AutomationRulesClientCreateOrUpdateOptions{AutomationRuleToUpsert: nil}) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AutomationRulesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/automationRules/AutomationRules_Delete.json -func ExampleAutomationRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAutomationRulesClient("", cred, nil) - res, err := client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.AutomationRulesClientDeleteResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/automationRules/AutomationRules_List.json -func ExampleAutomationRulesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAutomationRulesClient("", cred, nil) - pager := client.List("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/manualTrigger/AutomationRules_ManualTriggerPlaybook.json -func ExampleAutomationRulesClient_ManualTriggerPlaybook() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewAutomationRulesClient("", cred, nil) - _, err = client.ManualTriggerPlaybook(ctx, - "", - "", - "", - &armsecurityinsights.AutomationRulesClientManualTriggerPlaybookOptions{RequestBody: nil}) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmark_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmark_client_test.go deleted file mode 100644 index cd972422f602..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmark_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/expand/PostExpandBookmark.json -func ExampleBookmarkClient_Expand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarkClient("", cred, nil) - res, err := client.Expand(ctx, - "", - "", - "", - armsecurityinsights.BookmarkExpandParameters{ - EndTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-24T17:21:00.000Z"); return t }()), - ExpansionID: to.StringPtr(""), - StartTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-25T17:21:00.000Z"); return t }()), - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.BookmarkClientExpandResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarkrelations_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarkrelations_client_test.go deleted file mode 100644 index 6835fbbb9053..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarkrelations_client_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json -func ExampleBookmarkRelationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarkRelationsClient("", cred, nil) - pager := client.List("", - "", - "", - &armsecurityinsights.BookmarkRelationsClientListOptions{Filter: nil, - Orderby: nil, - Top: nil, - SkipToken: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/relations/GetBookmarkRelationByName.json -func ExampleBookmarkRelationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarkRelationsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.BookmarkRelationsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/relations/CreateBookmarkRelation.json -func ExampleBookmarkRelationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarkRelationsClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - "", - armsecurityinsights.Relation{ - Properties: &armsecurityinsights.RelationProperties{ - RelatedResourceID: to.StringPtr(""), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.BookmarkRelationsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/relations/DeleteBookmarkRelation.json -func ExampleBookmarkRelationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarkRelationsClient("", cred, nil) - _, err = client.Delete(ctx, - "", - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarks_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarks_client_test.go deleted file mode 100644 index 53f672d3bcac..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarks_client_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/GetBookmarks.json -func ExampleBookmarksClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarksClient("", cred, nil) - pager := client.List("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/GetBookmarkById.json -func ExampleBookmarksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarksClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.BookmarksClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/CreateBookmark.json -func ExampleBookmarksClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarksClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - armsecurityinsights.Bookmark{ - Etag: to.StringPtr(""), - Properties: &armsecurityinsights.BookmarkProperties{ - Created: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T13:15:30Z"); return t }()), - CreatedBy: &armsecurityinsights.UserInfo{ - ObjectID: to.StringPtr(""), - }, - DisplayName: to.StringPtr(""), - EntityMappings: []*armsecurityinsights.BookmarkEntityMappings{ - { - EntityType: to.StringPtr(""), - FieldMappings: []*armsecurityinsights.EntityFieldMapping{ - { - Identifier: to.StringPtr(""), - Value: to.StringPtr(""), - }}, - }}, - Labels: []*string{ - to.StringPtr("Tag1"), - to.StringPtr("Tag2")}, - Notes: to.StringPtr(""), - Query: to.StringPtr(""), - QueryResult: to.StringPtr(""), - Tactics: []*armsecurityinsights.AttackTactic{ - armsecurityinsights.AttackTactic("Execution").ToPtr()}, - Techniques: []*string{ - to.StringPtr("T1609")}, - Updated: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T13:15:30Z"); return t }()), - UpdatedBy: &armsecurityinsights.UserInfo{ - ObjectID: to.StringPtr(""), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.BookmarksClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/bookmarks/DeleteBookmark.json -func ExampleBookmarksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewBookmarksClient("", cred, nil) - _, err = client.Delete(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectors_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectors_client_test.go deleted file mode 100644 index 236099743e57..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectors_client_test.go +++ /dev/null @@ -1,252 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/dataConnectors/GetDataConnectors.json -func ExampleDataConnectorsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDataConnectorsClient("", cred, nil) - pager := client.List("", - "", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/dataConnectors/GetAPIPolling.json -func ExampleDataConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDataConnectorsClient("", cred, nil) - res, err := client.Get(ctx, - "", - "", - "", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DataConnectorsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/dataConnectors/CreateAPIPolling.json -func ExampleDataConnectorsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDataConnectorsClient("", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "", - "", - "", - &armsecurityinsights.CodelessAPIPollingDataConnector{ - Kind: armsecurityinsights.DataConnectorKind("APIPolling").ToPtr(), - Properties: &armsecurityinsights.APIPollingParameters{ - ConnectorUIConfig: &armsecurityinsights.CodelessUIConnectorConfigProperties{ - Availability: &armsecurityinsights.Availability{ - IsPreview: to.BoolPtr(true), - Status: to.Int32Ptr(1), - }, - ConnectivityCriteria: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem{ - { - Type: armsecurityinsights.ConnectivityType("SentinelKindsV2").ToPtr(), - Value: []*string{}, - }}, - DataTypes: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesDataTypesItem{ - { - Name: to.StringPtr(""), - LastDataReceivedQuery: to.StringPtr(""), - }}, - DescriptionMarkdown: to.StringPtr(""), - GraphQueries: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesGraphQueriesItem{ - { - BaseQuery: to.StringPtr(""), - Legend: to.StringPtr(""), - MetricName: to.StringPtr(""), - }}, - GraphQueriesTableName: to.StringPtr(""), - InstructionSteps: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesInstructionStepsItem{ - { - Description: to.StringPtr(""), - Instructions: []*armsecurityinsights.InstructionStepsInstructionsItem{ - { - Type: armsecurityinsights.SettingType("APIKey").ToPtr(), - Parameters: map[string]interface{}{ - "enable": "true", - "userRequestPlaceHoldersInput": []interface{}{ - map[string]interface{}{ - "displayText": "Organization Name", - "placeHolderName": "{{placeHolder1}}", - "placeHolderValue": "", - "requestObjectKey": "apiEndpoint", - }, - }, - }, - }}, - Title: to.StringPtr(""), - }}, - Permissions: &armsecurityinsights.Permissions{ - Customs: []*armsecurityinsights.PermissionsCustomsItem{ - { - Name: to.StringPtr("<name>"), - Description: to.StringPtr("<description>"), - }}, - ResourceProvider: []*armsecurityinsights.PermissionsResourceProviderItem{ - { - PermissionsDisplayText: to.StringPtr("<permissions-display-text>"), - Provider: armsecurityinsights.ProviderName("Microsoft.OperationalInsights/workspaces").ToPtr(), - ProviderDisplayName: to.StringPtr("<provider-display-name>"), - RequiredPermissions: &armsecurityinsights.RequiredPermissions{ - Delete: to.BoolPtr(true), - Read: to.BoolPtr(true), - Write: to.BoolPtr(true), - }, - Scope: armsecurityinsights.PermissionProviderScope("Workspace").ToPtr(), - }}, - }, - Publisher: to.StringPtr("<publisher>"), - SampleQueries: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesSampleQueriesItem{ - { - Description: to.StringPtr("<description>"), - Query: to.StringPtr("<query>"), - }}, - Title: to.StringPtr("<title>"), - }, - PollingConfig: &armsecurityinsights.CodelessConnectorPollingConfigProperties{ - Auth: &armsecurityinsights.CodelessConnectorPollingAuthProperties{ - APIKeyIdentifier: to.StringPtr("<apikey-identifier>"), - APIKeyName: to.StringPtr("<apikey-name>"), - AuthType: to.StringPtr("<auth-type>"), - }, - Paging: &armsecurityinsights.CodelessConnectorPollingPagingProperties{ - PageSizeParaName: to.StringPtr("<page-size-para-name>"), - PagingType: to.StringPtr("<paging-type>"), - }, - Response: &armsecurityinsights.CodelessConnectorPollingResponseProperties{ - EventsJSONPaths: []*string{ - to.StringPtr("$")}, - }, - Request: &armsecurityinsights.CodelessConnectorPollingRequestProperties{ - APIEndpoint: to.StringPtr("<apiendpoint>"), - Headers: map[string]interface{}{ - "Accept": "application/json", - "User-Agent": "Scuba", - }, - HTTPMethod: to.StringPtr("<httpmethod>"), - QueryParameters: map[string]interface{}{ - "phrase": "created:{_QueryWindowStartTime}..{_QueryWindowEndTime}", - }, - QueryTimeFormat: to.StringPtr("<query-time-format>"), - QueryWindowInMin: to.Int32Ptr(15), - RateLimitQPS: to.Int32Ptr(50), - RetryCount: to.Int32Ptr(2), - TimeoutInSeconds: to.Int32Ptr(60), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DataConnectorsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/dataConnectors/DeleteAPIPolling.json -func ExampleDataConnectorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDataConnectorsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<data-connector-id>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/dataConnectors/ConnectAPIPolling.json -func ExampleDataConnectorsClient_Connect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDataConnectorsClient("<subscription-id>", cred, nil) - _, err = client.Connect(ctx, - "<resource-group-name>", - "<workspace-name>", - "<data-connector-id>", - armsecurityinsights.DataConnectorConnectBody{ - APIKey: to.StringPtr("<apikey>"), - Kind: armsecurityinsights.ConnectAuthKind("APIKey").ToPtr(), - RequestConfigUserInputValues: []interface{}{ - map[string]interface{}{ - "displayText": "Organization Name", - "placeHolderName": "{{placeHolder1}}", - "placeHolderValue": "somePlaceHolderValue", - "requestObjectKey": "apiEndpoint", - }}, - }, - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/dataConnectors/DisconnectAPIPolling.json -func ExampleDataConnectorsClient_Disconnect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDataConnectorsClient("<subscription-id>", cred, nil) - _, err = client.Disconnect(ctx, - "<resource-group-name>", - "<workspace-name>", - "<data-connector-id>", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectorscheckrequirements_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectorscheckrequirements_client_test.go deleted file mode 100644 index 351555713850..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectorscheckrequirements_client_test.go +++ /dev/null @@ -1,42 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/dataConnectors/CheckRequirementsAzureActiveDirectoryNoAuthorization.json -func ExampleDataConnectorsCheckRequirementsClient_Post() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDataConnectorsCheckRequirementsClient("<subscription-id>", cred, nil) - res, err := client.Post(ctx, - "<resource-group-name>", - "<workspace-name>", - &armsecurityinsights.AADCheckRequirements{ - Kind: armsecurityinsights.DataConnectorKind("AzureActiveDirectory").ToPtr(), - Properties: &armsecurityinsights.AADCheckRequirementsProperties{ - TenantID: to.StringPtr("<tenant-id>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DataConnectorsCheckRequirementsClientPostResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_domainwhois_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_domainwhois_client_test.go deleted file mode 100644 index b4c444739396..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_domainwhois_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/enrichment/GetWhoisByDomainName.json -func ExampleDomainWhoisClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewDomainWhoisClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<domain>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.DomainWhoisClientGetResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entities_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entities_client_test.go deleted file mode 100644 index 9f4329e6c47e..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entities_client_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/GetEntities.json -func ExampleEntitiesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntitiesClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/GetCloudApplicationEntityById.json -func ExampleEntitiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntitiesClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntitiesClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/expand/PostExpandEntity.json -func ExampleEntitiesClient_Expand() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntitiesClient("<subscription-id>", cred, nil) - res, err := client.Expand(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-id>", - armsecurityinsights.EntityExpandParameters{ - EndTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-26T00:00:00.000Z"); return t }()), - ExpansionID: to.StringPtr("<expansion-id>"), - StartTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-25T00:00:00.000Z"); return t }()), - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntitiesClientExpandResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/GetQueries.json -func ExampleEntitiesClient_Queries() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntitiesClient("<subscription-id>", cred, nil) - res, err := client.Queries(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-id>", - armsecurityinsights.EntityItemQueryKind("Insight"), - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntitiesClientQueriesResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/insights/PostGetInsights.json -func ExampleEntitiesClient_GetInsights() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntitiesClient("<subscription-id>", cred, nil) - res, err := client.GetInsights(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-id>", - armsecurityinsights.EntityGetInsightsParameters{ - AddDefaultExtendedTimeRange: to.BoolPtr(false), - EndTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-01T00:00:00.000Z"); return t }()), - InsightQueryIDs: []*string{ - to.StringPtr("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4")}, - StartTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T00:00:00.000Z"); return t }()), - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntitiesClientGetInsightsResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesgettimeline_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesgettimeline_client_test.go deleted file mode 100644 index 19c3816ba41f..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesgettimeline_client_test.go +++ /dev/null @@ -1,44 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/timeline/PostTimelineEntity.json -func ExampleEntitiesGetTimelineClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntitiesGetTimelineClient("<subscription-id>", cred, nil) - res, err := client.List(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-id>", - armsecurityinsights.EntityTimelineParameters{ - EndTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-01T00:00:00.000Z"); return t }()), - NumberOfBucket: to.Int32Ptr(4), - StartTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T00:00:00.000Z"); return t }()), - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntitiesGetTimelineClientListResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesrelations_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesrelations_client_test.go deleted file mode 100644 index e2bb01e65bb5..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesrelations_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/relations/GetAllEntityRelations.json -func ExampleEntitiesRelationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntitiesRelationsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - "<entity-id>", - &armsecurityinsights.EntitiesRelationsClientListOptions{Filter: nil, - Orderby: nil, - Top: nil, - SkipToken: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityqueries_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityqueries_client_test.go deleted file mode 100644 index aa102cf01868..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityqueries_client_test.go +++ /dev/null @@ -1,128 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entityQueries/GetEntityQueries.json -func ExampleEntityQueriesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntityQueriesClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - &armsecurityinsights.EntityQueriesClientListOptions{Kind: armsecurityinsights.Enum13("Expansion").ToPtr()}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entityQueries/GetActivityEntityQueryById.json -func ExampleEntityQueriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntityQueriesClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-query-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntityQueriesClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entityQueries/CreateEntityQueryActivity.json -func ExampleEntityQueriesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntityQueriesClient("<subscription-id>", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-query-id>", - &armsecurityinsights.ActivityCustomEntityQuery{ - Etag: to.StringPtr("<etag>"), - Kind: armsecurityinsights.CustomEntityQueryKind("Activity").ToPtr(), - Properties: &armsecurityinsights.ActivityEntityQueriesProperties{ - Description: to.StringPtr("<description>"), - Content: to.StringPtr("<content>"), - Enabled: to.BoolPtr(true), - EntitiesFilter: map[string][]*string{ - "Host_OsFamily": { - to.StringPtr("Windows")}, - }, - InputEntityType: armsecurityinsights.EntityType("Host").ToPtr(), - QueryDefinitions: &armsecurityinsights.ActivityEntityQueriesPropertiesQueryDefinitions{ - Query: to.StringPtr("<query>"), - }, - RequiredInputFieldsSets: [][]*string{ - { - to.StringPtr("Host_HostName"), - to.StringPtr("Host_NTDomain")}, - { - to.StringPtr("Host_HostName"), - to.StringPtr("Host_DnsDomain")}, - { - to.StringPtr("Host_AzureID")}, - { - to.StringPtr("Host_OMSAgentID")}}, - Title: to.StringPtr("<title>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntityQueriesClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entityQueries/DeleteEntityQuery.json -func ExampleEntityQueriesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntityQueriesClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-query-id>", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityquerytemplates_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityquerytemplates_client_test.go deleted file mode 100644 index b34d078abdf1..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityquerytemplates_client_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json -func ExampleEntityQueryTemplatesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntityQueryTemplatesClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - &armsecurityinsights.EntityQueryTemplatesClientListOptions{Kind: armsecurityinsights.Enum15("Activity").ToPtr()}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entityQueryTemplates/GetActivityEntityQueryTemplateById.json -func ExampleEntityQueryTemplatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntityQueryTemplatesClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-query-template-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntityQueryTemplatesClientGetResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityrelations_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityrelations_client_test.go deleted file mode 100644 index 9238f3cf484a..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityrelations_client_test.go +++ /dev/null @@ -1,37 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/entities/relations/GetEntityRelationByName.json -func ExampleEntityRelationsClient_GetRelation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewEntityRelationsClient("<subscription-id>", cred, nil) - res, err := client.GetRelation(ctx, - "<resource-group-name>", - "<workspace-name>", - "<entity-id>", - "<relation-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.EntityRelationsClientGetRelationResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentcomments_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentcomments_client_test.go deleted file mode 100644 index 7d33b4eaba84..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentcomments_client_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/comments/GetAllIncidentComments.json -func ExampleIncidentCommentsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentCommentsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - "<incident-id>", - &armsecurityinsights.IncidentCommentsClientListOptions{Filter: nil, - Orderby: nil, - Top: nil, - SkipToken: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/comments/GetIncidentCommentById.json -func ExampleIncidentCommentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentCommentsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - "<incident-comment-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentCommentsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/comments/CreateIncidentComment.json -func ExampleIncidentCommentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentCommentsClient("<subscription-id>", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - "<incident-comment-id>", - armsecurityinsights.IncidentComment{ - Properties: &armsecurityinsights.IncidentCommentProperties{ - Message: to.StringPtr("<message>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentCommentsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/comments/DeleteIncidentComment.json -func ExampleIncidentCommentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentCommentsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - "<incident-comment-id>", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentrelations_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentrelations_client_test.go deleted file mode 100644 index b83574aaec5a..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentrelations_client_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/relations/GetAllIncidentRelations.json -func ExampleIncidentRelationsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentRelationsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - "<incident-id>", - &armsecurityinsights.IncidentRelationsClientListOptions{Filter: nil, - Orderby: nil, - Top: nil, - SkipToken: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/relations/GetIncidentRelationByName.json -func ExampleIncidentRelationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentRelationsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - "<relation-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentRelationsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/relations/CreateIncidentRelation.json -func ExampleIncidentRelationsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentRelationsClient("<subscription-id>", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - "<relation-name>", - armsecurityinsights.Relation{ - Properties: &armsecurityinsights.RelationProperties{ - RelatedResourceID: to.StringPtr("<related-resource-id>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentRelationsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/relations/DeleteIncidentRelation.json -func ExampleIncidentRelationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentRelationsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - "<relation-name>", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidents_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidents_client_test.go deleted file mode 100644 index 2e94318d0e22..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidents_client_test.go +++ /dev/null @@ -1,202 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/GetIncidents.json -func ExampleIncidentsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - &armsecurityinsights.IncidentsClientListOptions{Filter: nil, - Orderby: to.StringPtr("<orderby>"), - Top: to.Int32Ptr(1), - SkipToken: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/GetIncidentById.json -func ExampleIncidentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/CreateIncident.json -func ExampleIncidentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - armsecurityinsights.Incident{ - Etag: to.StringPtr("<etag>"), - Properties: &armsecurityinsights.IncidentProperties{ - Description: to.StringPtr("<description>"), - Classification: armsecurityinsights.IncidentClassification("FalsePositive").ToPtr(), - ClassificationComment: to.StringPtr("<classification-comment>"), - ClassificationReason: armsecurityinsights.IncidentClassificationReason("IncorrectAlertLogic").ToPtr(), - FirstActivityTimeUTC: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T13:00:30Z"); return t }()), - LastActivityTimeUTC: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T13:05:30Z"); return t }()), - Owner: &armsecurityinsights.IncidentOwnerInfo{ - ObjectID: to.StringPtr("<object-id>"), - }, - Severity: armsecurityinsights.IncidentSeverity("High").ToPtr(), - Status: armsecurityinsights.IncidentStatus("Closed").ToPtr(), - Title: to.StringPtr("<title>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentsClientCreateOrUpdateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/DeleteIncident.json -func ExampleIncidentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/CreateTeam.json -func ExampleIncidentsClient_CreateTeam() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - res, err := client.CreateTeam(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - armsecurityinsights.TeamProperties{ - TeamDescription: to.StringPtr("<team-description>"), - TeamName: to.StringPtr("<team-name>"), - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentsClientCreateTeamResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/GetAllIncidentAlerts.json -func ExampleIncidentsClient_ListAlerts() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - res, err := client.ListAlerts(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentsClientListAlertsResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/GetAllIncidentBookmarks.json -func ExampleIncidentsClient_ListBookmarks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - res, err := client.ListBookmarks(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentsClientListBookmarksResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/incidents/entities/GetAllIncidentEntities.json -func ExampleIncidentsClient_ListEntities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIncidentsClient("<subscription-id>", cred, nil) - res, err := client.ListEntities(ctx, - "<resource-group-name>", - "<workspace-name>", - "<incident-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IncidentsClientListEntitiesResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_ipgeodata_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_ipgeodata_client_test.go deleted file mode 100644 index e4c747fe32c7..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_ipgeodata_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/enrichment/GetGeodataByIp.json -func ExampleIPGeodataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewIPGeodataClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<ip-address>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.IPGeodataClientGetResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_metadata_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_metadata_client_test.go deleted file mode 100644 index 13edd4812c8a..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_metadata_client_test.go +++ /dev/null @@ -1,198 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/metadata/GetAllMetadataOData.json -func ExampleMetadataClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewMetadataClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - &armsecurityinsights.MetadataClientListOptions{Filter: nil, - Orderby: nil, - Top: nil, - Skip: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/metadata/GetMetadata.json -func ExampleMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewMetadataClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<metadata-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.MetadataClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/metadata/DeleteMetadata.json -func ExampleMetadataClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewMetadataClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<metadata-name>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/metadata/PutMetadata.json -func ExampleMetadataClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewMetadataClient("<subscription-id>", cred, nil) - res, err := client.Create(ctx, - "<resource-group-name>", - "<workspace-name>", - "<metadata-name>", - armsecurityinsights.MetadataModel{ - Properties: &armsecurityinsights.MetadataProperties{ - Author: &armsecurityinsights.MetadataAuthor{ - Name: to.StringPtr("<name>"), - Email: to.StringPtr("<email>"), - }, - Categories: &armsecurityinsights.MetadataCategories{ - Domains: []*string{ - to.StringPtr("Application"), - to.StringPtr("Security – Insider Threat")}, - Verticals: []*string{ - to.StringPtr("Healthcare")}, - }, - ContentID: to.StringPtr("<content-id>"), - Dependencies: &armsecurityinsights.MetadataDependencies{ - Criteria: []*armsecurityinsights.MetadataDependencies{ - { - Criteria: []*armsecurityinsights.MetadataDependencies{ - { - Name: to.StringPtr("<name>"), - ContentID: to.StringPtr("<content-id>"), - Kind: armsecurityinsights.Kind("DataConnector").ToPtr(), - }, - { - ContentID: to.StringPtr("<content-id>"), - Kind: armsecurityinsights.Kind("DataConnector").ToPtr(), - }, - { - ContentID: to.StringPtr("<content-id>"), - Kind: armsecurityinsights.Kind("DataConnector").ToPtr(), - Version: to.StringPtr("<version>"), - }}, - Operator: armsecurityinsights.Operator("OR").ToPtr(), - }, - { - ContentID: to.StringPtr("<content-id>"), - Kind: armsecurityinsights.Kind("Playbook").ToPtr(), - Version: to.StringPtr("<version>"), - }, - { - ContentID: to.StringPtr("<content-id>"), - Kind: armsecurityinsights.Kind("Parser").ToPtr(), - }}, - Operator: armsecurityinsights.Operator("AND").ToPtr(), - }, - FirstPublishDate: to.TimePtr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-05-18"); return t }()), - Kind: armsecurityinsights.Kind("AnalyticsRule").ToPtr(), - LastPublishDate: to.TimePtr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-05-18"); return t }()), - ParentID: to.StringPtr("<parent-id>"), - Providers: []*string{ - to.StringPtr("Amazon"), - to.StringPtr("Microsoft")}, - Source: &armsecurityinsights.MetadataSource{ - Name: to.StringPtr("<name>"), - Kind: armsecurityinsights.SourceKind("Solution").ToPtr(), - SourceID: to.StringPtr("<source-id>"), - }, - Support: &armsecurityinsights.MetadataSupport{ - Name: to.StringPtr("<name>"), - Email: to.StringPtr("<email>"), - Link: to.StringPtr("<link>"), - Tier: armsecurityinsights.SupportTier("Partner").ToPtr(), - }, - Version: to.StringPtr("<version>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.MetadataClientCreateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/metadata/PatchMetadata.json -func ExampleMetadataClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewMetadataClient("<subscription-id>", cred, nil) - res, err := client.Update(ctx, - "<resource-group-name>", - "<workspace-name>", - "<metadata-name>", - armsecurityinsights.MetadataPatch{ - Properties: &armsecurityinsights.MetadataPropertiesPatch{ - Author: &armsecurityinsights.MetadataAuthor{ - Name: to.StringPtr("<name>"), - Email: to.StringPtr("<email>"), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.MetadataClientUpdateResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_officeconsents_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_officeconsents_client_test.go deleted file mode 100644 index 5f182dbe2d9c..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_officeconsents_client_test.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/officeConsents/GetOfficeConsents.json -func ExampleOfficeConsentsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewOfficeConsentsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/officeConsents/GetOfficeConsentsById.json -func ExampleOfficeConsentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewOfficeConsentsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<consent-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.OfficeConsentsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/officeConsents/DeleteOfficeConsents.json -func ExampleOfficeConsentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewOfficeConsentsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<consent-id>", - nil) - if err != nil { - log.Fatal(err) - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_productsettings_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_productsettings_client_test.go deleted file mode 100644 index c323bb777e70..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_productsettings_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/settings/GetAllSettings.json -func ExampleProductSettingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewProductSettingsClient("<subscription-id>", cred, nil) - res, err := client.List(ctx, - "<resource-group-name>", - "<workspace-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ProductSettingsClientListResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/settings/GetEyesOnSetting.json -func ExampleProductSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewProductSettingsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<settings-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ProductSettingsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/settings/DeleteEyesOnSetting.json -func ExampleProductSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewProductSettingsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<settings-name>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/settings/UpdateEyesOnSetting.json -func ExampleProductSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewProductSettingsClient("<subscription-id>", cred, nil) - res, err := client.Update(ctx, - "<resource-group-name>", - "<workspace-name>", - "<settings-name>", - &armsecurityinsights.EyesOn{ - Etag: to.StringPtr("<etag>"), - Kind: armsecurityinsights.SettingKind("EyesOn").ToPtr(), - Properties: &armsecurityinsights.EyesOnSettingsProperties{}, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ProductSettingsClientUpdateResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sentinelonboardingstates_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sentinelonboardingstates_client_test.go deleted file mode 100644 index 6678ed3e08b2..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sentinelonboardingstates_client_test.go +++ /dev/null @@ -1,97 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json -func ExampleSentinelOnboardingStatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSentinelOnboardingStatesClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<sentinel-onboarding-state-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SentinelOnboardingStatesClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json -func ExampleSentinelOnboardingStatesClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSentinelOnboardingStatesClient("<subscription-id>", cred, nil) - res, err := client.Create(ctx, - "<resource-group-name>", - "<workspace-name>", - "<sentinel-onboarding-state-name>", - &armsecurityinsights.SentinelOnboardingStatesClientCreateOptions{SentinelOnboardingStateParameter: &armsecurityinsights.SentinelOnboardingState{ - Properties: &armsecurityinsights.SentinelOnboardingStateProperties{ - CustomerManagedKey: to.BoolPtr(false), - }, - }, - }) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SentinelOnboardingStatesClientCreateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json -func ExampleSentinelOnboardingStatesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSentinelOnboardingStatesClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<sentinel-onboarding-state-name>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json -func ExampleSentinelOnboardingStatesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSentinelOnboardingStatesClient("<subscription-id>", cred, nil) - res, err := client.List(ctx, - "<resource-group-name>", - "<workspace-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SentinelOnboardingStatesClientListResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrol_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrol_client_test.go deleted file mode 100644 index 40367e1f3ecb..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrol_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/repositories/GetRepositories.json -func ExampleSourceControlClient_ListRepositories() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSourceControlClient("<subscription-id>", cred, nil) - pager := client.ListRepositories("<resource-group-name>", - "<workspace-name>", - armsecurityinsights.RepoType("Github"), - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrols_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrols_client_test.go deleted file mode 100644 index ce1707641846..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrols_client_test.go +++ /dev/null @@ -1,124 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/sourcecontrols/GetSourceControls.json -func ExampleSourceControlsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSourceControlsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/sourcecontrols/GetSourceControlById.json -func ExampleSourceControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSourceControlsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<source-control-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SourceControlsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/sourcecontrols/DeleteSourceControl.json -func ExampleSourceControlsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSourceControlsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<source-control-id>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/sourcecontrols/CreateSourceControl.json -func ExampleSourceControlsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewSourceControlsClient("<subscription-id>", cred, nil) - res, err := client.Create(ctx, - "<resource-group-name>", - "<workspace-name>", - "<source-control-id>", - armsecurityinsights.SourceControl{ - Etag: to.StringPtr("<etag>"), - Properties: &armsecurityinsights.SourceControlProperties{ - Description: to.StringPtr("<description>"), - ContentTypes: []*armsecurityinsights.ContentType{ - armsecurityinsights.ContentType("AnalyticRules").ToPtr(), - armsecurityinsights.ContentType("Workbook").ToPtr()}, - DisplayName: to.StringPtr("<display-name>"), - RepoType: armsecurityinsights.RepoType("Github").ToPtr(), - Repository: &armsecurityinsights.Repository{ - Branch: to.StringPtr("<branch>"), - DisplayURL: to.StringPtr("<display-url>"), - PathMapping: []*armsecurityinsights.ContentPathMap{ - { - Path: to.StringPtr("<path>"), - ContentType: armsecurityinsights.ContentType("AnalyticRules").ToPtr(), - }, - { - Path: to.StringPtr("<path>"), - ContentType: armsecurityinsights.ContentType("Workbook").ToPtr(), - }}, - URL: to.StringPtr("<url>"), - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.SourceControlsClientCreateResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicator_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicator_client_test.go deleted file mode 100644 index d05c73450040..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicator_client_test.go +++ /dev/null @@ -1,229 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/CreateThreatIntelligence.json -func ExampleThreatIntelligenceIndicatorClient_CreateIndicator() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorClient("<subscription-id>", cred, nil) - res, err := client.CreateIndicator(ctx, - "<resource-group-name>", - "<workspace-name>", - armsecurityinsights.ThreatIntelligenceIndicatorModelForRequestBody{ - Kind: armsecurityinsights.ThreatIntelligenceResourceKindEnum("indicator").ToPtr(), - Properties: &armsecurityinsights.ThreatIntelligenceIndicatorProperties{ - Description: to.StringPtr("<description>"), - Confidence: to.Int32Ptr(78), - CreatedByRef: to.StringPtr("<created-by-ref>"), - DisplayName: to.StringPtr("<display-name>"), - ExternalReferences: []*armsecurityinsights.ThreatIntelligenceExternalReference{}, - GranularMarkings: []*armsecurityinsights.ThreatIntelligenceGranularMarkingModel{}, - KillChainPhases: []*armsecurityinsights.ThreatIntelligenceKillChainPhase{}, - Labels: []*string{}, - Modified: to.StringPtr("<modified>"), - Pattern: to.StringPtr("<pattern>"), - PatternType: to.StringPtr("<pattern-type>"), - Revoked: to.BoolPtr(false), - Source: to.StringPtr("<source>"), - ThreatIntelligenceTags: []*string{ - to.StringPtr("new schema")}, - ThreatTypes: []*string{ - to.StringPtr("compromised")}, - ValidFrom: to.StringPtr("<valid-from>"), - ValidUntil: to.StringPtr("<valid-until>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ThreatIntelligenceIndicatorClientCreateIndicatorResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json -func ExampleThreatIntelligenceIndicatorClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ThreatIntelligenceIndicatorClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json -func ExampleThreatIntelligenceIndicatorClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorClient("<subscription-id>", cred, nil) - res, err := client.Create(ctx, - "<resource-group-name>", - "<workspace-name>", - "<name>", - armsecurityinsights.ThreatIntelligenceIndicatorModelForRequestBody{ - Kind: armsecurityinsights.ThreatIntelligenceResourceKindEnum("indicator").ToPtr(), - Properties: &armsecurityinsights.ThreatIntelligenceIndicatorProperties{ - Description: to.StringPtr("<description>"), - Confidence: to.Int32Ptr(78), - CreatedByRef: to.StringPtr("<created-by-ref>"), - DisplayName: to.StringPtr("<display-name>"), - ExternalReferences: []*armsecurityinsights.ThreatIntelligenceExternalReference{}, - GranularMarkings: []*armsecurityinsights.ThreatIntelligenceGranularMarkingModel{}, - KillChainPhases: []*armsecurityinsights.ThreatIntelligenceKillChainPhase{}, - Labels: []*string{}, - Modified: to.StringPtr("<modified>"), - Pattern: to.StringPtr("<pattern>"), - PatternType: to.StringPtr("<pattern-type>"), - Revoked: to.BoolPtr(false), - Source: to.StringPtr("<source>"), - ThreatIntelligenceTags: []*string{ - to.StringPtr("new schema")}, - ThreatTypes: []*string{ - to.StringPtr("compromised")}, - ValidFrom: to.StringPtr("<valid-from>"), - ValidUntil: to.StringPtr("<valid-until>"), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ThreatIntelligenceIndicatorClientCreateResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json -func ExampleThreatIntelligenceIndicatorClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<name>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/QueryThreatIntelligence.json -func ExampleThreatIntelligenceIndicatorClient_QueryIndicators() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorClient("<subscription-id>", cred, nil) - pager := client.QueryIndicators("<resource-group-name>", - "<workspace-name>", - armsecurityinsights.ThreatIntelligenceFilteringCriteria{ - MaxConfidence: to.Int32Ptr(80), - MaxValidUntil: to.StringPtr("<max-valid-until>"), - MinConfidence: to.Int32Ptr(25), - MinValidUntil: to.StringPtr("<min-valid-until>"), - PageSize: to.Int32Ptr(100), - SortBy: []*armsecurityinsights.ThreatIntelligenceSortingCriteria{ - { - ItemKey: to.StringPtr("<item-key>"), - SortOrder: armsecurityinsights.ThreatIntelligenceSortingCriteriaEnum("descending").ToPtr(), - }}, - Sources: []*string{ - to.StringPtr("Azure Sentinel")}, - }, - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json -func ExampleThreatIntelligenceIndicatorClient_AppendTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorClient("<subscription-id>", cred, nil) - _, err = client.AppendTags(ctx, - "<resource-group-name>", - "<workspace-name>", - "<name>", - armsecurityinsights.ThreatIntelligenceAppendTags{ - ThreatIntelligenceTags: []*string{ - to.StringPtr("tag1"), - to.StringPtr("tag2")}, - }, - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json -func ExampleThreatIntelligenceIndicatorClient_ReplaceTags() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorClient("<subscription-id>", cred, nil) - res, err := client.ReplaceTags(ctx, - "<resource-group-name>", - "<workspace-name>", - "<name>", - armsecurityinsights.ThreatIntelligenceIndicatorModelForRequestBody{ - Kind: armsecurityinsights.ThreatIntelligenceResourceKindEnum("indicator").ToPtr(), - Etag: to.StringPtr("<etag>"), - Properties: &armsecurityinsights.ThreatIntelligenceIndicatorProperties{ - ThreatIntelligenceTags: []*string{ - to.StringPtr("patching tags")}, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ThreatIntelligenceIndicatorClientReplaceTagsResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicatormetrics_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicatormetrics_client_test.go deleted file mode 100644 index d2d9580faa3b..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicatormetrics_client_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json -func ExampleThreatIntelligenceIndicatorMetricsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorMetricsClient("<subscription-id>", cred, nil) - res, err := client.List(ctx, - "<resource-group-name>", - "<workspace-name>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.ThreatIntelligenceIndicatorMetricsClientListResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicators_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicators_client_test.go deleted file mode 100644 index dfac8f00376e..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicators_client_test.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/threatintelligence/GetThreatIntelligence.json -func ExampleThreatIntelligenceIndicatorsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewThreatIntelligenceIndicatorsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - &armsecurityinsights.ThreatIntelligenceIndicatorsClientListOptions{Filter: nil, - Orderby: nil, - Top: nil, - SkipToken: nil, - }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlistitems_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlistitems_client_test.go deleted file mode 100644 index aeffd6e2babc..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlistitems_client_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/GetWatchlistItems.json -func ExampleWatchlistItemsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistItemsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - "<watchlist-alias>", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/GetWatchlistItemById.json -func ExampleWatchlistItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistItemsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<watchlist-alias>", - "<watchlist-item-id>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.WatchlistItemsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/DeleteWatchlistItem.json -func ExampleWatchlistItemsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistItemsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<watchlist-alias>", - "<watchlist-item-id>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/CreateWatchlistItem.json -func ExampleWatchlistItemsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistItemsClient("<subscription-id>", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<workspace-name>", - "<watchlist-alias>", - "<watchlist-item-id>", - armsecurityinsights.WatchlistItem{ - Etag: to.StringPtr("<etag>"), - Properties: &armsecurityinsights.WatchlistItemProperties{ - ItemsKeyValue: map[string]interface{}{ - "Business tier": "10.0.2.0/24", - "Data tier": "10.0.2.0/24", - "Gateway subnet": "10.0.255.224/27", - "Private DMZ in": "10.0.0.0/27", - "Public DMZ out": "10.0.0.96/27", - "Web Tier": "10.0.1.0/24", - }, - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.WatchlistItemsClientCreateOrUpdateResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlists_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlists_client_test.go deleted file mode 100644 index eb60ce0e8f1b..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlists_client_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" -) - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/GetWatchlists.json -func ExampleWatchlistsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistsClient("<subscription-id>", cred, nil) - pager := client.List("<resource-group-name>", - "<workspace-name>", - nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { - log.Fatalf("failed to advance page: %v", err) - } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) - } - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/GetWatchlistByAlias.json -func ExampleWatchlistsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistsClient("<subscription-id>", cred, nil) - res, err := client.Get(ctx, - "<resource-group-name>", - "<workspace-name>", - "<watchlist-alias>", - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.WatchlistsClientGetResult) -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/DeleteWatchlist.json -func ExampleWatchlistsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistsClient("<subscription-id>", cred, nil) - _, err = client.Delete(ctx, - "<resource-group-name>", - "<workspace-name>", - "<watchlist-alias>", - nil) - if err != nil { - log.Fatal(err) - } -} - -// x-ms-original-file: specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2021-10-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json -func ExampleWatchlistsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client := armsecurityinsights.NewWatchlistsClient("<subscription-id>", cred, nil) - res, err := client.CreateOrUpdate(ctx, - "<resource-group-name>", - "<workspace-name>", - "<watchlist-alias>", - armsecurityinsights.Watchlist{ - Etag: to.StringPtr("<etag>"), - Properties: &armsecurityinsights.WatchlistProperties{ - Description: to.StringPtr("<description>"), - ContentType: to.StringPtr("<content-type>"), - DisplayName: to.StringPtr("<display-name>"), - ItemsSearchKey: to.StringPtr("<items-search-key>"), - NumberOfLinesToSkip: to.Int32Ptr(1), - Provider: to.StringPtr("<provider>"), - RawContent: to.StringPtr("<raw-content>"), - Source: armsecurityinsights.Source("Local file").ToPtr(), - }, - }, - nil) - if err != nil { - log.Fatal(err) - } - log.Printf("Response result: %#v\n", res.WatchlistsClientCreateOrUpdateResult) -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go index d249a0ad4c48..574041ffe991 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type ActionsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewActionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ActionsClient { +func NewActionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ActionsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ActionsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the action of alert rule. @@ -100,7 +105,7 @@ func (client *ActionsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, action) @@ -108,7 +113,7 @@ func (client *ActionsClient) createOrUpdateCreateRequest(ctx context.Context, re // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *ActionsClient) createOrUpdateHandleResponse(resp *http.Response) (ActionsClientCreateOrUpdateResponse, error) { - result := ActionsClientCreateOrUpdateResponse{RawResponse: resp} + result := ActionsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ActionResponse); err != nil { return ActionsClientCreateOrUpdateResponse{}, err } @@ -134,7 +139,7 @@ func (client *ActionsClient) Delete(ctx context.Context, resourceGroupName strin if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ActionsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ActionsClientDeleteResponse{RawResponse: resp}, nil + return ActionsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -165,7 +170,7 @@ func (client *ActionsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -221,7 +226,7 @@ func (client *ActionsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -229,7 +234,7 @@ func (client *ActionsClient) getCreateRequest(ctx context.Context, resourceGroup // getHandleResponse handles the Get response. func (client *ActionsClient) getHandleResponse(resp *http.Response) (ActionsClientGetResponse, error) { - result := ActionsClientGetResponse{RawResponse: resp} + result := ActionsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ActionResponse); err != nil { return ActionsClientGetResponse{}, err } @@ -242,16 +247,32 @@ func (client *ActionsClient) getHandleResponse(resp *http.Response) (ActionsClie // workspaceName - The name of the workspace. // ruleID - Alert rule ID // options - ActionsClientListByAlertRuleOptions contains the optional parameters for the ActionsClient.ListByAlertRule method. -func (client *ActionsClient) ListByAlertRule(resourceGroupName string, workspaceName string, ruleID string, options *ActionsClientListByAlertRuleOptions) *ActionsClientListByAlertRulePager { - return &ActionsClientListByAlertRulePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByAlertRuleCreateRequest(ctx, resourceGroupName, workspaceName, ruleID, options) +func (client *ActionsClient) ListByAlertRule(resourceGroupName string, workspaceName string, ruleID string, options *ActionsClientListByAlertRuleOptions) *runtime.Pager[ActionsClientListByAlertRuleResponse] { + return runtime.NewPager(runtime.PageProcessor[ActionsClientListByAlertRuleResponse]{ + More: func(page ActionsClientListByAlertRuleResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ActionsClientListByAlertRuleResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ActionsList.NextLink) + Fetcher: func(ctx context.Context, page *ActionsClientListByAlertRuleResponse) (ActionsClientListByAlertRuleResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAlertRuleCreateRequest(ctx, resourceGroupName, workspaceName, ruleID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ActionsClientListByAlertRuleResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ActionsClientListByAlertRuleResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ActionsClientListByAlertRuleResponse{}, runtime.NewResponseError(resp) + } + return client.listByAlertRuleHandleResponse(resp) }, - } + }) } // listByAlertRuleCreateRequest creates the ListByAlertRule request. @@ -278,7 +299,7 @@ func (client *ActionsClient) listByAlertRuleCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -286,7 +307,7 @@ func (client *ActionsClient) listByAlertRuleCreateRequest(ctx context.Context, r // listByAlertRuleHandleResponse handles the ListByAlertRule response. func (client *ActionsClient) listByAlertRuleHandleResponse(resp *http.Response) (ActionsClientListByAlertRuleResponse, error) { - result := ActionsClientListByAlertRuleResponse{RawResponse: resp} + result := ActionsClientListByAlertRuleResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ActionsList); err != nil { return ActionsClientListByAlertRuleResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go index cf4359005f14..5f2323ae4567 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type AlertRulesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAlertRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AlertRulesClient { +func NewAlertRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertRulesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AlertRulesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the alert rule. @@ -96,7 +101,7 @@ func (client *AlertRulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, alertRule) @@ -104,7 +109,7 @@ func (client *AlertRulesClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *AlertRulesClient) createOrUpdateHandleResponse(resp *http.Response) (AlertRulesClientCreateOrUpdateResponse, error) { - result := AlertRulesClientCreateOrUpdateResponse{RawResponse: resp} + result := AlertRulesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return AlertRulesClientCreateOrUpdateResponse{}, err } @@ -129,7 +134,7 @@ func (client *AlertRulesClient) Delete(ctx context.Context, resourceGroupName st if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return AlertRulesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return AlertRulesClientDeleteResponse{RawResponse: resp}, nil + return AlertRulesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -156,7 +161,7 @@ func (client *AlertRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -207,7 +212,7 @@ func (client *AlertRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -215,7 +220,7 @@ func (client *AlertRulesClient) getCreateRequest(ctx context.Context, resourceGr // getHandleResponse handles the Get response. func (client *AlertRulesClient) getHandleResponse(resp *http.Response) (AlertRulesClientGetResponse, error) { - result := AlertRulesClientGetResponse{RawResponse: resp} + result := AlertRulesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return AlertRulesClientGetResponse{}, err } @@ -227,16 +232,32 @@ func (client *AlertRulesClient) getHandleResponse(resp *http.Response) (AlertRul // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - AlertRulesClientListOptions contains the optional parameters for the AlertRulesClient.List method. -func (client *AlertRulesClient) List(resourceGroupName string, workspaceName string, options *AlertRulesClientListOptions) *AlertRulesClientListPager { - return &AlertRulesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *AlertRulesClient) List(resourceGroupName string, workspaceName string, options *AlertRulesClientListOptions) *runtime.Pager[AlertRulesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AlertRulesClientListResponse]{ + More: func(page AlertRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AlertRulesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AlertRulesList.NextLink) + Fetcher: func(ctx context.Context, page *AlertRulesClientListResponse) (AlertRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AlertRulesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AlertRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AlertRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -259,7 +280,7 @@ func (client *AlertRulesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -267,7 +288,7 @@ func (client *AlertRulesClient) listCreateRequest(ctx context.Context, resourceG // listHandleResponse handles the List response. func (client *AlertRulesClient) listHandleResponse(resp *http.Response) (AlertRulesClientListResponse, error) { - result := AlertRulesClientListResponse{RawResponse: resp} + result := AlertRulesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AlertRulesList); err != nil { return AlertRulesClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go index 0d48a449f82a..49a02e95de2e 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type AlertRuleTemplatesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAlertRuleTemplatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AlertRuleTemplatesClient { +func NewAlertRuleTemplatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertRuleTemplatesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AlertRuleTemplatesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Gets the alert rule template. @@ -94,7 +99,7 @@ func (client *AlertRuleTemplatesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -102,7 +107,7 @@ func (client *AlertRuleTemplatesClient) getCreateRequest(ctx context.Context, re // getHandleResponse handles the Get response. func (client *AlertRuleTemplatesClient) getHandleResponse(resp *http.Response) (AlertRuleTemplatesClientGetResponse, error) { - result := AlertRuleTemplatesClientGetResponse{RawResponse: resp} + result := AlertRuleTemplatesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return AlertRuleTemplatesClientGetResponse{}, err } @@ -114,16 +119,32 @@ func (client *AlertRuleTemplatesClient) getHandleResponse(resp *http.Response) ( // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - AlertRuleTemplatesClientListOptions contains the optional parameters for the AlertRuleTemplatesClient.List method. -func (client *AlertRuleTemplatesClient) List(resourceGroupName string, workspaceName string, options *AlertRuleTemplatesClientListOptions) *AlertRuleTemplatesClientListPager { - return &AlertRuleTemplatesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *AlertRuleTemplatesClient) List(resourceGroupName string, workspaceName string, options *AlertRuleTemplatesClientListOptions) *runtime.Pager[AlertRuleTemplatesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AlertRuleTemplatesClientListResponse]{ + More: func(page AlertRuleTemplatesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AlertRuleTemplatesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AlertRuleTemplatesList.NextLink) + Fetcher: func(ctx context.Context, page *AlertRuleTemplatesClientListResponse) (AlertRuleTemplatesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AlertRuleTemplatesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AlertRuleTemplatesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AlertRuleTemplatesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -146,7 +167,7 @@ func (client *AlertRuleTemplatesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -154,7 +175,7 @@ func (client *AlertRuleTemplatesClient) listCreateRequest(ctx context.Context, r // listHandleResponse handles the List response. func (client *AlertRuleTemplatesClient) listHandleResponse(resp *http.Response) (AlertRuleTemplatesClientListResponse, error) { - result := AlertRuleTemplatesClientListResponse{RawResponse: resp} + result := AlertRuleTemplatesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AlertRuleTemplatesList); err != nil { return AlertRuleTemplatesClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go index aa23bc0f5d1b..9b2301b0298c 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type AutomationRulesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAutomationRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AutomationRulesClient { +func NewAutomationRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AutomationRulesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &AutomationRulesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the automation rule. @@ -95,7 +100,7 @@ func (client *AutomationRulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.AutomationRuleToUpsert != nil { @@ -106,7 +111,7 @@ func (client *AutomationRulesClient) createOrUpdateCreateRequest(ctx context.Con // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *AutomationRulesClient) createOrUpdateHandleResponse(resp *http.Response) (AutomationRulesClientCreateOrUpdateResponse, error) { - result := AutomationRulesClientCreateOrUpdateResponse{RawResponse: resp} + result := AutomationRulesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AutomationRule); err != nil { return AutomationRulesClientCreateOrUpdateResponse{}, err } @@ -158,7 +163,7 @@ func (client *AutomationRulesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -166,7 +171,7 @@ func (client *AutomationRulesClient) deleteCreateRequest(ctx context.Context, re // deleteHandleResponse handles the Delete response. func (client *AutomationRulesClient) deleteHandleResponse(resp *http.Response) (AutomationRulesClientDeleteResponse, error) { - result := AutomationRulesClientDeleteResponse{RawResponse: resp} + result := AutomationRulesClientDeleteResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { return AutomationRulesClientDeleteResponse{}, err } @@ -218,7 +223,7 @@ func (client *AutomationRulesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -226,7 +231,7 @@ func (client *AutomationRulesClient) getCreateRequest(ctx context.Context, resou // getHandleResponse handles the Get response. func (client *AutomationRulesClient) getHandleResponse(resp *http.Response) (AutomationRulesClientGetResponse, error) { - result := AutomationRulesClientGetResponse{RawResponse: resp} + result := AutomationRulesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AutomationRule); err != nil { return AutomationRulesClientGetResponse{}, err } @@ -238,16 +243,32 @@ func (client *AutomationRulesClient) getHandleResponse(resp *http.Response) (Aut // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - AutomationRulesClientListOptions contains the optional parameters for the AutomationRulesClient.List method. -func (client *AutomationRulesClient) List(resourceGroupName string, workspaceName string, options *AutomationRulesClientListOptions) *AutomationRulesClientListPager { - return &AutomationRulesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *AutomationRulesClient) List(resourceGroupName string, workspaceName string, options *AutomationRulesClientListOptions) *runtime.Pager[AutomationRulesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[AutomationRulesClientListResponse]{ + More: func(page AutomationRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AutomationRulesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AutomationRulesList.NextLink) + Fetcher: func(ctx context.Context, page *AutomationRulesClientListResponse) (AutomationRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AutomationRulesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AutomationRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AutomationRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -270,7 +291,7 @@ func (client *AutomationRulesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -278,72 +299,9 @@ func (client *AutomationRulesClient) listCreateRequest(ctx context.Context, reso // listHandleResponse handles the List response. func (client *AutomationRulesClient) listHandleResponse(resp *http.Response) (AutomationRulesClientListResponse, error) { - result := AutomationRulesClientListResponse{RawResponse: resp} + result := AutomationRulesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AutomationRulesList); err != nil { return AutomationRulesClientListResponse{}, err } return result, nil } - -// ManualTriggerPlaybook - Triggers playbook on a specific incident -// If the operation fails it returns an *azcore.ResponseError type. -// resourceGroupName - The name of the resource group. The name is case insensitive. -// workspaceName - The name of the workspace. -// options - AutomationRulesClientManualTriggerPlaybookOptions contains the optional parameters for the AutomationRulesClient.ManualTriggerPlaybook -// method. -func (client *AutomationRulesClient) ManualTriggerPlaybook(ctx context.Context, resourceGroupName string, workspaceName string, incidentIdentifier string, options *AutomationRulesClientManualTriggerPlaybookOptions) (AutomationRulesClientManualTriggerPlaybookResponse, error) { - req, err := client.manualTriggerPlaybookCreateRequest(ctx, resourceGroupName, workspaceName, incidentIdentifier, options) - if err != nil { - return AutomationRulesClientManualTriggerPlaybookResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return AutomationRulesClientManualTriggerPlaybookResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AutomationRulesClientManualTriggerPlaybookResponse{}, runtime.NewResponseError(resp) - } - return client.manualTriggerPlaybookHandleResponse(resp) -} - -// manualTriggerPlaybookCreateRequest creates the ManualTriggerPlaybook request. -func (client *AutomationRulesClient) manualTriggerPlaybookCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, incidentIdentifier string, options *AutomationRulesClientManualTriggerPlaybookOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if workspaceName == "" { - return nil, errors.New("parameter workspaceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) - if incidentIdentifier == "" { - return nil, errors.New("parameter incidentIdentifier cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{incidentIdentifier}", url.PathEscape(incidentIdentifier)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header.Set("Accept", "application/json") - if options != nil && options.RequestBody != nil { - return req, runtime.MarshalAsJSON(req, *options.RequestBody) - } - return req, nil -} - -// manualTriggerPlaybookHandleResponse handles the ManualTriggerPlaybook response. -func (client *AutomationRulesClient) manualTriggerPlaybookHandleResponse(resp *http.Response) (AutomationRulesClientManualTriggerPlaybookResponse, error) { - result := AutomationRulesClientManualTriggerPlaybookResponse{RawResponse: resp} - if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { - return AutomationRulesClientManualTriggerPlaybookResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmark_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmark_client.go index 532847efc32d..35fa8dd86bba 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmark_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmark_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type BookmarkClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewBookmarkClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *BookmarkClient { +func NewBookmarkClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BookmarkClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &BookmarkClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Expand - Expand an bookmark @@ -95,7 +100,7 @@ func (client *BookmarkClient) expandCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -103,7 +108,7 @@ func (client *BookmarkClient) expandCreateRequest(ctx context.Context, resourceG // expandHandleResponse handles the Expand response. func (client *BookmarkClient) expandHandleResponse(resp *http.Response) (BookmarkClientExpandResponse, error) { - result := BookmarkClientExpandResponse{RawResponse: resp} + result := BookmarkClientExpandResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.BookmarkExpandResponse); err != nil { return BookmarkClientExpandResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarkrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarkrelations_client.go index 25bc17bdafbc..b7a62f0120cc 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarkrelations_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarkrelations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type BookmarkRelationsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewBookmarkRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *BookmarkRelationsClient { +func NewBookmarkRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BookmarkRelationsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &BookmarkRelationsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates the bookmark relation. @@ -102,7 +107,7 @@ func (client *BookmarkRelationsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, relation) @@ -110,7 +115,7 @@ func (client *BookmarkRelationsClient) createOrUpdateCreateRequest(ctx context.C // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *BookmarkRelationsClient) createOrUpdateHandleResponse(resp *http.Response) (BookmarkRelationsClientCreateOrUpdateResponse, error) { - result := BookmarkRelationsClientCreateOrUpdateResponse{RawResponse: resp} + result := BookmarkRelationsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { return BookmarkRelationsClientCreateOrUpdateResponse{}, err } @@ -137,7 +142,7 @@ func (client *BookmarkRelationsClient) Delete(ctx context.Context, resourceGroup if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return BookmarkRelationsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return BookmarkRelationsClientDeleteResponse{RawResponse: resp}, nil + return BookmarkRelationsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -168,7 +173,7 @@ func (client *BookmarkRelationsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -224,7 +229,7 @@ func (client *BookmarkRelationsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -232,7 +237,7 @@ func (client *BookmarkRelationsClient) getCreateRequest(ctx context.Context, res // getHandleResponse handles the Get response. func (client *BookmarkRelationsClient) getHandleResponse(resp *http.Response) (BookmarkRelationsClientGetResponse, error) { - result := BookmarkRelationsClientGetResponse{RawResponse: resp} + result := BookmarkRelationsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { return BookmarkRelationsClientGetResponse{}, err } @@ -245,16 +250,32 @@ func (client *BookmarkRelationsClient) getHandleResponse(resp *http.Response) (B // workspaceName - The name of the workspace. // bookmarkID - Bookmark ID // options - BookmarkRelationsClientListOptions contains the optional parameters for the BookmarkRelationsClient.List method. -func (client *BookmarkRelationsClient) List(resourceGroupName string, workspaceName string, bookmarkID string, options *BookmarkRelationsClientListOptions) *BookmarkRelationsClientListPager { - return &BookmarkRelationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, bookmarkID, options) +func (client *BookmarkRelationsClient) List(resourceGroupName string, workspaceName string, bookmarkID string, options *BookmarkRelationsClientListOptions) *runtime.Pager[BookmarkRelationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[BookmarkRelationsClientListResponse]{ + More: func(page BookmarkRelationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp BookmarkRelationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.RelationList.NextLink) + Fetcher: func(ctx context.Context, page *BookmarkRelationsClientListResponse) (BookmarkRelationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, bookmarkID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BookmarkRelationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BookmarkRelationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BookmarkRelationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -281,7 +302,7 @@ func (client *BookmarkRelationsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -301,7 +322,7 @@ func (client *BookmarkRelationsClient) listCreateRequest(ctx context.Context, re // listHandleResponse handles the List response. func (client *BookmarkRelationsClient) listHandleResponse(resp *http.Response) (BookmarkRelationsClientListResponse, error) { - result := BookmarkRelationsClientListResponse{RawResponse: resp} + result := BookmarkRelationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RelationList); err != nil { return BookmarkRelationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go index 30719147465c..7293b647f81d 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type BookmarksClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewBookmarksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *BookmarksClient { +func NewBookmarksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BookmarksClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &BookmarksClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the bookmark. @@ -96,7 +101,7 @@ func (client *BookmarksClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, bookmark) @@ -104,7 +109,7 @@ func (client *BookmarksClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *BookmarksClient) createOrUpdateHandleResponse(resp *http.Response) (BookmarksClientCreateOrUpdateResponse, error) { - result := BookmarksClientCreateOrUpdateResponse{RawResponse: resp} + result := BookmarksClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Bookmark); err != nil { return BookmarksClientCreateOrUpdateResponse{}, err } @@ -129,7 +134,7 @@ func (client *BookmarksClient) Delete(ctx context.Context, resourceGroupName str if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return BookmarksClientDeleteResponse{}, runtime.NewResponseError(resp) } - return BookmarksClientDeleteResponse{RawResponse: resp}, nil + return BookmarksClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -156,7 +161,7 @@ func (client *BookmarksClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -207,7 +212,7 @@ func (client *BookmarksClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -215,7 +220,7 @@ func (client *BookmarksClient) getCreateRequest(ctx context.Context, resourceGro // getHandleResponse handles the Get response. func (client *BookmarksClient) getHandleResponse(resp *http.Response) (BookmarksClientGetResponse, error) { - result := BookmarksClientGetResponse{RawResponse: resp} + result := BookmarksClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Bookmark); err != nil { return BookmarksClientGetResponse{}, err } @@ -227,16 +232,32 @@ func (client *BookmarksClient) getHandleResponse(resp *http.Response) (Bookmarks // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - BookmarksClientListOptions contains the optional parameters for the BookmarksClient.List method. -func (client *BookmarksClient) List(resourceGroupName string, workspaceName string, options *BookmarksClientListOptions) *BookmarksClientListPager { - return &BookmarksClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *BookmarksClient) List(resourceGroupName string, workspaceName string, options *BookmarksClientListOptions) *runtime.Pager[BookmarksClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[BookmarksClientListResponse]{ + More: func(page BookmarksClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp BookmarksClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.BookmarkList.NextLink) + Fetcher: func(ctx context.Context, page *BookmarksClientListResponse) (BookmarksClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return BookmarksClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BookmarksClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BookmarksClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -259,7 +280,7 @@ func (client *BookmarksClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -267,7 +288,7 @@ func (client *BookmarksClient) listCreateRequest(ctx context.Context, resourceGr // listHandleResponse handles the List response. func (client *BookmarksClient) listHandleResponse(resp *http.Response) (BookmarksClientListResponse, error) { - result := BookmarksClientListResponse{RawResponse: resp} + result := BookmarksClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.BookmarkList); err != nil { return BookmarksClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go index 79c3cd165536..0615ee09ea88 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -10,7 +10,7 @@ package armsecurityinsights const ( moduleName = "armsecurityinsights" - moduleVersion = "v0.1.1" + moduleVersion = "v0.2.0" ) // ActionType - The type of the automation rule action @@ -31,11 +31,6 @@ func PossibleActionTypeValues() []ActionType { } } -// ToPtr returns a *ActionType pointing to the current value. -func (c ActionType) ToPtr() *ActionType { - return &c -} - // AlertDetail - Alert detail type AlertDetail string @@ -54,11 +49,6 @@ func PossibleAlertDetailValues() []AlertDetail { } } -// ToPtr returns a *AlertDetail pointing to the current value. -func (c AlertDetail) ToPtr() *AlertDetail { - return &c -} - // AlertRuleKind - The kind of the alert rule type AlertRuleKind string @@ -83,11 +73,6 @@ func PossibleAlertRuleKindValues() []AlertRuleKind { } } -// ToPtr returns a *AlertRuleKind pointing to the current value. -func (c AlertRuleKind) ToPtr() *AlertRuleKind { - return &c -} - // AlertSeverity - The severity of the alert type AlertSeverity string @@ -112,11 +97,6 @@ func PossibleAlertSeverityValues() []AlertSeverity { } } -// ToPtr returns a *AlertSeverity pointing to the current value. -func (c AlertSeverity) ToPtr() *AlertSeverity { - return &c -} - // AlertStatus - The lifecycle status of the alert. type AlertStatus string @@ -144,11 +124,6 @@ func PossibleAlertStatusValues() []AlertStatus { } } -// ToPtr returns a *AlertStatus pointing to the current value. -func (c AlertStatus) ToPtr() *AlertStatus { - return &c -} - // AntispamMailDirection - The directionality of this mail message type AntispamMailDirection string @@ -173,11 +148,6 @@ func PossibleAntispamMailDirectionValues() []AntispamMailDirection { } } -// ToPtr returns a *AntispamMailDirection pointing to the current value. -func (c AntispamMailDirection) ToPtr() *AntispamMailDirection { - return &c -} - // AttackTactic - The severity for alerts created by this alert rule. type AttackTactic string @@ -224,11 +194,6 @@ func PossibleAttackTacticValues() []AttackTactic { } } -// ToPtr returns a *AttackTactic pointing to the current value. -func (c AttackTactic) ToPtr() *AttackTactic { - return &c -} - type AutomationRulePropertyConditionSupportedOperator string const ( @@ -271,11 +236,6 @@ func PossibleAutomationRulePropertyConditionSupportedOperatorValues() []Automati } } -// ToPtr returns a *AutomationRulePropertyConditionSupportedOperator pointing to the current value. -func (c AutomationRulePropertyConditionSupportedOperator) ToPtr() *AutomationRulePropertyConditionSupportedOperator { - return &c -} - // AutomationRulePropertyConditionSupportedProperty - The property to evaluate in an automation rule property condition type AutomationRulePropertyConditionSupportedProperty string @@ -450,11 +410,6 @@ func PossibleAutomationRulePropertyConditionSupportedPropertyValues() []Automati } } -// ToPtr returns a *AutomationRulePropertyConditionSupportedProperty pointing to the current value. -func (c AutomationRulePropertyConditionSupportedProperty) ToPtr() *AutomationRulePropertyConditionSupportedProperty { - return &c -} - type ConditionType string const ( @@ -469,11 +424,6 @@ func PossibleConditionTypeValues() []ConditionType { } } -// ToPtr returns a *ConditionType pointing to the current value. -func (c ConditionType) ToPtr() *ConditionType { - return &c -} - // ConfidenceLevel - The confidence level of this alert. type ConfidenceLevel string @@ -495,11 +445,6 @@ func PossibleConfidenceLevelValues() []ConfidenceLevel { } } -// ToPtr returns a *ConfidenceLevel pointing to the current value. -func (c ConfidenceLevel) ToPtr() *ConfidenceLevel { - return &c -} - // ConfidenceScoreStatus - The confidence score calculation status, i.e. indicating if score calculation is pending for this // alert, not applicable or final. type ConfidenceScoreStatus string @@ -526,11 +471,6 @@ func PossibleConfidenceScoreStatusValues() []ConfidenceScoreStatus { } } -// ToPtr returns a *ConfidenceScoreStatus pointing to the current value. -func (c ConfidenceScoreStatus) ToPtr() *ConfidenceScoreStatus { - return &c -} - // ConnectAuthKind - The authentication kind used to poll the data type ConnectAuthKind string @@ -549,11 +489,6 @@ func PossibleConnectAuthKindValues() []ConnectAuthKind { } } -// ToPtr returns a *ConnectAuthKind pointing to the current value. -func (c ConnectAuthKind) ToPtr() *ConnectAuthKind { - return &c -} - // ConnectivityType - type of connectivity type ConnectivityType string @@ -568,11 +503,6 @@ func PossibleConnectivityTypeValues() []ConnectivityType { } } -// ToPtr returns a *ConnectivityType pointing to the current value. -func (c ConnectivityType) ToPtr() *ConnectivityType { - return &c -} - // ContentType - The content type of a source control path. type ContentType string @@ -589,11 +519,6 @@ func PossibleContentTypeValues() []ContentType { } } -// ToPtr returns a *ContentType pointing to the current value. -func (c ContentType) ToPtr() *ContentType { - return &c -} - // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -614,11 +539,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// ToPtr returns a *CreatedByType pointing to the current value. -func (c CreatedByType) ToPtr() *CreatedByType { - return &c -} - // CustomEntityQueryKind - The kind of the entity query that supports put request. type CustomEntityQueryKind string @@ -633,11 +553,6 @@ func PossibleCustomEntityQueryKindValues() []CustomEntityQueryKind { } } -// ToPtr returns a *CustomEntityQueryKind pointing to the current value. -func (c CustomEntityQueryKind) ToPtr() *CustomEntityQueryKind { - return &c -} - // DataConnectorAuthorizationState - Describes the state of user's authorization for a connector kind. type DataConnectorAuthorizationState string @@ -654,11 +569,6 @@ func PossibleDataConnectorAuthorizationStateValues() []DataConnectorAuthorizatio } } -// ToPtr returns a *DataConnectorAuthorizationState pointing to the current value. -func (c DataConnectorAuthorizationState) ToPtr() *DataConnectorAuthorizationState { - return &c -} - // DataConnectorKind - The kind of the data connector type DataConnectorKind string @@ -671,6 +581,7 @@ const ( DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" DataConnectorKindDynamics365 DataConnectorKind = "Dynamics365" DataConnectorKindGenericUI DataConnectorKind = "GenericUI" + DataConnectorKindIOT DataConnectorKind = "IOT" DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" DataConnectorKindMicrosoftThreatIntelligence DataConnectorKind = "MicrosoftThreatIntelligence" @@ -695,6 +606,7 @@ func PossibleDataConnectorKindValues() []DataConnectorKind { DataConnectorKindAzureSecurityCenter, DataConnectorKindDynamics365, DataConnectorKindGenericUI, + DataConnectorKindIOT, DataConnectorKindMicrosoftCloudAppSecurity, DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, DataConnectorKindMicrosoftThreatIntelligence, @@ -709,11 +621,6 @@ func PossibleDataConnectorKindValues() []DataConnectorKind { } } -// ToPtr returns a *DataConnectorKind pointing to the current value. -func (c DataConnectorKind) ToPtr() *DataConnectorKind { - return &c -} - // DataConnectorLicenseState - Describes the state of user's license for a connector kind. type DataConnectorLicenseState string @@ -732,11 +639,6 @@ func PossibleDataConnectorLicenseStateValues() []DataConnectorLicenseState { } } -// ToPtr returns a *DataConnectorLicenseState pointing to the current value. -func (c DataConnectorLicenseState) ToPtr() *DataConnectorLicenseState { - return &c -} - // DataTypeState - Describe whether this data type connection is enabled or not. type DataTypeState string @@ -753,11 +655,6 @@ func PossibleDataTypeStateValues() []DataTypeState { } } -// ToPtr returns a *DataTypeState pointing to the current value. -func (c DataTypeState) ToPtr() *DataTypeState { - return &c -} - // DeliveryAction - The delivery action of this mail message like Delivered, Blocked, Replaced etc type DeliveryAction string @@ -785,11 +682,6 @@ func PossibleDeliveryActionValues() []DeliveryAction { } } -// ToPtr returns a *DeliveryAction pointing to the current value. -func (c DeliveryAction) ToPtr() *DeliveryAction { - return &c -} - // DeliveryLocation - The delivery location of this mail message like Inbox, JunkFolder etc type DeliveryLocation string @@ -829,9 +721,60 @@ func PossibleDeliveryLocationValues() []DeliveryLocation { } } -// ToPtr returns a *DeliveryLocation pointing to the current value. -func (c DeliveryLocation) ToPtr() *DeliveryLocation { - return &c +// DeploymentFetchStatus - Status while trying to fetch the deployment information. +type DeploymentFetchStatus string + +const ( + DeploymentFetchStatusNotFound DeploymentFetchStatus = "NotFound" + DeploymentFetchStatusSuccess DeploymentFetchStatus = "Success" + DeploymentFetchStatusUnauthorized DeploymentFetchStatus = "Unauthorized" +) + +// PossibleDeploymentFetchStatusValues returns the possible values for the DeploymentFetchStatus const type. +func PossibleDeploymentFetchStatusValues() []DeploymentFetchStatus { + return []DeploymentFetchStatus{ + DeploymentFetchStatusNotFound, + DeploymentFetchStatusSuccess, + DeploymentFetchStatusUnauthorized, + } +} + +// DeploymentResult - Status while trying to fetch the deployment information. +type DeploymentResult string + +const ( + DeploymentResultCanceled DeploymentResult = "Canceled" + DeploymentResultFailed DeploymentResult = "Failed" + DeploymentResultSuccess DeploymentResult = "Success" +) + +// PossibleDeploymentResultValues returns the possible values for the DeploymentResult const type. +func PossibleDeploymentResultValues() []DeploymentResult { + return []DeploymentResult{ + DeploymentResultCanceled, + DeploymentResultFailed, + DeploymentResultSuccess, + } +} + +// DeploymentState - The current state of the deployment. +type DeploymentState string + +const ( + DeploymentStateCanceling DeploymentState = "Canceling" + DeploymentStateCompleted DeploymentState = "Completed" + DeploymentStateInProgress DeploymentState = "In_Progress" + DeploymentStateQueued DeploymentState = "Queued" +) + +// PossibleDeploymentStateValues returns the possible values for the DeploymentState const type. +func PossibleDeploymentStateValues() []DeploymentState { + return []DeploymentState{ + DeploymentStateCanceling, + DeploymentStateCompleted, + DeploymentStateInProgress, + DeploymentStateQueued, + } } // ElevationToken - The elevation token associated with the process. @@ -855,11 +798,6 @@ func PossibleElevationTokenValues() []ElevationToken { } } -// ToPtr returns a *ElevationToken pointing to the current value. -func (c ElevationToken) ToPtr() *ElevationToken { - return &c -} - type EntityItemQueryKind string const ( @@ -874,11 +812,6 @@ func PossibleEntityItemQueryKindValues() []EntityItemQueryKind { } } -// ToPtr returns a *EntityItemQueryKind pointing to the current value. -func (c EntityItemQueryKind) ToPtr() *EntityItemQueryKind { - return &c -} - // EntityKind - The kind of the entity type EntityKind string @@ -954,11 +887,6 @@ func PossibleEntityKindValues() []EntityKind { } } -// ToPtr returns a *EntityKind pointing to the current value. -func (c EntityKind) ToPtr() *EntityKind { - return &c -} - // EntityMappingType - The V3 type of the mapped entity type EntityMappingType string @@ -1025,9 +953,20 @@ func PossibleEntityMappingTypeValues() []EntityMappingType { } } -// ToPtr returns a *EntityMappingType pointing to the current value. -func (c EntityMappingType) ToPtr() *EntityMappingType { - return &c +// EntityProviders - The entity provider that is synced. +type EntityProviders string + +const ( + EntityProvidersActiveDirectory EntityProviders = "ActiveDirectory" + EntityProvidersAzureActiveDirectory EntityProviders = "AzureActiveDirectory" +) + +// PossibleEntityProvidersValues returns the possible values for the EntityProviders const type. +func PossibleEntityProvidersValues() []EntityProviders { + return []EntityProviders{ + EntityProvidersActiveDirectory, + EntityProvidersAzureActiveDirectory, + } } // EntityQueryKind - The kind of the entity query @@ -1048,11 +987,6 @@ func PossibleEntityQueryKindValues() []EntityQueryKind { } } -// ToPtr returns a *EntityQueryKind pointing to the current value. -func (c EntityQueryKind) ToPtr() *EntityQueryKind { - return &c -} - // EntityQueryTemplateKind - The kind of the entity query template. type EntityQueryTemplateKind string @@ -1067,11 +1001,6 @@ func PossibleEntityQueryTemplateKindValues() []EntityQueryTemplateKind { } } -// ToPtr returns a *EntityQueryTemplateKind pointing to the current value. -func (c EntityQueryTemplateKind) ToPtr() *EntityQueryTemplateKind { - return &c -} - // EntityTimelineKind - The entity query kind type EntityTimelineKind string @@ -1093,11 +1022,6 @@ func PossibleEntityTimelineKindValues() []EntityTimelineKind { } } -// ToPtr returns a *EntityTimelineKind pointing to the current value. -func (c EntityTimelineKind) ToPtr() *EntityTimelineKind { - return &c -} - // EntityType - The type of the entity type EntityType string @@ -1173,11 +1097,6 @@ func PossibleEntityTypeValues() []EntityType { } } -// ToPtr returns a *EntityType pointing to the current value. -func (c EntityType) ToPtr() *EntityType { - return &c -} - type Enum13 string const ( @@ -1193,11 +1112,6 @@ func PossibleEnum13Values() []Enum13 { } } -// ToPtr returns a *Enum13 pointing to the current value. -func (c Enum13) ToPtr() *Enum13 { - return &c -} - type Enum15 string const ( @@ -1211,11 +1125,6 @@ func PossibleEnum15Values() []Enum15 { } } -// ToPtr returns a *Enum15 pointing to the current value. -func (c Enum15) ToPtr() *Enum15 { - return &c -} - // EventGroupingAggregationKind - The event grouping aggregation kinds type EventGroupingAggregationKind string @@ -1232,11 +1141,6 @@ func PossibleEventGroupingAggregationKindValues() []EventGroupingAggregationKind } } -// ToPtr returns a *EventGroupingAggregationKind pointing to the current value. -func (c EventGroupingAggregationKind) ToPtr() *EventGroupingAggregationKind { - return &c -} - // FileHashAlgorithm - The hash algorithm type. type FileHashAlgorithm string @@ -1264,11 +1168,6 @@ func PossibleFileHashAlgorithmValues() []FileHashAlgorithm { } } -// ToPtr returns a *FileHashAlgorithm pointing to the current value. -func (c FileHashAlgorithm) ToPtr() *FileHashAlgorithm { - return &c -} - // GetInsightsErrorKind - the query kind type GetInsightsErrorKind string @@ -1283,11 +1182,6 @@ func PossibleGetInsightsErrorKindValues() []GetInsightsErrorKind { } } -// ToPtr returns a *GetInsightsErrorKind pointing to the current value. -func (c GetInsightsErrorKind) ToPtr() *GetInsightsErrorKind { - return &c -} - // IncidentClassification - The reason the incident was closed type IncidentClassification string @@ -1312,11 +1206,6 @@ func PossibleIncidentClassificationValues() []IncidentClassification { } } -// ToPtr returns a *IncidentClassification pointing to the current value. -func (c IncidentClassification) ToPtr() *IncidentClassification { - return &c -} - // IncidentClassificationReason - The classification reason the incident was closed with type IncidentClassificationReason string @@ -1341,17 +1230,12 @@ func PossibleIncidentClassificationReasonValues() []IncidentClassificationReason } } -// ToPtr returns a *IncidentClassificationReason pointing to the current value. -func (c IncidentClassificationReason) ToPtr() *IncidentClassificationReason { - return &c -} - // IncidentLabelType - The type of the label type IncidentLabelType string const ( - // IncidentLabelTypeSystem - Label automatically created by the system - IncidentLabelTypeSystem IncidentLabelType = "System" + // IncidentLabelTypeAutoAssigned - Label automatically created by the system + IncidentLabelTypeAutoAssigned IncidentLabelType = "AutoAssigned" // IncidentLabelTypeUser - Label manually created by a user IncidentLabelTypeUser IncidentLabelType = "User" ) @@ -1359,16 +1243,11 @@ const ( // PossibleIncidentLabelTypeValues returns the possible values for the IncidentLabelType const type. func PossibleIncidentLabelTypeValues() []IncidentLabelType { return []IncidentLabelType{ - IncidentLabelTypeSystem, + IncidentLabelTypeAutoAssigned, IncidentLabelTypeUser, } } -// ToPtr returns a *IncidentLabelType pointing to the current value. -func (c IncidentLabelType) ToPtr() *IncidentLabelType { - return &c -} - // IncidentSeverity - The severity of the incident type IncidentSeverity string @@ -1393,11 +1272,6 @@ func PossibleIncidentSeverityValues() []IncidentSeverity { } } -// ToPtr returns a *IncidentSeverity pointing to the current value. -func (c IncidentSeverity) ToPtr() *IncidentSeverity { - return &c -} - // IncidentStatus - The status of the incident type IncidentStatus string @@ -1419,11 +1293,6 @@ func PossibleIncidentStatusValues() []IncidentStatus { } } -// ToPtr returns a *IncidentStatus pointing to the current value. -func (c IncidentStatus) ToPtr() *IncidentStatus { - return &c -} - // KillChainIntent - Holds the alert intent stage(s) mapping for this alert. type KillChainIntent string @@ -1512,29 +1381,27 @@ func PossibleKillChainIntentValues() []KillChainIntent { } } -// ToPtr returns a *KillChainIntent pointing to the current value. -func (c KillChainIntent) ToPtr() *KillChainIntent { - return &c -} - // Kind - The kind of content the metadata is for. type Kind string const ( - KindAnalyticsRule Kind = "AnalyticsRule" - KindAnalyticsRuleTemplate Kind = "AnalyticsRuleTemplate" - KindDataConnector Kind = "DataConnector" - KindDataType Kind = "DataType" - KindHuntingQuery Kind = "HuntingQuery" - KindInvestigationQuery Kind = "InvestigationQuery" - KindParser Kind = "Parser" - KindPlaybook Kind = "Playbook" - KindPlaybookTemplate Kind = "PlaybookTemplate" - KindSolution Kind = "Solution" - KindWatchlist Kind = "Watchlist" - KindWatchlistTemplate Kind = "WatchlistTemplate" - KindWorkbook Kind = "Workbook" - KindWorkbookTemplate Kind = "WorkbookTemplate" + KindAnalyticsRule Kind = "AnalyticsRule" + KindAnalyticsRuleTemplate Kind = "AnalyticsRuleTemplate" + KindAutomationRule Kind = "AutomationRule" + KindAzureFunction Kind = "AzureFunction" + KindDataConnector Kind = "DataConnector" + KindDataType Kind = "DataType" + KindHuntingQuery Kind = "HuntingQuery" + KindInvestigationQuery Kind = "InvestigationQuery" + KindLogicAppsCustomConnector Kind = "LogicAppsCustomConnector" + KindParser Kind = "Parser" + KindPlaybook Kind = "Playbook" + KindPlaybookTemplate Kind = "PlaybookTemplate" + KindSolution Kind = "Solution" + KindWatchlist Kind = "Watchlist" + KindWatchlistTemplate Kind = "WatchlistTemplate" + KindWorkbook Kind = "Workbook" + KindWorkbookTemplate Kind = "WorkbookTemplate" ) // PossibleKindValues returns the possible values for the Kind const type. @@ -1542,10 +1409,13 @@ func PossibleKindValues() []Kind { return []Kind{ KindAnalyticsRule, KindAnalyticsRuleTemplate, + KindAutomationRule, + KindAzureFunction, KindDataConnector, KindDataType, KindHuntingQuery, KindInvestigationQuery, + KindLogicAppsCustomConnector, KindParser, KindPlaybook, KindPlaybookTemplate, @@ -1557,11 +1427,6 @@ func PossibleKindValues() []Kind { } } -// ToPtr returns a *Kind pointing to the current value. -func (c Kind) ToPtr() *Kind { - return &c -} - // MatchingMethod - Grouping matching method. When method is Selected at least one of groupByEntities, groupByAlertDetails, // groupByCustomDetails must be provided and not empty. type MatchingMethod string @@ -1585,11 +1450,6 @@ func PossibleMatchingMethodValues() []MatchingMethod { } } -// ToPtr returns a *MatchingMethod pointing to the current value. -func (c MatchingMethod) ToPtr() *MatchingMethod { - return &c -} - // MicrosoftSecurityProductName - The alerts' productName on which the cases will be generated type MicrosoftSecurityProductName string @@ -1616,11 +1476,6 @@ func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName } } -// ToPtr returns a *MicrosoftSecurityProductName pointing to the current value. -func (c MicrosoftSecurityProductName) ToPtr() *MicrosoftSecurityProductName { - return &c -} - // OSFamily - The operating system type. type OSFamily string @@ -1648,11 +1503,6 @@ func PossibleOSFamilyValues() []OSFamily { } } -// ToPtr returns a *OSFamily pointing to the current value. -func (c OSFamily) ToPtr() *OSFamily { - return &c -} - // Operator - Operator used for list of dependencies in criteria array. type Operator string @@ -1669,11 +1519,6 @@ func PossibleOperatorValues() []Operator { } } -// ToPtr returns a *Operator pointing to the current value. -func (c Operator) ToPtr() *Operator { - return &c -} - // OutputType - Insights Column type. type OutputType string @@ -1694,11 +1539,6 @@ func PossibleOutputTypeValues() []OutputType { } } -// ToPtr returns a *OutputType pointing to the current value. -func (c OutputType) ToPtr() *OutputType { - return &c -} - // OwnerType - The type of the owner the incident is assigned to. type OwnerType string @@ -1720,11 +1560,6 @@ func PossibleOwnerTypeValues() []OwnerType { } } -// ToPtr returns a *OwnerType pointing to the current value. -func (c OwnerType) ToPtr() *OwnerType { - return &c -} - // PermissionProviderScope - Permission provider scope type PermissionProviderScope string @@ -1743,11 +1578,6 @@ func PossiblePermissionProviderScopeValues() []PermissionProviderScope { } } -// ToPtr returns a *PermissionProviderScope pointing to the current value. -func (c PermissionProviderScope) ToPtr() *PermissionProviderScope { - return &c -} - // PollingFrequency - The polling frequency for the TAXII server. type PollingFrequency string @@ -1769,11 +1599,6 @@ func PossiblePollingFrequencyValues() []PollingFrequency { } } -// ToPtr returns a *PollingFrequency pointing to the current value. -func (c PollingFrequency) ToPtr() *PollingFrequency { - return &c -} - // ProviderName - Provider name type ProviderName string @@ -1798,11 +1623,6 @@ func PossibleProviderNameValues() []ProviderName { } } -// ToPtr returns a *ProviderName pointing to the current value. -func (c ProviderName) ToPtr() *ProviderName { - return &c -} - // RegistryHive - the hive that holds the registry key. type RegistryHive string @@ -1845,11 +1665,6 @@ func PossibleRegistryHiveValues() []RegistryHive { } } -// ToPtr returns a *RegistryHive pointing to the current value. -func (c RegistryHive) ToPtr() *RegistryHive { - return &c -} - // RegistryValueKind - Specifies the data types to use when storing values in the registry, or identifies the data type of // a value in the registry. type RegistryValueKind string @@ -1887,11 +1702,6 @@ func PossibleRegistryValueKindValues() []RegistryValueKind { } } -// ToPtr returns a *RegistryValueKind pointing to the current value. -func (c RegistryValueKind) ToPtr() *RegistryValueKind { - return &c -} - // RepoType - The type of repository. type RepoType string @@ -1908,11 +1718,6 @@ func PossibleRepoTypeValues() []RepoType { } } -// ToPtr returns a *RepoType pointing to the current value. -func (c RepoType) ToPtr() *RepoType { - return &c -} - // SKUKind - The kind of the tier type SKUKind string @@ -1929,11 +1734,6 @@ func PossibleSKUKindValues() []SKUKind { } } -// ToPtr returns a *SKUKind pointing to the current value. -func (c SKUKind) ToPtr() *SKUKind { - return &c -} - // SettingKind - The kind of the setting type SettingKind string @@ -1954,11 +1754,6 @@ func PossibleSettingKindValues() []SettingKind { } } -// ToPtr returns a *SettingKind pointing to the current value. -func (c SettingKind) ToPtr() *SettingKind { - return &c -} - // SettingType - The kind of the setting type SettingType string @@ -1977,32 +1772,6 @@ func PossibleSettingTypeValues() []SettingType { } } -// ToPtr returns a *SettingType pointing to the current value. -func (c SettingType) ToPtr() *SettingType { - return &c -} - -// Source - The source of the watchlist -type Source string - -const ( - SourceLocalFile Source = "Local file" - SourceRemoteStorage Source = "Remote storage" -) - -// PossibleSourceValues returns the possible values for the Source const type. -func PossibleSourceValues() []Source { - return []Source{ - SourceLocalFile, - SourceRemoteStorage, - } -} - -// ToPtr returns a *Source pointing to the current value. -func (c Source) ToPtr() *Source { - return &c -} - // SourceKind - Source type of the content type SourceKind string @@ -2023,9 +1792,20 @@ func PossibleSourceKindValues() []SourceKind { } } -// ToPtr returns a *SourceKind pointing to the current value. -func (c SourceKind) ToPtr() *SourceKind { - return &c +// SourceType - The sourceType of the watchlist +type SourceType string + +const ( + SourceTypeLocalFile SourceType = "Local file" + SourceTypeRemoteStorage SourceType = "Remote storage" +) + +// PossibleSourceTypeValues returns the possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{ + SourceTypeLocalFile, + SourceTypeRemoteStorage, + } } // SupportTier - Type of support for content item @@ -2046,11 +1826,6 @@ func PossibleSupportTierValues() []SupportTier { } } -// ToPtr returns a *SupportTier pointing to the current value. -func (c SupportTier) ToPtr() *SupportTier { - return &c -} - // TemplateStatus - The alert rule template status. type TemplateStatus string @@ -2072,11 +1847,6 @@ func PossibleTemplateStatusValues() []TemplateStatus { } } -// ToPtr returns a *TemplateStatus pointing to the current value. -func (c TemplateStatus) ToPtr() *TemplateStatus { - return &c -} - // ThreatIntelligenceResourceKindEnum - The kind of the threat intelligence entity type ThreatIntelligenceResourceKindEnum string @@ -2092,11 +1862,6 @@ func PossibleThreatIntelligenceResourceKindEnumValues() []ThreatIntelligenceReso } } -// ToPtr returns a *ThreatIntelligenceResourceKindEnum pointing to the current value. -func (c ThreatIntelligenceResourceKindEnum) ToPtr() *ThreatIntelligenceResourceKindEnum { - return &c -} - // ThreatIntelligenceSortingCriteriaEnum - Sorting order (ascending/descending/unsorted). type ThreatIntelligenceSortingCriteriaEnum string @@ -2115,11 +1880,6 @@ func PossibleThreatIntelligenceSortingCriteriaEnumValues() []ThreatIntelligenceS } } -// ToPtr returns a *ThreatIntelligenceSortingCriteriaEnum pointing to the current value. -func (c ThreatIntelligenceSortingCriteriaEnum) ToPtr() *ThreatIntelligenceSortingCriteriaEnum { - return &c -} - // TriggerOperator - The operation against the threshold that triggers alert rule. type TriggerOperator string @@ -2140,11 +1900,6 @@ func PossibleTriggerOperatorValues() []TriggerOperator { } } -// ToPtr returns a *TriggerOperator pointing to the current value. -func (c TriggerOperator) ToPtr() *TriggerOperator { - return &c -} - type TriggersOn string const ( @@ -2159,11 +1914,6 @@ func PossibleTriggersOnValues() []TriggersOn { } } -// ToPtr returns a *TriggersOn pointing to the current value. -func (c TriggersOn) ToPtr() *TriggersOn { - return &c -} - type TriggersWhen string const ( @@ -2178,11 +1928,6 @@ func PossibleTriggersWhenValues() []TriggersWhen { } } -// ToPtr returns a *TriggersWhen pointing to the current value. -func (c TriggersWhen) ToPtr() *TriggersWhen { - return &c -} - // UebaDataSources - The data source that enriched by ueba. type UebaDataSources string @@ -2203,7 +1948,18 @@ func PossibleUebaDataSourcesValues() []UebaDataSources { } } -// ToPtr returns a *UebaDataSources pointing to the current value. -func (c UebaDataSources) ToPtr() *UebaDataSources { - return &c +// Version - The version of the source control. +type Version string + +const ( + VersionV1 Version = "V1" + VersionV2 Version = "V2" +) + +// PossibleVersionValues returns the possible values for the Version const type. +func PossibleVersionValues() []Version { + return []Version{ + VersionV1, + VersionV2, + } } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectors_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectors_client.go index 30c72025d870..e6b1da4b8d4e 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectors_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectors_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type DataConnectorsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewDataConnectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DataConnectorsClient { +func NewDataConnectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataConnectorsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &DataConnectorsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Connect - Connects a data connector. @@ -68,7 +73,7 @@ func (client *DataConnectorsClient) Connect(ctx context.Context, resourceGroupNa if !runtime.HasStatusCode(resp, http.StatusOK) { return DataConnectorsClientConnectResponse{}, runtime.NewResponseError(resp) } - return DataConnectorsClientConnectResponse{RawResponse: resp}, nil + return DataConnectorsClientConnectResponse{}, nil } // connectCreateRequest creates the Connect request. @@ -95,7 +100,7 @@ func (client *DataConnectorsClient) connectCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, connectBody) @@ -148,7 +153,7 @@ func (client *DataConnectorsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, dataConnector) @@ -156,7 +161,7 @@ func (client *DataConnectorsClient) createOrUpdateCreateRequest(ctx context.Cont // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *DataConnectorsClient) createOrUpdateHandleResponse(resp *http.Response) (DataConnectorsClientCreateOrUpdateResponse, error) { - result := DataConnectorsClientCreateOrUpdateResponse{RawResponse: resp} + result := DataConnectorsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return DataConnectorsClientCreateOrUpdateResponse{}, err } @@ -181,7 +186,7 @@ func (client *DataConnectorsClient) Delete(ctx context.Context, resourceGroupNam if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return DataConnectorsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return DataConnectorsClientDeleteResponse{RawResponse: resp}, nil + return DataConnectorsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -208,7 +213,7 @@ func (client *DataConnectorsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -233,7 +238,7 @@ func (client *DataConnectorsClient) Disconnect(ctx context.Context, resourceGrou if !runtime.HasStatusCode(resp, http.StatusOK) { return DataConnectorsClientDisconnectResponse{}, runtime.NewResponseError(resp) } - return DataConnectorsClientDisconnectResponse{RawResponse: resp}, nil + return DataConnectorsClientDisconnectResponse{}, nil } // disconnectCreateRequest creates the Disconnect request. @@ -260,7 +265,7 @@ func (client *DataConnectorsClient) disconnectCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -311,7 +316,7 @@ func (client *DataConnectorsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -319,7 +324,7 @@ func (client *DataConnectorsClient) getCreateRequest(ctx context.Context, resour // getHandleResponse handles the Get response. func (client *DataConnectorsClient) getHandleResponse(resp *http.Response) (DataConnectorsClientGetResponse, error) { - result := DataConnectorsClientGetResponse{RawResponse: resp} + result := DataConnectorsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return DataConnectorsClientGetResponse{}, err } @@ -331,16 +336,32 @@ func (client *DataConnectorsClient) getHandleResponse(resp *http.Response) (Data // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - DataConnectorsClientListOptions contains the optional parameters for the DataConnectorsClient.List method. -func (client *DataConnectorsClient) List(resourceGroupName string, workspaceName string, options *DataConnectorsClientListOptions) *DataConnectorsClientListPager { - return &DataConnectorsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *DataConnectorsClient) List(resourceGroupName string, workspaceName string, options *DataConnectorsClientListOptions) *runtime.Pager[DataConnectorsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[DataConnectorsClientListResponse]{ + More: func(page DataConnectorsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp DataConnectorsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.DataConnectorList.NextLink) + Fetcher: func(ctx context.Context, page *DataConnectorsClientListResponse) (DataConnectorsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DataConnectorsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataConnectorsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataConnectorsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -363,7 +384,7 @@ func (client *DataConnectorsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -371,7 +392,7 @@ func (client *DataConnectorsClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *DataConnectorsClient) listHandleResponse(resp *http.Response) (DataConnectorsClientListResponse, error) { - result := DataConnectorsClientListResponse{RawResponse: resp} + result := DataConnectorsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DataConnectorList); err != nil { return DataConnectorsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectorscheckrequirements_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectorscheckrequirements_client.go index 12cc8c29efa4..dff36663792b 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectorscheckrequirements_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectorscheckrequirements_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type DataConnectorsCheckRequirementsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewDataConnectorsCheckRequirementsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DataConnectorsCheckRequirementsClient { +func NewDataConnectorsCheckRequirementsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataConnectorsCheckRequirementsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &DataConnectorsCheckRequirementsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Post - Get requirements state for a data connector type. @@ -91,7 +96,7 @@ func (client *DataConnectorsCheckRequirementsClient) postCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, dataConnectorsCheckRequirements) @@ -99,7 +104,7 @@ func (client *DataConnectorsCheckRequirementsClient) postCreateRequest(ctx conte // postHandleResponse handles the Post response. func (client *DataConnectorsCheckRequirementsClient) postHandleResponse(resp *http.Response) (DataConnectorsCheckRequirementsClientPostResponse, error) { - result := DataConnectorsCheckRequirementsClientPostResponse{RawResponse: resp} + result := DataConnectorsCheckRequirementsClientPostResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DataConnectorRequirementsState); err != nil { return DataConnectorsCheckRequirementsClientPostResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_date_type.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_date_type.go index 170111be32bd..40c2e0114a98 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_date_type.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_date_type.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_domainwhois_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_domainwhois_client.go index 75558991c9b0..a3e031e72c7a 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_domainwhois_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_domainwhois_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type DomainWhoisClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewDomainWhoisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DomainWhoisClient { +func NewDomainWhoisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DomainWhoisClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &DomainWhoisClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Get whois information for a single domain name @@ -85,7 +90,7 @@ func (client *DomainWhoisClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") reqQP.Set("domain", domain) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") @@ -94,7 +99,7 @@ func (client *DomainWhoisClient) getCreateRequest(ctx context.Context, resourceG // getHandleResponse handles the Get response. func (client *DomainWhoisClient) getHandleResponse(resp *http.Response) (DomainWhoisClientGetResponse, error) { - result := DomainWhoisClientGetResponse{RawResponse: resp} + result := DomainWhoisClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EnrichmentDomainWhois); err != nil { return DomainWhoisClientGetResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entities_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entities_client.go index 4bdf6e8f23bc..841ae48ce7a2 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entities_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entities_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type EntitiesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewEntitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *EntitiesClient { +func NewEntitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EntitiesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &EntitiesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Expand - Expands an entity. @@ -95,7 +100,7 @@ func (client *EntitiesClient) expandCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -103,7 +108,7 @@ func (client *EntitiesClient) expandCreateRequest(ctx context.Context, resourceG // expandHandleResponse handles the Expand response. func (client *EntitiesClient) expandHandleResponse(resp *http.Response) (EntitiesClientExpandResponse, error) { - result := EntitiesClientExpandResponse{RawResponse: resp} + result := EntitiesClientExpandResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EntityExpandResponse); err != nil { return EntitiesClientExpandResponse{}, err } @@ -155,7 +160,7 @@ func (client *EntitiesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -163,7 +168,7 @@ func (client *EntitiesClient) getCreateRequest(ctx context.Context, resourceGrou // getHandleResponse handles the Get response. func (client *EntitiesClient) getHandleResponse(resp *http.Response) (EntitiesClientGetResponse, error) { - result := EntitiesClientGetResponse{RawResponse: resp} + result := EntitiesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return EntitiesClientGetResponse{}, err } @@ -216,7 +221,7 @@ func (client *EntitiesClient) getInsightsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -224,7 +229,7 @@ func (client *EntitiesClient) getInsightsCreateRequest(ctx context.Context, reso // getInsightsHandleResponse handles the GetInsights response. func (client *EntitiesClient) getInsightsHandleResponse(resp *http.Response) (EntitiesClientGetInsightsResponse, error) { - result := EntitiesClientGetInsightsResponse{RawResponse: resp} + result := EntitiesClientGetInsightsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EntityGetInsightsResponse); err != nil { return EntitiesClientGetInsightsResponse{}, err } @@ -236,16 +241,32 @@ func (client *EntitiesClient) getInsightsHandleResponse(resp *http.Response) (En // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - EntitiesClientListOptions contains the optional parameters for the EntitiesClient.List method. -func (client *EntitiesClient) List(resourceGroupName string, workspaceName string, options *EntitiesClientListOptions) *EntitiesClientListPager { - return &EntitiesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *EntitiesClient) List(resourceGroupName string, workspaceName string, options *EntitiesClientListOptions) *runtime.Pager[EntitiesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[EntitiesClientListResponse]{ + More: func(page EntitiesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp EntitiesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.EntityList.NextLink) + Fetcher: func(ctx context.Context, page *EntitiesClientListResponse) (EntitiesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return EntitiesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntitiesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntitiesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -268,7 +289,7 @@ func (client *EntitiesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -276,7 +297,7 @@ func (client *EntitiesClient) listCreateRequest(ctx context.Context, resourceGro // listHandleResponse handles the List response. func (client *EntitiesClient) listHandleResponse(resp *http.Response) (EntitiesClientListResponse, error) { - result := EntitiesClientListResponse{RawResponse: resp} + result := EntitiesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EntityList); err != nil { return EntitiesClientListResponse{}, err } @@ -329,7 +350,7 @@ func (client *EntitiesClient) queriesCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") reqQP.Set("kind", string(kind)) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") @@ -338,7 +359,7 @@ func (client *EntitiesClient) queriesCreateRequest(ctx context.Context, resource // queriesHandleResponse handles the Queries response. func (client *EntitiesClient) queriesHandleResponse(resp *http.Response) (EntitiesClientQueriesResponse, error) { - result := EntitiesClientQueriesResponse{RawResponse: resp} + result := EntitiesClientQueriesResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.GetQueriesResponse); err != nil { return EntitiesClientQueriesResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesgettimeline_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesgettimeline_client.go index cd09dbd813f7..72e25f076299 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesgettimeline_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesgettimeline_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type EntitiesGetTimelineClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewEntitiesGetTimelineClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *EntitiesGetTimelineClient { +func NewEntitiesGetTimelineClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EntitiesGetTimelineClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &EntitiesGetTimelineClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - Timeline for an entity. @@ -96,7 +101,7 @@ func (client *EntitiesGetTimelineClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, parameters) @@ -104,7 +109,7 @@ func (client *EntitiesGetTimelineClient) listCreateRequest(ctx context.Context, // listHandleResponse handles the List response. func (client *EntitiesGetTimelineClient) listHandleResponse(resp *http.Response) (EntitiesGetTimelineClientListResponse, error) { - result := EntitiesGetTimelineClientListResponse{RawResponse: resp} + result := EntitiesGetTimelineClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EntityTimelineResponse); err != nil { return EntitiesGetTimelineClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesrelations_client.go index f98f6a9a31a3..10979ee1d9c4 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesrelations_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesrelations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type EntitiesRelationsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewEntitiesRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *EntitiesRelationsClient { +func NewEntitiesRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EntitiesRelationsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &EntitiesRelationsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - Gets all relations of an entity. @@ -56,16 +61,32 @@ func NewEntitiesRelationsClient(subscriptionID string, credential azcore.TokenCr // workspaceName - The name of the workspace. // entityID - entity ID // options - EntitiesRelationsClientListOptions contains the optional parameters for the EntitiesRelationsClient.List method. -func (client *EntitiesRelationsClient) List(resourceGroupName string, workspaceName string, entityID string, options *EntitiesRelationsClientListOptions) *EntitiesRelationsClientListPager { - return &EntitiesRelationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, entityID, options) +func (client *EntitiesRelationsClient) List(resourceGroupName string, workspaceName string, entityID string, options *EntitiesRelationsClientListOptions) *runtime.Pager[EntitiesRelationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[EntitiesRelationsClientListResponse]{ + More: func(page EntitiesRelationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp EntitiesRelationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.RelationList.NextLink) + Fetcher: func(ctx context.Context, page *EntitiesRelationsClientListResponse) (EntitiesRelationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, entityID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return EntitiesRelationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntitiesRelationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntitiesRelationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -92,7 +113,7 @@ func (client *EntitiesRelationsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -112,7 +133,7 @@ func (client *EntitiesRelationsClient) listCreateRequest(ctx context.Context, re // listHandleResponse handles the List response. func (client *EntitiesRelationsClient) listHandleResponse(resp *http.Response) (EntitiesRelationsClientListResponse, error) { - result := EntitiesRelationsClientListResponse{RawResponse: resp} + result := EntitiesRelationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RelationList); err != nil { return EntitiesRelationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityqueries_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityqueries_client.go index 061974893f96..f07541569c79 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityqueries_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityqueries_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type EntityQueriesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewEntityQueriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *EntityQueriesClient { +func NewEntityQueriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EntityQueriesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &EntityQueriesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the entity query. @@ -96,7 +101,7 @@ func (client *EntityQueriesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, entityQuery) @@ -104,7 +109,7 @@ func (client *EntityQueriesClient) createOrUpdateCreateRequest(ctx context.Conte // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *EntityQueriesClient) createOrUpdateHandleResponse(resp *http.Response) (EntityQueriesClientCreateOrUpdateResponse, error) { - result := EntityQueriesClientCreateOrUpdateResponse{RawResponse: resp} + result := EntityQueriesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return EntityQueriesClientCreateOrUpdateResponse{}, err } @@ -129,7 +134,7 @@ func (client *EntityQueriesClient) Delete(ctx context.Context, resourceGroupName if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return EntityQueriesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return EntityQueriesClientDeleteResponse{RawResponse: resp}, nil + return EntityQueriesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -156,7 +161,7 @@ func (client *EntityQueriesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -207,7 +212,7 @@ func (client *EntityQueriesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -215,7 +220,7 @@ func (client *EntityQueriesClient) getCreateRequest(ctx context.Context, resourc // getHandleResponse handles the Get response. func (client *EntityQueriesClient) getHandleResponse(resp *http.Response) (EntityQueriesClientGetResponse, error) { - result := EntityQueriesClientGetResponse{RawResponse: resp} + result := EntityQueriesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return EntityQueriesClientGetResponse{}, err } @@ -227,16 +232,32 @@ func (client *EntityQueriesClient) getHandleResponse(resp *http.Response) (Entit // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - EntityQueriesClientListOptions contains the optional parameters for the EntityQueriesClient.List method. -func (client *EntityQueriesClient) List(resourceGroupName string, workspaceName string, options *EntityQueriesClientListOptions) *EntityQueriesClientListPager { - return &EntityQueriesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *EntityQueriesClient) List(resourceGroupName string, workspaceName string, options *EntityQueriesClientListOptions) *runtime.Pager[EntityQueriesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[EntityQueriesClientListResponse]{ + More: func(page EntityQueriesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp EntityQueriesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.EntityQueryList.NextLink) + Fetcher: func(ctx context.Context, page *EntityQueriesClientListResponse) (EntityQueriesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return EntityQueriesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntityQueriesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntityQueriesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -262,7 +283,7 @@ func (client *EntityQueriesClient) listCreateRequest(ctx context.Context, resour if options != nil && options.Kind != nil { reqQP.Set("kind", string(*options.Kind)) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -270,7 +291,7 @@ func (client *EntityQueriesClient) listCreateRequest(ctx context.Context, resour // listHandleResponse handles the List response. func (client *EntityQueriesClient) listHandleResponse(resp *http.Response) (EntityQueriesClientListResponse, error) { - result := EntityQueriesClientListResponse{RawResponse: resp} + result := EntityQueriesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EntityQueryList); err != nil { return EntityQueriesClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityquerytemplates_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityquerytemplates_client.go index 40e3449cd40c..f5f484dd4d70 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityquerytemplates_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityquerytemplates_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type EntityQueryTemplatesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewEntityQueryTemplatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *EntityQueryTemplatesClient { +func NewEntityQueryTemplatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EntityQueryTemplatesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &EntityQueryTemplatesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Gets an entity query. @@ -95,7 +100,7 @@ func (client *EntityQueryTemplatesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -103,7 +108,7 @@ func (client *EntityQueryTemplatesClient) getCreateRequest(ctx context.Context, // getHandleResponse handles the Get response. func (client *EntityQueryTemplatesClient) getHandleResponse(resp *http.Response) (EntityQueryTemplatesClientGetResponse, error) { - result := EntityQueryTemplatesClientGetResponse{RawResponse: resp} + result := EntityQueryTemplatesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return EntityQueryTemplatesClientGetResponse{}, err } @@ -116,16 +121,32 @@ func (client *EntityQueryTemplatesClient) getHandleResponse(resp *http.Response) // workspaceName - The name of the workspace. // options - EntityQueryTemplatesClientListOptions contains the optional parameters for the EntityQueryTemplatesClient.List // method. -func (client *EntityQueryTemplatesClient) List(resourceGroupName string, workspaceName string, options *EntityQueryTemplatesClientListOptions) *EntityQueryTemplatesClientListPager { - return &EntityQueryTemplatesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *EntityQueryTemplatesClient) List(resourceGroupName string, workspaceName string, options *EntityQueryTemplatesClientListOptions) *runtime.Pager[EntityQueryTemplatesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[EntityQueryTemplatesClientListResponse]{ + More: func(page EntityQueryTemplatesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp EntityQueryTemplatesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.EntityQueryTemplateList.NextLink) + Fetcher: func(ctx context.Context, page *EntityQueryTemplatesClientListResponse) (EntityQueryTemplatesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return EntityQueryTemplatesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntityQueryTemplatesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntityQueryTemplatesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -151,7 +172,7 @@ func (client *EntityQueryTemplatesClient) listCreateRequest(ctx context.Context, if options != nil && options.Kind != nil { reqQP.Set("kind", string(*options.Kind)) } - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -159,7 +180,7 @@ func (client *EntityQueryTemplatesClient) listCreateRequest(ctx context.Context, // listHandleResponse handles the List response. func (client *EntityQueryTemplatesClient) listHandleResponse(resp *http.Response) (EntityQueryTemplatesClientListResponse, error) { - result := EntityQueryTemplatesClientListResponse{RawResponse: resp} + result := EntityQueryTemplatesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EntityQueryTemplateList); err != nil { return EntityQueryTemplatesClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityrelations_client.go index 8c0d3e1c8b6b..9c8e85b4c039 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityrelations_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityrelations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type EntityRelationsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewEntityRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *EntityRelationsClient { +func NewEntityRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EntityRelationsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &EntityRelationsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // GetRelation - Gets an entity relation. @@ -100,7 +105,7 @@ func (client *EntityRelationsClient) getRelationCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -108,7 +113,7 @@ func (client *EntityRelationsClient) getRelationCreateRequest(ctx context.Contex // getRelationHandleResponse handles the GetRelation response. func (client *EntityRelationsClient) getRelationHandleResponse(resp *http.Response) (EntityRelationsClientGetRelationResponse, error) { - result := EntityRelationsClientGetRelationResponse{RawResponse: resp} + result := EntityRelationsClientGetRelationResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { return EntityRelationsClientGetRelationResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go index 1e35c4425d42..32c6a9cc132d 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type IncidentCommentsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewIncidentCommentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *IncidentCommentsClient { +func NewIncidentCommentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IncidentCommentsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &IncidentCommentsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the incident comment. @@ -102,7 +107,7 @@ func (client *IncidentCommentsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, incidentComment) @@ -110,7 +115,7 @@ func (client *IncidentCommentsClient) createOrUpdateCreateRequest(ctx context.Co // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *IncidentCommentsClient) createOrUpdateHandleResponse(resp *http.Response) (IncidentCommentsClientCreateOrUpdateResponse, error) { - result := IncidentCommentsClientCreateOrUpdateResponse{RawResponse: resp} + result := IncidentCommentsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IncidentComment); err != nil { return IncidentCommentsClientCreateOrUpdateResponse{}, err } @@ -136,7 +141,7 @@ func (client *IncidentCommentsClient) Delete(ctx context.Context, resourceGroupN if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return IncidentCommentsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return IncidentCommentsClientDeleteResponse{RawResponse: resp}, nil + return IncidentCommentsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -167,7 +172,7 @@ func (client *IncidentCommentsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -223,7 +228,7 @@ func (client *IncidentCommentsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -231,7 +236,7 @@ func (client *IncidentCommentsClient) getCreateRequest(ctx context.Context, reso // getHandleResponse handles the Get response. func (client *IncidentCommentsClient) getHandleResponse(resp *http.Response) (IncidentCommentsClientGetResponse, error) { - result := IncidentCommentsClientGetResponse{RawResponse: resp} + result := IncidentCommentsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IncidentComment); err != nil { return IncidentCommentsClientGetResponse{}, err } @@ -244,16 +249,32 @@ func (client *IncidentCommentsClient) getHandleResponse(resp *http.Response) (In // workspaceName - The name of the workspace. // incidentID - Incident ID // options - IncidentCommentsClientListOptions contains the optional parameters for the IncidentCommentsClient.List method. -func (client *IncidentCommentsClient) List(resourceGroupName string, workspaceName string, incidentID string, options *IncidentCommentsClientListOptions) *IncidentCommentsClientListPager { - return &IncidentCommentsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, incidentID, options) +func (client *IncidentCommentsClient) List(resourceGroupName string, workspaceName string, incidentID string, options *IncidentCommentsClientListOptions) *runtime.Pager[IncidentCommentsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[IncidentCommentsClientListResponse]{ + More: func(page IncidentCommentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp IncidentCommentsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.IncidentCommentList.NextLink) + Fetcher: func(ctx context.Context, page *IncidentCommentsClientListResponse) (IncidentCommentsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, incidentID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IncidentCommentsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IncidentCommentsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IncidentCommentsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -280,7 +301,7 @@ func (client *IncidentCommentsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -300,7 +321,7 @@ func (client *IncidentCommentsClient) listCreateRequest(ctx context.Context, res // listHandleResponse handles the List response. func (client *IncidentCommentsClient) listHandleResponse(resp *http.Response) (IncidentCommentsClientListResponse, error) { - result := IncidentCommentsClientListResponse{RawResponse: resp} + result := IncidentCommentsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IncidentCommentList); err != nil { return IncidentCommentsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go index 4b7618501d56..deabb3a917a3 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type IncidentRelationsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewIncidentRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *IncidentRelationsClient { +func NewIncidentRelationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IncidentRelationsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &IncidentRelationsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the incident relation. @@ -102,7 +107,7 @@ func (client *IncidentRelationsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, relation) @@ -110,7 +115,7 @@ func (client *IncidentRelationsClient) createOrUpdateCreateRequest(ctx context.C // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *IncidentRelationsClient) createOrUpdateHandleResponse(resp *http.Response) (IncidentRelationsClientCreateOrUpdateResponse, error) { - result := IncidentRelationsClientCreateOrUpdateResponse{RawResponse: resp} + result := IncidentRelationsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { return IncidentRelationsClientCreateOrUpdateResponse{}, err } @@ -137,7 +142,7 @@ func (client *IncidentRelationsClient) Delete(ctx context.Context, resourceGroup if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return IncidentRelationsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return IncidentRelationsClientDeleteResponse{RawResponse: resp}, nil + return IncidentRelationsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -168,7 +173,7 @@ func (client *IncidentRelationsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -224,7 +229,7 @@ func (client *IncidentRelationsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -232,7 +237,7 @@ func (client *IncidentRelationsClient) getCreateRequest(ctx context.Context, res // getHandleResponse handles the Get response. func (client *IncidentRelationsClient) getHandleResponse(resp *http.Response) (IncidentRelationsClientGetResponse, error) { - result := IncidentRelationsClientGetResponse{RawResponse: resp} + result := IncidentRelationsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { return IncidentRelationsClientGetResponse{}, err } @@ -245,16 +250,32 @@ func (client *IncidentRelationsClient) getHandleResponse(resp *http.Response) (I // workspaceName - The name of the workspace. // incidentID - Incident ID // options - IncidentRelationsClientListOptions contains the optional parameters for the IncidentRelationsClient.List method. -func (client *IncidentRelationsClient) List(resourceGroupName string, workspaceName string, incidentID string, options *IncidentRelationsClientListOptions) *IncidentRelationsClientListPager { - return &IncidentRelationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, incidentID, options) +func (client *IncidentRelationsClient) List(resourceGroupName string, workspaceName string, incidentID string, options *IncidentRelationsClientListOptions) *runtime.Pager[IncidentRelationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[IncidentRelationsClientListResponse]{ + More: func(page IncidentRelationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp IncidentRelationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.RelationList.NextLink) + Fetcher: func(ctx context.Context, page *IncidentRelationsClientListResponse) (IncidentRelationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, incidentID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IncidentRelationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IncidentRelationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IncidentRelationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -281,7 +302,7 @@ func (client *IncidentRelationsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -301,7 +322,7 @@ func (client *IncidentRelationsClient) listCreateRequest(ctx context.Context, re // listHandleResponse handles the List response. func (client *IncidentRelationsClient) listHandleResponse(resp *http.Response) (IncidentRelationsClientListResponse, error) { - result := IncidentRelationsClientListResponse{RawResponse: resp} + result := IncidentRelationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RelationList); err != nil { return IncidentRelationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go index cec5d7a10e47..2ffee86d64ec 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type IncidentsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewIncidentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *IncidentsClient { +func NewIncidentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IncidentsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &IncidentsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates the incident. @@ -97,7 +102,7 @@ func (client *IncidentsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, incident) @@ -105,7 +110,7 @@ func (client *IncidentsClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *IncidentsClient) createOrUpdateHandleResponse(resp *http.Response) (IncidentsClientCreateOrUpdateResponse, error) { - result := IncidentsClientCreateOrUpdateResponse{RawResponse: resp} + result := IncidentsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Incident); err != nil { return IncidentsClientCreateOrUpdateResponse{}, err } @@ -158,7 +163,7 @@ func (client *IncidentsClient) createTeamCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, teamProperties) @@ -166,7 +171,7 @@ func (client *IncidentsClient) createTeamCreateRequest(ctx context.Context, reso // createTeamHandleResponse handles the CreateTeam response. func (client *IncidentsClient) createTeamHandleResponse(resp *http.Response) (IncidentsClientCreateTeamResponse, error) { - result := IncidentsClientCreateTeamResponse{RawResponse: resp} + result := IncidentsClientCreateTeamResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.TeamInformation); err != nil { return IncidentsClientCreateTeamResponse{}, err } @@ -191,7 +196,7 @@ func (client *IncidentsClient) Delete(ctx context.Context, resourceGroupName str if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return IncidentsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return IncidentsClientDeleteResponse{RawResponse: resp}, nil + return IncidentsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -218,7 +223,7 @@ func (client *IncidentsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -269,7 +274,7 @@ func (client *IncidentsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -277,7 +282,7 @@ func (client *IncidentsClient) getCreateRequest(ctx context.Context, resourceGro // getHandleResponse handles the Get response. func (client *IncidentsClient) getHandleResponse(resp *http.Response) (IncidentsClientGetResponse, error) { - result := IncidentsClientGetResponse{RawResponse: resp} + result := IncidentsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Incident); err != nil { return IncidentsClientGetResponse{}, err } @@ -289,16 +294,32 @@ func (client *IncidentsClient) getHandleResponse(resp *http.Response) (Incidents // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - IncidentsClientListOptions contains the optional parameters for the IncidentsClient.List method. -func (client *IncidentsClient) List(resourceGroupName string, workspaceName string, options *IncidentsClientListOptions) *IncidentsClientListPager { - return &IncidentsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *IncidentsClient) List(resourceGroupName string, workspaceName string, options *IncidentsClientListOptions) *runtime.Pager[IncidentsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[IncidentsClientListResponse]{ + More: func(page IncidentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp IncidentsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.IncidentList.NextLink) + Fetcher: func(ctx context.Context, page *IncidentsClientListResponse) (IncidentsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IncidentsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IncidentsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IncidentsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -321,7 +342,7 @@ func (client *IncidentsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -341,7 +362,7 @@ func (client *IncidentsClient) listCreateRequest(ctx context.Context, resourceGr // listHandleResponse handles the List response. func (client *IncidentsClient) listHandleResponse(resp *http.Response) (IncidentsClientListResponse, error) { - result := IncidentsClientListResponse{RawResponse: resp} + result := IncidentsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IncidentList); err != nil { return IncidentsClientListResponse{}, err } @@ -393,7 +414,7 @@ func (client *IncidentsClient) listAlertsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -401,7 +422,7 @@ func (client *IncidentsClient) listAlertsCreateRequest(ctx context.Context, reso // listAlertsHandleResponse handles the ListAlerts response. func (client *IncidentsClient) listAlertsHandleResponse(resp *http.Response) (IncidentsClientListAlertsResponse, error) { - result := IncidentsClientListAlertsResponse{RawResponse: resp} + result := IncidentsClientListAlertsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IncidentAlertList); err != nil { return IncidentsClientListAlertsResponse{}, err } @@ -453,7 +474,7 @@ func (client *IncidentsClient) listBookmarksCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -461,7 +482,7 @@ func (client *IncidentsClient) listBookmarksCreateRequest(ctx context.Context, r // listBookmarksHandleResponse handles the ListBookmarks response. func (client *IncidentsClient) listBookmarksHandleResponse(resp *http.Response) (IncidentsClientListBookmarksResponse, error) { - result := IncidentsClientListBookmarksResponse{RawResponse: resp} + result := IncidentsClientListBookmarksResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IncidentBookmarkList); err != nil { return IncidentsClientListBookmarksResponse{}, err } @@ -513,7 +534,7 @@ func (client *IncidentsClient) listEntitiesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -521,9 +542,71 @@ func (client *IncidentsClient) listEntitiesCreateRequest(ctx context.Context, re // listEntitiesHandleResponse handles the ListEntities response. func (client *IncidentsClient) listEntitiesHandleResponse(resp *http.Response) (IncidentsClientListEntitiesResponse, error) { - result := IncidentsClientListEntitiesResponse{RawResponse: resp} + result := IncidentsClientListEntitiesResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IncidentEntitiesResponse); err != nil { return IncidentsClientListEntitiesResponse{}, err } return result, nil } + +// RunPlaybook - Triggers playbook on a specific incident +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// options - IncidentsClientRunPlaybookOptions contains the optional parameters for the IncidentsClient.RunPlaybook method. +func (client *IncidentsClient) RunPlaybook(ctx context.Context, resourceGroupName string, workspaceName string, incidentIdentifier string, options *IncidentsClientRunPlaybookOptions) (IncidentsClientRunPlaybookResponse, error) { + req, err := client.runPlaybookCreateRequest(ctx, resourceGroupName, workspaceName, incidentIdentifier, options) + if err != nil { + return IncidentsClientRunPlaybookResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IncidentsClientRunPlaybookResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusNoContent) { + return IncidentsClientRunPlaybookResponse{}, runtime.NewResponseError(resp) + } + return client.runPlaybookHandleResponse(resp) +} + +// runPlaybookCreateRequest creates the RunPlaybook request. +func (client *IncidentsClient) runPlaybookCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, incidentIdentifier string, options *IncidentsClientRunPlaybookOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentIdentifier}/runPlaybook" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if workspaceName == "" { + return nil, errors.New("parameter workspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{workspaceName}", url.PathEscape(workspaceName)) + if incidentIdentifier == "" { + return nil, errors.New("parameter incidentIdentifier cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{incidentIdentifier}", url.PathEscape(incidentIdentifier)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-04-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + if options != nil && options.RequestBody != nil { + return req, runtime.MarshalAsJSON(req, *options.RequestBody) + } + return req, nil +} + +// runPlaybookHandleResponse handles the RunPlaybook response. +func (client *IncidentsClient) runPlaybookHandleResponse(resp *http.Response) (IncidentsClientRunPlaybookResponse, error) { + result := IncidentsClientRunPlaybookResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Interface); err != nil { + return IncidentsClientRunPlaybookResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_ipgeodata_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_ipgeodata_client.go index 1b093a1bca4f..f880b2fbf886 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_ipgeodata_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_ipgeodata_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type IPGeodataClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewIPGeodataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *IPGeodataClient { +func NewIPGeodataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPGeodataClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &IPGeodataClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Get geodata for a single IP address @@ -85,7 +90,7 @@ func (client *IPGeodataClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") reqQP.Set("ipAddress", ipAddress) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") @@ -94,7 +99,7 @@ func (client *IPGeodataClient) getCreateRequest(ctx context.Context, resourceGro // getHandleResponse handles the Get response. func (client *IPGeodataClient) getHandleResponse(resp *http.Response) (IPGeodataClientGetResponse, error) { - result := IPGeodataClientGetResponse{RawResponse: resp} + result := IPGeodataClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.EnrichmentIPGeodata); err != nil { return IPGeodataClientGetResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_metadata_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_metadata_client.go index d89dd54293ca..ff1064672fa3 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_metadata_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_metadata_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type MetadataClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewMetadataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MetadataClient { +func NewMetadataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MetadataClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &MetadataClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Create - Create a Metadata. @@ -96,7 +101,7 @@ func (client *MetadataClient) createCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, metadata) @@ -104,7 +109,7 @@ func (client *MetadataClient) createCreateRequest(ctx context.Context, resourceG // createHandleResponse handles the Create response. func (client *MetadataClient) createHandleResponse(resp *http.Response) (MetadataClientCreateResponse, error) { - result := MetadataClientCreateResponse{RawResponse: resp} + result := MetadataClientCreateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MetadataModel); err != nil { return MetadataClientCreateResponse{}, err } @@ -129,7 +134,7 @@ func (client *MetadataClient) Delete(ctx context.Context, resourceGroupName stri if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return MetadataClientDeleteResponse{}, runtime.NewResponseError(resp) } - return MetadataClientDeleteResponse{RawResponse: resp}, nil + return MetadataClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -156,7 +161,7 @@ func (client *MetadataClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -207,7 +212,7 @@ func (client *MetadataClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -215,7 +220,7 @@ func (client *MetadataClient) getCreateRequest(ctx context.Context, resourceGrou // getHandleResponse handles the Get response. func (client *MetadataClient) getHandleResponse(resp *http.Response) (MetadataClientGetResponse, error) { - result := MetadataClientGetResponse{RawResponse: resp} + result := MetadataClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MetadataModel); err != nil { return MetadataClientGetResponse{}, err } @@ -227,16 +232,32 @@ func (client *MetadataClient) getHandleResponse(resp *http.Response) (MetadataCl // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - MetadataClientListOptions contains the optional parameters for the MetadataClient.List method. -func (client *MetadataClient) List(resourceGroupName string, workspaceName string, options *MetadataClientListOptions) *MetadataClientListPager { - return &MetadataClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *MetadataClient) List(resourceGroupName string, workspaceName string, options *MetadataClientListOptions) *runtime.Pager[MetadataClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[MetadataClientListResponse]{ + More: func(page MetadataClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp MetadataClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.MetadataList.NextLink) + Fetcher: func(ctx context.Context, page *MetadataClientListResponse) (MetadataClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return MetadataClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MetadataClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MetadataClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -259,7 +280,7 @@ func (client *MetadataClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -279,7 +300,7 @@ func (client *MetadataClient) listCreateRequest(ctx context.Context, resourceGro // listHandleResponse handles the List response. func (client *MetadataClient) listHandleResponse(resp *http.Response) (MetadataClientListResponse, error) { - result := MetadataClientListResponse{RawResponse: resp} + result := MetadataClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MetadataList); err != nil { return MetadataClientListResponse{}, err } @@ -332,7 +353,7 @@ func (client *MetadataClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, metadataPatch) @@ -340,7 +361,7 @@ func (client *MetadataClient) updateCreateRequest(ctx context.Context, resourceG // updateHandleResponse handles the Update response. func (client *MetadataClient) updateHandleResponse(resp *http.Response) (MetadataClientUpdateResponse, error) { - result := MetadataClientUpdateResponse{RawResponse: resp} + result := MetadataClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MetadataModel); err != nil { return MetadataClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go index d1b222d69ec1..f24eb27d9a9e 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -8,12 +8,7 @@ package armsecurityinsights -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "time" -) +import "time" // AADCheckRequirements - Represents AAD (Azure Active Directory) requirements check request. type AADCheckRequirements struct { @@ -24,44 +19,6 @@ type AADCheckRequirements struct { Properties *AADCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AADCheckRequirements. -func (a *AADCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: a.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AADCheckRequirements. -func (a AADCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindAzureActiveDirectory - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AADCheckRequirements. -func (a *AADCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AADCheckRequirementsProperties - AAD (Azure Active Directory) requirements check properties. type AADCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -92,69 +49,6 @@ type AADDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type AADDataConnector. -func (a *AADDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AADDataConnector. -func (a AADDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = DataConnectorKindAzureActiveDirectory - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AADDataConnector. -func (a *AADDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AADDataConnectorProperties - AAD (Azure Active Directory) data connector properties. type AADDataConnectorProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -173,44 +67,6 @@ type AATPCheckRequirements struct { Properties *AATPCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AATPCheckRequirements. -func (a *AATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: a.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AATPCheckRequirements. -func (a AATPCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindAzureAdvancedThreatProtection - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AATPCheckRequirements. -func (a *AATPCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AATPCheckRequirementsProperties - AATP (Azure Advanced Threat Protection) requirements check properties. type AATPCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -241,69 +97,6 @@ type AATPDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type AATPDataConnector. -func (a *AATPDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AATPDataConnector. -func (a AATPDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = DataConnectorKindAzureAdvancedThreatProtection - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AATPDataConnector. -func (a *AATPDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AATPDataConnectorProperties - AATP (Azure Advanced Threat Protection) data connector properties. type AATPDataConnectorProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -331,44 +124,6 @@ type ASCCheckRequirements struct { Properties *ASCCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type ASCCheckRequirements. -func (a *ASCCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: a.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ASCCheckRequirements. -func (a ASCCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindAzureSecurityCenter - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ASCCheckRequirements. -func (a *ASCCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ASCCheckRequirementsProperties - ASC (Azure Security Center) requirements check properties. type ASCCheckRequirementsProperties struct { // The subscription id to connect to, and get the data from. @@ -399,69 +154,6 @@ type ASCDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type ASCDataConnector. -func (a *ASCDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ASCDataConnector. -func (a ASCDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = DataConnectorKindAzureSecurityCenter - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ASCDataConnector. -func (a *ASCDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ASCDataConnectorProperties - ASC (Azure Security Center) data connector properties. type ASCDataConnectorProperties struct { // The available data types for the connector. @@ -492,64 +184,6 @@ type AccountEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type AccountEntity. -func (a *AccountEntity) GetEntity() *Entity { - return &Entity{ - Kind: a.Kind, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AccountEntity. -func (a AccountEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - objectMap["kind"] = EntityKindAccount - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AccountEntity. -func (a *AccountEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AccountEntityProperties - Account entity property bag. type AccountEntityProperties struct { // READ-ONLY; The Azure Active Directory tenant id. @@ -597,26 +231,6 @@ type AccountEntityProperties struct { UpnSuffix *string `json:"upnSuffix,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AccountEntityProperties. -func (a AccountEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aadTenantId", a.AADTenantID) - populate(objectMap, "aadUserId", a.AADUserID) - populate(objectMap, "accountName", a.AccountName) - populate(objectMap, "additionalData", a.AdditionalData) - populate(objectMap, "dnsDomain", a.DNSDomain) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "hostEntityId", a.HostEntityID) - populate(objectMap, "isDomainJoined", a.IsDomainJoined) - populate(objectMap, "ntDomain", a.NtDomain) - populate(objectMap, "objectGuid", a.ObjectGUID) - populate(objectMap, "puid", a.Puid) - populate(objectMap, "sid", a.Sid) - populate(objectMap, "upnSuffix", a.UpnSuffix) - return json.Marshal(objectMap) -} - // ActionPropertiesBase - Action property bag base. type ActionPropertiesBase struct { // REQUIRED; Logic App Resource Id, /subscriptions/{my-subscription}/resourceGroups/{my-resource-group}/providers/Microsoft.Logic/workflows/{my-workflow-id}. @@ -712,14 +326,6 @@ type ActionsList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ActionsList. -func (a ActionsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // ActivityCustomEntityQuery - Represents Activity entity query. type ActivityCustomEntityQuery struct { // REQUIRED; the entity query kind @@ -744,69 +350,6 @@ type ActivityCustomEntityQuery struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetCustomEntityQuery implements the CustomEntityQueryClassification interface for type ActivityCustomEntityQuery. -func (a *ActivityCustomEntityQuery) GetCustomEntityQuery() *CustomEntityQuery { - return &CustomEntityQuery{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ActivityCustomEntityQuery. -func (a ActivityCustomEntityQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = CustomEntityQueryKindActivity - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityCustomEntityQuery. -func (a *ActivityCustomEntityQuery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ActivityEntityQueriesProperties - Describes activity entity query properties type ActivityEntityQueriesProperties struct { // The entity query content to display in timeline @@ -843,73 +386,6 @@ type ActivityEntityQueriesProperties struct { LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueriesProperties. -func (a ActivityEntityQueriesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "content", a.Content) - populateTimeRFC3339(objectMap, "createdTimeUtc", a.CreatedTimeUTC) - populate(objectMap, "description", a.Description) - populate(objectMap, "enabled", a.Enabled) - populate(objectMap, "entitiesFilter", a.EntitiesFilter) - populate(objectMap, "inputEntityType", a.InputEntityType) - populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", a.LastModifiedTimeUTC) - populate(objectMap, "queryDefinitions", a.QueryDefinitions) - populate(objectMap, "requiredInputFieldsSets", a.RequiredInputFieldsSets) - populate(objectMap, "templateName", a.TemplateName) - populate(objectMap, "title", a.Title) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityEntityQueriesProperties. -func (a *ActivityEntityQueriesProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "content": - err = unpopulate(val, &a.Content) - delete(rawMsg, key) - case "createdTimeUtc": - err = unpopulateTimeRFC3339(val, &a.CreatedTimeUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &a.Description) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &a.Enabled) - delete(rawMsg, key) - case "entitiesFilter": - err = unpopulate(val, &a.EntitiesFilter) - delete(rawMsg, key) - case "inputEntityType": - err = unpopulate(val, &a.InputEntityType) - delete(rawMsg, key) - case "lastModifiedTimeUtc": - err = unpopulateTimeRFC3339(val, &a.LastModifiedTimeUTC) - delete(rawMsg, key) - case "queryDefinitions": - err = unpopulate(val, &a.QueryDefinitions) - delete(rawMsg, key) - case "requiredInputFieldsSets": - err = unpopulate(val, &a.RequiredInputFieldsSets) - delete(rawMsg, key) - case "templateName": - err = unpopulate(val, &a.TemplateName) - delete(rawMsg, key) - case "title": - err = unpopulate(val, &a.Title) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ActivityEntityQueriesPropertiesQueryDefinitions - The Activity query definitions type ActivityEntityQueriesPropertiesQueryDefinitions struct { // The Activity query to run on a given entity @@ -940,69 +416,6 @@ type ActivityEntityQuery struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntityQuery implements the EntityQueryClassification interface for type ActivityEntityQuery. -func (a *ActivityEntityQuery) GetEntityQuery() *EntityQuery { - return &EntityQuery{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQuery. -func (a ActivityEntityQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = EntityQueryKindActivity - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityEntityQuery. -func (a *ActivityEntityQuery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ActivityEntityQueryTemplate - Represents Activity entity query. type ActivityEntityQueryTemplate struct { // REQUIRED; the entity query template kind @@ -1024,64 +437,6 @@ type ActivityEntityQueryTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntityQueryTemplate implements the EntityQueryTemplateClassification interface for type ActivityEntityQueryTemplate. -func (a *ActivityEntityQueryTemplate) GetEntityQueryTemplate() *EntityQueryTemplate { - return &EntityQueryTemplate{ - Kind: a.Kind, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueryTemplate. -func (a ActivityEntityQueryTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - objectMap["kind"] = EntityQueryTemplateKindActivity - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityEntityQueryTemplate. -func (a *ActivityEntityQueryTemplate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ActivityEntityQueryTemplateProperties - Describes activity entity query properties type ActivityEntityQueryTemplateProperties struct { // The entity query content to display in timeline @@ -1109,20 +464,6 @@ type ActivityEntityQueryTemplateProperties struct { Title *string `json:"title,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueryTemplateProperties. -func (a ActivityEntityQueryTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "content", a.Content) - populate(objectMap, "dataTypes", a.DataTypes) - populate(objectMap, "description", a.Description) - populate(objectMap, "entitiesFilter", a.EntitiesFilter) - populate(objectMap, "inputEntityType", a.InputEntityType) - populate(objectMap, "queryDefinitions", a.QueryDefinitions) - populate(objectMap, "requiredInputFieldsSets", a.RequiredInputFieldsSets) - populate(objectMap, "title", a.Title) - return json.Marshal(objectMap) -} - // ActivityEntityQueryTemplatePropertiesQueryDefinitions - The Activity query definitions type ActivityEntityQueryTemplatePropertiesQueryDefinitions struct { // The Activity query to run on a given entity @@ -1159,68 +500,6 @@ type ActivityTimelineItem struct { Title *string `json:"title,omitempty"` } -// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type ActivityTimelineItem. -func (a *ActivityTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { - return &EntityTimelineItem{ - Kind: a.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ActivityTimelineItem. -func (a ActivityTimelineItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "bucketEndTimeUTC", a.BucketEndTimeUTC) - populateTimeRFC3339(objectMap, "bucketStartTimeUTC", a.BucketStartTimeUTC) - populate(objectMap, "content", a.Content) - populateTimeRFC3339(objectMap, "firstActivityTimeUTC", a.FirstActivityTimeUTC) - objectMap["kind"] = EntityTimelineKindActivity - populateTimeRFC3339(objectMap, "lastActivityTimeUTC", a.LastActivityTimeUTC) - populate(objectMap, "queryId", a.QueryID) - populate(objectMap, "title", a.Title) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityTimelineItem. -func (a *ActivityTimelineItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "bucketEndTimeUTC": - err = unpopulateTimeRFC3339(val, &a.BucketEndTimeUTC) - delete(rawMsg, key) - case "bucketStartTimeUTC": - err = unpopulateTimeRFC3339(val, &a.BucketStartTimeUTC) - delete(rawMsg, key) - case "content": - err = unpopulate(val, &a.Content) - delete(rawMsg, key) - case "firstActivityTimeUTC": - err = unpopulateTimeRFC3339(val, &a.FirstActivityTimeUTC) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "lastActivityTimeUTC": - err = unpopulateTimeRFC3339(val, &a.LastActivityTimeUTC) - delete(rawMsg, key) - case "queryId": - err = unpopulate(val, &a.QueryID) - delete(rawMsg, key) - case "title": - err = unpopulate(val, &a.Title) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AlertDetailsOverride - Settings for how to dynamically override alert static details type AlertDetailsOverride struct { // the format containing columns name(s) to override the alert description @@ -1267,9 +546,6 @@ type AlertRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRule implements the AlertRuleClassification interface for type AlertRule. -func (a *AlertRule) GetAlertRule() *AlertRule { return a } - // AlertRuleTemplateClassification provides polymorphic access to related types. // Call the interface's GetAlertRuleTemplate() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -1298,9 +574,6 @@ type AlertRuleTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type AlertRuleTemplate. -func (a *AlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { return a } - // AlertRuleTemplateDataSource - alert rule template data sources type AlertRuleTemplateDataSource struct { // The connector id that provides the following data types @@ -1310,14 +583,6 @@ type AlertRuleTemplateDataSource struct { DataTypes []*string `json:"dataTypes,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplateDataSource. -func (a AlertRuleTemplateDataSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectorId", a.ConnectorID) - populate(objectMap, "dataTypes", a.DataTypes) - return json.Marshal(objectMap) -} - // AlertRuleTemplatePropertiesBase - Base alert rule template property bag. type AlertRuleTemplatePropertiesBase struct { // the number of alert rules that were created by this template @@ -1342,57 +607,6 @@ type AlertRuleTemplatePropertiesBase struct { LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplatePropertiesBase. -func (a AlertRuleTemplatePropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRulesCreatedByTemplateCount", a.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", a.CreatedDateUTC) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", a.LastUpdatedDateUTC) - populate(objectMap, "requiredDataConnectors", a.RequiredDataConnectors) - populate(objectMap, "status", a.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplatePropertiesBase. -func (a *AlertRuleTemplatePropertiesBase) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &a.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &a.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &a.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &a.DisplayName) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &a.LastUpdatedDateUTC) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &a.RequiredDataConnectors) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &a.Status) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AlertRuleTemplateWithMitreProperties - Alert rule template with MITRE property bag. type AlertRuleTemplateWithMitreProperties struct { // the number of alert rules that were created by this template @@ -1423,65 +637,6 @@ type AlertRuleTemplateWithMitreProperties struct { LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplateWithMitreProperties. -func (a AlertRuleTemplateWithMitreProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRulesCreatedByTemplateCount", a.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", a.CreatedDateUTC) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", a.LastUpdatedDateUTC) - populate(objectMap, "requiredDataConnectors", a.RequiredDataConnectors) - populate(objectMap, "status", a.Status) - populate(objectMap, "tactics", a.Tactics) - populate(objectMap, "techniques", a.Techniques) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplateWithMitreProperties. -func (a *AlertRuleTemplateWithMitreProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &a.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &a.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &a.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &a.DisplayName) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &a.LastUpdatedDateUTC) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &a.RequiredDataConnectors) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &a.Status) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &a.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &a.Techniques) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AlertRuleTemplatesClientGetOptions contains the optional parameters for the AlertRuleTemplatesClient.Get method. type AlertRuleTemplatesClientGetOptions struct { // placeholder for future optional parameters @@ -1501,37 +656,6 @@ type AlertRuleTemplatesList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplatesList. -func (a AlertRuleTemplatesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplatesList. -func (a *AlertRuleTemplatesList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &a.NextLink) - delete(rawMsg, key) - case "value": - a.Value, err = unmarshalAlertRuleTemplateClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AlertRulesClientCreateOrUpdateOptions contains the optional parameters for the AlertRulesClient.CreateOrUpdate method. type AlertRulesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -1561,37 +685,6 @@ type AlertRulesList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AlertRulesList. -func (a AlertRulesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulesList. -func (a *AlertRulesList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &a.NextLink) - delete(rawMsg, key) - case "value": - a.Value, err = unmarshalAlertRuleClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AlertsDataTypeOfDataConnector - Alerts data type for data connectors. type AlertsDataTypeOfDataConnector struct { // REQUIRED; Alerts data type connection. @@ -1622,69 +715,6 @@ type Anomalies struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetSettings implements the SettingsClassification interface for type Anomalies. -func (a *Anomalies) GetSettings() *Settings { - return &Settings{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type Anomalies. -func (a Anomalies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = SettingKindAnomalies - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Anomalies. -func (a *Anomalies) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AnomaliesSettingsProperties - Anomalies property bag. type AnomaliesSettingsProperties struct { // READ-ONLY; Determines whether the setting is enable or disabled. @@ -1729,9 +759,6 @@ type AutomationRuleAction struct { Order *int32 `json:"order,omitempty"` } -// GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleAction. -func (a *AutomationRuleAction) GetAutomationRuleAction() *AutomationRuleAction { return a } - // AutomationRuleConditionClassification provides polymorphic access to related types. // Call the interface's GetAutomationRuleCondition() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -1747,9 +774,6 @@ type AutomationRuleCondition struct { ConditionType *ConditionType `json:"conditionType,omitempty"` } -// GetAutomationRuleCondition implements the AutomationRuleConditionClassification interface for type AutomationRuleCondition. -func (a *AutomationRuleCondition) GetAutomationRuleCondition() *AutomationRuleCondition { return a } - // AutomationRuleModifyPropertiesAction - Describes an automation rule action to modify an object's properties type AutomationRuleModifyPropertiesAction struct { // REQUIRED; The type of the automation rule action @@ -1760,49 +784,6 @@ type AutomationRuleModifyPropertiesAction struct { ActionConfiguration *IncidentPropertiesAction `json:"actionConfiguration,omitempty"` } -// GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleModifyPropertiesAction. -func (a *AutomationRuleModifyPropertiesAction) GetAutomationRuleAction() *AutomationRuleAction { - return &AutomationRuleAction{ - Order: a.Order, - ActionType: a.ActionType, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleModifyPropertiesAction. -func (a AutomationRuleModifyPropertiesAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionConfiguration", a.ActionConfiguration) - objectMap["actionType"] = ActionTypeModifyProperties - populate(objectMap, "order", a.Order) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleModifyPropertiesAction. -func (a *AutomationRuleModifyPropertiesAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "actionConfiguration": - err = unpopulate(val, &a.ActionConfiguration) - delete(rawMsg, key) - case "actionType": - err = unpopulate(val, &a.ActionType) - delete(rawMsg, key) - case "order": - err = unpopulate(val, &a.Order) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AutomationRuleProperties - Automation rule properties type AutomationRuleProperties struct { // REQUIRED; The actions to execute when the automation rule is triggered @@ -1830,61 +811,6 @@ type AutomationRuleProperties struct { LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleProperties. -func (a AutomationRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actions", a.Actions) - populate(objectMap, "createdBy", a.CreatedBy) - populateTimeRFC3339(objectMap, "createdTimeUtc", a.CreatedTimeUTC) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "lastModifiedBy", a.LastModifiedBy) - populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", a.LastModifiedTimeUTC) - populate(objectMap, "order", a.Order) - populate(objectMap, "triggeringLogic", a.TriggeringLogic) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleProperties. -func (a *AutomationRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "actions": - a.Actions, err = unmarshalAutomationRuleActionClassificationArray(val) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &a.CreatedBy) - delete(rawMsg, key) - case "createdTimeUtc": - err = unpopulateTimeRFC3339(val, &a.CreatedTimeUTC) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &a.DisplayName) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, &a.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedTimeUtc": - err = unpopulateTimeRFC3339(val, &a.LastModifiedTimeUTC) - delete(rawMsg, key) - case "order": - err = unpopulate(val, &a.Order) - delete(rawMsg, key) - case "triggeringLogic": - err = unpopulate(val, &a.TriggeringLogic) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - type AutomationRulePropertyValuesCondition struct { Operator *AutomationRulePropertyConditionSupportedOperator `json:"operator,omitempty"` @@ -1893,15 +819,6 @@ type AutomationRulePropertyValuesCondition struct { PropertyValues []*string `json:"propertyValues,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AutomationRulePropertyValuesCondition. -func (a AutomationRulePropertyValuesCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operator", a.Operator) - populate(objectMap, "propertyName", a.PropertyName) - populate(objectMap, "propertyValues", a.PropertyValues) - return json.Marshal(objectMap) -} - // AutomationRuleRunPlaybookAction - Describes an automation rule action to run a playbook type AutomationRuleRunPlaybookAction struct { // REQUIRED; The type of the automation rule action @@ -1912,49 +829,6 @@ type AutomationRuleRunPlaybookAction struct { ActionConfiguration *PlaybookActionProperties `json:"actionConfiguration,omitempty"` } -// GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleRunPlaybookAction. -func (a *AutomationRuleRunPlaybookAction) GetAutomationRuleAction() *AutomationRuleAction { - return &AutomationRuleAction{ - Order: a.Order, - ActionType: a.ActionType, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleRunPlaybookAction. -func (a AutomationRuleRunPlaybookAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionConfiguration", a.ActionConfiguration) - objectMap["actionType"] = ActionTypeRunPlaybook - populate(objectMap, "order", a.Order) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleRunPlaybookAction. -func (a *AutomationRuleRunPlaybookAction) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "actionConfiguration": - err = unpopulate(val, &a.ActionConfiguration) - delete(rawMsg, key) - case "actionType": - err = unpopulate(val, &a.ActionType) - delete(rawMsg, key) - case "order": - err = unpopulate(val, &a.Order) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AutomationRuleTriggeringLogic - Describes automation rule triggering logic type AutomationRuleTriggeringLogic struct { // REQUIRED; Determines whether the automation rule is enabled or disabled @@ -1973,49 +847,6 @@ type AutomationRuleTriggeringLogic struct { ExpirationTimeUTC *time.Time `json:"expirationTimeUtc,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleTriggeringLogic. -func (a AutomationRuleTriggeringLogic) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "conditions", a.Conditions) - populateTimeRFC3339(objectMap, "expirationTimeUtc", a.ExpirationTimeUTC) - populate(objectMap, "isEnabled", a.IsEnabled) - populate(objectMap, "triggersOn", a.TriggersOn) - populate(objectMap, "triggersWhen", a.TriggersWhen) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleTriggeringLogic. -func (a *AutomationRuleTriggeringLogic) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "conditions": - a.Conditions, err = unmarshalAutomationRuleConditionClassificationArray(val) - delete(rawMsg, key) - case "expirationTimeUtc": - err = unpopulateTimeRFC3339(val, &a.ExpirationTimeUTC) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, &a.IsEnabled) - delete(rawMsg, key) - case "triggersOn": - err = unpopulate(val, &a.TriggersOn) - delete(rawMsg, key) - case "triggersWhen": - err = unpopulate(val, &a.TriggersWhen) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AutomationRulesClientCreateOrUpdateOptions contains the optional parameters for the AutomationRulesClient.CreateOrUpdate // method. type AutomationRulesClientCreateOrUpdateOptions struct { @@ -2038,25 +869,11 @@ type AutomationRulesClientListOptions struct { // placeholder for future optional parameters } -// AutomationRulesClientManualTriggerPlaybookOptions contains the optional parameters for the AutomationRulesClient.ManualTriggerPlaybook -// method. -type AutomationRulesClientManualTriggerPlaybookOptions struct { - RequestBody *ManualTriggerRequestBody -} - type AutomationRulesList struct { NextLink *string `json:"nextLink,omitempty"` Value []*AutomationRule `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AutomationRulesList. -func (a AutomationRulesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // Availability - Connector Availability Status type Availability struct { // Set connector as preview @@ -2072,40 +889,6 @@ type AwsCloudTrailCheckRequirements struct { Kind *DataConnectorKind `json:"kind,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AwsCloudTrailCheckRequirements. -func (a *AwsCloudTrailCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: a.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AwsCloudTrailCheckRequirements. -func (a AwsCloudTrailCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindAmazonWebServicesCloudTrail - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCloudTrailCheckRequirements. -func (a *AwsCloudTrailCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AwsCloudTrailDataConnector - Represents Amazon Web Services CloudTrail data connector. type AwsCloudTrailDataConnector struct { // REQUIRED; The data connector kind @@ -2130,69 +913,6 @@ type AwsCloudTrailDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type AwsCloudTrailDataConnector. -func (a *AwsCloudTrailDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AwsCloudTrailDataConnector. -func (a AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = DataConnectorKindAmazonWebServicesCloudTrail - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCloudTrailDataConnector. -func (a *AwsCloudTrailDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AwsCloudTrailDataConnectorDataTypes - The available data types for Amazon Web Services CloudTrail data connector. type AwsCloudTrailDataConnectorDataTypes struct { // REQUIRED; Logs data type. @@ -2220,40 +940,6 @@ type AwsS3CheckRequirements struct { Kind *DataConnectorKind `json:"kind,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AwsS3CheckRequirements. -func (a *AwsS3CheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: a.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AwsS3CheckRequirements. -func (a AwsS3CheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindAmazonWebServicesS3 - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AwsS3CheckRequirements. -func (a *AwsS3CheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AwsS3DataConnector - Represents Amazon Web Services S3 data connector. type AwsS3DataConnector struct { // REQUIRED; The data connector kind @@ -2278,69 +964,6 @@ type AwsS3DataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type AwsS3DataConnector. -func (a *AwsS3DataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: a.Kind, - Etag: a.Etag, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AwsS3DataConnector. -func (a AwsS3DataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", a.Etag) - populate(objectMap, "id", a.ID) - objectMap["kind"] = DataConnectorKindAmazonWebServicesS3 - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AwsS3DataConnector. -func (a *AwsS3DataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &a.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AwsS3DataConnectorDataTypes - The available data types for Amazon Web Services S3 data connector. type AwsS3DataConnectorDataTypes struct { // REQUIRED; Logs data type. @@ -2368,14 +991,13 @@ type AwsS3DataConnectorProperties struct { SqsUrls []*string `json:"sqsUrls,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AwsS3DataConnectorProperties. -func (a AwsS3DataConnectorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataTypes", a.DataTypes) - populate(objectMap, "destinationTable", a.DestinationTable) - populate(objectMap, "roleArn", a.RoleArn) - populate(objectMap, "sqsUrls", a.SqsUrls) - return json.Marshal(objectMap) +// AzureDevOpsResourceInfo - Resources created in Azure DevOps repository. +type AzureDevOpsResourceInfo struct { + // Id of the pipeline created for the source-control. + PipelineID *string `json:"pipelineId,omitempty"` + + // Id of the service-connection created for the source-control. + ServiceConnectionID *string `json:"serviceConnectionId,omitempty"` } // AzureResourceEntity - Represents an azure resource entity. @@ -2399,64 +1021,6 @@ type AzureResourceEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type AzureResourceEntity. -func (a *AzureResourceEntity) GetEntity() *Entity { - return &Entity{ - Kind: a.Kind, - ID: a.ID, - Name: a.Name, - Type: a.Type, - SystemData: a.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type AzureResourceEntity. -func (a AzureResourceEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - objectMap["kind"] = EntityKindAzureResource - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceEntity. -func (a *AzureResourceEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &a.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &a.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &a.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &a.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // AzureResourceEntityProperties - AzureResource entity property bag. type AzureResourceEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -2473,16 +1037,6 @@ type AzureResourceEntityProperties struct { SubscriptionID *string `json:"subscriptionId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AzureResourceEntityProperties. -func (a AzureResourceEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", a.AdditionalData) - populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "resourceId", a.ResourceID) - populate(objectMap, "subscriptionId", a.SubscriptionID) - return json.Marshal(objectMap) -} - // Bookmark - Represents a bookmark in Azure Security Insights. type Bookmark struct { // Etag of the azure resource @@ -2518,14 +1072,6 @@ type BookmarkEntityMappings struct { FieldMappings []*EntityFieldMapping `json:"fieldMappings,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type BookmarkEntityMappings. -func (b BookmarkEntityMappings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "entityType", b.EntityType) - populate(objectMap, "fieldMappings", b.FieldMappings) - return json.Marshal(objectMap) -} - // BookmarkExpandParameters - The parameters required to execute an expand operation on the given bookmark. type BookmarkExpandParameters struct { // The end date filter, so the only expansion results returned are before this date. @@ -2538,41 +1084,6 @@ type BookmarkExpandParameters struct { StartTime *time.Time `json:"startTime,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type BookmarkExpandParameters. -func (b BookmarkExpandParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", b.EndTime) - populate(objectMap, "expansionId", b.ExpansionID) - populateTimeRFC3339(objectMap, "startTime", b.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkExpandParameters. -func (b *BookmarkExpandParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, &b.EndTime) - delete(rawMsg, key) - case "expansionId": - err = unpopulate(val, &b.ExpansionID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &b.StartTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // BookmarkExpandResponse - The entity expansion result operation response. type BookmarkExpandResponse struct { // The metadata from the expansion operation results. @@ -2591,37 +1102,6 @@ type BookmarkExpandResponseValue struct { Entities []EntityClassification `json:"entities,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type BookmarkExpandResponseValue. -func (b BookmarkExpandResponseValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "edges", b.Edges) - populate(objectMap, "entities", b.Entities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkExpandResponseValue. -func (b *BookmarkExpandResponseValue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "edges": - err = unpopulate(val, &b.Edges) - delete(rawMsg, key) - case "entities": - b.Entities, err = unmarshalEntityClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // BookmarkList - List all the bookmarks. type BookmarkList struct { // REQUIRED; Array of bookmarks. @@ -2631,14 +1111,6 @@ type BookmarkList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type BookmarkList. -func (b BookmarkList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", b.NextLink) - populate(objectMap, "value", b.Value) - return json.Marshal(objectMap) -} - // BookmarkProperties - Describes bookmark properties type BookmarkProperties struct { // REQUIRED; The display name of the bookmark @@ -2690,93 +1162,6 @@ type BookmarkProperties struct { UpdatedBy *UserInfo `json:"updatedBy,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type BookmarkProperties. -func (b BookmarkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "created", b.Created) - populate(objectMap, "createdBy", b.CreatedBy) - populate(objectMap, "displayName", b.DisplayName) - populate(objectMap, "entityMappings", b.EntityMappings) - populateTimeRFC3339(objectMap, "eventTime", b.EventTime) - populate(objectMap, "incidentInfo", b.IncidentInfo) - populate(objectMap, "labels", b.Labels) - populate(objectMap, "notes", b.Notes) - populate(objectMap, "query", b.Query) - populateTimeRFC3339(objectMap, "queryEndTime", b.QueryEndTime) - populate(objectMap, "queryResult", b.QueryResult) - populateTimeRFC3339(objectMap, "queryStartTime", b.QueryStartTime) - populate(objectMap, "tactics", b.Tactics) - populate(objectMap, "techniques", b.Techniques) - populateTimeRFC3339(objectMap, "updated", b.Updated) - populate(objectMap, "updatedBy", b.UpdatedBy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkProperties. -func (b *BookmarkProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "created": - err = unpopulateTimeRFC3339(val, &b.Created) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &b.CreatedBy) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &b.DisplayName) - delete(rawMsg, key) - case "entityMappings": - err = unpopulate(val, &b.EntityMappings) - delete(rawMsg, key) - case "eventTime": - err = unpopulateTimeRFC3339(val, &b.EventTime) - delete(rawMsg, key) - case "incidentInfo": - err = unpopulate(val, &b.IncidentInfo) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, &b.Labels) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, &b.Notes) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &b.Query) - delete(rawMsg, key) - case "queryEndTime": - err = unpopulateTimeRFC3339(val, &b.QueryEndTime) - delete(rawMsg, key) - case "queryResult": - err = unpopulate(val, &b.QueryResult) - delete(rawMsg, key) - case "queryStartTime": - err = unpopulateTimeRFC3339(val, &b.QueryStartTime) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &b.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &b.Techniques) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, &b.Updated) - delete(rawMsg, key) - case "updatedBy": - err = unpopulate(val, &b.UpdatedBy) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // BookmarkRelationsClientCreateOrUpdateOptions contains the optional parameters for the BookmarkRelationsClient.CreateOrUpdate // method. type BookmarkRelationsClientCreateOrUpdateOptions struct { @@ -2837,72 +1222,6 @@ type BookmarkTimelineItem struct { StartTimeUTC *time.Time `json:"startTimeUtc,omitempty"` } -// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type BookmarkTimelineItem. -func (b *BookmarkTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { - return &EntityTimelineItem{ - Kind: b.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type BookmarkTimelineItem. -func (b BookmarkTimelineItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureResourceId", b.AzureResourceID) - populate(objectMap, "createdBy", b.CreatedBy) - populate(objectMap, "displayName", b.DisplayName) - populateTimeRFC3339(objectMap, "endTimeUtc", b.EndTimeUTC) - populateTimeRFC3339(objectMap, "eventTime", b.EventTime) - objectMap["kind"] = EntityTimelineKindBookmark - populate(objectMap, "labels", b.Labels) - populate(objectMap, "notes", b.Notes) - populateTimeRFC3339(objectMap, "startTimeUtc", b.StartTimeUTC) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkTimelineItem. -func (b *BookmarkTimelineItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "azureResourceId": - err = unpopulate(val, &b.AzureResourceID) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &b.CreatedBy) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &b.DisplayName) - delete(rawMsg, key) - case "endTimeUtc": - err = unpopulateTimeRFC3339(val, &b.EndTimeUTC) - delete(rawMsg, key) - case "eventTime": - err = unpopulateTimeRFC3339(val, &b.EventTime) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &b.Kind) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, &b.Labels) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, &b.Notes) - delete(rawMsg, key) - case "startTimeUtc": - err = unpopulateTimeRFC3339(val, &b.StartTimeUTC) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // BookmarksClientCreateOrUpdateOptions contains the optional parameters for the BookmarksClient.CreateOrUpdate method. type BookmarksClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -2959,64 +1278,6 @@ type CloudApplicationEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type CloudApplicationEntity. -func (c *CloudApplicationEntity) GetEntity() *Entity { - return &Entity{ - Kind: c.Kind, - ID: c.ID, - Name: c.Name, - Type: c.Type, - SystemData: c.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type CloudApplicationEntity. -func (c CloudApplicationEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - objectMap["kind"] = EntityKindCloudApplication - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudApplicationEntity. -func (c *CloudApplicationEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &c.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &c.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &c.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // CloudApplicationEntityProperties - CloudApplication entity property bag. type CloudApplicationEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -3037,15 +1298,19 @@ type CloudApplicationEntityProperties struct { InstanceName *string `json:"instanceName,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type CloudApplicationEntityProperties. -func (c CloudApplicationEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", c.AdditionalData) - populate(objectMap, "appId", c.AppID) - populate(objectMap, "appName", c.AppName) - populate(objectMap, "friendlyName", c.FriendlyName) - populate(objectMap, "instanceName", c.InstanceName) - return json.Marshal(objectMap) +// CloudError - Error response structure. +type CloudError struct { + // Error data + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody - Error details. +type CloudErrorBody struct { + // READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty" azure:"ro"` } // CodelessAPIPollingDataConnector - Represents Codeless API Polling data connector. @@ -3072,69 +1337,6 @@ type CodelessAPIPollingDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type CodelessAPIPollingDataConnector. -func (c *CodelessAPIPollingDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: c.Kind, - Etag: c.Etag, - ID: c.ID, - Name: c.Name, - Type: c.Type, - SystemData: c.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type CodelessAPIPollingDataConnector. -func (c CodelessAPIPollingDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - objectMap["kind"] = DataConnectorKindAPIPolling - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CodelessAPIPollingDataConnector. -func (c *CodelessAPIPollingDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &c.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &c.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &c.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // CodelessConnectorPollingAuthProperties - Describe the authentication properties needed to successfully authenticate with // the server type CodelessConnectorPollingAuthProperties struct { @@ -3280,16 +1482,6 @@ type CodelessConnectorPollingResponseProperties struct { SuccessStatusValue *string `json:"successStatusValue,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type CodelessConnectorPollingResponseProperties. -func (c CodelessConnectorPollingResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eventsJsonPaths", c.EventsJSONPaths) - populate(objectMap, "isGzipCompressed", c.IsGzipCompressed) - populate(objectMap, "successStatusJsonPath", c.SuccessStatusJSONPath) - populate(objectMap, "successStatusValue", c.SuccessStatusValue) - return json.Marshal(objectMap) -} - // CodelessParameters - Represents Codeless UI data connector type CodelessParameters struct { // Config to describe the instructions blade @@ -3335,24 +1527,6 @@ type CodelessUIConnectorConfigProperties struct { CustomImage *string `json:"customImage,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type CodelessUIConnectorConfigProperties. -func (c CodelessUIConnectorConfigProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availability", c.Availability) - populate(objectMap, "connectivityCriteria", c.ConnectivityCriteria) - populate(objectMap, "customImage", c.CustomImage) - populate(objectMap, "dataTypes", c.DataTypes) - populate(objectMap, "descriptionMarkdown", c.DescriptionMarkdown) - populate(objectMap, "graphQueries", c.GraphQueries) - populate(objectMap, "graphQueriesTableName", c.GraphQueriesTableName) - populate(objectMap, "instructionSteps", c.InstructionSteps) - populate(objectMap, "permissions", c.Permissions) - populate(objectMap, "publisher", c.Publisher) - populate(objectMap, "sampleQueries", c.SampleQueries) - populate(objectMap, "title", c.Title) - return json.Marshal(objectMap) -} - type CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem struct { // type of connectivity Type *ConnectivityType `json:"type,omitempty"` @@ -3361,14 +1535,6 @@ type CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem struct { Value []*string `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem. -func (c CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", c.Type) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - type CodelessUIConnectorConfigPropertiesDataTypesItem struct { // Query for indicate last data received LastDataReceivedQuery *string `json:"lastDataReceivedQuery,omitempty"` @@ -3399,15 +1565,6 @@ type CodelessUIConnectorConfigPropertiesInstructionStepsItem struct { Title *string `json:"title,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type CodelessUIConnectorConfigPropertiesInstructionStepsItem. -func (c CodelessUIConnectorConfigPropertiesInstructionStepsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", c.Description) - populate(objectMap, "instructions", c.Instructions) - populate(objectMap, "title", c.Title) - return json.Marshal(objectMap) -} - type CodelessUIConnectorConfigPropertiesSampleQueriesItem struct { // The sample query description Description *string `json:"description,omitempty"` @@ -3440,69 +1597,6 @@ type CodelessUIDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type CodelessUIDataConnector. -func (c *CodelessUIDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: c.Kind, - Etag: c.Etag, - ID: c.ID, - Name: c.Name, - Type: c.Type, - SystemData: c.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type CodelessUIDataConnector. -func (c CodelessUIDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", c.Etag) - populate(objectMap, "id", c.ID) - objectMap["kind"] = DataConnectorKindGenericUI - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CodelessUIDataConnector. -func (c *CodelessUIDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &c.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &c.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &c.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &c.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &c.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &c.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &c.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ConnectedEntity - Expansion result connected entities type ConnectedEntity struct { // key-value pairs for a connected entity mapping @@ -3521,14 +1615,6 @@ type ConnectivityCriteria struct { Value []*string `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCriteria. -func (c ConnectivityCriteria) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "type", c.Type) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - // ConnectorInstructionModelBase - Instruction step details type ConnectorInstructionModelBase struct { // REQUIRED; The kind of the setting @@ -3577,9 +1663,6 @@ type CustomEntityQuery struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetCustomEntityQuery implements the CustomEntityQueryClassification interface for type CustomEntityQuery. -func (c *CustomEntityQuery) GetCustomEntityQuery() *CustomEntityQuery { return c } - // Customs permissions required for the connector type Customs struct { // Customs permissions description @@ -3619,64 +1702,6 @@ type DNSEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type DNSEntity. -func (d *DNSEntity) GetEntity() *Entity { - return &Entity{ - Kind: d.Kind, - ID: d.ID, - Name: d.Name, - Type: d.Type, - SystemData: d.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type DNSEntity. -func (d DNSEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - objectMap["kind"] = EntityKindDNSResolution - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DNSEntity. -func (d *DNSEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &d.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &d.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &d.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // DNSEntityProperties - Dns entity property bag. type DNSEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -3699,25 +1724,13 @@ type DNSEntityProperties struct { IPAddressEntityIDs []*string `json:"ipAddressEntityIds,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type DNSEntityProperties. -func (d DNSEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", d.AdditionalData) - populate(objectMap, "dnsServerIpEntityId", d.DNSServerIPEntityID) - populate(objectMap, "domainName", d.DomainName) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "hostIpAddressEntityId", d.HostIPAddressEntityID) - populate(objectMap, "ipAddressEntityIds", d.IPAddressEntityIDs) - return json.Marshal(objectMap) -} - // DataConnectorClassification provides polymorphic access to related types. // Call the interface's GetDataConnector() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AADDataConnector, *AATPDataConnector, *ASCDataConnector, *AwsCloudTrailDataConnector, *AwsS3DataConnector, *CodelessAPIPollingDataConnector, -// - *CodelessUIDataConnector, *DataConnector, *Dynamics365DataConnector, *MCASDataConnector, *MDATPDataConnector, *MSTIDataConnector, -// - *MTPDataConnector, *Office365ProjectDataConnector, *OfficeATPDataConnector, *OfficeDataConnector, *OfficeIRMDataConnector, -// - *OfficePowerBIDataConnector, *TIDataConnector, *TiTaxiiDataConnector +// - *CodelessUIDataConnector, *DataConnector, *Dynamics365DataConnector, *IoTDataConnector, *MCASDataConnector, *MDATPDataConnector, +// - *MSTIDataConnector, *MTPDataConnector, *Office365ProjectDataConnector, *OfficeATPDataConnector, *OfficeDataConnector, +// - *OfficeIRMDataConnector, *OfficePowerBIDataConnector, *TIDataConnector, *TiTaxiiDataConnector type DataConnectorClassification interface { // GetDataConnector returns the DataConnector content of the underlying type. GetDataConnector() *DataConnector @@ -3744,9 +1757,6 @@ type DataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type DataConnector. -func (d *DataConnector) GetDataConnector() *DataConnector { return d } - // DataConnectorConnectBody - Represents Codeless API Polling data connector. type DataConnectorConnectBody struct { // The API key of the audit server. @@ -3772,20 +1782,6 @@ type DataConnectorConnectBody struct { UserName *string `json:"userName,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type DataConnectorConnectBody. -func (d DataConnectorConnectBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiKey", d.APIKey) - populate(objectMap, "authorizationCode", d.AuthorizationCode) - populate(objectMap, "clientId", d.ClientID) - populate(objectMap, "clientSecret", d.ClientSecret) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "password", d.Password) - populate(objectMap, "requestConfigUserInputValues", d.RequestConfigUserInputValues) - populate(objectMap, "userName", d.UserName) - return json.Marshal(objectMap) -} - // DataConnectorDataTypeCommon - Common field for data type in data connectors. type DataConnectorDataTypeCommon struct { // REQUIRED; Describe whether this data type connection is enabled or not. @@ -3801,37 +1797,6 @@ type DataConnectorList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type DataConnectorList. -func (d DataConnectorList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectorList. -func (d *DataConnectorList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &d.NextLink) - delete(rawMsg, key) - case "value": - d.Value, err = unmarshalDataConnectorClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // DataConnectorRequirementsState - Data connector requirements status. type DataConnectorRequirementsState struct { // Authorization state for this connector @@ -3857,8 +1822,8 @@ type DataConnectorWithAlertsProperties struct { // Call the interface's GetDataConnectorsCheckRequirements() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AADCheckRequirements, *AATPCheckRequirements, *ASCCheckRequirements, *AwsCloudTrailCheckRequirements, *AwsS3CheckRequirements, -// - *DataConnectorsCheckRequirements, *Dynamics365CheckRequirements, *MCASCheckRequirements, *MDATPCheckRequirements, *MSTICheckRequirements, -// - *MtpCheckRequirements, *Office365ProjectCheckRequirements, *OfficeATPCheckRequirements, *OfficeIRMCheckRequirements, +// - *DataConnectorsCheckRequirements, *Dynamics365CheckRequirements, *IoTCheckRequirements, *MCASCheckRequirements, *MDATPCheckRequirements, +// - *MSTICheckRequirements, *MtpCheckRequirements, *Office365ProjectCheckRequirements, *OfficeATPCheckRequirements, *OfficeIRMCheckRequirements, // - *OfficePowerBICheckRequirements, *TICheckRequirements, *TiTaxiiCheckRequirements type DataConnectorsCheckRequirementsClassification interface { // GetDataConnectorsCheckRequirements returns the DataConnectorsCheckRequirements content of the underlying type. @@ -3871,11 +1836,6 @@ type DataConnectorsCheckRequirements struct { Kind *DataConnectorKind `json:"kind,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type DataConnectorsCheckRequirements. -func (d *DataConnectorsCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return d -} - // DataConnectorsCheckRequirementsClientPostOptions contains the optional parameters for the DataConnectorsCheckRequirementsClient.Post // method. type DataConnectorsCheckRequirementsClientPostOptions struct { @@ -3919,6 +1879,36 @@ type DataTypeDefinitions struct { DataType *string `json:"dataType,omitempty"` } +// Deployment - Description about a deployment. +type Deployment struct { + // Deployment identifier. + DeploymentID *string `json:"deploymentId,omitempty"` + + // Url to access repository action logs. + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` + + // The outcome of the deployment. + DeploymentResult *DeploymentResult `json:"deploymentResult,omitempty"` + + // Current status of the deployment. + DeploymentState *DeploymentState `json:"deploymentState,omitempty"` + + // The time when the deployment finished. + DeploymentTime *time.Time `json:"deploymentTime,omitempty"` +} + +// DeploymentInfo - Information regarding a deployment. +type DeploymentInfo struct { + // Deployment information. + Deployment *Deployment `json:"deployment,omitempty"` + + // Status while fetching the last deployment. + DeploymentFetchStatus *DeploymentFetchStatus `json:"deploymentFetchStatus,omitempty"` + + // Additional details about the deployment that can be shown to the user. + Message *string `json:"message,omitempty"` +} + // DomainWhoisClientGetOptions contains the optional parameters for the DomainWhoisClient.Get method. type DomainWhoisClientGetOptions struct { // placeholder for future optional parameters @@ -3933,44 +1923,6 @@ type Dynamics365CheckRequirements struct { Properties *Dynamics365CheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type Dynamics365CheckRequirements. -func (d *Dynamics365CheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: d.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type Dynamics365CheckRequirements. -func (d Dynamics365CheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindDynamics365 - populate(objectMap, "properties", d.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Dynamics365CheckRequirements. -func (d *Dynamics365CheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &d.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &d.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Dynamics365CheckRequirementsProperties - Dynamics365 requirements check properties. type Dynamics365CheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -4001,69 +1953,6 @@ type Dynamics365DataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type Dynamics365DataConnector. -func (d *Dynamics365DataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: d.Kind, - Etag: d.Etag, - ID: d.ID, - Name: d.Name, - Type: d.Type, - SystemData: d.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type Dynamics365DataConnector. -func (d Dynamics365DataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", d.Etag) - populate(objectMap, "id", d.ID) - objectMap["kind"] = DataConnectorKindDynamics365 - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Dynamics365DataConnector. -func (d *Dynamics365DataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &d.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &d.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &d.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &d.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &d.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &d.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Dynamics365DataConnectorDataTypes - The available data types for Dynamics365 data connector. type Dynamics365DataConnectorDataTypes struct { // REQUIRED; Common Data Service data type connection. @@ -4106,53 +1995,6 @@ type EnrichmentDomainWhois struct { Updated *time.Time `json:"updated,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EnrichmentDomainWhois. -func (e EnrichmentDomainWhois) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "created", e.Created) - populate(objectMap, "domain", e.Domain) - populateTimeRFC3339(objectMap, "expires", e.Expires) - populate(objectMap, "parsedWhois", e.ParsedWhois) - populate(objectMap, "server", e.Server) - populateTimeRFC3339(objectMap, "updated", e.Updated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EnrichmentDomainWhois. -func (e *EnrichmentDomainWhois) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "created": - err = unpopulateTimeRFC3339(val, &e.Created) - delete(rawMsg, key) - case "domain": - err = unpopulate(val, &e.Domain) - delete(rawMsg, key) - case "expires": - err = unpopulateTimeRFC3339(val, &e.Expires) - delete(rawMsg, key) - case "parsedWhois": - err = unpopulate(val, &e.ParsedWhois) - delete(rawMsg, key) - case "server": - err = unpopulate(val, &e.Server) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, &e.Updated) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EnrichmentDomainWhoisContact - An individual contact associated with this domain type EnrichmentDomainWhoisContact struct { // The city for this contact @@ -4186,22 +2028,6 @@ type EnrichmentDomainWhoisContact struct { Street []*string `json:"street,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EnrichmentDomainWhoisContact. -func (e EnrichmentDomainWhoisContact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "city", e.City) - populate(objectMap, "country", e.Country) - populate(objectMap, "email", e.Email) - populate(objectMap, "fax", e.Fax) - populate(objectMap, "name", e.Name) - populate(objectMap, "org", e.Org) - populate(objectMap, "phone", e.Phone) - populate(objectMap, "postal", e.Postal) - populate(objectMap, "state", e.State) - populate(objectMap, "street", e.Street) - return json.Marshal(objectMap) -} - // EnrichmentDomainWhoisContacts - The set of contacts associated with this domain type EnrichmentDomainWhoisContacts struct { // The admin contact for this whois record @@ -4232,16 +2058,6 @@ type EnrichmentDomainWhoisDetails struct { Statuses []*string `json:"statuses,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EnrichmentDomainWhoisDetails. -func (e EnrichmentDomainWhoisDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contacts", e.Contacts) - populate(objectMap, "nameServers", e.NameServers) - populate(objectMap, "registrar", e.Registrar) - populate(objectMap, "statuses", e.Statuses) - return json.Marshal(objectMap) -} - // EnrichmentDomainWhoisRegistrarDetails - The registrar associated with this domain type EnrichmentDomainWhoisRegistrarDetails struct { // This registrar's abuse contact email @@ -4391,9 +2207,6 @@ type Entity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type Entity. -func (e *Entity) GetEntity() *Entity { return e } - // EntityAnalytics - Settings with single toggle. type EntityAnalytics struct { // REQUIRED; The kind of the setting @@ -4418,73 +2231,10 @@ type EntityAnalytics struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetSettings implements the SettingsClassification interface for type EntityAnalytics. -func (e *EntityAnalytics) GetSettings() *Settings { - return &Settings{ - Kind: e.Kind, - Etag: e.Etag, - ID: e.ID, - Name: e.Name, - Type: e.Type, - SystemData: e.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type EntityAnalytics. -func (e EntityAnalytics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - objectMap["kind"] = SettingKindEntityAnalytics - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityAnalytics. -func (e *EntityAnalytics) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &e.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &e.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &e.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityAnalyticsProperties - EntityAnalytics property bag. type EntityAnalyticsProperties struct { - // READ-ONLY; Determines whether the setting is enable or disabled. - IsEnabled *bool `json:"isEnabled,omitempty" azure:"ro"` + // The relevant entity providers that are synced + EntityProviders []*EntityProviders `json:"entityProviders,omitempty"` } // EntityCommonProperties - Entity common property bag. @@ -4497,14 +2247,6 @@ type EntityCommonProperties struct { FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type EntityCommonProperties. -func (e EntityCommonProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", e.AdditionalData) - populate(objectMap, "friendlyName", e.FriendlyName) - return json.Marshal(objectMap) -} - // EntityEdges - The edge that connects the entity to the other entity. type EntityEdges struct { // A bag of custom fields that should be part of the entity and will be presented to the user. @@ -4514,14 +2256,6 @@ type EntityEdges struct { TargetEntityID *string `json:"targetEntityId,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityEdges. -func (e EntityEdges) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", e.AdditionalData) - populate(objectMap, "targetEntityId", e.TargetEntityID) - return json.Marshal(objectMap) -} - // EntityExpandParameters - The parameters required to execute an expand operation on the given entity. type EntityExpandParameters struct { // The end date filter, so the only expansion results returned are before this date. @@ -4534,41 +2268,6 @@ type EntityExpandParameters struct { StartTime *time.Time `json:"startTime,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityExpandParameters. -func (e EntityExpandParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "expansionId", e.ExpansionID) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityExpandParameters. -func (e *EntityExpandParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, &e.EndTime) - delete(rawMsg, key) - case "expansionId": - err = unpopulate(val, &e.ExpansionID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &e.StartTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityExpandResponse - The entity expansion result operation response. type EntityExpandResponse struct { // The metadata from the expansion operation results. @@ -4587,37 +2286,6 @@ type EntityExpandResponseValue struct { Entities []EntityClassification `json:"entities,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityExpandResponseValue. -func (e EntityExpandResponseValue) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "edges", e.Edges) - populate(objectMap, "entities", e.Entities) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityExpandResponseValue. -func (e *EntityExpandResponseValue) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "edges": - err = unpopulate(val, &e.Edges) - delete(rawMsg, key) - case "entities": - e.Entities, err = unmarshalEntityClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityFieldMapping - Map identifiers of a single entity type EntityFieldMapping struct { // Alert V3 identifier @@ -4642,45 +2310,6 @@ type EntityGetInsightsParameters struct { InsightQueryIDs []*string `json:"insightQueryIds,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityGetInsightsParameters. -func (e EntityGetInsightsParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "addDefaultExtendedTimeRange", e.AddDefaultExtendedTimeRange) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "insightQueryIds", e.InsightQueryIDs) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityGetInsightsParameters. -func (e *EntityGetInsightsParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "addDefaultExtendedTimeRange": - err = unpopulate(val, &e.AddDefaultExtendedTimeRange) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, &e.EndTime) - delete(rawMsg, key) - case "insightQueryIds": - err = unpopulate(val, &e.InsightQueryIDs) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &e.StartTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityGetInsightsResponse - The Get Insights result operation response. type EntityGetInsightsResponse struct { // The metadata from the get insights operation results. @@ -4690,14 +2319,6 @@ type EntityGetInsightsResponse struct { Value []*EntityInsightItem `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityGetInsightsResponse. -func (e EntityGetInsightsResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metaData", e.MetaData) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - // EntityInsightItem - Entity insight Item. type EntityInsightItem struct { // Query results for table insights query. @@ -4713,16 +2334,6 @@ type EntityInsightItem struct { TableQueryResults *InsightsTableResult `json:"tableQueryResults,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityInsightItem. -func (e EntityInsightItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "chartQueryResults", e.ChartQueryResults) - populate(objectMap, "queryId", e.QueryID) - populate(objectMap, "queryTimeInterval", e.QueryTimeInterval) - populate(objectMap, "tableQueryResults", e.TableQueryResults) - return json.Marshal(objectMap) -} - // EntityInsightItemQueryTimeInterval - The Time interval that the query actually executed on. type EntityInsightItemQueryTimeInterval struct { // Insight query end time @@ -4732,37 +2343,6 @@ type EntityInsightItemQueryTimeInterval struct { StartTime *time.Time `json:"startTime,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityInsightItemQueryTimeInterval. -func (e EntityInsightItemQueryTimeInterval) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityInsightItemQueryTimeInterval. -func (e *EntityInsightItemQueryTimeInterval) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, &e.EndTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &e.StartTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityList - List of all the entities. type EntityList struct { // REQUIRED; Array of entities. @@ -4772,37 +2352,6 @@ type EntityList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type EntityList. -func (e EntityList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityList. -func (e *EntityList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &e.NextLink) - delete(rawMsg, key) - case "value": - e.Value, err = unmarshalEntityClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityMapping - Single entity mapping for the alert rule type EntityMapping struct { // The V3 type of the mapped entity @@ -4812,14 +2361,6 @@ type EntityMapping struct { FieldMappings []*FieldMapping `json:"fieldMappings,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityMapping. -func (e EntityMapping) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "entityType", e.EntityType) - populate(objectMap, "fieldMappings", e.FieldMappings) - return json.Marshal(objectMap) -} - // EntityQueriesClientCreateOrUpdateOptions contains the optional parameters for the EntityQueriesClient.CreateOrUpdate method. type EntityQueriesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -4871,9 +2412,6 @@ type EntityQuery struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntityQuery implements the EntityQueryClassification interface for type EntityQuery. -func (e *EntityQuery) GetEntityQuery() *EntityQuery { return e } - // EntityQueryItemClassification provides polymorphic access to related types. // Call the interface's GetEntityQueryItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -4898,9 +2436,6 @@ type EntityQueryItem struct { ID *string `json:"id,omitempty" azure:"ro"` } -// GetEntityQueryItem implements the EntityQueryItemClassification interface for type EntityQueryItem. -func (e *EntityQueryItem) GetEntityQueryItem() *EntityQueryItem { return e } - // EntityQueryItemProperties - An properties abstract Query item for entity type EntityQueryItemProperties struct { // Data types for template @@ -4916,16 +2451,6 @@ type EntityQueryItemProperties struct { RequiredInputFieldsSets [][]*string `json:"requiredInputFieldsSets,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityQueryItemProperties. -func (e EntityQueryItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataTypes", e.DataTypes) - populate(objectMap, "entitiesFilter", &e.EntitiesFilter) - populate(objectMap, "inputEntityType", e.InputEntityType) - populate(objectMap, "requiredInputFieldsSets", e.RequiredInputFieldsSets) - return json.Marshal(objectMap) -} - type EntityQueryItemPropertiesDataTypesItem struct { // Data type name DataType *string `json:"dataType,omitempty"` @@ -4940,37 +2465,6 @@ type EntityQueryList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type EntityQueryList. -func (e EntityQueryList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueryList. -func (e *EntityQueryList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &e.NextLink) - delete(rawMsg, key) - case "value": - e.Value, err = unmarshalEntityQueryClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityQueryTemplateClassification provides polymorphic access to related types. // Call the interface's GetEntityQueryTemplate() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -4998,9 +2492,6 @@ type EntityQueryTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntityQueryTemplate implements the EntityQueryTemplateClassification interface for type EntityQueryTemplate. -func (e *EntityQueryTemplate) GetEntityQueryTemplate() *EntityQueryTemplate { return e } - // EntityQueryTemplateList - List of all the entity query templates. type EntityQueryTemplateList struct { // REQUIRED; Array of entity query templates. @@ -5010,37 +2501,6 @@ type EntityQueryTemplateList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type EntityQueryTemplateList. -func (e EntityQueryTemplateList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueryTemplateList. -func (e *EntityQueryTemplateList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &e.NextLink) - delete(rawMsg, key) - case "value": - e.Value, err = unmarshalEntityQueryTemplateClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityQueryTemplatesClientGetOptions contains the optional parameters for the EntityQueryTemplatesClient.Get method. type EntityQueryTemplatesClientGetOptions struct { // placeholder for future optional parameters @@ -5072,9 +2532,6 @@ type EntityTimelineItem struct { Kind *EntityTimelineKind `json:"kind,omitempty"` } -// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type EntityTimelineItem. -func (e *EntityTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { return e } - // EntityTimelineParameters - The parameters required to execute s timeline operation on the given entity. type EntityTimelineParameters struct { // REQUIRED; The end timeline date, so the results returned are before this date. @@ -5090,45 +2547,6 @@ type EntityTimelineParameters struct { NumberOfBucket *int32 `json:"numberOfBucket,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityTimelineParameters. -func (e EntityTimelineParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "kinds", e.Kinds) - populate(objectMap, "numberOfBucket", e.NumberOfBucket) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityTimelineParameters. -func (e *EntityTimelineParameters) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, &e.EndTime) - delete(rawMsg, key) - case "kinds": - err = unpopulate(val, &e.Kinds) - delete(rawMsg, key) - case "numberOfBucket": - err = unpopulate(val, &e.NumberOfBucket) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &e.StartTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EntityTimelineResponse - The entity timeline result operation response. type EntityTimelineResponse struct { // The metadata from the timeline operation results. @@ -5138,37 +2556,6 @@ type EntityTimelineResponse struct { Value []EntityTimelineItemClassification `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type EntityTimelineResponse. -func (e EntityTimelineResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metaData", e.MetaData) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityTimelineResponse. -func (e *EntityTimelineResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "metaData": - err = unpopulate(val, &e.MetaData) - delete(rawMsg, key) - case "value": - e.Value, err = unmarshalEntityTimelineItemClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EventGroupingSettings - Event grouping settings property bag. type EventGroupingSettings struct { // The event grouping aggregation kinds @@ -5196,18 +2583,6 @@ type ExpansionEntityQueriesProperties struct { QueryTemplate *string `json:"queryTemplate,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ExpansionEntityQueriesProperties. -func (e ExpansionEntityQueriesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataSources", e.DataSources) - populate(objectMap, "displayName", e.DisplayName) - populate(objectMap, "inputEntityType", e.InputEntityType) - populate(objectMap, "inputFields", e.InputFields) - populate(objectMap, "outputEntityTypes", e.OutputEntityTypes) - populate(objectMap, "queryTemplate", e.QueryTemplate) - return json.Marshal(objectMap) -} - // ExpansionEntityQuery - Represents Expansion entity query. type ExpansionEntityQuery struct { // REQUIRED; the entity query kind @@ -5232,69 +2607,6 @@ type ExpansionEntityQuery struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntityQuery implements the EntityQueryClassification interface for type ExpansionEntityQuery. -func (e *ExpansionEntityQuery) GetEntityQuery() *EntityQuery { - return &EntityQuery{ - Kind: e.Kind, - Etag: e.Etag, - ID: e.ID, - Name: e.Name, - Type: e.Type, - SystemData: e.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ExpansionEntityQuery. -func (e ExpansionEntityQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - objectMap["kind"] = EntityQueryKindExpansion - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpansionEntityQuery. -func (e *ExpansionEntityQuery) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &e.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &e.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &e.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ExpansionResultAggregation - Information of a specific aggregation in the expansion result. type ExpansionResultAggregation struct { // REQUIRED; Total number of aggregations of the given kind (and aggregationType if given) in the expansion result. @@ -5316,13 +2628,6 @@ type ExpansionResultsMetadata struct { Aggregations []*ExpansionResultAggregation `json:"aggregations,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ExpansionResultsMetadata. -func (e ExpansionResultsMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregations", e.Aggregations) - return json.Marshal(objectMap) -} - // EyesOn - Settings with single toggle. type EyesOn struct { // REQUIRED; The kind of the setting @@ -5347,69 +2652,6 @@ type EyesOn struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetSettings implements the SettingsClassification interface for type EyesOn. -func (e *EyesOn) GetSettings() *Settings { - return &Settings{ - Kind: e.Kind, - Etag: e.Etag, - ID: e.ID, - Name: e.Name, - Type: e.Type, - SystemData: e.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type EyesOn. -func (e EyesOn) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", e.Etag) - populate(objectMap, "id", e.ID) - objectMap["kind"] = SettingKindEyesOn - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "systemData", e.SystemData) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type EyesOn. -func (e *EyesOn) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &e.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &e.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &e.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &e.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &e.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &e.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // EyesOnSettingsProperties - EyesOn property bag. type EyesOnSettingsProperties struct { // READ-ONLY; Determines whether the setting is enable or disabled. @@ -5446,64 +2688,6 @@ type FileEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type FileEntity. -func (f *FileEntity) GetEntity() *Entity { - return &Entity{ - Kind: f.Kind, - ID: f.ID, - Name: f.Name, - Type: f.Type, - SystemData: f.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type FileEntity. -func (f FileEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - objectMap["kind"] = EntityKindFile - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileEntity. -func (f *FileEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &f.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // FileEntityProperties - File entity property bag. type FileEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -5526,18 +2710,6 @@ type FileEntityProperties struct { HostEntityID *string `json:"hostEntityId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type FileEntityProperties. -func (f FileEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", f.AdditionalData) - populate(objectMap, "directory", f.Directory) - populate(objectMap, "fileHashEntityIds", f.FileHashEntityIDs) - populate(objectMap, "fileName", f.FileName) - populate(objectMap, "friendlyName", f.FriendlyName) - populate(objectMap, "hostEntityId", f.HostEntityID) - return json.Marshal(objectMap) -} - // FileHashEntity - Represents a file hash entity. type FileHashEntity struct { // REQUIRED; The kind of the entity. @@ -5559,64 +2731,6 @@ type FileHashEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type FileHashEntity. -func (f *FileHashEntity) GetEntity() *Entity { - return &Entity{ - Kind: f.Kind, - ID: f.ID, - Name: f.Name, - Type: f.Type, - SystemData: f.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type FileHashEntity. -func (f FileHashEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - objectMap["kind"] = EntityKindFileHash - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FileHashEntity. -func (f *FileHashEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &f.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // FileHashEntityProperties - FileHash entity property bag. type FileHashEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -5633,16 +2747,6 @@ type FileHashEntityProperties struct { HashValue *string `json:"hashValue,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type FileHashEntityProperties. -func (f FileHashEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", f.AdditionalData) - populate(objectMap, "algorithm", f.Algorithm) - populate(objectMap, "friendlyName", f.FriendlyName) - populate(objectMap, "hashValue", f.HashValue) - return json.Marshal(objectMap) -} - // FusionAlertRule - Represents Fusion alert rule. type FusionAlertRule struct { // REQUIRED; The kind of the alert rule @@ -5667,69 +2771,6 @@ type FusionAlertRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRule implements the AlertRuleClassification interface for type FusionAlertRule. -func (f *FusionAlertRule) GetAlertRule() *AlertRule { - return &AlertRule{ - Kind: f.Kind, - Etag: f.Etag, - ID: f.ID, - Name: f.Name, - Type: f.Type, - SystemData: f.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRule. -func (f FusionAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", f.Etag) - populate(objectMap, "id", f.ID) - objectMap["kind"] = AlertRuleKindFusion - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRule. -func (f *FusionAlertRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &f.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &f.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // FusionAlertRuleProperties - Fusion alert rule base property bag. type FusionAlertRuleProperties struct { // REQUIRED; The Name of the alert rule template used to create this rule. @@ -5738,12 +2779,12 @@ type FusionAlertRuleProperties struct { // REQUIRED; Determines whether this alert rule is enabled or disabled. Enabled *bool `json:"enabled,omitempty"` - // REQUIRED; Configuration for all supported source signals in fusion detection. - SourceSettings []*FusionSourceSettings `json:"sourceSettings,omitempty"` - // Configuration to exclude scenarios in fusion detection. ScenarioExclusionPatterns []*FusionScenarioExclusionPattern `json:"scenarioExclusionPatterns,omitempty"` + // Configuration for all supported source signals in fusion detection. + SourceSettings []*FusionSourceSettings `json:"sourceSettings,omitempty"` + // READ-ONLY; The description of the alert rule. Description *string `json:"description,omitempty" azure:"ro"` @@ -5763,69 +2804,6 @@ type FusionAlertRuleProperties struct { Techniques []*string `json:"techniques,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleProperties. -func (f FusionAlertRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRuleTemplateName", f.AlertRuleTemplateName) - populate(objectMap, "description", f.Description) - populate(objectMap, "displayName", f.DisplayName) - populate(objectMap, "enabled", f.Enabled) - populateTimeRFC3339(objectMap, "lastModifiedUtc", f.LastModifiedUTC) - populate(objectMap, "scenarioExclusionPatterns", f.ScenarioExclusionPatterns) - populate(objectMap, "severity", f.Severity) - populate(objectMap, "sourceSettings", f.SourceSettings) - populate(objectMap, "tactics", f.Tactics) - populate(objectMap, "techniques", f.Techniques) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRuleProperties. -func (f *FusionAlertRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRuleTemplateName": - err = unpopulate(val, &f.AlertRuleTemplateName) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &f.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &f.DisplayName) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &f.Enabled) - delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, &f.LastModifiedUTC) - delete(rawMsg, key) - case "scenarioExclusionPatterns": - err = unpopulate(val, &f.ScenarioExclusionPatterns) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &f.Severity) - delete(rawMsg, key) - case "sourceSettings": - err = unpopulate(val, &f.SourceSettings) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &f.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &f.Techniques) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // FusionAlertRuleTemplate - Represents Fusion alert rule template. type FusionAlertRuleTemplate struct { // REQUIRED; The kind of the alert rule @@ -5847,72 +2825,8 @@ type FusionAlertRuleTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type FusionAlertRuleTemplate. -func (f *FusionAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { - return &AlertRuleTemplate{ - Kind: f.Kind, - ID: f.ID, - Name: f.Name, - Type: f.Type, - SystemData: f.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleTemplate. -func (f FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - objectMap["kind"] = AlertRuleKindFusion - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRuleTemplate. -func (f *FusionAlertRuleTemplate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &f.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // FusionAlertRuleTemplateProperties - Fusion alert rule template properties type FusionAlertRuleTemplateProperties struct { - // REQUIRED; The severity for alerts created by this alert rule. - Severity *AlertSeverity `json:"severity,omitempty"` - - // REQUIRED; All supported source signal configurations consumed in fusion detection. - SourceSettings []*FusionTemplateSourceSetting `json:"sourceSettings,omitempty"` - // the number of alert rules that were created by this template AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` @@ -5922,13 +2836,19 @@ type FusionAlertRuleTemplateProperties struct { // The display name for alert rule template. DisplayName *string `json:"displayName,omitempty"` - // The required data sources for this template + // The required data connectors for this template RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + // The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty"` + + // All supported source signal configurations consumed in fusion detection. + SourceSettings []*FusionTemplateSourceSetting `json:"sourceSettings,omitempty"` + // The alert rule template status. Status *TemplateStatus `json:"status,omitempty"` - // The tactics of the alert rule + // The tactics of the alert rule template Tactics []*AttackTactic `json:"tactics,omitempty"` // The techniques of the alert rule @@ -5937,77 +2857,10 @@ type FusionAlertRuleTemplateProperties struct { // READ-ONLY; The time that this alert rule template has been added. CreatedDateUTC *time.Time `json:"createdDateUTC,omitempty" azure:"ro"` - // READ-ONLY; The last time that this alert rule template has been updated. + // READ-ONLY; The time that this alert rule template was last updated. LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleTemplateProperties. -func (f FusionAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRulesCreatedByTemplateCount", f.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", f.CreatedDateUTC) - populate(objectMap, "description", f.Description) - populate(objectMap, "displayName", f.DisplayName) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", f.LastUpdatedDateUTC) - populate(objectMap, "requiredDataConnectors", f.RequiredDataConnectors) - populate(objectMap, "severity", f.Severity) - populate(objectMap, "sourceSettings", f.SourceSettings) - populate(objectMap, "status", f.Status) - populate(objectMap, "tactics", f.Tactics) - populate(objectMap, "techniques", f.Techniques) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRuleTemplateProperties. -func (f *FusionAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &f.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &f.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &f.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &f.DisplayName) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &f.LastUpdatedDateUTC) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &f.RequiredDataConnectors) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &f.Severity) - delete(rawMsg, key) - case "sourceSettings": - err = unpopulate(val, &f.SourceSettings) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &f.Status) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &f.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &f.Techniques) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // FusionScenarioExclusionPattern - Represents a Fusion scenario exclusion patterns in Fusion detection. type FusionScenarioExclusionPattern struct { // REQUIRED; DateTime when scenario exclusion pattern is added in UTC. @@ -6029,15 +2882,6 @@ type FusionSourceSettings struct { SourceSubTypes []*FusionSourceSubTypeSetting `json:"sourceSubTypes,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type FusionSourceSettings. -func (f FusionSourceSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", f.Enabled) - populate(objectMap, "sourceName", f.SourceName) - populate(objectMap, "sourceSubTypes", f.SourceSubTypes) - return json.Marshal(objectMap) -} - // FusionSourceSubTypeSetting - Represents a supported source subtype configuration under a source signal in Fusion detection. type FusionSourceSubTypeSetting struct { // REQUIRED; Determines whether this source subtype under source signal is enabled or disabled in Fusion detection. @@ -6063,14 +2907,6 @@ type FusionSubTypeSeverityFilter struct { IsSupported *bool `json:"isSupported,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type FusionSubTypeSeverityFilter. -func (f FusionSubTypeSeverityFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filters", f.Filters) - populate(objectMap, "isSupported", f.IsSupported) - return json.Marshal(objectMap) -} - // FusionSubTypeSeverityFiltersItem - Represents a Severity filter setting for a given source subtype consumed in Fusion detection. type FusionSubTypeSeverityFiltersItem struct { // REQUIRED; Determines whether this severity is enabled or disabled for this source subtype consumed in Fusion detection. @@ -6089,14 +2925,6 @@ type FusionTemplateSourceSetting struct { SourceSubTypes []*FusionTemplateSourceSubType `json:"sourceSubTypes,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type FusionTemplateSourceSetting. -func (f FusionTemplateSourceSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "sourceName", f.SourceName) - populate(objectMap, "sourceSubTypes", f.SourceSubTypes) - return json.Marshal(objectMap) -} - // FusionTemplateSourceSubType - Represents a source subtype under a source signal consumed in Fusion detection. type FusionTemplateSourceSubType struct { // REQUIRED; Severity configuration available for a source subtype consumed in fusion detection. @@ -6119,14 +2947,6 @@ type FusionTemplateSubTypeSeverityFilter struct { SeverityFilters []*AlertSeverity `json:"severityFilters,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type FusionTemplateSubTypeSeverityFilter. -func (f FusionTemplateSubTypeSeverityFilter) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isSupported", f.IsSupported) - populate(objectMap, "severityFilters", f.SeverityFilters) - return json.Marshal(objectMap) -} - // GeoLocation - The geo-location context attached to the ip entity type GeoLocation struct { // READ-ONLY; Autonomous System Number @@ -6176,45 +2996,16 @@ type GetInsightsResultsMetadata struct { Errors []*GetInsightsError `json:"errors,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type GetInsightsResultsMetadata. -func (g GetInsightsResultsMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errors", g.Errors) - populate(objectMap, "totalCount", g.TotalCount) - return json.Marshal(objectMap) -} - // GetQueriesResponse - Retrieve queries for entity result operation response. type GetQueriesResponse struct { // The query result values. Value []EntityQueryItemClassification `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type GetQueriesResponse. -func (g GetQueriesResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", g.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GetQueriesResponse. -func (g *GetQueriesResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - g.Value, err = unmarshalEntityQueryItemClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil +// GitHubResourceInfo - Resources created in GitHub repository. +type GitHubResourceInfo struct { + // GitHub application installation id. + AppInstallationID *string `json:"appInstallationId,omitempty"` } // GraphQueries - The graph query to show the current data status @@ -6256,19 +3047,6 @@ type GroupingConfiguration struct { GroupByEntities []*EntityMappingType `json:"groupByEntities,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type GroupingConfiguration. -func (g GroupingConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", g.Enabled) - populate(objectMap, "groupByAlertDetails", g.GroupByAlertDetails) - populate(objectMap, "groupByCustomDetails", g.GroupByCustomDetails) - populate(objectMap, "groupByEntities", g.GroupByEntities) - populate(objectMap, "lookbackDuration", g.LookbackDuration) - populate(objectMap, "matchingMethod", g.MatchingMethod) - populate(objectMap, "reopenClosedIncident", g.ReopenClosedIncident) - return json.Marshal(objectMap) -} - // HostEntity - Represents a host entity. type HostEntity struct { // REQUIRED; The kind of the entity. @@ -6290,64 +3068,6 @@ type HostEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type HostEntity. -func (h *HostEntity) GetEntity() *Entity { - return &Entity{ - Kind: h.Kind, - ID: h.ID, - Name: h.Name, - Type: h.Type, - SystemData: h.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type HostEntity. -func (h HostEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", h.ID) - objectMap["kind"] = EntityKindHost - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HostEntity. -func (h *HostEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &h.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &h.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &h.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &h.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &h.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &h.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // HostEntityProperties - Host entity property bag. type HostEntityProperties struct { // The operating system type. @@ -6386,23 +3106,6 @@ type HostEntityProperties struct { OmsAgentID *string `json:"omsAgentID,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type HostEntityProperties. -func (h HostEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", h.AdditionalData) - populate(objectMap, "azureID", h.AzureID) - populate(objectMap, "dnsDomain", h.DNSDomain) - populate(objectMap, "friendlyName", h.FriendlyName) - populate(objectMap, "hostName", h.HostName) - populate(objectMap, "isDomainJoined", h.IsDomainJoined) - populate(objectMap, "netBiosName", h.NetBiosName) - populate(objectMap, "ntDomain", h.NtDomain) - populate(objectMap, "osFamily", h.OSFamily) - populate(objectMap, "osVersion", h.OSVersion) - populate(objectMap, "omsAgentID", h.OmsAgentID) - return json.Marshal(objectMap) -} - // HuntingBookmark - Represents a Hunting bookmark entity. type HuntingBookmark struct { // REQUIRED; The kind of the entity. @@ -6424,64 +3127,6 @@ type HuntingBookmark struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type HuntingBookmark. -func (h *HuntingBookmark) GetEntity() *Entity { - return &Entity{ - Kind: h.Kind, - ID: h.ID, - Name: h.Name, - Type: h.Type, - SystemData: h.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type HuntingBookmark. -func (h HuntingBookmark) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", h.ID) - objectMap["kind"] = EntityKindBookmark - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HuntingBookmark. -func (h *HuntingBookmark) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &h.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &h.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &h.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &h.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &h.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &h.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // HuntingBookmarkProperties - Describes bookmark properties type HuntingBookmarkProperties struct { // REQUIRED; The display name of the bookmark @@ -6525,81 +3170,6 @@ type HuntingBookmarkProperties struct { FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type HuntingBookmarkProperties. -func (h HuntingBookmarkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", h.AdditionalData) - populateTimeRFC3339(objectMap, "created", h.Created) - populate(objectMap, "createdBy", h.CreatedBy) - populate(objectMap, "displayName", h.DisplayName) - populateTimeRFC3339(objectMap, "eventTime", h.EventTime) - populate(objectMap, "friendlyName", h.FriendlyName) - populate(objectMap, "incidentInfo", h.IncidentInfo) - populate(objectMap, "labels", h.Labels) - populate(objectMap, "notes", h.Notes) - populate(objectMap, "query", h.Query) - populate(objectMap, "queryResult", h.QueryResult) - populateTimeRFC3339(objectMap, "updated", h.Updated) - populate(objectMap, "updatedBy", h.UpdatedBy) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HuntingBookmarkProperties. -func (h *HuntingBookmarkProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalData": - err = unpopulate(val, &h.AdditionalData) - delete(rawMsg, key) - case "created": - err = unpopulateTimeRFC3339(val, &h.Created) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &h.CreatedBy) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &h.DisplayName) - delete(rawMsg, key) - case "eventTime": - err = unpopulateTimeRFC3339(val, &h.EventTime) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &h.FriendlyName) - delete(rawMsg, key) - case "incidentInfo": - err = unpopulate(val, &h.IncidentInfo) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, &h.Labels) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, &h.Notes) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &h.Query) - delete(rawMsg, key) - case "queryResult": - err = unpopulate(val, &h.QueryResult) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, &h.Updated) - delete(rawMsg, key) - case "updatedBy": - err = unpopulate(val, &h.UpdatedBy) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // IPEntity - Represents an ip entity. type IPEntity struct { // REQUIRED; The kind of the entity. @@ -6621,64 +3191,6 @@ type IPEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type IPEntity. -func (i *IPEntity) GetEntity() *Entity { - return &Entity{ - Kind: i.Kind, - ID: i.ID, - Name: i.Name, - Type: i.Type, - SystemData: i.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type IPEntity. -func (i IPEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = EntityKindIP - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IPEntity. -func (i *IPEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &i.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &i.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &i.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &i.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // IPEntityProperties - Ip entity property bag. type IPEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -6698,17 +3210,6 @@ type IPEntityProperties struct { ThreatIntelligence []*ThreatIntelligence `json:"threatIntelligence,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IPEntityProperties. -func (i IPEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", i.AdditionalData) - populate(objectMap, "address", i.Address) - populate(objectMap, "friendlyName", i.FriendlyName) - populate(objectMap, "location", i.Location) - populate(objectMap, "threatIntelligence", i.ThreatIntelligence) - return json.Marshal(objectMap) -} - // IPGeodataClientGetOptions contains the optional parameters for the IPGeodataClient.Get method. type IPGeodataClientGetOptions struct { // placeholder for future optional parameters @@ -6759,45 +3260,18 @@ type IncidentAdditionalData struct { Techniques []*string `json:"techniques,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentAdditionalData. -func (i IncidentAdditionalData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertProductNames", i.AlertProductNames) - populate(objectMap, "alertsCount", i.AlertsCount) - populate(objectMap, "bookmarksCount", i.BookmarksCount) - populate(objectMap, "commentsCount", i.CommentsCount) - populate(objectMap, "providerIncidentUrl", i.ProviderIncidentURL) - populate(objectMap, "tactics", i.Tactics) - populate(objectMap, "techniques", i.Techniques) - return json.Marshal(objectMap) -} - // IncidentAlertList - List of incident alerts. type IncidentAlertList struct { // REQUIRED; Array of incident alerts. Value []*SecurityAlert `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentAlertList. -func (i IncidentAlertList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - // IncidentBookmarkList - List of incident bookmarks. type IncidentBookmarkList struct { // REQUIRED; Array of incident bookmarks. Value []*HuntingBookmark `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentBookmarkList. -func (i IncidentBookmarkList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - // IncidentComment - Represents an incident comment type IncidentComment struct { // Etag of the azure resource @@ -6828,14 +3302,6 @@ type IncidentCommentList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentCommentList. -func (i IncidentCommentList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - // IncidentCommentProperties - Incident comment property bag. type IncidentCommentProperties struct { // REQUIRED; The comment message @@ -6851,45 +3317,6 @@ type IncidentCommentProperties struct { LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentCommentProperties. -func (i IncidentCommentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", i.Author) - populateTimeRFC3339(objectMap, "createdTimeUtc", i.CreatedTimeUTC) - populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", i.LastModifiedTimeUTC) - populate(objectMap, "message", i.Message) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IncidentCommentProperties. -func (i *IncidentCommentProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "author": - err = unpopulate(val, &i.Author) - delete(rawMsg, key) - case "createdTimeUtc": - err = unpopulateTimeRFC3339(val, &i.CreatedTimeUTC) - delete(rawMsg, key) - case "lastModifiedTimeUtc": - err = unpopulateTimeRFC3339(val, &i.LastModifiedTimeUTC) - delete(rawMsg, key) - case "message": - err = unpopulate(val, &i.Message) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // IncidentCommentsClientCreateOrUpdateOptions contains the optional parameters for the IncidentCommentsClient.CreateOrUpdate // method. type IncidentCommentsClientCreateOrUpdateOptions struct { @@ -6938,37 +3365,6 @@ type IncidentEntitiesResponse struct { MetaData []*IncidentEntitiesResultsMetadata `json:"metaData,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentEntitiesResponse. -func (i IncidentEntitiesResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "entities", i.Entities) - populate(objectMap, "metaData", i.MetaData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IncidentEntitiesResponse. -func (i *IncidentEntitiesResponse) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "entities": - i.Entities, err = unmarshalEntityClassificationArray(val) - delete(rawMsg, key) - case "metaData": - err = unpopulate(val, &i.MetaData) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // IncidentEntitiesResultsMetadata - Information of a specific aggregation in the incident related entities result. type IncidentEntitiesResultsMetadata struct { // REQUIRED; Total number of aggregations of the given kind in the incident related entities result. @@ -7011,14 +3407,6 @@ type IncidentList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentList. -func (i IncidentList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - // IncidentOwnerInfo - Information on the user an incident is assigned to type IncidentOwnerInfo struct { // The name of the user the incident is assigned to. @@ -7030,11 +3418,11 @@ type IncidentOwnerInfo struct { // The object id of the user the incident is assigned to. ObjectID *string `json:"objectId,omitempty"` + // The type of the owner the incident is assigned to. + OwnerType *OwnerType `json:"ownerType,omitempty"` + // The user principal name of the user the incident is assigned to. UserPrincipalName *string `json:"userPrincipalName,omitempty"` - - // READ-ONLY; The type of the owner the incident is assigned to. - OwnerType *OwnerType `json:"ownerType,omitempty" azure:"ro"` } // IncidentProperties - Describes incident properties @@ -7100,109 +3488,6 @@ type IncidentProperties struct { RelatedAnalyticRuleIDs []*string `json:"relatedAnalyticRuleIds,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentProperties. -func (i IncidentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", i.AdditionalData) - populate(objectMap, "classification", i.Classification) - populate(objectMap, "classificationComment", i.ClassificationComment) - populate(objectMap, "classificationReason", i.ClassificationReason) - populateTimeRFC3339(objectMap, "createdTimeUtc", i.CreatedTimeUTC) - populate(objectMap, "description", i.Description) - populateTimeRFC3339(objectMap, "firstActivityTimeUtc", i.FirstActivityTimeUTC) - populate(objectMap, "incidentNumber", i.IncidentNumber) - populate(objectMap, "incidentUrl", i.IncidentURL) - populate(objectMap, "labels", i.Labels) - populateTimeRFC3339(objectMap, "lastActivityTimeUtc", i.LastActivityTimeUTC) - populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", i.LastModifiedTimeUTC) - populate(objectMap, "owner", i.Owner) - populate(objectMap, "providerIncidentId", i.ProviderIncidentID) - populate(objectMap, "providerName", i.ProviderName) - populate(objectMap, "relatedAnalyticRuleIds", i.RelatedAnalyticRuleIDs) - populate(objectMap, "severity", i.Severity) - populate(objectMap, "status", i.Status) - populate(objectMap, "teamInformation", i.TeamInformation) - populate(objectMap, "title", i.Title) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IncidentProperties. -func (i *IncidentProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalData": - err = unpopulate(val, &i.AdditionalData) - delete(rawMsg, key) - case "classification": - err = unpopulate(val, &i.Classification) - delete(rawMsg, key) - case "classificationComment": - err = unpopulate(val, &i.ClassificationComment) - delete(rawMsg, key) - case "classificationReason": - err = unpopulate(val, &i.ClassificationReason) - delete(rawMsg, key) - case "createdTimeUtc": - err = unpopulateTimeRFC3339(val, &i.CreatedTimeUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &i.Description) - delete(rawMsg, key) - case "firstActivityTimeUtc": - err = unpopulateTimeRFC3339(val, &i.FirstActivityTimeUTC) - delete(rawMsg, key) - case "incidentNumber": - err = unpopulate(val, &i.IncidentNumber) - delete(rawMsg, key) - case "incidentUrl": - err = unpopulate(val, &i.IncidentURL) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, &i.Labels) - delete(rawMsg, key) - case "lastActivityTimeUtc": - err = unpopulateTimeRFC3339(val, &i.LastActivityTimeUTC) - delete(rawMsg, key) - case "lastModifiedTimeUtc": - err = unpopulateTimeRFC3339(val, &i.LastModifiedTimeUTC) - delete(rawMsg, key) - case "owner": - err = unpopulate(val, &i.Owner) - delete(rawMsg, key) - case "providerIncidentId": - err = unpopulate(val, &i.ProviderIncidentID) - delete(rawMsg, key) - case "providerName": - err = unpopulate(val, &i.ProviderName) - delete(rawMsg, key) - case "relatedAnalyticRuleIds": - err = unpopulate(val, &i.RelatedAnalyticRuleIDs) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &i.Severity) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &i.Status) - delete(rawMsg, key) - case "teamInformation": - err = unpopulate(val, &i.TeamInformation) - delete(rawMsg, key) - case "title": - err = unpopulate(val, &i.Title) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - type IncidentPropertiesAction struct { // The reason the incident was closed Classification *IncidentClassification `json:"classification,omitempty"` @@ -7226,19 +3511,6 @@ type IncidentPropertiesAction struct { Status *IncidentStatus `json:"status,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type IncidentPropertiesAction. -func (i IncidentPropertiesAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "classification", i.Classification) - populate(objectMap, "classificationComment", i.ClassificationComment) - populate(objectMap, "classificationReason", i.ClassificationReason) - populate(objectMap, "labels", i.Labels) - populate(objectMap, "owner", i.Owner) - populate(objectMap, "severity", i.Severity) - populate(objectMap, "status", i.Status) - return json.Marshal(objectMap) -} - // IncidentRelationsClientCreateOrUpdateOptions contains the optional parameters for the IncidentRelationsClient.CreateOrUpdate // method. type IncidentRelationsClientCreateOrUpdateOptions struct { @@ -7318,6 +3590,11 @@ type IncidentsClientListOptions struct { Top *int32 } +// IncidentsClientRunPlaybookOptions contains the optional parameters for the IncidentsClient.RunPlaybook method. +type IncidentsClientRunPlaybookOptions struct { + RequestBody *ManualTriggerRequestBody +} + // InsightQueryItem - Represents Insight Query. type InsightQueryItem struct { // REQUIRED; The kind of the entity query @@ -7336,59 +3613,6 @@ type InsightQueryItem struct { ID *string `json:"id,omitempty" azure:"ro"` } -// GetEntityQueryItem implements the EntityQueryItemClassification interface for type InsightQueryItem. -func (i *InsightQueryItem) GetEntityQueryItem() *EntityQueryItem { - return &EntityQueryItem{ - ID: i.ID, - Name: i.Name, - Type: i.Type, - Kind: i.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type InsightQueryItem. -func (i InsightQueryItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = EntityQueryKindInsight - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type InsightQueryItem. -func (i *InsightQueryItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &i.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &i.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // InsightQueryItemProperties - Represents Insight Query. type InsightQueryItemProperties struct { // The activity query definitions. @@ -7428,24 +3652,6 @@ type InsightQueryItemProperties struct { TableQuery *InsightQueryItemPropertiesTableQuery `json:"tableQuery,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type InsightQueryItemProperties. -func (i InsightQueryItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalQuery", i.AdditionalQuery) - populate(objectMap, "baseQuery", i.BaseQuery) - populate(objectMap, "chartQuery", &i.ChartQuery) - populate(objectMap, "dataTypes", i.DataTypes) - populate(objectMap, "defaultTimeRange", i.DefaultTimeRange) - populate(objectMap, "description", i.Description) - populate(objectMap, "displayName", i.DisplayName) - populate(objectMap, "entitiesFilter", &i.EntitiesFilter) - populate(objectMap, "inputEntityType", i.InputEntityType) - populate(objectMap, "referenceTimeRange", i.ReferenceTimeRange) - populate(objectMap, "requiredInputFieldsSets", i.RequiredInputFieldsSets) - populate(objectMap, "tableQuery", i.TableQuery) - return json.Marshal(objectMap) -} - // InsightQueryItemPropertiesAdditionalQuery - The activity query definitions. type InsightQueryItemPropertiesAdditionalQuery struct { // The insight query. @@ -7479,14 +3685,6 @@ type InsightQueryItemPropertiesTableQuery struct { QueriesDefinitions []*InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem `json:"queriesDefinitions,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type InsightQueryItemPropertiesTableQuery. -func (i InsightQueryItemPropertiesTableQuery) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "columnsDefinitions", i.ColumnsDefinitions) - populate(objectMap, "queriesDefinitions", i.QueriesDefinitions) - return json.Marshal(objectMap) -} - type InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem struct { // Insight column header. Header *string `json:"header,omitempty"` @@ -7512,16 +3710,6 @@ type InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem struct { Summarize *string `json:"summarize,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem. -func (i InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "filter", i.Filter) - populate(objectMap, "linkColumnsDefinitions", i.LinkColumnsDefinitions) - populate(objectMap, "project", i.Project) - populate(objectMap, "summarize", i.Summarize) - return json.Marshal(objectMap) -} - type InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem struct { // Insight Link Definition Projected Name. ProjectedName *string `json:"projectedName,omitempty"` @@ -7539,14 +3727,6 @@ type InsightsTableResult struct { Rows [][]*string `json:"rows,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type InsightsTableResult. -func (i InsightsTableResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "columns", i.Columns) - populate(objectMap, "rows", i.Rows) - return json.Marshal(objectMap) -} - type InsightsTableResultColumnsItem struct { // the name of the colum Name *string `json:"name,omitempty"` @@ -7567,15 +3747,6 @@ type InstructionSteps struct { Title *string `json:"title,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type InstructionSteps. -func (i InstructionSteps) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", i.Description) - populate(objectMap, "instructions", i.Instructions) - populate(objectMap, "title", i.Title) - return json.Marshal(objectMap) -} - type InstructionStepsInstructionsItem struct { // REQUIRED; The kind of the setting Type *SettingType `json:"type,omitempty"` @@ -7584,6 +3755,54 @@ type InstructionStepsInstructionsItem struct { Parameters interface{} `json:"parameters,omitempty"` } +// IoTCheckRequirements - Represents IoT requirements check request. +type IoTCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // IoT requirements check properties. + Properties *IoTCheckRequirementsProperties `json:"properties,omitempty"` +} + +// IoTCheckRequirementsProperties - IoT requirements check properties. +type IoTCheckRequirementsProperties struct { + // The subscription id to connect to, and get the data from. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// IoTDataConnector - Represents IoT data connector. +type IoTDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // IoT data connector properties. + Properties *IoTDataConnectorProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// IoTDataConnectorProperties - IoT data connector properties. +type IoTDataConnectorProperties struct { + // The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` + + // The subscription id to connect to, and get the data from. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + // IoTDeviceEntity - Represents an IoT device entity. type IoTDeviceEntity struct { // REQUIRED; The kind of the entity. @@ -7605,64 +3824,6 @@ type IoTDeviceEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type IoTDeviceEntity. -func (i *IoTDeviceEntity) GetEntity() *Entity { - return &Entity{ - Kind: i.Kind, - ID: i.ID, - Name: i.Name, - Type: i.Type, - SystemData: i.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type IoTDeviceEntity. -func (i IoTDeviceEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = EntityKindIoTDevice - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IoTDeviceEntity. -func (i *IoTDeviceEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &i.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &i.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &i.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &i.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &i.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // IoTDeviceEntityProperties - IoTDevice entity property bag. type IoTDeviceEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -7724,31 +3885,6 @@ type IoTDeviceEntityProperties struct { Vendor *string `json:"vendor,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IoTDeviceEntityProperties. -func (i IoTDeviceEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", i.AdditionalData) - populate(objectMap, "deviceId", i.DeviceID) - populate(objectMap, "deviceName", i.DeviceName) - populate(objectMap, "deviceType", i.DeviceType) - populate(objectMap, "edgeId", i.EdgeID) - populate(objectMap, "firmwareVersion", i.FirmwareVersion) - populate(objectMap, "friendlyName", i.FriendlyName) - populate(objectMap, "hostEntityId", i.HostEntityID) - populate(objectMap, "ipAddressEntityId", i.IPAddressEntityID) - populate(objectMap, "iotHubEntityId", i.IotHubEntityID) - populate(objectMap, "iotSecurityAgentId", i.IotSecurityAgentID) - populate(objectMap, "macAddress", i.MacAddress) - populate(objectMap, "model", i.Model) - populate(objectMap, "operatingSystem", i.OperatingSystem) - populate(objectMap, "protocols", i.Protocols) - populate(objectMap, "serialNumber", i.SerialNumber) - populate(objectMap, "source", i.Source) - populate(objectMap, "threatIntelligence", i.ThreatIntelligence) - populate(objectMap, "vendor", i.Vendor) - return json.Marshal(objectMap) -} - // LastDataReceivedDataType - Data type for last data received type LastDataReceivedDataType struct { // Query for indicate last data received @@ -7767,44 +3903,6 @@ type MCASCheckRequirements struct { Properties *MCASCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MCASCheckRequirements. -func (m *MCASCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: m.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MCASCheckRequirements. -func (m MCASCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindMicrosoftCloudAppSecurity - populate(objectMap, "properties", m.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MCASCheckRequirements. -func (m *MCASCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MCASCheckRequirementsProperties - MCAS (Microsoft Cloud App Security) requirements check properties. type MCASCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -7835,69 +3933,6 @@ type MCASDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type MCASDataConnector. -func (m *MCASDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: m.Kind, - Etag: m.Etag, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MCASDataConnector. -func (m MCASDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - objectMap["kind"] = DataConnectorKindMicrosoftCloudAppSecurity - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MCASDataConnector. -func (m *MCASDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MCASDataConnectorDataTypes - The available data types for MCAS (Microsoft Cloud App Security) data connector. type MCASDataConnectorDataTypes struct { // REQUIRED; Alerts data type connection. @@ -7925,44 +3960,6 @@ type MDATPCheckRequirements struct { Properties *MDATPCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MDATPCheckRequirements. -func (m *MDATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: m.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MDATPCheckRequirements. -func (m MDATPCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindMicrosoftDefenderAdvancedThreatProtection - populate(objectMap, "properties", m.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MDATPCheckRequirements. -func (m *MDATPCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MDATPCheckRequirementsProperties - MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. type MDATPCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -7993,69 +3990,6 @@ type MDATPDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type MDATPDataConnector. -func (m *MDATPDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: m.Kind, - Etag: m.Etag, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MDATPDataConnector. -func (m MDATPDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - objectMap["kind"] = DataConnectorKindMicrosoftDefenderAdvancedThreatProtection - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MDATPDataConnector. -func (m *MDATPDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MDATPDataConnectorProperties - MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. type MDATPDataConnectorProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -8089,69 +4023,6 @@ type MLBehaviorAnalyticsAlertRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRule implements the AlertRuleClassification interface for type MLBehaviorAnalyticsAlertRule. -func (m *MLBehaviorAnalyticsAlertRule) GetAlertRule() *AlertRule { - return &AlertRule{ - Kind: m.Kind, - Etag: m.Etag, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRule. -func (m MLBehaviorAnalyticsAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - objectMap["kind"] = AlertRuleKindMLBehaviorAnalytics - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRule. -func (m *MLBehaviorAnalyticsAlertRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MLBehaviorAnalyticsAlertRuleProperties - MLBehaviorAnalytics alert rule base property bag. type MLBehaviorAnalyticsAlertRuleProperties struct { // REQUIRED; The Name of the alert rule template used to create this rule. @@ -8179,61 +4050,6 @@ type MLBehaviorAnalyticsAlertRuleProperties struct { Techniques []*string `json:"techniques,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRuleProperties. -func (m MLBehaviorAnalyticsAlertRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRuleTemplateName", m.AlertRuleTemplateName) - populate(objectMap, "description", m.Description) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "enabled", m.Enabled) - populateTimeRFC3339(objectMap, "lastModifiedUtc", m.LastModifiedUTC) - populate(objectMap, "severity", m.Severity) - populate(objectMap, "tactics", m.Tactics) - populate(objectMap, "techniques", m.Techniques) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRuleProperties. -func (m *MLBehaviorAnalyticsAlertRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRuleTemplateName": - err = unpopulate(val, &m.AlertRuleTemplateName) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &m.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &m.DisplayName) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &m.Enabled) - delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, &m.LastModifiedUTC) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &m.Severity) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &m.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &m.Techniques) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MLBehaviorAnalyticsAlertRuleTemplate - Represents MLBehaviorAnalytics alert rule template. type MLBehaviorAnalyticsAlertRuleTemplate struct { // REQUIRED; The kind of the alert rule @@ -8255,64 +4071,6 @@ type MLBehaviorAnalyticsAlertRuleTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type MLBehaviorAnalyticsAlertRuleTemplate. -func (m *MLBehaviorAnalyticsAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { - return &AlertRuleTemplate{ - Kind: m.Kind, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRuleTemplate. -func (m MLBehaviorAnalyticsAlertRuleTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = AlertRuleKindMLBehaviorAnalytics - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRuleTemplate. -func (m *MLBehaviorAnalyticsAlertRuleTemplate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MLBehaviorAnalyticsAlertRuleTemplateProperties - MLBehaviorAnalytics alert rule template properties. type MLBehaviorAnalyticsAlertRuleTemplateProperties struct { // REQUIRED; The severity for alerts created by this alert rule. @@ -8346,69 +4104,6 @@ type MLBehaviorAnalyticsAlertRuleTemplateProperties struct { LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRuleTemplateProperties. -func (m MLBehaviorAnalyticsAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRulesCreatedByTemplateCount", m.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", m.CreatedDateUTC) - populate(objectMap, "description", m.Description) - populate(objectMap, "displayName", m.DisplayName) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", m.LastUpdatedDateUTC) - populate(objectMap, "requiredDataConnectors", m.RequiredDataConnectors) - populate(objectMap, "severity", m.Severity) - populate(objectMap, "status", m.Status) - populate(objectMap, "tactics", m.Tactics) - populate(objectMap, "techniques", m.Techniques) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRuleTemplateProperties. -func (m *MLBehaviorAnalyticsAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &m.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &m.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &m.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &m.DisplayName) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &m.LastUpdatedDateUTC) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &m.RequiredDataConnectors) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &m.Severity) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &m.Status) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &m.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &m.Techniques) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MSTICheckRequirements - Represents Microsoft Threat Intelligence requirements check request. type MSTICheckRequirements struct { // REQUIRED; Describes the kind of connector to be checked. @@ -8418,44 +4113,6 @@ type MSTICheckRequirements struct { Properties *MSTICheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MSTICheckRequirements. -func (m *MSTICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: m.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MSTICheckRequirements. -func (m MSTICheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindMicrosoftThreatIntelligence - populate(objectMap, "properties", m.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MSTICheckRequirements. -func (m *MSTICheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MSTICheckRequirementsProperties - Microsoft Threat Intelligence requirements check properties. type MSTICheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -8486,69 +4143,6 @@ type MSTIDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type MSTIDataConnector. -func (m *MSTIDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: m.Kind, - Etag: m.Etag, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MSTIDataConnector. -func (m MSTIDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - objectMap["kind"] = DataConnectorKindMicrosoftThreatIntelligence - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MSTIDataConnector. -func (m *MSTIDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MSTIDataConnectorDataTypes - The available data types for Microsoft Threat Intelligence Platforms data connector. type MSTIDataConnectorDataTypes struct { // REQUIRED; Data type for Microsoft Threat Intelligence Platforms data connector. @@ -8615,69 +4209,6 @@ type MTPDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type MTPDataConnector. -func (m *MTPDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: m.Kind, - Etag: m.Etag, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MTPDataConnector. -func (m MTPDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - objectMap["kind"] = DataConnectorKindMicrosoftThreatProtection - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MTPDataConnector. -func (m *MTPDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MTPDataConnectorDataTypes - The available data types for Microsoft Threat Protection Platforms data connector. type MTPDataConnectorDataTypes struct { // REQUIRED; Data type for Microsoft Threat Protection Platforms data connector. @@ -8720,64 +4251,6 @@ type MailClusterEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type MailClusterEntity. -func (m *MailClusterEntity) GetEntity() *Entity { - return &Entity{ - Kind: m.Kind, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MailClusterEntity. -func (m MailClusterEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindMailCluster - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MailClusterEntity. -func (m *MailClusterEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MailClusterEntityProperties - Mail cluster entity property bag. type MailClusterEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -8833,97 +4306,6 @@ type MailClusterEntityProperties struct { Threats []*string `json:"threats,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MailClusterEntityProperties. -func (m MailClusterEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", m.AdditionalData) - populate(objectMap, "clusterGroup", m.ClusterGroup) - populateTimeRFC3339(objectMap, "clusterQueryEndTime", m.ClusterQueryEndTime) - populateTimeRFC3339(objectMap, "clusterQueryStartTime", m.ClusterQueryStartTime) - populate(objectMap, "clusterSourceIdentifier", m.ClusterSourceIdentifier) - populate(objectMap, "clusterSourceType", m.ClusterSourceType) - populate(objectMap, "countByDeliveryStatus", &m.CountByDeliveryStatus) - populate(objectMap, "countByProtectionStatus", &m.CountByProtectionStatus) - populate(objectMap, "countByThreatType", &m.CountByThreatType) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "isVolumeAnomaly", m.IsVolumeAnomaly) - populate(objectMap, "mailCount", m.MailCount) - populate(objectMap, "networkMessageIds", m.NetworkMessageIDs) - populate(objectMap, "query", m.Query) - populateTimeRFC3339(objectMap, "queryTime", m.QueryTime) - populate(objectMap, "source", m.Source) - populate(objectMap, "threats", m.Threats) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MailClusterEntityProperties. -func (m *MailClusterEntityProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalData": - err = unpopulate(val, &m.AdditionalData) - delete(rawMsg, key) - case "clusterGroup": - err = unpopulate(val, &m.ClusterGroup) - delete(rawMsg, key) - case "clusterQueryEndTime": - err = unpopulateTimeRFC3339(val, &m.ClusterQueryEndTime) - delete(rawMsg, key) - case "clusterQueryStartTime": - err = unpopulateTimeRFC3339(val, &m.ClusterQueryStartTime) - delete(rawMsg, key) - case "clusterSourceIdentifier": - err = unpopulate(val, &m.ClusterSourceIdentifier) - delete(rawMsg, key) - case "clusterSourceType": - err = unpopulate(val, &m.ClusterSourceType) - delete(rawMsg, key) - case "countByDeliveryStatus": - err = unpopulate(val, &m.CountByDeliveryStatus) - delete(rawMsg, key) - case "countByProtectionStatus": - err = unpopulate(val, &m.CountByProtectionStatus) - delete(rawMsg, key) - case "countByThreatType": - err = unpopulate(val, &m.CountByThreatType) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &m.FriendlyName) - delete(rawMsg, key) - case "isVolumeAnomaly": - err = unpopulate(val, &m.IsVolumeAnomaly) - delete(rawMsg, key) - case "mailCount": - err = unpopulate(val, &m.MailCount) - delete(rawMsg, key) - case "networkMessageIds": - err = unpopulate(val, &m.NetworkMessageIDs) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &m.Query) - delete(rawMsg, key) - case "queryTime": - err = unpopulateTimeRFC3339(val, &m.QueryTime) - delete(rawMsg, key) - case "source": - err = unpopulate(val, &m.Source) - delete(rawMsg, key) - case "threats": - err = unpopulate(val, &m.Threats) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MailMessageEntity - Represents a mail message entity. type MailMessageEntity struct { // REQUIRED; The kind of the entity. @@ -8945,64 +4327,6 @@ type MailMessageEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type MailMessageEntity. -func (m *MailMessageEntity) GetEntity() *Entity { - return &Entity{ - Kind: m.Kind, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MailMessageEntity. -func (m MailMessageEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindMailMessage - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MailMessageEntity. -func (m *MailMessageEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MailMessageEntityProperties - Mail message entity property bag. type MailMessageEntityProperties struct { // The directionality of this mail message @@ -9089,137 +4413,6 @@ type MailMessageEntityProperties struct { Urls []*string `json:"urls,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MailMessageEntityProperties. -func (m MailMessageEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", m.AdditionalData) - populate(objectMap, "antispamDirection", m.AntispamDirection) - populate(objectMap, "bodyFingerprintBin1", m.BodyFingerprintBin1) - populate(objectMap, "bodyFingerprintBin2", m.BodyFingerprintBin2) - populate(objectMap, "bodyFingerprintBin3", m.BodyFingerprintBin3) - populate(objectMap, "bodyFingerprintBin4", m.BodyFingerprintBin4) - populate(objectMap, "bodyFingerprintBin5", m.BodyFingerprintBin5) - populate(objectMap, "deliveryAction", m.DeliveryAction) - populate(objectMap, "deliveryLocation", m.DeliveryLocation) - populate(objectMap, "fileEntityIds", m.FileEntityIDs) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "internetMessageId", m.InternetMessageID) - populate(objectMap, "language", m.Language) - populate(objectMap, "networkMessageId", m.NetworkMessageID) - populate(objectMap, "p1Sender", m.P1Sender) - populate(objectMap, "p1SenderDisplayName", m.P1SenderDisplayName) - populate(objectMap, "p1SenderDomain", m.P1SenderDomain) - populate(objectMap, "p2Sender", m.P2Sender) - populate(objectMap, "p2SenderDisplayName", m.P2SenderDisplayName) - populate(objectMap, "p2SenderDomain", m.P2SenderDomain) - populateTimeRFC3339(objectMap, "receiveDate", m.ReceiveDate) - populate(objectMap, "recipient", m.Recipient) - populate(objectMap, "senderIP", m.SenderIP) - populate(objectMap, "subject", m.Subject) - populate(objectMap, "threatDetectionMethods", m.ThreatDetectionMethods) - populate(objectMap, "threats", m.Threats) - populate(objectMap, "urls", m.Urls) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MailMessageEntityProperties. -func (m *MailMessageEntityProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalData": - err = unpopulate(val, &m.AdditionalData) - delete(rawMsg, key) - case "antispamDirection": - err = unpopulate(val, &m.AntispamDirection) - delete(rawMsg, key) - case "bodyFingerprintBin1": - err = unpopulate(val, &m.BodyFingerprintBin1) - delete(rawMsg, key) - case "bodyFingerprintBin2": - err = unpopulate(val, &m.BodyFingerprintBin2) - delete(rawMsg, key) - case "bodyFingerprintBin3": - err = unpopulate(val, &m.BodyFingerprintBin3) - delete(rawMsg, key) - case "bodyFingerprintBin4": - err = unpopulate(val, &m.BodyFingerprintBin4) - delete(rawMsg, key) - case "bodyFingerprintBin5": - err = unpopulate(val, &m.BodyFingerprintBin5) - delete(rawMsg, key) - case "deliveryAction": - err = unpopulate(val, &m.DeliveryAction) - delete(rawMsg, key) - case "deliveryLocation": - err = unpopulate(val, &m.DeliveryLocation) - delete(rawMsg, key) - case "fileEntityIds": - err = unpopulate(val, &m.FileEntityIDs) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &m.FriendlyName) - delete(rawMsg, key) - case "internetMessageId": - err = unpopulate(val, &m.InternetMessageID) - delete(rawMsg, key) - case "language": - err = unpopulate(val, &m.Language) - delete(rawMsg, key) - case "networkMessageId": - err = unpopulate(val, &m.NetworkMessageID) - delete(rawMsg, key) - case "p1Sender": - err = unpopulate(val, &m.P1Sender) - delete(rawMsg, key) - case "p1SenderDisplayName": - err = unpopulate(val, &m.P1SenderDisplayName) - delete(rawMsg, key) - case "p1SenderDomain": - err = unpopulate(val, &m.P1SenderDomain) - delete(rawMsg, key) - case "p2Sender": - err = unpopulate(val, &m.P2Sender) - delete(rawMsg, key) - case "p2SenderDisplayName": - err = unpopulate(val, &m.P2SenderDisplayName) - delete(rawMsg, key) - case "p2SenderDomain": - err = unpopulate(val, &m.P2SenderDomain) - delete(rawMsg, key) - case "receiveDate": - err = unpopulateTimeRFC3339(val, &m.ReceiveDate) - delete(rawMsg, key) - case "recipient": - err = unpopulate(val, &m.Recipient) - delete(rawMsg, key) - case "senderIP": - err = unpopulate(val, &m.SenderIP) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, &m.Subject) - delete(rawMsg, key) - case "threatDetectionMethods": - err = unpopulate(val, &m.ThreatDetectionMethods) - delete(rawMsg, key) - case "threats": - err = unpopulate(val, &m.Threats) - delete(rawMsg, key) - case "urls": - err = unpopulate(val, &m.Urls) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MailboxEntity - Represents a mailbox entity. type MailboxEntity struct { // REQUIRED; The kind of the entity. @@ -9241,64 +4434,6 @@ type MailboxEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type MailboxEntity. -func (m *MailboxEntity) GetEntity() *Entity { - return &Entity{ - Kind: m.Kind, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MailboxEntity. -func (m MailboxEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindMailbox - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MailboxEntity. -func (m *MailboxEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MailboxEntityProperties - Mailbox entity property bag. type MailboxEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -9322,18 +4457,6 @@ type MailboxEntityProperties struct { Upn *string `json:"upn,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MailboxEntityProperties. -func (m MailboxEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", m.AdditionalData) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "externalDirectoryObjectId", m.ExternalDirectoryObjectID) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "mailboxPrimaryAddress", m.MailboxPrimaryAddress) - populate(objectMap, "upn", m.Upn) - return json.Marshal(objectMap) -} - // MalwareEntity - Represents a malware entity. type MalwareEntity struct { // REQUIRED; The kind of the entity. @@ -9355,64 +4478,6 @@ type MalwareEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type MalwareEntity. -func (m *MalwareEntity) GetEntity() *Entity { - return &Entity{ - Kind: m.Kind, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MalwareEntity. -func (m MalwareEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindMalware - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MalwareEntity. -func (m *MalwareEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MalwareEntityProperties - Malware entity property bag. type MalwareEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -9435,18 +4500,6 @@ type MalwareEntityProperties struct { ProcessEntityIDs []*string `json:"processEntityIds,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MalwareEntityProperties. -func (m MalwareEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", m.AdditionalData) - populate(objectMap, "category", m.Category) - populate(objectMap, "fileEntityIds", m.FileEntityIDs) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "malwareName", m.MalwareName) - populate(objectMap, "processEntityIds", m.ProcessEntityIDs) - return json.Marshal(objectMap) -} - type ManualTriggerRequestBody struct { LogicAppsResourceID *string `json:"logicAppsResourceId,omitempty"` TenantID *string `json:"tenantId,omitempty"` @@ -9473,14 +4526,6 @@ type MetadataCategories struct { Verticals []*string `json:"verticals,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetadataCategories. -func (m MetadataCategories) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "domains", m.Domains) - populate(objectMap, "verticals", m.Verticals) - return json.Marshal(objectMap) -} - // MetadataClientCreateOptions contains the optional parameters for the MetadataClient.Create method. type MetadataClientCreateOptions struct { // placeholder for future optional parameters @@ -9538,18 +4583,6 @@ type MetadataDependencies struct { Version *string `json:"version,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetadataDependencies. -func (m MetadataDependencies) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentId", m.ContentID) - populate(objectMap, "criteria", m.Criteria) - populate(objectMap, "kind", m.Kind) - populate(objectMap, "name", m.Name) - populate(objectMap, "operator", m.Operator) - populate(objectMap, "version", m.Version) - return json.Marshal(objectMap) -} - // MetadataList - List of all the metadata. type MetadataList struct { // REQUIRED; Array of metadata. @@ -9559,14 +4592,6 @@ type MetadataList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MetadataList. -func (m MetadataList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - // MetadataModel - Metadata resource definition. type MetadataModel struct { // Etag of the azure resource @@ -9609,18 +4634,6 @@ type MetadataPatch struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MetadataPatch. -func (m MetadataPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - // MetadataProperties - Metadata property bag. type MetadataProperties struct { // REQUIRED; The kind of content the metadata is for. @@ -9641,6 +4654,12 @@ type MetadataProperties struct { // resource name ContentID *string `json:"contentId,omitempty"` + // Schema version of the content. Can be used to distinguish between different flow based on the schema version + ContentSchemaVersion *string `json:"contentSchemaVersion,omitempty"` + + // The custom version of the content. A optional free text + CustomVersion *string `json:"customVersion,omitempty"` + // Dependencies for the content item, what other content items it requires to work. Can describe more complex dependencies // using a recursive/nested structure. For a single dependency an id/kind/version // can be supplied or operator/criteria for complex formats. @@ -9649,9 +4668,18 @@ type MetadataProperties struct { // first publish date solution content item FirstPublishDate *time.Time `json:"firstPublishDate,omitempty"` + // the icon identifier. this id can later be fetched from the solution template + Icon *string `json:"icon,omitempty"` + // last publish date for the solution content item LastPublishDate *time.Time `json:"lastPublishDate,omitempty"` + // preview image file names. These will be taken from the solution artifacts + PreviewImages []*string `json:"previewImages,omitempty"` + + // preview image file names. These will be taken from the solution artifacts. used for dark theme support + PreviewImagesDark []*string `json:"previewImagesDark,omitempty"` + // Providers for the solution content item Providers []*string `json:"providers,omitempty"` @@ -9661,83 +4689,18 @@ type MetadataProperties struct { // Support information for the metadata - type, name, contact information Support *MetadataSupport `json:"support,omitempty"` + // the tactics the resource covers + ThreatAnalysisTactics []*string `json:"threatAnalysisTactics,omitempty"` + + // the techniques the resource covers, these have to be aligned with the tactics being used + ThreatAnalysisTechniques []*string `json:"threatAnalysisTechniques,omitempty"` + // Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM template // best practices. Can also be any string, but then we cannot guarantee any version // checks Version *string `json:"version,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetadataProperties. -func (m MetadataProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", m.Author) - populate(objectMap, "categories", m.Categories) - populate(objectMap, "contentId", m.ContentID) - populate(objectMap, "dependencies", m.Dependencies) - populateDateType(objectMap, "firstPublishDate", m.FirstPublishDate) - populate(objectMap, "kind", m.Kind) - populateDateType(objectMap, "lastPublishDate", m.LastPublishDate) - populate(objectMap, "parentId", m.ParentID) - populate(objectMap, "providers", m.Providers) - populate(objectMap, "source", m.Source) - populate(objectMap, "support", m.Support) - populate(objectMap, "version", m.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataProperties. -func (m *MetadataProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "author": - err = unpopulate(val, &m.Author) - delete(rawMsg, key) - case "categories": - err = unpopulate(val, &m.Categories) - delete(rawMsg, key) - case "contentId": - err = unpopulate(val, &m.ContentID) - delete(rawMsg, key) - case "dependencies": - err = unpopulate(val, &m.Dependencies) - delete(rawMsg, key) - case "firstPublishDate": - err = unpopulateDateType(val, &m.FirstPublishDate) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "lastPublishDate": - err = unpopulateDateType(val, &m.LastPublishDate) - delete(rawMsg, key) - case "parentId": - err = unpopulate(val, &m.ParentID) - delete(rawMsg, key) - case "providers": - err = unpopulate(val, &m.Providers) - delete(rawMsg, key) - case "source": - err = unpopulate(val, &m.Source) - delete(rawMsg, key) - case "support": - err = unpopulate(val, &m.Support) - delete(rawMsg, key) - case "version": - err = unpopulate(val, &m.Version) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MetadataPropertiesPatch - Metadata property bag for patch requests. This is the same as the MetadataProperties, but with // nothing required type MetadataPropertiesPatch struct { @@ -9752,6 +4715,12 @@ type MetadataPropertiesPatch struct { // resource name ContentID *string `json:"contentId,omitempty"` + // Schema version of the content. Can be used to distinguish between different flow based on the schema version + ContentSchemaVersion *string `json:"contentSchemaVersion,omitempty"` + + // The custom version of the content. A optional free text + CustomVersion *string `json:"customVersion,omitempty"` + // Dependencies for the content item, what other content items it requires to work. Can describe more complex dependencies // using a recursive/nested structure. For a single dependency an id/kind/version // can be supplied or operator/criteria for complex formats. @@ -9760,6 +4729,9 @@ type MetadataPropertiesPatch struct { // first publish date solution content item FirstPublishDate *time.Time `json:"firstPublishDate,omitempty"` + // the icon identifier. this id can later be fetched from the solution template + Icon *string `json:"icon,omitempty"` + // The kind of content the metadata is for. Kind *Kind `json:"kind,omitempty"` @@ -9770,6 +4742,12 @@ type MetadataPropertiesPatch struct { // and resource group) ParentID *string `json:"parentId,omitempty"` + // preview image file names. These will be taken from the solution artifacts + PreviewImages []*string `json:"previewImages,omitempty"` + + // preview image file names. These will be taken from the solution artifacts. used for dark theme support + PreviewImagesDark []*string `json:"previewImagesDark,omitempty"` + // Providers for the solution content item Providers []*string `json:"providers,omitempty"` @@ -9779,83 +4757,18 @@ type MetadataPropertiesPatch struct { // Support information for the metadata - type, name, contact information Support *MetadataSupport `json:"support,omitempty"` + // the tactics the resource covers + ThreatAnalysisTactics []*string `json:"threatAnalysisTactics,omitempty"` + + // the techniques the resource covers, these have to be aligned with the tactics being used + ThreatAnalysisTechniques []*string `json:"threatAnalysisTechniques,omitempty"` + // Version of the content. Default and recommended format is numeric (e.g. 1, 1.0, 1.0.0, 1.0.0.0), following ARM template // best practices. Can also be any string, but then we cannot guarantee any version // checks Version *string `json:"version,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MetadataPropertiesPatch. -func (m MetadataPropertiesPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "author", m.Author) - populate(objectMap, "categories", m.Categories) - populate(objectMap, "contentId", m.ContentID) - populate(objectMap, "dependencies", m.Dependencies) - populateDateType(objectMap, "firstPublishDate", m.FirstPublishDate) - populate(objectMap, "kind", m.Kind) - populateDateType(objectMap, "lastPublishDate", m.LastPublishDate) - populate(objectMap, "parentId", m.ParentID) - populate(objectMap, "providers", m.Providers) - populate(objectMap, "source", m.Source) - populate(objectMap, "support", m.Support) - populate(objectMap, "version", m.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataPropertiesPatch. -func (m *MetadataPropertiesPatch) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "author": - err = unpopulate(val, &m.Author) - delete(rawMsg, key) - case "categories": - err = unpopulate(val, &m.Categories) - delete(rawMsg, key) - case "contentId": - err = unpopulate(val, &m.ContentID) - delete(rawMsg, key) - case "dependencies": - err = unpopulate(val, &m.Dependencies) - delete(rawMsg, key) - case "firstPublishDate": - err = unpopulateDateType(val, &m.FirstPublishDate) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "lastPublishDate": - err = unpopulateDateType(val, &m.LastPublishDate) - delete(rawMsg, key) - case "parentId": - err = unpopulate(val, &m.ParentID) - delete(rawMsg, key) - case "providers": - err = unpopulate(val, &m.Providers) - delete(rawMsg, key) - case "source": - err = unpopulate(val, &m.Source) - delete(rawMsg, key) - case "support": - err = unpopulate(val, &m.Support) - delete(rawMsg, key) - case "version": - err = unpopulate(val, &m.Version) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MetadataSource - The original source of the content item, where it comes from. type MetadataSource struct { // REQUIRED; Source type of the content @@ -9907,69 +4820,6 @@ type MicrosoftSecurityIncidentCreationAlertRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRule implements the AlertRuleClassification interface for type MicrosoftSecurityIncidentCreationAlertRule. -func (m *MicrosoftSecurityIncidentCreationAlertRule) GetAlertRule() *AlertRule { - return &AlertRule{ - Kind: m.Kind, - Etag: m.Etag, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRule. -func (m MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) - populate(objectMap, "id", m.ID) - objectMap["kind"] = AlertRuleKindMicrosoftSecurityIncidentCreation - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRule. -func (m *MicrosoftSecurityIncidentCreationAlertRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MicrosoftSecurityIncidentCreationAlertRuleCommonProperties - MicrosoftSecurityIncidentCreation rule common property bag. type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties struct { // REQUIRED; The alerts' productName on which the cases will be generated @@ -9985,16 +4835,6 @@ type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties struct { SeveritiesFilter []*AlertSeverity `json:"severitiesFilter,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties. -func (m MicrosoftSecurityIncidentCreationAlertRuleCommonProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayNamesExcludeFilter", m.DisplayNamesExcludeFilter) - populate(objectMap, "displayNamesFilter", m.DisplayNamesFilter) - populate(objectMap, "productFilter", m.ProductFilter) - populate(objectMap, "severitiesFilter", m.SeveritiesFilter) - return json.Marshal(objectMap) -} - // MicrosoftSecurityIncidentCreationAlertRuleProperties - MicrosoftSecurityIncidentCreation rule property bag. type MicrosoftSecurityIncidentCreationAlertRuleProperties struct { // REQUIRED; The display name for alerts created by this alert rule. @@ -10025,65 +4865,6 @@ type MicrosoftSecurityIncidentCreationAlertRuleProperties struct { LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleProperties. -func (m MicrosoftSecurityIncidentCreationAlertRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRuleTemplateName", m.AlertRuleTemplateName) - populate(objectMap, "description", m.Description) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "displayNamesExcludeFilter", m.DisplayNamesExcludeFilter) - populate(objectMap, "displayNamesFilter", m.DisplayNamesFilter) - populate(objectMap, "enabled", m.Enabled) - populateTimeRFC3339(objectMap, "lastModifiedUtc", m.LastModifiedUTC) - populate(objectMap, "productFilter", m.ProductFilter) - populate(objectMap, "severitiesFilter", m.SeveritiesFilter) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleProperties. -func (m *MicrosoftSecurityIncidentCreationAlertRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRuleTemplateName": - err = unpopulate(val, &m.AlertRuleTemplateName) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &m.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &m.DisplayName) - delete(rawMsg, key) - case "displayNamesExcludeFilter": - err = unpopulate(val, &m.DisplayNamesExcludeFilter) - delete(rawMsg, key) - case "displayNamesFilter": - err = unpopulate(val, &m.DisplayNamesFilter) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &m.Enabled) - delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, &m.LastModifiedUTC) - delete(rawMsg, key) - case "productFilter": - err = unpopulate(val, &m.ProductFilter) - delete(rawMsg, key) - case "severitiesFilter": - err = unpopulate(val, &m.SeveritiesFilter) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MicrosoftSecurityIncidentCreationAlertRuleTemplate - Represents MicrosoftSecurityIncidentCreation rule template. type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { // REQUIRED; The kind of the alert rule @@ -10105,69 +4886,8 @@ type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. -func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { - return &AlertRuleTemplate{ - Kind: m.Kind, - ID: m.ID, - Name: m.Name, - Type: m.Type, - SystemData: m.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. -func (m MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = AlertRuleKindMicrosoftSecurityIncidentCreation - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. -func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &m.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &m.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &m.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - MicrosoftSecurityIncidentCreation rule template properties type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { - // REQUIRED; The alerts' productName on which the cases will be generated - ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` - // the number of alert rules that were created by this template AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` @@ -10183,6 +4903,9 @@ type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { // the alerts' displayNames on which the cases will be generated DisplayNamesFilter []*string `json:"displayNamesFilter,omitempty"` + // The alerts' productName on which the cases will be generated + ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` + // The required data sources for this template RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` @@ -10199,73 +4922,6 @@ type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties. -func (m MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRulesCreatedByTemplateCount", m.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", m.CreatedDateUTC) - populate(objectMap, "description", m.Description) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "displayNamesExcludeFilter", m.DisplayNamesExcludeFilter) - populate(objectMap, "displayNamesFilter", m.DisplayNamesFilter) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", m.LastUpdatedDateUTC) - populate(objectMap, "productFilter", m.ProductFilter) - populate(objectMap, "requiredDataConnectors", m.RequiredDataConnectors) - populate(objectMap, "severitiesFilter", m.SeveritiesFilter) - populate(objectMap, "status", m.Status) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties. -func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &m.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &m.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &m.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &m.DisplayName) - delete(rawMsg, key) - case "displayNamesExcludeFilter": - err = unpopulate(val, &m.DisplayNamesExcludeFilter) - delete(rawMsg, key) - case "displayNamesFilter": - err = unpopulate(val, &m.DisplayNamesFilter) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &m.LastUpdatedDateUTC) - delete(rawMsg, key) - case "productFilter": - err = unpopulate(val, &m.ProductFilter) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &m.RequiredDataConnectors) - delete(rawMsg, key) - case "severitiesFilter": - err = unpopulate(val, &m.SeveritiesFilter) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &m.Status) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MtpCheckRequirements - Represents MTP (Microsoft Threat Protection) requirements check request. type MtpCheckRequirements struct { // REQUIRED; Describes the kind of connector to be checked. @@ -10275,44 +4931,6 @@ type MtpCheckRequirements struct { Properties *MTPCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MtpCheckRequirements. -func (m *MtpCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: m.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type MtpCheckRequirements. -func (m MtpCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindMicrosoftThreatProtection - populate(objectMap, "properties", m.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MtpCheckRequirements. -func (m *MtpCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &m.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &m.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // NrtAlertRule - Represents NRT alert rule. type NrtAlertRule struct { // REQUIRED; The kind of the alert rule @@ -10337,69 +4955,6 @@ type NrtAlertRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRule implements the AlertRuleClassification interface for type NrtAlertRule. -func (n *NrtAlertRule) GetAlertRule() *AlertRule { - return &AlertRule{ - Kind: n.Kind, - Etag: n.Etag, - ID: n.ID, - Name: n.Name, - Type: n.Type, - SystemData: n.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type NrtAlertRule. -func (n NrtAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", n.Etag) - populate(objectMap, "id", n.ID) - objectMap["kind"] = AlertRuleKindNRT - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRule. -func (n *NrtAlertRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &n.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &n.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &n.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &n.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &n.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &n.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // NrtAlertRuleProperties - Nrt alert rule base property bag. type NrtAlertRuleProperties struct { // REQUIRED; The display name for alerts created by this alert rule. @@ -10408,6 +4963,12 @@ type NrtAlertRuleProperties struct { // REQUIRED; Determines whether this alert rule is enabled or disabled. Enabled *bool `json:"enabled,omitempty"` + // REQUIRED; The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` + + // REQUIRED; The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty"` + // REQUIRED; The suppression (in ISO 8601 duration format) to wait since last time this alert rule been triggered. SuppressionDuration *string `json:"suppressionDuration,omitempty"` @@ -10432,12 +4993,6 @@ type NrtAlertRuleProperties struct { // The settings of the incidents that created from alerts triggered by this analytics rule IncidentConfiguration *IncidentConfiguration `json:"incidentConfiguration,omitempty"` - // The query that creates alerts for this rule. - Query *string `json:"query,omitempty"` - - // The severity for alerts created by this alert rule. - Severity *AlertSeverity `json:"severity,omitempty"` - // The tactics of the alert rule Tactics []*AttackTactic `json:"tactics,omitempty"` @@ -10451,93 +5006,6 @@ type NrtAlertRuleProperties struct { LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleProperties. -func (n NrtAlertRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertDetailsOverride", n.AlertDetailsOverride) - populate(objectMap, "alertRuleTemplateName", n.AlertRuleTemplateName) - populate(objectMap, "customDetails", n.CustomDetails) - populate(objectMap, "description", n.Description) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "enabled", n.Enabled) - populate(objectMap, "entityMappings", n.EntityMappings) - populate(objectMap, "incidentConfiguration", n.IncidentConfiguration) - populateTimeRFC3339(objectMap, "lastModifiedUtc", n.LastModifiedUTC) - populate(objectMap, "query", n.Query) - populate(objectMap, "severity", n.Severity) - populate(objectMap, "suppressionDuration", n.SuppressionDuration) - populate(objectMap, "suppressionEnabled", n.SuppressionEnabled) - populate(objectMap, "tactics", n.Tactics) - populate(objectMap, "techniques", n.Techniques) - populate(objectMap, "templateVersion", n.TemplateVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRuleProperties. -func (n *NrtAlertRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertDetailsOverride": - err = unpopulate(val, &n.AlertDetailsOverride) - delete(rawMsg, key) - case "alertRuleTemplateName": - err = unpopulate(val, &n.AlertRuleTemplateName) - delete(rawMsg, key) - case "customDetails": - err = unpopulate(val, &n.CustomDetails) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &n.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &n.DisplayName) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &n.Enabled) - delete(rawMsg, key) - case "entityMappings": - err = unpopulate(val, &n.EntityMappings) - delete(rawMsg, key) - case "incidentConfiguration": - err = unpopulate(val, &n.IncidentConfiguration) - delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, &n.LastModifiedUTC) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &n.Query) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &n.Severity) - delete(rawMsg, key) - case "suppressionDuration": - err = unpopulate(val, &n.SuppressionDuration) - delete(rawMsg, key) - case "suppressionEnabled": - err = unpopulate(val, &n.SuppressionEnabled) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &n.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &n.Techniques) - delete(rawMsg, key) - case "templateVersion": - err = unpopulate(val, &n.TemplateVersion) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // NrtAlertRuleTemplate - Represents NRT alert rule template. type NrtAlertRuleTemplate struct { // REQUIRED; The kind of the alert rule @@ -10559,64 +5027,6 @@ type NrtAlertRuleTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type NrtAlertRuleTemplate. -func (n *NrtAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { - return &AlertRuleTemplate{ - Kind: n.Kind, - ID: n.ID, - Name: n.Name, - Type: n.Type, - SystemData: n.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleTemplate. -func (n NrtAlertRuleTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", n.ID) - objectMap["kind"] = AlertRuleKindNRT - populate(objectMap, "name", n.Name) - populate(objectMap, "properties", n.Properties) - populate(objectMap, "systemData", n.SystemData) - populate(objectMap, "type", n.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRuleTemplate. -func (n *NrtAlertRuleTemplate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &n.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &n.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &n.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &n.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &n.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &n.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // NrtAlertRuleTemplateProperties - NRT alert rule template properties type NrtAlertRuleTemplateProperties struct { // The alert details override settings @@ -10665,89 +5075,6 @@ type NrtAlertRuleTemplateProperties struct { LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleTemplateProperties. -func (n NrtAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertDetailsOverride", n.AlertDetailsOverride) - populate(objectMap, "alertRulesCreatedByTemplateCount", n.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", n.CreatedDateUTC) - populate(objectMap, "customDetails", n.CustomDetails) - populate(objectMap, "description", n.Description) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "entityMappings", n.EntityMappings) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", n.LastUpdatedDateUTC) - populate(objectMap, "query", n.Query) - populate(objectMap, "requiredDataConnectors", n.RequiredDataConnectors) - populate(objectMap, "severity", n.Severity) - populate(objectMap, "status", n.Status) - populate(objectMap, "tactics", n.Tactics) - populate(objectMap, "techniques", n.Techniques) - populate(objectMap, "version", n.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRuleTemplateProperties. -func (n *NrtAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertDetailsOverride": - err = unpopulate(val, &n.AlertDetailsOverride) - delete(rawMsg, key) - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &n.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &n.CreatedDateUTC) - delete(rawMsg, key) - case "customDetails": - err = unpopulate(val, &n.CustomDetails) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &n.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &n.DisplayName) - delete(rawMsg, key) - case "entityMappings": - err = unpopulate(val, &n.EntityMappings) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &n.LastUpdatedDateUTC) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &n.Query) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &n.RequiredDataConnectors) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &n.Severity) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &n.Status) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &n.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &n.Techniques) - delete(rawMsg, key) - case "version": - err = unpopulate(val, &n.Version) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Office365ProjectCheckRequirements - Represents Office365 Project requirements check request. type Office365ProjectCheckRequirements struct { // REQUIRED; Describes the kind of connector to be checked. @@ -10757,44 +5084,6 @@ type Office365ProjectCheckRequirements struct { Properties *Office365ProjectCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type Office365ProjectCheckRequirements. -func (o *Office365ProjectCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: o.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type Office365ProjectCheckRequirements. -func (o Office365ProjectCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindOffice365Project - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Office365ProjectCheckRequirements. -func (o *Office365ProjectCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Office365ProjectCheckRequirementsProperties - Office365 Project requirements check properties. type Office365ProjectCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -10837,69 +5126,6 @@ type Office365ProjectDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type Office365ProjectDataConnector. -func (o *Office365ProjectDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: o.Kind, - Etag: o.Etag, - ID: o.ID, - Name: o.Name, - Type: o.Type, - SystemData: o.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type Office365ProjectDataConnector. -func (o Office365ProjectDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - objectMap["kind"] = DataConnectorKindOffice365Project - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Office365ProjectDataConnector. -func (o *Office365ProjectDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &o.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &o.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &o.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &o.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Office365ProjectDataConnectorProperties - Office Microsoft Project data connector properties. type Office365ProjectDataConnectorProperties struct { // REQUIRED; The available data types for the connector. @@ -10918,44 +5144,6 @@ type OfficeATPCheckRequirements struct { Properties *OfficeATPCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficeATPCheckRequirements. -func (o *OfficeATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: o.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type OfficeATPCheckRequirements. -func (o OfficeATPCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindOfficeATP - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeATPCheckRequirements. -func (o *OfficeATPCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OfficeATPCheckRequirementsProperties - OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. type OfficeATPCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -10986,69 +5174,6 @@ type OfficeATPDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type OfficeATPDataConnector. -func (o *OfficeATPDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: o.Kind, - Etag: o.Etag, - ID: o.ID, - Name: o.Name, - Type: o.Type, - SystemData: o.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type OfficeATPDataConnector. -func (o OfficeATPDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - objectMap["kind"] = DataConnectorKindOfficeATP - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeATPDataConnector. -func (o *OfficeATPDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &o.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &o.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &o.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &o.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OfficeATPDataConnectorProperties - OfficeATP (Office 365 Advanced Threat Protection) data connector properties. type OfficeATPDataConnectorProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -11085,14 +5210,6 @@ type OfficeConsentList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type OfficeConsentList. -func (o OfficeConsentList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // OfficeConsentProperties - Consent property bag. type OfficeConsentProperties struct { // Help to easily cascade among the data layers. @@ -11141,69 +5258,6 @@ type OfficeDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type OfficeDataConnector. -func (o *OfficeDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: o.Kind, - Etag: o.Etag, - ID: o.ID, - Name: o.Name, - Type: o.Type, - SystemData: o.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type OfficeDataConnector. -func (o OfficeDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - objectMap["kind"] = DataConnectorKindOffice365 - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeDataConnector. -func (o *OfficeDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &o.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &o.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &o.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &o.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OfficeDataConnectorDataTypes - The available data types for office data connector. type OfficeDataConnectorDataTypes struct { // REQUIRED; Exchange data type connection. @@ -11252,44 +5306,6 @@ type OfficeIRMCheckRequirements struct { Properties *OfficeIRMCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficeIRMCheckRequirements. -func (o *OfficeIRMCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: o.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type OfficeIRMCheckRequirements. -func (o OfficeIRMCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindOfficeIRM - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeIRMCheckRequirements. -func (o *OfficeIRMCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OfficeIRMCheckRequirementsProperties - OfficeIRM (Microsoft Insider Risk Management) requirements check properties. type OfficeIRMCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -11320,69 +5336,6 @@ type OfficeIRMDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type OfficeIRMDataConnector. -func (o *OfficeIRMDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: o.Kind, - Etag: o.Etag, - ID: o.ID, - Name: o.Name, - Type: o.Type, - SystemData: o.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type OfficeIRMDataConnector. -func (o OfficeIRMDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - objectMap["kind"] = DataConnectorKindOfficeIRM - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeIRMDataConnector. -func (o *OfficeIRMDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &o.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &o.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &o.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &o.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OfficeIRMDataConnectorProperties - OfficeIRM (Microsoft Insider Risk Management) data connector properties. type OfficeIRMDataConnectorProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -11401,44 +5354,6 @@ type OfficePowerBICheckRequirements struct { Properties *OfficePowerBICheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficePowerBICheckRequirements. -func (o *OfficePowerBICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: o.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type OfficePowerBICheckRequirements. -func (o OfficePowerBICheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindOfficePowerBI - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficePowerBICheckRequirements. -func (o *OfficePowerBICheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OfficePowerBICheckRequirementsProperties - Office PowerBI requirements check properties. type OfficePowerBICheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -11481,69 +5396,6 @@ type OfficePowerBIDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type OfficePowerBIDataConnector. -func (o *OfficePowerBIDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: o.Kind, - Etag: o.Etag, - ID: o.ID, - Name: o.Name, - Type: o.Type, - SystemData: o.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type OfficePowerBIDataConnector. -func (o OfficePowerBIDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", o.Etag) - populate(objectMap, "id", o.ID) - objectMap["kind"] = DataConnectorKindOfficePowerBI - populate(objectMap, "name", o.Name) - populate(objectMap, "properties", o.Properties) - populate(objectMap, "systemData", o.SystemData) - populate(objectMap, "type", o.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficePowerBIDataConnector. -func (o *OfficePowerBIDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &o.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &o.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &o.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &o.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &o.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &o.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &o.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // OfficePowerBIDataConnectorProperties - Office Microsoft PowerBI data connector properties. type OfficePowerBIDataConnectorProperties struct { // REQUIRED; The available data types for the connector. @@ -11597,14 +5449,6 @@ type OperationsList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type OperationsList. -func (o OperationsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", o.NextLink) - populate(objectMap, "value", o.Value) - return json.Marshal(objectMap) -} - // Permissions required for the connector type Permissions struct { // Customs permissions required for the connector @@ -11614,14 +5458,6 @@ type Permissions struct { ResourceProvider []*PermissionsResourceProviderItem `json:"resourceProvider,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type Permissions. -func (p Permissions) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customs", p.Customs) - populate(objectMap, "resourceProvider", p.ResourceProvider) - return json.Marshal(objectMap) -} - type PermissionsCustomsItem struct { // Customs permissions description Description *string `json:"description,omitempty"` @@ -11676,64 +5512,6 @@ type ProcessEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type ProcessEntity. -func (p *ProcessEntity) GetEntity() *Entity { - return &Entity{ - Kind: p.Kind, - ID: p.ID, - Name: p.Name, - Type: p.Type, - SystemData: p.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ProcessEntity. -func (p ProcessEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - objectMap["kind"] = EntityKindProcess - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProcessEntity. -func (p *ProcessEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &p.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &p.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &p.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &p.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &p.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &p.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ProcessEntityProperties - Process entity property bag. type ProcessEntityProperties struct { // The elevation token associated with the process. @@ -11771,73 +5549,6 @@ type ProcessEntityProperties struct { ProcessID *string `json:"processId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ProcessEntityProperties. -func (p ProcessEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountEntityId", p.AccountEntityID) - populate(objectMap, "additionalData", p.AdditionalData) - populate(objectMap, "commandLine", p.CommandLine) - populateTimeRFC3339(objectMap, "creationTimeUtc", p.CreationTimeUTC) - populate(objectMap, "elevationToken", p.ElevationToken) - populate(objectMap, "friendlyName", p.FriendlyName) - populate(objectMap, "hostEntityId", p.HostEntityID) - populate(objectMap, "hostLogonSessionEntityId", p.HostLogonSessionEntityID) - populate(objectMap, "imageFileEntityId", p.ImageFileEntityID) - populate(objectMap, "parentProcessEntityId", p.ParentProcessEntityID) - populate(objectMap, "processId", p.ProcessID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProcessEntityProperties. -func (p *ProcessEntityProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "accountEntityId": - err = unpopulate(val, &p.AccountEntityID) - delete(rawMsg, key) - case "additionalData": - err = unpopulate(val, &p.AdditionalData) - delete(rawMsg, key) - case "commandLine": - err = unpopulate(val, &p.CommandLine) - delete(rawMsg, key) - case "creationTimeUtc": - err = unpopulateTimeRFC3339(val, &p.CreationTimeUTC) - delete(rawMsg, key) - case "elevationToken": - err = unpopulate(val, &p.ElevationToken) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &p.FriendlyName) - delete(rawMsg, key) - case "hostEntityId": - err = unpopulate(val, &p.HostEntityID) - delete(rawMsg, key) - case "hostLogonSessionEntityId": - err = unpopulate(val, &p.HostLogonSessionEntityID) - delete(rawMsg, key) - case "imageFileEntityId": - err = unpopulate(val, &p.ImageFileEntityID) - delete(rawMsg, key) - case "parentProcessEntityId": - err = unpopulate(val, &p.ParentProcessEntityID) - delete(rawMsg, key) - case "processId": - err = unpopulate(val, &p.ProcessID) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ProductSettingsClientDeleteOptions contains the optional parameters for the ProductSettingsClient.Delete method. type ProductSettingsClientDeleteOptions struct { // placeholder for future optional parameters @@ -11865,182 +5576,6 @@ type PropertyConditionProperties struct { ConditionProperties *AutomationRulePropertyValuesCondition `json:"conditionProperties,omitempty"` } -// GetAutomationRuleCondition implements the AutomationRuleConditionClassification interface for type PropertyConditionProperties. -func (p *PropertyConditionProperties) GetAutomationRuleCondition() *AutomationRuleCondition { - return &AutomationRuleCondition{ - ConditionType: p.ConditionType, - } -} - -// MarshalJSON implements the json.Marshaller interface for type PropertyConditionProperties. -func (p PropertyConditionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "conditionProperties", p.ConditionProperties) - objectMap["conditionType"] = ConditionTypeProperty - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PropertyConditionProperties. -func (p *PropertyConditionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "conditionProperties": - err = unpopulate(val, &p.ConditionProperties) - delete(rawMsg, key) - case "conditionType": - err = unpopulate(val, &p.ConditionType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - -// QueryBasedAlertRuleProperties - Query based alert rule base property bag. -type QueryBasedAlertRuleProperties struct { - // REQUIRED; The display name for alerts created by this alert rule. - DisplayName *string `json:"displayName,omitempty"` - - // REQUIRED; Determines whether this alert rule is enabled or disabled. - Enabled *bool `json:"enabled,omitempty"` - - // REQUIRED; The suppression (in ISO 8601 duration format) to wait since last time this alert rule been triggered. - SuppressionDuration *string `json:"suppressionDuration,omitempty"` - - // REQUIRED; Determines whether the suppression for this alert rule is enabled or disabled. - SuppressionEnabled *bool `json:"suppressionEnabled,omitempty"` - - // The alert details override settings - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - - // The Name of the alert rule template used to create this rule. - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - - // Dictionary of string key-value pairs of columns to be attached to the alert - CustomDetails map[string]*string `json:"customDetails,omitempty"` - - // The description of the alert rule. - Description *string `json:"description,omitempty"` - - // Array of the entity mappings of the alert rule - EntityMappings []*EntityMapping `json:"entityMappings,omitempty"` - - // The settings of the incidents that created from alerts triggered by this analytics rule - IncidentConfiguration *IncidentConfiguration `json:"incidentConfiguration,omitempty"` - - // The query that creates alerts for this rule. - Query *string `json:"query,omitempty"` - - // The severity for alerts created by this alert rule. - Severity *AlertSeverity `json:"severity,omitempty"` - - // The tactics of the alert rule - Tactics []*AttackTactic `json:"tactics,omitempty"` - - // The techniques of the alert rule - Techniques []*string `json:"techniques,omitempty"` - - // The version of the alert rule template used to create this rule - in format , where all are numbers, for example 0 - TemplateVersion *string `json:"templateVersion,omitempty"` - - // READ-ONLY; The last time that this alert rule has been modified. - LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` -} - -// MarshalJSON implements the json.Marshaller interface for type QueryBasedAlertRuleProperties. -func (q QueryBasedAlertRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertDetailsOverride", q.AlertDetailsOverride) - populate(objectMap, "alertRuleTemplateName", q.AlertRuleTemplateName) - populate(objectMap, "customDetails", q.CustomDetails) - populate(objectMap, "description", q.Description) - populate(objectMap, "displayName", q.DisplayName) - populate(objectMap, "enabled", q.Enabled) - populate(objectMap, "entityMappings", q.EntityMappings) - populate(objectMap, "incidentConfiguration", q.IncidentConfiguration) - populateTimeRFC3339(objectMap, "lastModifiedUtc", q.LastModifiedUTC) - populate(objectMap, "query", q.Query) - populate(objectMap, "severity", q.Severity) - populate(objectMap, "suppressionDuration", q.SuppressionDuration) - populate(objectMap, "suppressionEnabled", q.SuppressionEnabled) - populate(objectMap, "tactics", q.Tactics) - populate(objectMap, "techniques", q.Techniques) - populate(objectMap, "templateVersion", q.TemplateVersion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QueryBasedAlertRuleProperties. -func (q *QueryBasedAlertRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertDetailsOverride": - err = unpopulate(val, &q.AlertDetailsOverride) - delete(rawMsg, key) - case "alertRuleTemplateName": - err = unpopulate(val, &q.AlertRuleTemplateName) - delete(rawMsg, key) - case "customDetails": - err = unpopulate(val, &q.CustomDetails) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &q.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &q.DisplayName) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &q.Enabled) - delete(rawMsg, key) - case "entityMappings": - err = unpopulate(val, &q.EntityMappings) - delete(rawMsg, key) - case "incidentConfiguration": - err = unpopulate(val, &q.IncidentConfiguration) - delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, &q.LastModifiedUTC) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &q.Query) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &q.Severity) - delete(rawMsg, key) - case "suppressionDuration": - err = unpopulate(val, &q.SuppressionDuration) - delete(rawMsg, key) - case "suppressionEnabled": - err = unpopulate(val, &q.SuppressionEnabled) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &q.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &q.Techniques) - delete(rawMsg, key) - case "templateVersion": - err = unpopulate(val, &q.TemplateVersion) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // QueryBasedAlertRuleTemplateProperties - Query based alert rule template base property bag. type QueryBasedAlertRuleTemplateProperties struct { // The alert details override settings @@ -12062,18 +5597,6 @@ type QueryBasedAlertRuleTemplateProperties struct { Version *string `json:"version,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type QueryBasedAlertRuleTemplateProperties. -func (q QueryBasedAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertDetailsOverride", q.AlertDetailsOverride) - populate(objectMap, "customDetails", q.CustomDetails) - populate(objectMap, "entityMappings", q.EntityMappings) - populate(objectMap, "query", q.Query) - populate(objectMap, "severity", q.Severity) - populate(objectMap, "version", q.Version) - return json.Marshal(objectMap) -} - // RegistryKeyEntity - Represents a registry key entity. type RegistryKeyEntity struct { // REQUIRED; The kind of the entity. @@ -12095,64 +5618,6 @@ type RegistryKeyEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type RegistryKeyEntity. -func (r *RegistryKeyEntity) GetEntity() *Entity { - return &Entity{ - Kind: r.Kind, - ID: r.ID, - Name: r.Name, - Type: r.Type, - SystemData: r.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type RegistryKeyEntity. -func (r RegistryKeyEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - objectMap["kind"] = EntityKindRegistryKey - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryKeyEntity. -func (r *RegistryKeyEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &r.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &r.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &r.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &r.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RegistryKeyEntityProperties - RegistryKey entity property bag. type RegistryKeyEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -12169,16 +5634,6 @@ type RegistryKeyEntityProperties struct { Key *string `json:"key,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RegistryKeyEntityProperties. -func (r RegistryKeyEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", r.AdditionalData) - populate(objectMap, "friendlyName", r.FriendlyName) - populate(objectMap, "hive", r.Hive) - populate(objectMap, "key", r.Key) - return json.Marshal(objectMap) -} - // RegistryValueEntity - Represents a registry value entity. type RegistryValueEntity struct { // REQUIRED; The kind of the entity. @@ -12200,64 +5655,6 @@ type RegistryValueEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type RegistryValueEntity. -func (r *RegistryValueEntity) GetEntity() *Entity { - return &Entity{ - Kind: r.Kind, - ID: r.ID, - Name: r.Name, - Type: r.Type, - SystemData: r.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type RegistryValueEntity. -func (r RegistryValueEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - objectMap["kind"] = EntityKindRegistryValue - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryValueEntity. -func (r *RegistryValueEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &r.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &r.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &r.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &r.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &r.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &r.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RegistryValueEntityProperties - RegistryValue entity property bag. type RegistryValueEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -12281,18 +5678,6 @@ type RegistryValueEntityProperties struct { ValueType *RegistryValueKind `json:"valueType,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RegistryValueEntityProperties. -func (r RegistryValueEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", r.AdditionalData) - populate(objectMap, "friendlyName", r.FriendlyName) - populate(objectMap, "keyEntityId", r.KeyEntityID) - populate(objectMap, "valueData", r.ValueData) - populate(objectMap, "valueName", r.ValueName) - populate(objectMap, "valueType", r.ValueType) - return json.Marshal(objectMap) -} - // Relation - Represents a relation between two resources type Relation struct { // Etag of the azure resource @@ -12323,14 +5708,6 @@ type RelationList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RelationList. -func (r RelationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - // RelationProperties - Relation property bag. type RelationProperties struct { // REQUIRED; The resource ID of the related resource @@ -12358,15 +5735,6 @@ type Repo struct { URL *string `json:"url,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type Repo. -func (r Repo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "branches", r.Branches) - populate(objectMap, "fullName", r.FullName) - populate(objectMap, "url", r.URL) - return json.Marshal(objectMap) -} - // RepoList - List all the source controls. type RepoList struct { // REQUIRED; Array of repositories. @@ -12376,14 +5744,6 @@ type RepoList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RepoList. -func (r RepoList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - // Repository - metadata of a repository. type Repository struct { // Branch name of repository. @@ -12402,15 +5762,16 @@ type Repository struct { URL *string `json:"url,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type Repository. -func (r Repository) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "branch", r.Branch) - populate(objectMap, "deploymentLogsUrl", r.DeploymentLogsURL) - populate(objectMap, "displayUrl", r.DisplayURL) - populate(objectMap, "pathMapping", r.PathMapping) - populate(objectMap, "url", r.URL) - return json.Marshal(objectMap) +// RepositoryResourceInfo - Resources created in user's repository for the source-control. +type RepositoryResourceInfo struct { + // Resources created in Azure DevOps for this source-control. + AzureDevOpsResourceInfo *AzureDevOpsResourceInfo `json:"azureDevOpsResourceInfo,omitempty"` + + // Resources created in GitHub for this source-control. + GitHubResourceInfo *GitHubResourceInfo `json:"gitHubResourceInfo,omitempty"` + + // The webhook object created for the source-control. + Webhook *Webhook `json:"webhook,omitempty"` } // RequiredPermissions - Required permissions for the connector @@ -12479,6 +5840,15 @@ type ResourceWithEtag struct { Type *string `json:"type,omitempty" azure:"ro"` } +// SKU - The pricing tier of the solution +type SKU struct { + // The amount of reservation level + CapacityReservationLevel *int32 `json:"capacityReservationLevel,omitempty"` + + // The kind of the tier + Name *SKUKind `json:"name,omitempty"` +} + // SampleQueries - The sample queries for the connector type SampleQueries struct { // The sample query description @@ -12512,80 +5882,32 @@ type ScheduledAlertRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRule implements the AlertRuleClassification interface for type ScheduledAlertRule. -func (s *ScheduledAlertRule) GetAlertRule() *AlertRule { - return &AlertRule{ - Kind: s.Kind, - Etag: s.Etag, - ID: s.ID, - Name: s.Name, - Type: s.Type, - SystemData: s.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRule. -func (s ScheduledAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - objectMap["kind"] = AlertRuleKindScheduled - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRule. -func (s *ScheduledAlertRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &s.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &s.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &s.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ScheduledAlertRuleCommonProperties - Scheduled alert rule template property bag. type ScheduledAlertRuleCommonProperties struct { + // The alert details override settings + AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` + + // Dictionary of string key-value pairs of columns to be attached to the alert + CustomDetails map[string]*string `json:"customDetails,omitempty"` + + // Array of the entity mappings of the alert rule + EntityMappings []*EntityMapping `json:"entityMappings,omitempty"` + // The event grouping settings. EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` + // The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` + // The frequency (in ISO 8601 duration format) for this alert rule to run. QueryFrequency *string `json:"queryFrequency,omitempty"` // The period (in ISO 8601 duration format) that this alert rule looks at. QueryPeriod *string `json:"queryPeriod,omitempty"` + // The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty"` + // The operation against the threshold that triggers alert rule. TriggerOperator *TriggerOperator `json:"triggerOperator,omitempty"` @@ -12659,113 +5981,6 @@ type ScheduledAlertRuleProperties struct { LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRuleProperties. -func (s ScheduledAlertRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertDetailsOverride", s.AlertDetailsOverride) - populate(objectMap, "alertRuleTemplateName", s.AlertRuleTemplateName) - populate(objectMap, "customDetails", s.CustomDetails) - populate(objectMap, "description", s.Description) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "enabled", s.Enabled) - populate(objectMap, "entityMappings", s.EntityMappings) - populate(objectMap, "eventGroupingSettings", s.EventGroupingSettings) - populate(objectMap, "incidentConfiguration", s.IncidentConfiguration) - populateTimeRFC3339(objectMap, "lastModifiedUtc", s.LastModifiedUTC) - populate(objectMap, "query", s.Query) - populate(objectMap, "queryFrequency", s.QueryFrequency) - populate(objectMap, "queryPeriod", s.QueryPeriod) - populate(objectMap, "severity", s.Severity) - populate(objectMap, "suppressionDuration", s.SuppressionDuration) - populate(objectMap, "suppressionEnabled", s.SuppressionEnabled) - populate(objectMap, "tactics", s.Tactics) - populate(objectMap, "techniques", s.Techniques) - populate(objectMap, "templateVersion", s.TemplateVersion) - populate(objectMap, "triggerOperator", s.TriggerOperator) - populate(objectMap, "triggerThreshold", s.TriggerThreshold) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRuleProperties. -func (s *ScheduledAlertRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertDetailsOverride": - err = unpopulate(val, &s.AlertDetailsOverride) - delete(rawMsg, key) - case "alertRuleTemplateName": - err = unpopulate(val, &s.AlertRuleTemplateName) - delete(rawMsg, key) - case "customDetails": - err = unpopulate(val, &s.CustomDetails) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &s.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &s.DisplayName) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &s.Enabled) - delete(rawMsg, key) - case "entityMappings": - err = unpopulate(val, &s.EntityMappings) - delete(rawMsg, key) - case "eventGroupingSettings": - err = unpopulate(val, &s.EventGroupingSettings) - delete(rawMsg, key) - case "incidentConfiguration": - err = unpopulate(val, &s.IncidentConfiguration) - delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, &s.LastModifiedUTC) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &s.Query) - delete(rawMsg, key) - case "queryFrequency": - err = unpopulate(val, &s.QueryFrequency) - delete(rawMsg, key) - case "queryPeriod": - err = unpopulate(val, &s.QueryPeriod) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &s.Severity) - delete(rawMsg, key) - case "suppressionDuration": - err = unpopulate(val, &s.SuppressionDuration) - delete(rawMsg, key) - case "suppressionEnabled": - err = unpopulate(val, &s.SuppressionEnabled) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &s.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &s.Techniques) - delete(rawMsg, key) - case "templateVersion": - err = unpopulate(val, &s.TemplateVersion) - delete(rawMsg, key) - case "triggerOperator": - err = unpopulate(val, &s.TriggerOperator) - delete(rawMsg, key) - case "triggerThreshold": - err = unpopulate(val, &s.TriggerThreshold) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ScheduledAlertRuleTemplate - Represents scheduled alert rule template. type ScheduledAlertRuleTemplate struct { // REQUIRED; The kind of the alert rule @@ -12787,64 +6002,6 @@ type ScheduledAlertRuleTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type ScheduledAlertRuleTemplate. -func (s *ScheduledAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { - return &AlertRuleTemplate{ - Kind: s.Kind, - ID: s.ID, - Name: s.Name, - Type: s.Type, - SystemData: s.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRuleTemplate. -func (s ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - objectMap["kind"] = AlertRuleKindScheduled - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRuleTemplate. -func (s *ScheduledAlertRuleTemplate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &s.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &s.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ScheduledAlertRuleTemplateProperties - Scheduled alert rule template properties type ScheduledAlertRuleTemplateProperties struct { // The alert details override settings @@ -12877,7 +6034,7 @@ type ScheduledAlertRuleTemplateProperties struct { // The period (in ISO 8601 duration format) that this alert rule looks at. QueryPeriod *string `json:"queryPeriod,omitempty"` - // The required data sources for this template + // The required data connectors for this template RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` // The severity for alerts created by this alert rule. @@ -12886,7 +6043,7 @@ type ScheduledAlertRuleTemplateProperties struct { // The alert rule template status. Status *TemplateStatus `json:"status,omitempty"` - // The tactics of the alert rule + // The tactics of the alert rule template Tactics []*AttackTactic `json:"tactics,omitempty"` // The techniques of the alert rule @@ -12904,113 +6061,10 @@ type ScheduledAlertRuleTemplateProperties struct { // READ-ONLY; The time that this alert rule template has been added. CreatedDateUTC *time.Time `json:"createdDateUTC,omitempty" azure:"ro"` - // READ-ONLY; The last time that this alert rule template has been updated. + // READ-ONLY; The time that this alert rule template was last updated. LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRuleTemplateProperties. -func (s ScheduledAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertDetailsOverride", s.AlertDetailsOverride) - populate(objectMap, "alertRulesCreatedByTemplateCount", s.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", s.CreatedDateUTC) - populate(objectMap, "customDetails", s.CustomDetails) - populate(objectMap, "description", s.Description) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "entityMappings", s.EntityMappings) - populate(objectMap, "eventGroupingSettings", s.EventGroupingSettings) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", s.LastUpdatedDateUTC) - populate(objectMap, "query", s.Query) - populate(objectMap, "queryFrequency", s.QueryFrequency) - populate(objectMap, "queryPeriod", s.QueryPeriod) - populate(objectMap, "requiredDataConnectors", s.RequiredDataConnectors) - populate(objectMap, "severity", s.Severity) - populate(objectMap, "status", s.Status) - populate(objectMap, "tactics", s.Tactics) - populate(objectMap, "techniques", s.Techniques) - populate(objectMap, "triggerOperator", s.TriggerOperator) - populate(objectMap, "triggerThreshold", s.TriggerThreshold) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRuleTemplateProperties. -func (s *ScheduledAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertDetailsOverride": - err = unpopulate(val, &s.AlertDetailsOverride) - delete(rawMsg, key) - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &s.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &s.CreatedDateUTC) - delete(rawMsg, key) - case "customDetails": - err = unpopulate(val, &s.CustomDetails) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &s.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &s.DisplayName) - delete(rawMsg, key) - case "entityMappings": - err = unpopulate(val, &s.EntityMappings) - delete(rawMsg, key) - case "eventGroupingSettings": - err = unpopulate(val, &s.EventGroupingSettings) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &s.LastUpdatedDateUTC) - delete(rawMsg, key) - case "query": - err = unpopulate(val, &s.Query) - delete(rawMsg, key) - case "queryFrequency": - err = unpopulate(val, &s.QueryFrequency) - delete(rawMsg, key) - case "queryPeriod": - err = unpopulate(val, &s.QueryPeriod) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &s.RequiredDataConnectors) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &s.Severity) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &s.Status) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &s.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &s.Techniques) - delete(rawMsg, key) - case "triggerOperator": - err = unpopulate(val, &s.TriggerOperator) - delete(rawMsg, key) - case "triggerThreshold": - err = unpopulate(val, &s.TriggerThreshold) - delete(rawMsg, key) - case "version": - err = unpopulate(val, &s.Version) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SecurityAlert - Represents a security alert entity. type SecurityAlert struct { // REQUIRED; The kind of the entity. @@ -13032,64 +6086,6 @@ type SecurityAlert struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type SecurityAlert. -func (s *SecurityAlert) GetEntity() *Entity { - return &Entity{ - Kind: s.Kind, - ID: s.ID, - Name: s.Name, - Type: s.Type, - SystemData: s.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityAlert. -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - objectMap["kind"] = EntityKindSecurityAlert - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlert. -func (s *SecurityAlert) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &s.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &s.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SecurityAlertProperties - SecurityAlert entity property bag. type SecurityAlertProperties struct { // The severity of the alert @@ -13176,137 +6172,6 @@ type SecurityAlertProperties struct { VendorName *string `json:"vendorName,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SecurityAlertProperties. -func (s SecurityAlertProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", s.AdditionalData) - populate(objectMap, "alertDisplayName", s.AlertDisplayName) - populate(objectMap, "alertLink", s.AlertLink) - populate(objectMap, "alertType", s.AlertType) - populate(objectMap, "compromisedEntity", s.CompromisedEntity) - populate(objectMap, "confidenceLevel", s.ConfidenceLevel) - populate(objectMap, "confidenceReasons", s.ConfidenceReasons) - populate(objectMap, "confidenceScore", s.ConfidenceScore) - populate(objectMap, "confidenceScoreStatus", s.ConfidenceScoreStatus) - populate(objectMap, "description", s.Description) - populateTimeRFC3339(objectMap, "endTimeUtc", s.EndTimeUTC) - populate(objectMap, "friendlyName", s.FriendlyName) - populate(objectMap, "intent", s.Intent) - populateTimeRFC3339(objectMap, "processingEndTime", s.ProcessingEndTime) - populate(objectMap, "productComponentName", s.ProductComponentName) - populate(objectMap, "productName", s.ProductName) - populate(objectMap, "productVersion", s.ProductVersion) - populate(objectMap, "providerAlertId", s.ProviderAlertID) - populate(objectMap, "remediationSteps", s.RemediationSteps) - populate(objectMap, "resourceIdentifiers", s.ResourceIdentifiers) - populate(objectMap, "severity", s.Severity) - populateTimeRFC3339(objectMap, "startTimeUtc", s.StartTimeUTC) - populate(objectMap, "status", s.Status) - populate(objectMap, "systemAlertId", s.SystemAlertID) - populate(objectMap, "tactics", s.Tactics) - populateTimeRFC3339(objectMap, "timeGenerated", s.TimeGenerated) - populate(objectMap, "vendorName", s.VendorName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertProperties. -func (s *SecurityAlertProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalData": - err = unpopulate(val, &s.AdditionalData) - delete(rawMsg, key) - case "alertDisplayName": - err = unpopulate(val, &s.AlertDisplayName) - delete(rawMsg, key) - case "alertLink": - err = unpopulate(val, &s.AlertLink) - delete(rawMsg, key) - case "alertType": - err = unpopulate(val, &s.AlertType) - delete(rawMsg, key) - case "compromisedEntity": - err = unpopulate(val, &s.CompromisedEntity) - delete(rawMsg, key) - case "confidenceLevel": - err = unpopulate(val, &s.ConfidenceLevel) - delete(rawMsg, key) - case "confidenceReasons": - err = unpopulate(val, &s.ConfidenceReasons) - delete(rawMsg, key) - case "confidenceScore": - err = unpopulate(val, &s.ConfidenceScore) - delete(rawMsg, key) - case "confidenceScoreStatus": - err = unpopulate(val, &s.ConfidenceScoreStatus) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &s.Description) - delete(rawMsg, key) - case "endTimeUtc": - err = unpopulateTimeRFC3339(val, &s.EndTimeUTC) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &s.FriendlyName) - delete(rawMsg, key) - case "intent": - err = unpopulate(val, &s.Intent) - delete(rawMsg, key) - case "processingEndTime": - err = unpopulateTimeRFC3339(val, &s.ProcessingEndTime) - delete(rawMsg, key) - case "productComponentName": - err = unpopulate(val, &s.ProductComponentName) - delete(rawMsg, key) - case "productName": - err = unpopulate(val, &s.ProductName) - delete(rawMsg, key) - case "productVersion": - err = unpopulate(val, &s.ProductVersion) - delete(rawMsg, key) - case "providerAlertId": - err = unpopulate(val, &s.ProviderAlertID) - delete(rawMsg, key) - case "remediationSteps": - err = unpopulate(val, &s.RemediationSteps) - delete(rawMsg, key) - case "resourceIdentifiers": - err = unpopulate(val, &s.ResourceIdentifiers) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &s.Severity) - delete(rawMsg, key) - case "startTimeUtc": - err = unpopulateTimeRFC3339(val, &s.StartTimeUTC) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &s.Status) - delete(rawMsg, key) - case "systemAlertId": - err = unpopulate(val, &s.SystemAlertID) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &s.Tactics) - delete(rawMsg, key) - case "timeGenerated": - err = unpopulateTimeRFC3339(val, &s.TimeGenerated) - delete(rawMsg, key) - case "vendorName": - err = unpopulate(val, &s.VendorName) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SecurityAlertPropertiesConfidenceReasonsItem - confidence reason item type SecurityAlertPropertiesConfidenceReasonsItem struct { // READ-ONLY; The reason's description @@ -13349,76 +6214,6 @@ type SecurityAlertTimelineItem struct { ProductName *string `json:"productName,omitempty"` } -// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type SecurityAlertTimelineItem. -func (s *SecurityAlertTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { - return &EntityTimelineItem{ - Kind: s.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityAlertTimelineItem. -func (s SecurityAlertTimelineItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertType", s.AlertType) - populate(objectMap, "azureResourceId", s.AzureResourceID) - populate(objectMap, "description", s.Description) - populate(objectMap, "displayName", s.DisplayName) - populateTimeRFC3339(objectMap, "endTimeUtc", s.EndTimeUTC) - objectMap["kind"] = EntityTimelineKindSecurityAlert - populate(objectMap, "productName", s.ProductName) - populate(objectMap, "severity", s.Severity) - populateTimeRFC3339(objectMap, "startTimeUtc", s.StartTimeUTC) - populateTimeRFC3339(objectMap, "timeGenerated", s.TimeGenerated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertTimelineItem. -func (s *SecurityAlertTimelineItem) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertType": - err = unpopulate(val, &s.AlertType) - delete(rawMsg, key) - case "azureResourceId": - err = unpopulate(val, &s.AzureResourceID) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &s.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &s.DisplayName) - delete(rawMsg, key) - case "endTimeUtc": - err = unpopulateTimeRFC3339(val, &s.EndTimeUTC) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &s.Kind) - delete(rawMsg, key) - case "productName": - err = unpopulate(val, &s.ProductName) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &s.Severity) - delete(rawMsg, key) - case "startTimeUtc": - err = unpopulateTimeRFC3339(val, &s.StartTimeUTC) - delete(rawMsg, key) - case "timeGenerated": - err = unpopulateTimeRFC3339(val, &s.TimeGenerated) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SecurityGroupEntity - Represents a security group entity. type SecurityGroupEntity struct { // REQUIRED; The kind of the entity. @@ -13440,64 +6235,6 @@ type SecurityGroupEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type SecurityGroupEntity. -func (s *SecurityGroupEntity) GetEntity() *Entity { - return &Entity{ - Kind: s.Kind, - ID: s.ID, - Name: s.Name, - Type: s.Type, - SystemData: s.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupEntity. -func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - objectMap["kind"] = EntityKindSecurityGroup - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupEntity. -func (s *SecurityGroupEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &s.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &s.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SecurityGroupEntityProperties - SecurityGroup entity property bag. type SecurityGroupEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -13517,17 +6254,6 @@ type SecurityGroupEntityProperties struct { Sid *string `json:"sid,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupEntityProperties. -func (s SecurityGroupEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", s.AdditionalData) - populate(objectMap, "distinguishedName", s.DistinguishedName) - populate(objectMap, "friendlyName", s.FriendlyName) - populate(objectMap, "objectGuid", s.ObjectGUID) - populate(objectMap, "sid", s.Sid) - return json.Marshal(objectMap) -} - // SentinelOnboardingState - Sentinel onboarding state type SentinelOnboardingState struct { // Etag of the azure resource @@ -13585,46 +6311,12 @@ type SentinelOnboardingStatesList struct { Value []*SentinelOnboardingState `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SentinelOnboardingStatesList. -func (s SentinelOnboardingStatesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // SettingList - List of all the settings. type SettingList struct { // REQUIRED; Array of settings. Value []SettingsClassification `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SettingList. -func (s SettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SettingList. -func (s *SettingList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "value": - s.Value, err = unmarshalSettingsClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SettingsClassification provides polymorphic access to related types. // Call the interface's GetSettings() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -13655,9 +6347,6 @@ type Settings struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetSettings implements the SettingsClassification interface for type Settings. -func (s *Settings) GetSettings() *Settings { return s } - // SourceControl - Represents a SourceControl in Azure Security Insights. type SourceControl struct { // Etag of the azure resource @@ -13694,14 +6383,6 @@ type SourceControlList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SourceControlList. -func (s SourceControlList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // SourceControlProperties - Describes source control properties type SourceControlProperties struct { // REQUIRED; Array of source control content types. @@ -13721,18 +6402,15 @@ type SourceControlProperties struct { // The id (a Guid) of the source control ID *string `json:"id,omitempty"` -} -// MarshalJSON implements the json.Marshaller interface for type SourceControlProperties. -func (s SourceControlProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentTypes", s.ContentTypes) - populate(objectMap, "description", s.Description) - populate(objectMap, "displayName", s.DisplayName) - populate(objectMap, "id", s.ID) - populate(objectMap, "repoType", s.RepoType) - populate(objectMap, "repository", s.Repository) - return json.Marshal(objectMap) + // Information regarding the latest deployment for the source control. + LastDeploymentInfo *DeploymentInfo `json:"lastDeploymentInfo,omitempty"` + + // Information regarding the resources created in user's repository. + RepositoryResourceInfo *RepositoryResourceInfo `json:"repositoryResourceInfo,omitempty"` + + // The version number associated with the source control + Version *Version `json:"version,omitempty"` } // SourceControlsClientCreateOptions contains the optional parameters for the SourceControlsClient.Create method. @@ -13776,64 +6454,6 @@ type SubmissionMailEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type SubmissionMailEntity. -func (s *SubmissionMailEntity) GetEntity() *Entity { - return &Entity{ - Kind: s.Kind, - ID: s.ID, - Name: s.Name, - Type: s.Type, - SystemData: s.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type SubmissionMailEntity. -func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - objectMap["kind"] = EntityKindSubmissionMail - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubmissionMailEntity. -func (s *SubmissionMailEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &s.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &s.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &s.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &s.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SubmissionMailEntityProperties - Submission mail entity property bag. type SubmissionMailEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -13874,77 +6494,6 @@ type SubmissionMailEntityProperties struct { Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SubmissionMailEntityProperties. -func (s SubmissionMailEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", s.AdditionalData) - populate(objectMap, "friendlyName", s.FriendlyName) - populate(objectMap, "networkMessageId", s.NetworkMessageID) - populate(objectMap, "recipient", s.Recipient) - populate(objectMap, "reportType", s.ReportType) - populate(objectMap, "sender", s.Sender) - populate(objectMap, "senderIp", s.SenderIP) - populate(objectMap, "subject", s.Subject) - populateTimeRFC3339(objectMap, "submissionDate", s.SubmissionDate) - populate(objectMap, "submissionId", s.SubmissionID) - populate(objectMap, "submitter", s.Submitter) - populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubmissionMailEntityProperties. -func (s *SubmissionMailEntityProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalData": - err = unpopulate(val, &s.AdditionalData) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &s.FriendlyName) - delete(rawMsg, key) - case "networkMessageId": - err = unpopulate(val, &s.NetworkMessageID) - delete(rawMsg, key) - case "recipient": - err = unpopulate(val, &s.Recipient) - delete(rawMsg, key) - case "reportType": - err = unpopulate(val, &s.ReportType) - delete(rawMsg, key) - case "sender": - err = unpopulate(val, &s.Sender) - delete(rawMsg, key) - case "senderIp": - err = unpopulate(val, &s.SenderIP) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, &s.Subject) - delete(rawMsg, key) - case "submissionDate": - err = unpopulateTimeRFC3339(val, &s.SubmissionDate) - delete(rawMsg, key) - case "submissionId": - err = unpopulate(val, &s.SubmissionID) - delete(rawMsg, key) - case "submitter": - err = unpopulate(val, &s.Submitter) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, &s.Timestamp) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -13966,53 +6515,6 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TICheckRequirements - Threat Intelligence Platforms data connector check requirements type TICheckRequirements struct { // REQUIRED; Describes the kind of connector to be checked. @@ -14022,44 +6524,6 @@ type TICheckRequirements struct { Properties *TICheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type TICheckRequirements. -func (t *TICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: t.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type TICheckRequirements. -func (t TICheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindThreatIntelligence - populate(objectMap, "properties", t.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TICheckRequirements. -func (t *TICheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TICheckRequirementsProperties - Threat Intelligence Platforms data connector required properties. type TICheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -14090,69 +6554,6 @@ type TIDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type TIDataConnector. -func (t *TIDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: t.Kind, - Etag: t.Etag, - ID: t.ID, - Name: t.Name, - Type: t.Type, - SystemData: t.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type TIDataConnector. -func (t TIDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) - populate(objectMap, "id", t.ID) - objectMap["kind"] = DataConnectorKindThreatIntelligence - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TIDataConnector. -func (t *TIDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &t.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &t.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &t.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &t.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &t.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TIDataConnectorDataTypes - The available data types for TI (Threat Intelligence) data connector. type TIDataConnectorDataTypes struct { // REQUIRED; Data type for indicators connection. @@ -14177,41 +6578,6 @@ type TIDataConnectorProperties struct { TipLookbackPeriod *time.Time `json:"tipLookbackPeriod,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TIDataConnectorProperties. -func (t TIDataConnectorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataTypes", t.DataTypes) - populate(objectMap, "tenantId", t.TenantID) - populateTimeRFC3339(objectMap, "tipLookbackPeriod", t.TipLookbackPeriod) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TIDataConnectorProperties. -func (t *TIDataConnectorProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "dataTypes": - err = unpopulate(val, &t.DataTypes) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, &t.TenantID) - delete(rawMsg, key) - case "tipLookbackPeriod": - err = unpopulateTimeRFC3339(val, &t.TipLookbackPeriod) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TeamInformation - Describes team information type TeamInformation struct { // READ-ONLY; The description of the team @@ -14230,49 +6596,6 @@ type TeamInformation struct { TeamID *string `json:"teamId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type TeamInformation. -func (t TeamInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", t.Description) - populate(objectMap, "name", t.Name) - populate(objectMap, "primaryChannelUrl", t.PrimaryChannelURL) - populateTimeRFC3339(objectMap, "teamCreationTimeUtc", t.TeamCreationTimeUTC) - populate(objectMap, "teamId", t.TeamID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TeamInformation. -func (t *TeamInformation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, &t.Description) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &t.Name) - delete(rawMsg, key) - case "primaryChannelUrl": - err = unpopulate(val, &t.PrimaryChannelURL) - delete(rawMsg, key) - case "teamCreationTimeUtc": - err = unpopulateTimeRFC3339(val, &t.TeamCreationTimeUTC) - delete(rawMsg, key) - case "teamId": - err = unpopulate(val, &t.TeamID) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TeamProperties - Describes team properties type TeamProperties struct { // REQUIRED; The name of the team @@ -14288,16 +6611,6 @@ type TeamProperties struct { TeamDescription *string `json:"teamDescription,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TeamProperties. -func (t TeamProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupIds", t.GroupIDs) - populate(objectMap, "memberIds", t.MemberIDs) - populate(objectMap, "teamDescription", t.TeamDescription) - populate(objectMap, "teamName", t.TeamName) - return json.Marshal(objectMap) -} - // ThreatIntelligence property bag. type ThreatIntelligence struct { // READ-ONLY; Confidence (must be between 0 and 1) @@ -14343,69 +6656,6 @@ type ThreatIntelligenceAlertRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRule implements the AlertRuleClassification interface for type ThreatIntelligenceAlertRule. -func (t *ThreatIntelligenceAlertRule) GetAlertRule() *AlertRule { - return &AlertRule{ - Kind: t.Kind, - Etag: t.Etag, - ID: t.ID, - Name: t.Name, - Type: t.Type, - SystemData: t.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRule. -func (t ThreatIntelligenceAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) - populate(objectMap, "id", t.ID) - objectMap["kind"] = AlertRuleKindThreatIntelligence - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRule. -func (t *ThreatIntelligenceAlertRule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &t.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &t.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &t.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &t.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &t.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ThreatIntelligenceAlertRuleProperties - Threat Intelligence alert rule base property bag. type ThreatIntelligenceAlertRuleProperties struct { // REQUIRED; The Name of the alert rule template used to create this rule. @@ -14433,61 +6683,6 @@ type ThreatIntelligenceAlertRuleProperties struct { Techniques []*string `json:"techniques,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleProperties. -func (t ThreatIntelligenceAlertRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRuleTemplateName", t.AlertRuleTemplateName) - populate(objectMap, "description", t.Description) - populate(objectMap, "displayName", t.DisplayName) - populate(objectMap, "enabled", t.Enabled) - populateTimeRFC3339(objectMap, "lastModifiedUtc", t.LastModifiedUTC) - populate(objectMap, "severity", t.Severity) - populate(objectMap, "tactics", t.Tactics) - populate(objectMap, "techniques", t.Techniques) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRuleProperties. -func (t *ThreatIntelligenceAlertRuleProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRuleTemplateName": - err = unpopulate(val, &t.AlertRuleTemplateName) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &t.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &t.DisplayName) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, &t.Enabled) - delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, &t.LastModifiedUTC) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &t.Severity) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &t.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &t.Techniques) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ThreatIntelligenceAlertRuleTemplate - Represents Threat Intelligence alert rule template. type ThreatIntelligenceAlertRuleTemplate struct { // REQUIRED; The kind of the alert rule @@ -14509,64 +6704,6 @@ type ThreatIntelligenceAlertRuleTemplate struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type ThreatIntelligenceAlertRuleTemplate. -func (t *ThreatIntelligenceAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { - return &AlertRuleTemplate{ - Kind: t.Kind, - ID: t.ID, - Name: t.Name, - Type: t.Type, - SystemData: t.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleTemplate. -func (t ThreatIntelligenceAlertRuleTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - objectMap["kind"] = AlertRuleKindThreatIntelligence - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRuleTemplate. -func (t *ThreatIntelligenceAlertRuleTemplate) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &t.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &t.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &t.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &t.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ThreatIntelligenceAlertRuleTemplateProperties - Threat Intelligence alert rule template properties type ThreatIntelligenceAlertRuleTemplateProperties struct { // REQUIRED; The severity for alerts created by this alert rule. @@ -14600,82 +6737,12 @@ type ThreatIntelligenceAlertRuleTemplateProperties struct { LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleTemplateProperties. -func (t ThreatIntelligenceAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "alertRulesCreatedByTemplateCount", t.AlertRulesCreatedByTemplateCount) - populateTimeRFC3339(objectMap, "createdDateUTC", t.CreatedDateUTC) - populate(objectMap, "description", t.Description) - populate(objectMap, "displayName", t.DisplayName) - populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", t.LastUpdatedDateUTC) - populate(objectMap, "requiredDataConnectors", t.RequiredDataConnectors) - populate(objectMap, "severity", t.Severity) - populate(objectMap, "status", t.Status) - populate(objectMap, "tactics", t.Tactics) - populate(objectMap, "techniques", t.Techniques) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRuleTemplateProperties. -func (t *ThreatIntelligenceAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, &t.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, &t.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &t.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &t.DisplayName) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, &t.LastUpdatedDateUTC) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, &t.RequiredDataConnectors) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, &t.Severity) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &t.Status) - delete(rawMsg, key) - case "tactics": - err = unpopulate(val, &t.Tactics) - delete(rawMsg, key) - case "techniques": - err = unpopulate(val, &t.Techniques) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ThreatIntelligenceAppendTags - Array of tags to be appended to the threat intelligence indicator. type ThreatIntelligenceAppendTags struct { // List of tags to be appended. ThreatIntelligenceTags []*string `json:"threatIntelligenceTags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAppendTags. -func (t ThreatIntelligenceAppendTags) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "threatIntelligenceTags", t.ThreatIntelligenceTags) - return json.Marshal(objectMap) -} - // ThreatIntelligenceExternalReference - Describes external reference type ThreatIntelligenceExternalReference struct { // External reference description @@ -14694,17 +6761,6 @@ type ThreatIntelligenceExternalReference struct { URL *string `json:"url,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceExternalReference. -func (t ThreatIntelligenceExternalReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", t.Description) - populate(objectMap, "externalId", t.ExternalID) - populate(objectMap, "hashes", t.Hashes) - populate(objectMap, "sourceName", t.SourceName) - populate(objectMap, "url", t.URL) - return json.Marshal(objectMap) -} - // ThreatIntelligenceFilteringCriteria - Filtering criteria for querying threat intelligence indicators. type ThreatIntelligenceFilteringCriteria struct { // Ids of threat intelligence indicators @@ -14747,25 +6803,6 @@ type ThreatIntelligenceFilteringCriteria struct { ThreatTypes []*string `json:"threatTypes,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceFilteringCriteria. -func (t ThreatIntelligenceFilteringCriteria) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "ids", t.IDs) - populate(objectMap, "includeDisabled", t.IncludeDisabled) - populate(objectMap, "keywords", t.Keywords) - populate(objectMap, "maxConfidence", t.MaxConfidence) - populate(objectMap, "maxValidUntil", t.MaxValidUntil) - populate(objectMap, "minConfidence", t.MinConfidence) - populate(objectMap, "minValidUntil", t.MinValidUntil) - populate(objectMap, "pageSize", t.PageSize) - populate(objectMap, "patternTypes", t.PatternTypes) - populate(objectMap, "skipToken", t.SkipToken) - populate(objectMap, "sortBy", t.SortBy) - populate(objectMap, "sources", t.Sources) - populate(objectMap, "threatTypes", t.ThreatTypes) - return json.Marshal(objectMap) -} - // ThreatIntelligenceGranularMarkingModel - Describes threat granular marking model entity type ThreatIntelligenceGranularMarkingModel struct { // Language granular marking model @@ -14778,15 +6815,6 @@ type ThreatIntelligenceGranularMarkingModel struct { Selectors []*string `json:"selectors,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceGranularMarkingModel. -func (t ThreatIntelligenceGranularMarkingModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "language", t.Language) - populate(objectMap, "markingRef", t.MarkingRef) - populate(objectMap, "selectors", t.Selectors) - return json.Marshal(objectMap) -} - // ThreatIntelligenceIndicatorClientAppendTagsOptions contains the optional parameters for the ThreatIntelligenceIndicatorClient.AppendTags // method. type ThreatIntelligenceIndicatorClientAppendTagsOptions struct { @@ -14859,130 +6887,6 @@ type ThreatIntelligenceIndicatorModel struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetThreatIntelligenceInformation implements the ThreatIntelligenceInformationClassification interface for type ThreatIntelligenceIndicatorModel. -func (t *ThreatIntelligenceIndicatorModel) GetThreatIntelligenceInformation() *ThreatIntelligenceInformation { - return &ThreatIntelligenceInformation{ - Etag: t.Etag, - Kind: t.Kind, - ID: t.ID, - Name: t.Name, - Type: t.Type, - SystemData: t.SystemData, - } -} - -// GetThreatIntelligenceResourceKind implements the ThreatIntelligenceResourceKindClassification interface for type ThreatIntelligenceIndicatorModel. -func (t *ThreatIntelligenceIndicatorModel) GetThreatIntelligenceResourceKind() *ThreatIntelligenceResourceKind { - return &ThreatIntelligenceResourceKind{ - Kind: t.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceIndicatorModel. -func (t ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) - populate(objectMap, "id", t.ID) - objectMap["kind"] = ThreatIntelligenceResourceKindEnumIndicator - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorModel. -func (t *ThreatIntelligenceIndicatorModel) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &t.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &t.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &t.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &t.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &t.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - -// ThreatIntelligenceIndicatorModelForRequestBody - Threat intelligence indicator entity used in request body. -type ThreatIntelligenceIndicatorModelForRequestBody struct { - // REQUIRED; The kind of the entity. - Kind *ThreatIntelligenceResourceKindEnum `json:"kind,omitempty"` - - // Etag of the azure resource - Etag *string `json:"etag,omitempty"` - - // Threat Intelligence Entity properties - Properties *ThreatIntelligenceIndicatorProperties `json:"properties,omitempty"` -} - -// GetThreatIntelligenceResourceKind implements the ThreatIntelligenceResourceKindClassification interface for type ThreatIntelligenceIndicatorModelForRequestBody. -func (t *ThreatIntelligenceIndicatorModelForRequestBody) GetThreatIntelligenceResourceKind() *ThreatIntelligenceResourceKind { - return &ThreatIntelligenceResourceKind{ - Kind: t.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceIndicatorModelForRequestBody. -func (t ThreatIntelligenceIndicatorModelForRequestBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) - objectMap["kind"] = ThreatIntelligenceResourceKindEnumIndicator - populate(objectMap, "properties", t.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorModelForRequestBody. -func (t *ThreatIntelligenceIndicatorModelForRequestBody) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &t.Etag) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ThreatIntelligenceIndicatorProperties - Describes threat intelligence entity properties type ThreatIntelligenceIndicatorProperties struct { // Confidence of threat intelligence entity @@ -15077,42 +6981,6 @@ type ThreatIntelligenceIndicatorProperties struct { FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceIndicatorProperties. -func (t ThreatIntelligenceIndicatorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", t.AdditionalData) - populate(objectMap, "confidence", t.Confidence) - populate(objectMap, "created", t.Created) - populate(objectMap, "createdByRef", t.CreatedByRef) - populate(objectMap, "defanged", t.Defanged) - populate(objectMap, "description", t.Description) - populate(objectMap, "displayName", t.DisplayName) - populate(objectMap, "extensions", t.Extensions) - populate(objectMap, "externalId", t.ExternalID) - populate(objectMap, "externalLastUpdatedTimeUtc", t.ExternalLastUpdatedTimeUTC) - populate(objectMap, "externalReferences", t.ExternalReferences) - populate(objectMap, "friendlyName", t.FriendlyName) - populate(objectMap, "granularMarkings", t.GranularMarkings) - populate(objectMap, "indicatorTypes", t.IndicatorTypes) - populate(objectMap, "killChainPhases", t.KillChainPhases) - populate(objectMap, "labels", t.Labels) - populate(objectMap, "language", t.Language) - populate(objectMap, "lastUpdatedTimeUtc", t.LastUpdatedTimeUTC) - populate(objectMap, "modified", t.Modified) - populate(objectMap, "objectMarkingRefs", t.ObjectMarkingRefs) - populate(objectMap, "parsedPattern", t.ParsedPattern) - populate(objectMap, "pattern", t.Pattern) - populate(objectMap, "patternType", t.PatternType) - populate(objectMap, "patternVersion", t.PatternVersion) - populate(objectMap, "revoked", t.Revoked) - populate(objectMap, "source", t.Source) - populate(objectMap, "threatIntelligenceTags", t.ThreatIntelligenceTags) - populate(objectMap, "threatTypes", t.ThreatTypes) - populate(objectMap, "validFrom", t.ValidFrom) - populate(objectMap, "validUntil", t.ValidUntil) - return json.Marshal(objectMap) -} - // ThreatIntelligenceIndicatorsClientListOptions contains the optional parameters for the ThreatIntelligenceIndicatorsClient.List // method. type ThreatIntelligenceIndicatorsClientListOptions struct { @@ -15133,7 +7001,6 @@ type ThreatIntelligenceIndicatorsClientListOptions struct { // Use a type switch to determine the concrete type. The possible types are: // - *ThreatIntelligenceIndicatorModel, *ThreatIntelligenceInformation type ThreatIntelligenceInformationClassification interface { - ThreatIntelligenceResourceKindClassification // GetThreatIntelligenceInformation returns the ThreatIntelligenceInformation content of the underlying type. GetThreatIntelligenceInformation() *ThreatIntelligenceInformation } @@ -15159,65 +7026,6 @@ type ThreatIntelligenceInformation struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetThreatIntelligenceInformation implements the ThreatIntelligenceInformationClassification interface for type ThreatIntelligenceInformation. -func (t *ThreatIntelligenceInformation) GetThreatIntelligenceInformation() *ThreatIntelligenceInformation { - return t -} - -// GetThreatIntelligenceResourceKind implements the ThreatIntelligenceResourceKindClassification interface for type ThreatIntelligenceInformation. -func (t *ThreatIntelligenceInformation) GetThreatIntelligenceResourceKind() *ThreatIntelligenceResourceKind { - return &ThreatIntelligenceResourceKind{ - Kind: t.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceInformation. -func (t ThreatIntelligenceInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) - populate(objectMap, "id", t.ID) - objectMap["kind"] = "ThreatIntelligenceInformation" - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceInformation. -func (t *ThreatIntelligenceInformation) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &t.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &t.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &t.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &t.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &t.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ThreatIntelligenceInformationList - List of all the threat intelligence information objects. type ThreatIntelligenceInformationList struct { // REQUIRED; Array of threat intelligence information objects. @@ -15227,37 +7035,6 @@ type ThreatIntelligenceInformationList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceInformationList. -func (t ThreatIntelligenceInformationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", t.NextLink) - populate(objectMap, "value", t.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceInformationList. -func (t *ThreatIntelligenceInformationList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, &t.NextLink) - delete(rawMsg, key) - case "value": - t.Value, err = unmarshalThreatIntelligenceInformationClassificationArray(val) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ThreatIntelligenceKillChainPhase - Describes threat kill chain phase entity type ThreatIntelligenceKillChainPhase struct { // Kill chainName name @@ -15282,16 +7059,6 @@ type ThreatIntelligenceMetric struct { ThreatTypeMetrics []*ThreatIntelligenceMetricEntity `json:"threatTypeMetrics,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceMetric. -func (t ThreatIntelligenceMetric) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "lastUpdatedTimeUtc", t.LastUpdatedTimeUTC) - populate(objectMap, "patternTypeMetrics", t.PatternTypeMetrics) - populate(objectMap, "sourceMetrics", t.SourceMetrics) - populate(objectMap, "threatTypeMetrics", t.ThreatTypeMetrics) - return json.Marshal(objectMap) -} - // ThreatIntelligenceMetricEntity - Describes threat intelligence metric entity type ThreatIntelligenceMetricEntity struct { // Metric name @@ -15313,13 +7080,6 @@ type ThreatIntelligenceMetricsList struct { Value []*ThreatIntelligenceMetrics `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceMetricsList. -func (t ThreatIntelligenceMetricsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", t.Value) - return json.Marshal(objectMap) -} - // ThreatIntelligenceParsedPattern - Describes parsed pattern entity type ThreatIntelligenceParsedPattern struct { // Pattern type key @@ -15329,14 +7089,6 @@ type ThreatIntelligenceParsedPattern struct { PatternTypeValues []*ThreatIntelligenceParsedPatternTypeValue `json:"patternTypeValues,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceParsedPattern. -func (t ThreatIntelligenceParsedPattern) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "patternTypeKey", t.PatternTypeKey) - populate(objectMap, "patternTypeValues", t.PatternTypeValues) - return json.Marshal(objectMap) -} - // ThreatIntelligenceParsedPatternTypeValue - Describes threat kill chain phase entity type ThreatIntelligenceParsedPatternTypeValue struct { // Value of parsed pattern @@ -15346,26 +7098,6 @@ type ThreatIntelligenceParsedPatternTypeValue struct { ValueType *string `json:"valueType,omitempty"` } -// ThreatIntelligenceResourceKindClassification provides polymorphic access to related types. -// Call the interface's GetThreatIntelligenceResourceKind() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ThreatIntelligenceIndicatorModel, *ThreatIntelligenceInformation, *ThreatIntelligenceResourceKind -type ThreatIntelligenceResourceKindClassification interface { - // GetThreatIntelligenceResourceKind returns the ThreatIntelligenceResourceKind content of the underlying type. - GetThreatIntelligenceResourceKind() *ThreatIntelligenceResourceKind -} - -// ThreatIntelligenceResourceKind - Describes an entity with kind. -type ThreatIntelligenceResourceKind struct { - // REQUIRED; The kind of the entity. - Kind *ThreatIntelligenceResourceKindEnum `json:"kind,omitempty"` -} - -// GetThreatIntelligenceResourceKind implements the ThreatIntelligenceResourceKindClassification interface for type ThreatIntelligenceResourceKind. -func (t *ThreatIntelligenceResourceKind) GetThreatIntelligenceResourceKind() *ThreatIntelligenceResourceKind { - return t -} - // ThreatIntelligenceSortingCriteria - List of available columns for sorting type ThreatIntelligenceSortingCriteria struct { // Column name @@ -15384,44 +7116,6 @@ type TiTaxiiCheckRequirements struct { Properties *TiTaxiiCheckRequirementsProperties `json:"properties,omitempty"` } -// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type TiTaxiiCheckRequirements. -func (t *TiTaxiiCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { - return &DataConnectorsCheckRequirements{ - Kind: t.Kind, - } -} - -// MarshalJSON implements the json.Marshaller interface for type TiTaxiiCheckRequirements. -func (t TiTaxiiCheckRequirements) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["kind"] = DataConnectorKindThreatIntelligenceTaxii - populate(objectMap, "properties", t.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TiTaxiiCheckRequirements. -func (t *TiTaxiiCheckRequirements) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TiTaxiiCheckRequirementsProperties - Threat Intelligence TAXII data connector required properties. type TiTaxiiCheckRequirementsProperties struct { // REQUIRED; The tenant id to connect to, and get the data from. @@ -15452,69 +7146,6 @@ type TiTaxiiDataConnector struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetDataConnector implements the DataConnectorClassification interface for type TiTaxiiDataConnector. -func (t *TiTaxiiDataConnector) GetDataConnector() *DataConnector { - return &DataConnector{ - Kind: t.Kind, - Etag: t.Etag, - ID: t.ID, - Name: t.Name, - Type: t.Type, - SystemData: t.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type TiTaxiiDataConnector. -func (t TiTaxiiDataConnector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) - populate(objectMap, "id", t.ID) - objectMap["kind"] = DataConnectorKindThreatIntelligenceTaxii - populate(objectMap, "name", t.Name) - populate(objectMap, "properties", t.Properties) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TiTaxiiDataConnector. -func (t *TiTaxiiDataConnector) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &t.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &t.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &t.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &t.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &t.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &t.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &t.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TiTaxiiDataConnectorDataTypes - The available data types for Threat Intelligence TAXII data connector. type TiTaxiiDataConnectorDataTypes struct { // REQUIRED; Data type for TAXII connector. @@ -15560,69 +7191,6 @@ type TiTaxiiDataConnectorProperties struct { WorkspaceID *string `json:"workspaceId,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TiTaxiiDataConnectorProperties. -func (t TiTaxiiDataConnectorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "collectionId", t.CollectionID) - populate(objectMap, "dataTypes", t.DataTypes) - populate(objectMap, "friendlyName", t.FriendlyName) - populate(objectMap, "password", t.Password) - populate(objectMap, "pollingFrequency", t.PollingFrequency) - populateTimeRFC3339(objectMap, "taxiiLookbackPeriod", t.TaxiiLookbackPeriod) - populate(objectMap, "taxiiServer", t.TaxiiServer) - populate(objectMap, "tenantId", t.TenantID) - populate(objectMap, "userName", t.UserName) - populate(objectMap, "workspaceId", t.WorkspaceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TiTaxiiDataConnectorProperties. -func (t *TiTaxiiDataConnectorProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "collectionId": - err = unpopulate(val, &t.CollectionID) - delete(rawMsg, key) - case "dataTypes": - err = unpopulate(val, &t.DataTypes) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &t.FriendlyName) - delete(rawMsg, key) - case "password": - err = unpopulate(val, &t.Password) - delete(rawMsg, key) - case "pollingFrequency": - err = unpopulate(val, &t.PollingFrequency) - delete(rawMsg, key) - case "taxiiLookbackPeriod": - err = unpopulateTimeRFC3339(val, &t.TaxiiLookbackPeriod) - delete(rawMsg, key) - case "taxiiServer": - err = unpopulate(val, &t.TaxiiServer) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, &t.TenantID) - delete(rawMsg, key) - case "userName": - err = unpopulate(val, &t.UserName) - delete(rawMsg, key) - case "workspaceId": - err = unpopulate(val, &t.WorkspaceID) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TimelineAggregation - timeline aggregation information per kind type TimelineAggregation struct { // REQUIRED; the total items found for a kind @@ -15656,15 +7224,6 @@ type TimelineResultsMetadata struct { Errors []*TimelineError `json:"errors,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TimelineResultsMetadata. -func (t TimelineResultsMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "aggregations", t.Aggregations) - populate(objectMap, "errors", t.Errors) - populate(objectMap, "totalCount", t.TotalCount) - return json.Marshal(objectMap) -} - // URLEntity - Represents a url entity. type URLEntity struct { // REQUIRED; The kind of the entity. @@ -15686,64 +7245,6 @@ type URLEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type URLEntity. -func (u *URLEntity) GetEntity() *Entity { - return &Entity{ - Kind: u.Kind, - ID: u.ID, - Name: u.Name, - Type: u.Type, - SystemData: u.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type URLEntity. -func (u URLEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", u.ID) - objectMap["kind"] = EntityKindURL - populate(objectMap, "name", u.Name) - populate(objectMap, "properties", u.Properties) - populate(objectMap, "systemData", u.SystemData) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type URLEntity. -func (u *URLEntity) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &u.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &u.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &u.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &u.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &u.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &u.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // URLEntityProperties - Url entity property bag. type URLEntityProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. @@ -15757,15 +7258,6 @@ type URLEntityProperties struct { URL *string `json:"url,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type URLEntityProperties. -func (u URLEntityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", u.AdditionalData) - populate(objectMap, "friendlyName", u.FriendlyName) - populate(objectMap, "url", u.URL) - return json.Marshal(objectMap) -} - // Ueba - Settings with single toggle. type Ueba struct { // REQUIRED; The kind of the setting @@ -15790,82 +7282,12 @@ type Ueba struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetSettings implements the SettingsClassification interface for type Ueba. -func (u *Ueba) GetSettings() *Settings { - return &Settings{ - Kind: u.Kind, - Etag: u.Etag, - ID: u.ID, - Name: u.Name, - Type: u.Type, - SystemData: u.SystemData, - } -} - -// MarshalJSON implements the json.Marshaller interface for type Ueba. -func (u Ueba) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", u.Etag) - populate(objectMap, "id", u.ID) - objectMap["kind"] = SettingKindUeba - populate(objectMap, "name", u.Name) - populate(objectMap, "properties", u.Properties) - populate(objectMap, "systemData", u.SystemData) - populate(objectMap, "type", u.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Ueba. -func (u *Ueba) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "etag": - err = unpopulate(val, &u.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, &u.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, &u.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &u.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &u.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, &u.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &u.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // UebaProperties - Ueba property bag. type UebaProperties struct { // The relevant data sources that enriched by ueba DataSources []*UebaDataSources `json:"dataSources,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type UebaProperties. -func (u UebaProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataSources", u.DataSources) - return json.Marshal(objectMap) -} - // UserInfo - User information that made some action type UserInfo struct { // The object id of the user. @@ -15929,18 +7351,10 @@ type WatchlistItemList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type WatchlistItemList. -func (w WatchlistItemList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - // WatchlistItemProperties - Describes watchlist item properties type WatchlistItemProperties struct { // REQUIRED; key-value pairs for a watchlist item - ItemsKeyValue interface{} `json:"itemsKeyValue,omitempty"` + ItemsKeyValue map[string]interface{} `json:"itemsKeyValue,omitempty"` // The time the watchlist item was created Created *time.Time `json:"created,omitempty"` @@ -15949,7 +7363,7 @@ type WatchlistItemProperties struct { CreatedBy *UserInfo `json:"createdBy,omitempty"` // key-value pairs for a watchlist item entity mapping - EntityMapping interface{} `json:"entityMapping,omitempty"` + EntityMapping map[string]interface{} `json:"entityMapping,omitempty"` // A flag that indicates if the watchlist item is deleted or not IsDeleted *bool `json:"isDeleted,omitempty"` @@ -15970,69 +7384,6 @@ type WatchlistItemProperties struct { WatchlistItemType *string `json:"watchlistItemType,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type WatchlistItemProperties. -func (w WatchlistItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "created", w.Created) - populate(objectMap, "createdBy", w.CreatedBy) - populate(objectMap, "entityMapping", &w.EntityMapping) - populate(objectMap, "isDeleted", w.IsDeleted) - populate(objectMap, "itemsKeyValue", &w.ItemsKeyValue) - populate(objectMap, "tenantId", w.TenantID) - populateTimeRFC3339(objectMap, "updated", w.Updated) - populate(objectMap, "updatedBy", w.UpdatedBy) - populate(objectMap, "watchlistItemId", w.WatchlistItemID) - populate(objectMap, "watchlistItemType", w.WatchlistItemType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WatchlistItemProperties. -func (w *WatchlistItemProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "created": - err = unpopulateTimeRFC3339(val, &w.Created) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &w.CreatedBy) - delete(rawMsg, key) - case "entityMapping": - err = unpopulate(val, &w.EntityMapping) - delete(rawMsg, key) - case "isDeleted": - err = unpopulate(val, &w.IsDeleted) - delete(rawMsg, key) - case "itemsKeyValue": - err = unpopulate(val, &w.ItemsKeyValue) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, &w.TenantID) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, &w.Updated) - delete(rawMsg, key) - case "updatedBy": - err = unpopulate(val, &w.UpdatedBy) - delete(rawMsg, key) - case "watchlistItemId": - err = unpopulate(val, &w.WatchlistItemID) - delete(rawMsg, key) - case "watchlistItemType": - err = unpopulate(val, &w.WatchlistItemType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // WatchlistItemsClientCreateOrUpdateOptions contains the optional parameters for the WatchlistItemsClient.CreateOrUpdate // method. type WatchlistItemsClientCreateOrUpdateOptions struct { @@ -16051,7 +7402,10 @@ type WatchlistItemsClientGetOptions struct { // WatchlistItemsClientListOptions contains the optional parameters for the WatchlistItemsClient.List method. type WatchlistItemsClientListOptions struct { - // placeholder for future optional parameters + // Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skiptoken parameter that + // specifies a starting point to use for subsequent calls. Optional. + SkipToken *string } // WatchlistList - List all the watchlists. @@ -16063,14 +7417,6 @@ type WatchlistList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type WatchlistList. -func (w WatchlistList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - // WatchlistProperties - Describes watchlist properties type WatchlistProperties struct { // REQUIRED; The display name of the watchlist @@ -16084,9 +7430,6 @@ type WatchlistProperties struct { // REQUIRED; The provider of the watchlist Provider *string `json:"provider,omitempty"` - // REQUIRED; The source of the watchlist - Source *Source `json:"source,omitempty"` - // The content type of the raw content. Example : text/csv or text/tsv ContentType *string `json:"contentType,omitempty"` @@ -16115,6 +7458,12 @@ type WatchlistProperties struct { // file that will parsed by the endpoint RawContent *string `json:"rawContent,omitempty"` + // The filename of the watchlist, called 'source' + Source *string `json:"source,omitempty"` + + // The sourceType of the watchlist + SourceType *SourceType `json:"sourceType,omitempty"` + // The tenantId where the watchlist belongs to TenantID *string `json:"tenantId,omitempty"` @@ -16134,120 +7483,10 @@ type WatchlistProperties struct { // The id (a Guid) of the watchlist WatchlistID *string `json:"watchlistId,omitempty"` - // The number of Watchlist Items in the Watchlist - WatchlistItemsCount *int32 `json:"watchlistItemsCount,omitempty"` - // The type of the watchlist WatchlistType *string `json:"watchlistType,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type WatchlistProperties. -func (w WatchlistProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentType", w.ContentType) - populateTimeRFC3339(objectMap, "created", w.Created) - populate(objectMap, "createdBy", w.CreatedBy) - populate(objectMap, "defaultDuration", w.DefaultDuration) - populate(objectMap, "description", w.Description) - populate(objectMap, "displayName", w.DisplayName) - populate(objectMap, "isDeleted", w.IsDeleted) - populate(objectMap, "itemsSearchKey", w.ItemsSearchKey) - populate(objectMap, "labels", w.Labels) - populate(objectMap, "numberOfLinesToSkip", w.NumberOfLinesToSkip) - populate(objectMap, "provider", w.Provider) - populate(objectMap, "rawContent", w.RawContent) - populate(objectMap, "source", w.Source) - populate(objectMap, "tenantId", w.TenantID) - populateTimeRFC3339(objectMap, "updated", w.Updated) - populate(objectMap, "updatedBy", w.UpdatedBy) - populate(objectMap, "uploadStatus", w.UploadStatus) - populate(objectMap, "watchlistAlias", w.WatchlistAlias) - populate(objectMap, "watchlistId", w.WatchlistID) - populate(objectMap, "watchlistItemsCount", w.WatchlistItemsCount) - populate(objectMap, "watchlistType", w.WatchlistType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WatchlistProperties. -func (w *WatchlistProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "contentType": - err = unpopulate(val, &w.ContentType) - delete(rawMsg, key) - case "created": - err = unpopulateTimeRFC3339(val, &w.Created) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &w.CreatedBy) - delete(rawMsg, key) - case "defaultDuration": - err = unpopulate(val, &w.DefaultDuration) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &w.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, &w.DisplayName) - delete(rawMsg, key) - case "isDeleted": - err = unpopulate(val, &w.IsDeleted) - delete(rawMsg, key) - case "itemsSearchKey": - err = unpopulate(val, &w.ItemsSearchKey) - delete(rawMsg, key) - case "labels": - err = unpopulate(val, &w.Labels) - delete(rawMsg, key) - case "numberOfLinesToSkip": - err = unpopulate(val, &w.NumberOfLinesToSkip) - delete(rawMsg, key) - case "provider": - err = unpopulate(val, &w.Provider) - delete(rawMsg, key) - case "rawContent": - err = unpopulate(val, &w.RawContent) - delete(rawMsg, key) - case "source": - err = unpopulate(val, &w.Source) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, &w.TenantID) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, &w.Updated) - delete(rawMsg, key) - case "updatedBy": - err = unpopulate(val, &w.UpdatedBy) - delete(rawMsg, key) - case "uploadStatus": - err = unpopulate(val, &w.UploadStatus) - delete(rawMsg, key) - case "watchlistAlias": - err = unpopulate(val, &w.WatchlistAlias) - delete(rawMsg, key) - case "watchlistId": - err = unpopulate(val, &w.WatchlistID) - delete(rawMsg, key) - case "watchlistItemsCount": - err = unpopulate(val, &w.WatchlistItemsCount) - delete(rawMsg, key) - case "watchlistType": - err = unpopulate(val, &w.WatchlistType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // WatchlistsClientCreateOrUpdateOptions contains the optional parameters for the WatchlistsClient.CreateOrUpdate method. type WatchlistsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -16265,22 +7504,23 @@ type WatchlistsClientGetOptions struct { // WatchlistsClientListOptions contains the optional parameters for the WatchlistsClient.List method. type WatchlistsClientListOptions struct { - // placeholder for future optional parameters + // Skiptoken is only used if a previous operation returned a partial result. If a previous response contains a nextLink element, + // the value of the nextLink element will include a skiptoken parameter that + // specifies a starting point to use for subsequent calls. Optional. + SkipToken *string } -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} +// Webhook - Detail about the webhook object. +type Webhook struct { + // A flag to instruct the backend service to rotate webhook secret. + RotateWebhookSecret *bool `json:"rotateWebhookSecret,omitempty"` + + // Unique identifier for the webhook. + WebhookID *string `json:"webhookId,omitempty"` + + // Time when the webhook secret was updated. + WebhookSecretUpdateTime *string `json:"webhookSecretUpdateTime,omitempty"` -func unpopulate(data json.RawMessage, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) + // URL that gets invoked by the webhook. + WebhookURL *string `json:"webhookUrl,omitempty"` } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models_serde.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models_serde.go new file mode 100644 index 000000000000..688a679630b9 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models_serde.go @@ -0,0 +1,8937 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsecurityinsights + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AADCheckRequirements. +func (a *AADCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AADCheckRequirements. +func (a AADCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindAzureActiveDirectory + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AADCheckRequirements. +func (a *AADCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type AADDataConnector. +func (a *AADDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AADDataConnector. +func (a AADDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = DataConnectorKindAzureActiveDirectory + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AADDataConnector. +func (a *AADDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AATPCheckRequirements. +func (a *AATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AATPCheckRequirements. +func (a AATPCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindAzureAdvancedThreatProtection + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AATPCheckRequirements. +func (a *AATPCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type AATPDataConnector. +func (a *AATPDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AATPDataConnector. +func (a AATPDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = DataConnectorKindAzureAdvancedThreatProtection + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AATPDataConnector. +func (a *AATPDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type ASCCheckRequirements. +func (a *ASCCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ASCCheckRequirements. +func (a ASCCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindAzureSecurityCenter + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ASCCheckRequirements. +func (a *ASCCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type ASCDataConnector. +func (a *ASCDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ASCDataConnector. +func (a ASCDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = DataConnectorKindAzureSecurityCenter + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ASCDataConnector. +func (a *ASCDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type AccountEntity. +func (a *AccountEntity) GetEntity() *Entity { + return &Entity{ + Kind: a.Kind, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AccountEntity. +func (a AccountEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + objectMap["kind"] = EntityKindAccount + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccountEntity. +func (a *AccountEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccountEntityProperties. +func (a AccountEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aadTenantId", a.AADTenantID) + populate(objectMap, "aadUserId", a.AADUserID) + populate(objectMap, "accountName", a.AccountName) + populate(objectMap, "additionalData", a.AdditionalData) + populate(objectMap, "dnsDomain", a.DNSDomain) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "hostEntityId", a.HostEntityID) + populate(objectMap, "isDomainJoined", a.IsDomainJoined) + populate(objectMap, "ntDomain", a.NtDomain) + populate(objectMap, "objectGuid", a.ObjectGUID) + populate(objectMap, "puid", a.Puid) + populate(objectMap, "sid", a.Sid) + populate(objectMap, "upnSuffix", a.UpnSuffix) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ActionsList. +func (a ActionsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// GetCustomEntityQuery implements the CustomEntityQueryClassification interface for type ActivityCustomEntityQuery. +func (a *ActivityCustomEntityQuery) GetCustomEntityQuery() *CustomEntityQuery { + return &CustomEntityQuery{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ActivityCustomEntityQuery. +func (a ActivityCustomEntityQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = CustomEntityQueryKindActivity + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityCustomEntityQuery. +func (a *ActivityCustomEntityQuery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueriesProperties. +func (a ActivityEntityQueriesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "content", a.Content) + populateTimeRFC3339(objectMap, "createdTimeUtc", a.CreatedTimeUTC) + populate(objectMap, "description", a.Description) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "entitiesFilter", a.EntitiesFilter) + populate(objectMap, "inputEntityType", a.InputEntityType) + populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", a.LastModifiedTimeUTC) + populate(objectMap, "queryDefinitions", a.QueryDefinitions) + populate(objectMap, "requiredInputFieldsSets", a.RequiredInputFieldsSets) + populate(objectMap, "templateName", a.TemplateName) + populate(objectMap, "title", a.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityEntityQueriesProperties. +func (a *ActivityEntityQueriesProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "content": + err = unpopulate(val, &a.Content) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, &a.CreatedTimeUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &a.Description) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &a.Enabled) + delete(rawMsg, key) + case "entitiesFilter": + err = unpopulate(val, &a.EntitiesFilter) + delete(rawMsg, key) + case "inputEntityType": + err = unpopulate(val, &a.InputEntityType) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, &a.LastModifiedTimeUTC) + delete(rawMsg, key) + case "queryDefinitions": + err = unpopulate(val, &a.QueryDefinitions) + delete(rawMsg, key) + case "requiredInputFieldsSets": + err = unpopulate(val, &a.RequiredInputFieldsSets) + delete(rawMsg, key) + case "templateName": + err = unpopulate(val, &a.TemplateName) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &a.Title) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntityQuery implements the EntityQueryClassification interface for type ActivityEntityQuery. +func (a *ActivityEntityQuery) GetEntityQuery() *EntityQuery { + return &EntityQuery{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQuery. +func (a ActivityEntityQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = EntityQueryKindActivity + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityEntityQuery. +func (a *ActivityEntityQuery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntityQueryTemplate implements the EntityQueryTemplateClassification interface for type ActivityEntityQueryTemplate. +func (a *ActivityEntityQueryTemplate) GetEntityQueryTemplate() *EntityQueryTemplate { + return &EntityQueryTemplate{ + Kind: a.Kind, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueryTemplate. +func (a ActivityEntityQueryTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + objectMap["kind"] = EntityQueryTemplateKindActivity + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityEntityQueryTemplate. +func (a *ActivityEntityQueryTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueryTemplateProperties. +func (a ActivityEntityQueryTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "content", a.Content) + populate(objectMap, "dataTypes", a.DataTypes) + populate(objectMap, "description", a.Description) + populate(objectMap, "entitiesFilter", a.EntitiesFilter) + populate(objectMap, "inputEntityType", a.InputEntityType) + populate(objectMap, "queryDefinitions", a.QueryDefinitions) + populate(objectMap, "requiredInputFieldsSets", a.RequiredInputFieldsSets) + populate(objectMap, "title", a.Title) + return json.Marshal(objectMap) +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type ActivityTimelineItem. +func (a *ActivityTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { + return &EntityTimelineItem{ + Kind: a.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ActivityTimelineItem. +func (a ActivityTimelineItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "bucketEndTimeUTC", a.BucketEndTimeUTC) + populateTimeRFC3339(objectMap, "bucketStartTimeUTC", a.BucketStartTimeUTC) + populate(objectMap, "content", a.Content) + populateTimeRFC3339(objectMap, "firstActivityTimeUTC", a.FirstActivityTimeUTC) + objectMap["kind"] = EntityTimelineKindActivity + populateTimeRFC3339(objectMap, "lastActivityTimeUTC", a.LastActivityTimeUTC) + populate(objectMap, "queryId", a.QueryID) + populate(objectMap, "title", a.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ActivityTimelineItem. +func (a *ActivityTimelineItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "bucketEndTimeUTC": + err = unpopulateTimeRFC3339(val, &a.BucketEndTimeUTC) + delete(rawMsg, key) + case "bucketStartTimeUTC": + err = unpopulateTimeRFC3339(val, &a.BucketStartTimeUTC) + delete(rawMsg, key) + case "content": + err = unpopulate(val, &a.Content) + delete(rawMsg, key) + case "firstActivityTimeUTC": + err = unpopulateTimeRFC3339(val, &a.FirstActivityTimeUTC) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "lastActivityTimeUTC": + err = unpopulateTimeRFC3339(val, &a.LastActivityTimeUTC) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, &a.QueryID) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &a.Title) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRule implements the AlertRuleClassification interface for type AlertRule. +func (a *AlertRule) GetAlertRule() *AlertRule { return a } + +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type AlertRuleTemplate. +func (a *AlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { return a } + +// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplateDataSource. +func (a AlertRuleTemplateDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connectorId", a.ConnectorID) + populate(objectMap, "dataTypes", a.DataTypes) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplatePropertiesBase. +func (a AlertRuleTemplatePropertiesBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRulesCreatedByTemplateCount", a.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", a.CreatedDateUTC) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", a.LastUpdatedDateUTC) + populate(objectMap, "requiredDataConnectors", a.RequiredDataConnectors) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplatePropertiesBase. +func (a *AlertRuleTemplatePropertiesBase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &a.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &a.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &a.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &a.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &a.RequiredDataConnectors) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &a.Status) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplateWithMitreProperties. +func (a AlertRuleTemplateWithMitreProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRulesCreatedByTemplateCount", a.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", a.CreatedDateUTC) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", a.LastUpdatedDateUTC) + populate(objectMap, "requiredDataConnectors", a.RequiredDataConnectors) + populate(objectMap, "status", a.Status) + populate(objectMap, "tactics", a.Tactics) + populate(objectMap, "techniques", a.Techniques) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplateWithMitreProperties. +func (a *AlertRuleTemplateWithMitreProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &a.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &a.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &a.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &a.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &a.RequiredDataConnectors) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &a.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &a.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &a.Techniques) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplatesList. +func (a AlertRuleTemplatesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplatesList. +func (a *AlertRuleTemplatesList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &a.NextLink) + delete(rawMsg, key) + case "value": + a.Value, err = unmarshalAlertRuleTemplateClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AlertRulesList. +func (a AlertRulesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulesList. +func (a *AlertRulesList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &a.NextLink) + delete(rawMsg, key) + case "value": + a.Value, err = unmarshalAlertRuleClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetSettings implements the SettingsClassification interface for type Anomalies. +func (a *Anomalies) GetSettings() *Settings { + return &Settings{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type Anomalies. +func (a Anomalies) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = SettingKindAnomalies + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Anomalies. +func (a *Anomalies) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleAction. +func (a *AutomationRuleAction) GetAutomationRuleAction() *AutomationRuleAction { return a } + +// GetAutomationRuleCondition implements the AutomationRuleConditionClassification interface for type AutomationRuleCondition. +func (a *AutomationRuleCondition) GetAutomationRuleCondition() *AutomationRuleCondition { return a } + +// GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleModifyPropertiesAction. +func (a *AutomationRuleModifyPropertiesAction) GetAutomationRuleAction() *AutomationRuleAction { + return &AutomationRuleAction{ + Order: a.Order, + ActionType: a.ActionType, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleModifyPropertiesAction. +func (a AutomationRuleModifyPropertiesAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionConfiguration", a.ActionConfiguration) + objectMap["actionType"] = ActionTypeModifyProperties + populate(objectMap, "order", a.Order) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleModifyPropertiesAction. +func (a *AutomationRuleModifyPropertiesAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "actionConfiguration": + err = unpopulate(val, &a.ActionConfiguration) + delete(rawMsg, key) + case "actionType": + err = unpopulate(val, &a.ActionType) + delete(rawMsg, key) + case "order": + err = unpopulate(val, &a.Order) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleProperties. +func (a AutomationRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actions", a.Actions) + populate(objectMap, "createdBy", a.CreatedBy) + populateTimeRFC3339(objectMap, "createdTimeUtc", a.CreatedTimeUTC) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "lastModifiedBy", a.LastModifiedBy) + populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", a.LastModifiedTimeUTC) + populate(objectMap, "order", a.Order) + populate(objectMap, "triggeringLogic", a.TriggeringLogic) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleProperties. +func (a *AutomationRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "actions": + a.Actions, err = unmarshalAutomationRuleActionClassificationArray(val) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &a.CreatedBy) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, &a.CreatedTimeUTC) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &a.DisplayName) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &a.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, &a.LastModifiedTimeUTC) + delete(rawMsg, key) + case "order": + err = unpopulate(val, &a.Order) + delete(rawMsg, key) + case "triggeringLogic": + err = unpopulate(val, &a.TriggeringLogic) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutomationRulePropertyValuesCondition. +func (a AutomationRulePropertyValuesCondition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operator", a.Operator) + populate(objectMap, "propertyName", a.PropertyName) + populate(objectMap, "propertyValues", a.PropertyValues) + return json.Marshal(objectMap) +} + +// GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleRunPlaybookAction. +func (a *AutomationRuleRunPlaybookAction) GetAutomationRuleAction() *AutomationRuleAction { + return &AutomationRuleAction{ + Order: a.Order, + ActionType: a.ActionType, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleRunPlaybookAction. +func (a AutomationRuleRunPlaybookAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actionConfiguration", a.ActionConfiguration) + objectMap["actionType"] = ActionTypeRunPlaybook + populate(objectMap, "order", a.Order) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleRunPlaybookAction. +func (a *AutomationRuleRunPlaybookAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "actionConfiguration": + err = unpopulate(val, &a.ActionConfiguration) + delete(rawMsg, key) + case "actionType": + err = unpopulate(val, &a.ActionType) + delete(rawMsg, key) + case "order": + err = unpopulate(val, &a.Order) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleTriggeringLogic. +func (a AutomationRuleTriggeringLogic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "conditions", a.Conditions) + populateTimeRFC3339(objectMap, "expirationTimeUtc", a.ExpirationTimeUTC) + populate(objectMap, "isEnabled", a.IsEnabled) + populate(objectMap, "triggersOn", a.TriggersOn) + populate(objectMap, "triggersWhen", a.TriggersWhen) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleTriggeringLogic. +func (a *AutomationRuleTriggeringLogic) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "conditions": + a.Conditions, err = unmarshalAutomationRuleConditionClassificationArray(val) + delete(rawMsg, key) + case "expirationTimeUtc": + err = unpopulateTimeRFC3339(val, &a.ExpirationTimeUTC) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, &a.IsEnabled) + delete(rawMsg, key) + case "triggersOn": + err = unpopulate(val, &a.TriggersOn) + delete(rawMsg, key) + case "triggersWhen": + err = unpopulate(val, &a.TriggersWhen) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutomationRulesList. +func (a AutomationRulesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AwsCloudTrailCheckRequirements. +func (a *AwsCloudTrailCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AwsCloudTrailCheckRequirements. +func (a AwsCloudTrailCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindAmazonWebServicesCloudTrail + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCloudTrailCheckRequirements. +func (a *AwsCloudTrailCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type AwsCloudTrailDataConnector. +func (a *AwsCloudTrailDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AwsCloudTrailDataConnector. +func (a AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = DataConnectorKindAmazonWebServicesCloudTrail + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCloudTrailDataConnector. +func (a *AwsCloudTrailDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AwsS3CheckRequirements. +func (a *AwsS3CheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AwsS3CheckRequirements. +func (a AwsS3CheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindAmazonWebServicesS3 + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsS3CheckRequirements. +func (a *AwsS3CheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type AwsS3DataConnector. +func (a *AwsS3DataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AwsS3DataConnector. +func (a AwsS3DataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) + populate(objectMap, "id", a.ID) + objectMap["kind"] = DataConnectorKindAmazonWebServicesS3 + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsS3DataConnector. +func (a *AwsS3DataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &a.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AwsS3DataConnectorProperties. +func (a AwsS3DataConnectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataTypes", a.DataTypes) + populate(objectMap, "destinationTable", a.DestinationTable) + populate(objectMap, "roleArn", a.RoleArn) + populate(objectMap, "sqsUrls", a.SqsUrls) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type AzureResourceEntity. +func (a *AzureResourceEntity) GetEntity() *Entity { + return &Entity{ + Kind: a.Kind, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type AzureResourceEntity. +func (a AzureResourceEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + objectMap["kind"] = EntityKindAzureResource + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceEntity. +func (a *AzureResourceEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureResourceEntityProperties. +func (a AzureResourceEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", a.AdditionalData) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "resourceId", a.ResourceID) + populate(objectMap, "subscriptionId", a.SubscriptionID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type BookmarkEntityMappings. +func (b BookmarkEntityMappings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "entityType", b.EntityType) + populate(objectMap, "fieldMappings", b.FieldMappings) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type BookmarkExpandParameters. +func (b BookmarkExpandParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", b.EndTime) + populate(objectMap, "expansionId", b.ExpansionID) + populateTimeRFC3339(objectMap, "startTime", b.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkExpandParameters. +func (b *BookmarkExpandParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &b.EndTime) + delete(rawMsg, key) + case "expansionId": + err = unpopulate(val, &b.ExpansionID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &b.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BookmarkExpandResponseValue. +func (b BookmarkExpandResponseValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "edges", b.Edges) + populate(objectMap, "entities", b.Entities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkExpandResponseValue. +func (b *BookmarkExpandResponseValue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "edges": + err = unpopulate(val, &b.Edges) + delete(rawMsg, key) + case "entities": + b.Entities, err = unmarshalEntityClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BookmarkList. +func (b BookmarkList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type BookmarkProperties. +func (b BookmarkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "created", b.Created) + populate(objectMap, "createdBy", b.CreatedBy) + populate(objectMap, "displayName", b.DisplayName) + populate(objectMap, "entityMappings", b.EntityMappings) + populateTimeRFC3339(objectMap, "eventTime", b.EventTime) + populate(objectMap, "incidentInfo", b.IncidentInfo) + populate(objectMap, "labels", b.Labels) + populate(objectMap, "notes", b.Notes) + populate(objectMap, "query", b.Query) + populateTimeRFC3339(objectMap, "queryEndTime", b.QueryEndTime) + populate(objectMap, "queryResult", b.QueryResult) + populateTimeRFC3339(objectMap, "queryStartTime", b.QueryStartTime) + populate(objectMap, "tactics", b.Tactics) + populate(objectMap, "techniques", b.Techniques) + populateTimeRFC3339(objectMap, "updated", b.Updated) + populate(objectMap, "updatedBy", b.UpdatedBy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkProperties. +func (b *BookmarkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "created": + err = unpopulateTimeRFC3339(val, &b.Created) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &b.CreatedBy) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &b.DisplayName) + delete(rawMsg, key) + case "entityMappings": + err = unpopulate(val, &b.EntityMappings) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, &b.EventTime) + delete(rawMsg, key) + case "incidentInfo": + err = unpopulate(val, &b.IncidentInfo) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, &b.Labels) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, &b.Notes) + delete(rawMsg, key) + case "query": + err = unpopulate(val, &b.Query) + delete(rawMsg, key) + case "queryEndTime": + err = unpopulateTimeRFC3339(val, &b.QueryEndTime) + delete(rawMsg, key) + case "queryResult": + err = unpopulate(val, &b.QueryResult) + delete(rawMsg, key) + case "queryStartTime": + err = unpopulateTimeRFC3339(val, &b.QueryStartTime) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &b.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &b.Techniques) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, &b.Updated) + delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, &b.UpdatedBy) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type BookmarkTimelineItem. +func (b *BookmarkTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { + return &EntityTimelineItem{ + Kind: b.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type BookmarkTimelineItem. +func (b BookmarkTimelineItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureResourceId", b.AzureResourceID) + populate(objectMap, "createdBy", b.CreatedBy) + populate(objectMap, "displayName", b.DisplayName) + populateTimeRFC3339(objectMap, "endTimeUtc", b.EndTimeUTC) + populateTimeRFC3339(objectMap, "eventTime", b.EventTime) + objectMap["kind"] = EntityTimelineKindBookmark + populate(objectMap, "labels", b.Labels) + populate(objectMap, "notes", b.Notes) + populateTimeRFC3339(objectMap, "startTimeUtc", b.StartTimeUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkTimelineItem. +func (b *BookmarkTimelineItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "azureResourceId": + err = unpopulate(val, &b.AzureResourceID) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &b.CreatedBy) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &b.DisplayName) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulateTimeRFC3339(val, &b.EndTimeUTC) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, &b.EventTime) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &b.Kind) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, &b.Labels) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, &b.Notes) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, &b.StartTimeUTC) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type CloudApplicationEntity. +func (c *CloudApplicationEntity) GetEntity() *Entity { + return &Entity{ + Kind: c.Kind, + ID: c.ID, + Name: c.Name, + Type: c.Type, + SystemData: c.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type CloudApplicationEntity. +func (c CloudApplicationEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + objectMap["kind"] = EntityKindCloudApplication + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudApplicationEntity. +func (c *CloudApplicationEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &c.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &c.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudApplicationEntityProperties. +func (c CloudApplicationEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", c.AdditionalData) + populate(objectMap, "appId", c.AppID) + populate(objectMap, "appName", c.AppName) + populate(objectMap, "friendlyName", c.FriendlyName) + populate(objectMap, "instanceName", c.InstanceName) + return json.Marshal(objectMap) +} + +// GetDataConnector implements the DataConnectorClassification interface for type CodelessAPIPollingDataConnector. +func (c *CodelessAPIPollingDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: c.Kind, + Etag: c.Etag, + ID: c.ID, + Name: c.Name, + Type: c.Type, + SystemData: c.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type CodelessAPIPollingDataConnector. +func (c CodelessAPIPollingDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + objectMap["kind"] = DataConnectorKindAPIPolling + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CodelessAPIPollingDataConnector. +func (c *CodelessAPIPollingDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &c.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &c.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CodelessConnectorPollingResponseProperties. +func (c CodelessConnectorPollingResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "eventsJsonPaths", c.EventsJSONPaths) + populate(objectMap, "isGzipCompressed", c.IsGzipCompressed) + populate(objectMap, "successStatusJsonPath", c.SuccessStatusJSONPath) + populate(objectMap, "successStatusValue", c.SuccessStatusValue) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CodelessUIConnectorConfigProperties. +func (c CodelessUIConnectorConfigProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "availability", c.Availability) + populate(objectMap, "connectivityCriteria", c.ConnectivityCriteria) + populate(objectMap, "customImage", c.CustomImage) + populate(objectMap, "dataTypes", c.DataTypes) + populate(objectMap, "descriptionMarkdown", c.DescriptionMarkdown) + populate(objectMap, "graphQueries", c.GraphQueries) + populate(objectMap, "graphQueriesTableName", c.GraphQueriesTableName) + populate(objectMap, "instructionSteps", c.InstructionSteps) + populate(objectMap, "permissions", c.Permissions) + populate(objectMap, "publisher", c.Publisher) + populate(objectMap, "sampleQueries", c.SampleQueries) + populate(objectMap, "title", c.Title) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem. +func (c CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", c.Type) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CodelessUIConnectorConfigPropertiesInstructionStepsItem. +func (c CodelessUIConnectorConfigPropertiesInstructionStepsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", c.Description) + populate(objectMap, "instructions", c.Instructions) + populate(objectMap, "title", c.Title) + return json.Marshal(objectMap) +} + +// GetDataConnector implements the DataConnectorClassification interface for type CodelessUIDataConnector. +func (c *CodelessUIDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: c.Kind, + Etag: c.Etag, + ID: c.ID, + Name: c.Name, + Type: c.Type, + SystemData: c.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type CodelessUIDataConnector. +func (c CodelessUIDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + objectMap["kind"] = DataConnectorKindGenericUI + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CodelessUIDataConnector. +func (c *CodelessUIDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &c.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &c.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCriteria. +func (c ConnectivityCriteria) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "type", c.Type) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// GetCustomEntityQuery implements the CustomEntityQueryClassification interface for type CustomEntityQuery. +func (c *CustomEntityQuery) GetCustomEntityQuery() *CustomEntityQuery { return c } + +// GetEntity implements the EntityClassification interface for type DNSEntity. +func (d *DNSEntity) GetEntity() *Entity { + return &Entity{ + Kind: d.Kind, + ID: d.ID, + Name: d.Name, + Type: d.Type, + SystemData: d.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type DNSEntity. +func (d DNSEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", d.ID) + objectMap["kind"] = EntityKindDNSResolution + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DNSEntity. +func (d *DNSEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &d.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &d.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DNSEntityProperties. +func (d DNSEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", d.AdditionalData) + populate(objectMap, "dnsServerIpEntityId", d.DNSServerIPEntityID) + populate(objectMap, "domainName", d.DomainName) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "hostIpAddressEntityId", d.HostIPAddressEntityID) + populate(objectMap, "ipAddressEntityIds", d.IPAddressEntityIDs) + return json.Marshal(objectMap) +} + +// GetDataConnector implements the DataConnectorClassification interface for type DataConnector. +func (d *DataConnector) GetDataConnector() *DataConnector { return d } + +// MarshalJSON implements the json.Marshaller interface for type DataConnectorConnectBody. +func (d DataConnectorConnectBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apiKey", d.APIKey) + populate(objectMap, "authorizationCode", d.AuthorizationCode) + populate(objectMap, "clientId", d.ClientID) + populate(objectMap, "clientSecret", d.ClientSecret) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "password", d.Password) + populate(objectMap, "requestConfigUserInputValues", d.RequestConfigUserInputValues) + populate(objectMap, "userName", d.UserName) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DataConnectorList. +func (d DataConnectorList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectorList. +func (d *DataConnectorList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &d.NextLink) + delete(rawMsg, key) + case "value": + d.Value, err = unmarshalDataConnectorClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type DataConnectorsCheckRequirements. +func (d *DataConnectorsCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return d +} + +// MarshalJSON implements the json.Marshaller interface for type Deployment. +func (d Deployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "deploymentId", d.DeploymentID) + populate(objectMap, "deploymentLogsUrl", d.DeploymentLogsURL) + populate(objectMap, "deploymentResult", d.DeploymentResult) + populate(objectMap, "deploymentState", d.DeploymentState) + populateTimeRFC3339(objectMap, "deploymentTime", d.DeploymentTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Deployment. +func (d *Deployment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentId": + err = unpopulate(val, &d.DeploymentID) + delete(rawMsg, key) + case "deploymentLogsUrl": + err = unpopulate(val, &d.DeploymentLogsURL) + delete(rawMsg, key) + case "deploymentResult": + err = unpopulate(val, &d.DeploymentResult) + delete(rawMsg, key) + case "deploymentState": + err = unpopulate(val, &d.DeploymentState) + delete(rawMsg, key) + case "deploymentTime": + err = unpopulateTimeRFC3339(val, &d.DeploymentTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type Dynamics365CheckRequirements. +func (d *Dynamics365CheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: d.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type Dynamics365CheckRequirements. +func (d Dynamics365CheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindDynamics365 + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Dynamics365CheckRequirements. +func (d *Dynamics365CheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &d.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type Dynamics365DataConnector. +func (d *Dynamics365DataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: d.Kind, + Etag: d.Etag, + ID: d.ID, + Name: d.Name, + Type: d.Type, + SystemData: d.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type Dynamics365DataConnector. +func (d Dynamics365DataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", d.Etag) + populate(objectMap, "id", d.ID) + objectMap["kind"] = DataConnectorKindDynamics365 + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Dynamics365DataConnector. +func (d *Dynamics365DataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &d.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &d.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnrichmentDomainWhois. +func (e EnrichmentDomainWhois) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "created", e.Created) + populate(objectMap, "domain", e.Domain) + populateTimeRFC3339(objectMap, "expires", e.Expires) + populate(objectMap, "parsedWhois", e.ParsedWhois) + populate(objectMap, "server", e.Server) + populateTimeRFC3339(objectMap, "updated", e.Updated) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnrichmentDomainWhois. +func (e *EnrichmentDomainWhois) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "created": + err = unpopulateTimeRFC3339(val, &e.Created) + delete(rawMsg, key) + case "domain": + err = unpopulate(val, &e.Domain) + delete(rawMsg, key) + case "expires": + err = unpopulateTimeRFC3339(val, &e.Expires) + delete(rawMsg, key) + case "parsedWhois": + err = unpopulate(val, &e.ParsedWhois) + delete(rawMsg, key) + case "server": + err = unpopulate(val, &e.Server) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, &e.Updated) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EnrichmentDomainWhoisContact. +func (e EnrichmentDomainWhoisContact) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "city", e.City) + populate(objectMap, "country", e.Country) + populate(objectMap, "email", e.Email) + populate(objectMap, "fax", e.Fax) + populate(objectMap, "name", e.Name) + populate(objectMap, "org", e.Org) + populate(objectMap, "phone", e.Phone) + populate(objectMap, "postal", e.Postal) + populate(objectMap, "state", e.State) + populate(objectMap, "street", e.Street) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EnrichmentDomainWhoisDetails. +func (e EnrichmentDomainWhoisDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contacts", e.Contacts) + populate(objectMap, "nameServers", e.NameServers) + populate(objectMap, "registrar", e.Registrar) + populate(objectMap, "statuses", e.Statuses) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type Entity. +func (e *Entity) GetEntity() *Entity { return e } + +// GetSettings implements the SettingsClassification interface for type EntityAnalytics. +func (e *EntityAnalytics) GetSettings() *Settings { + return &Settings{ + Kind: e.Kind, + Etag: e.Etag, + ID: e.ID, + Name: e.Name, + Type: e.Type, + SystemData: e.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type EntityAnalytics. +func (e EntityAnalytics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + objectMap["kind"] = SettingKindEntityAnalytics + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityAnalytics. +func (e *EntityAnalytics) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &e.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &e.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EntityAnalyticsProperties. +func (e EntityAnalyticsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "entityProviders", e.EntityProviders) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EntityCommonProperties. +func (e EntityCommonProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", e.AdditionalData) + populate(objectMap, "friendlyName", e.FriendlyName) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EntityEdges. +func (e EntityEdges) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", e.AdditionalData) + populate(objectMap, "targetEntityId", e.TargetEntityID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EntityExpandParameters. +func (e EntityExpandParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", e.EndTime) + populate(objectMap, "expansionId", e.ExpansionID) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityExpandParameters. +func (e *EntityExpandParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &e.EndTime) + delete(rawMsg, key) + case "expansionId": + err = unpopulate(val, &e.ExpansionID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EntityExpandResponseValue. +func (e EntityExpandResponseValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "edges", e.Edges) + populate(objectMap, "entities", e.Entities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityExpandResponseValue. +func (e *EntityExpandResponseValue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "edges": + err = unpopulate(val, &e.Edges) + delete(rawMsg, key) + case "entities": + e.Entities, err = unmarshalEntityClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EntityGetInsightsParameters. +func (e EntityGetInsightsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "addDefaultExtendedTimeRange", e.AddDefaultExtendedTimeRange) + populateTimeRFC3339(objectMap, "endTime", e.EndTime) + populate(objectMap, "insightQueryIds", e.InsightQueryIDs) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityGetInsightsParameters. +func (e *EntityGetInsightsParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "addDefaultExtendedTimeRange": + err = unpopulate(val, &e.AddDefaultExtendedTimeRange) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, &e.EndTime) + delete(rawMsg, key) + case "insightQueryIds": + err = unpopulate(val, &e.InsightQueryIDs) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EntityGetInsightsResponse. +func (e EntityGetInsightsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metaData", e.MetaData) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EntityInsightItem. +func (e EntityInsightItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "chartQueryResults", e.ChartQueryResults) + populate(objectMap, "queryId", e.QueryID) + populate(objectMap, "queryTimeInterval", e.QueryTimeInterval) + populate(objectMap, "tableQueryResults", e.TableQueryResults) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EntityInsightItemQueryTimeInterval. +func (e EntityInsightItemQueryTimeInterval) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", e.EndTime) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityInsightItemQueryTimeInterval. +func (e *EntityInsightItemQueryTimeInterval) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &e.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EntityList. +func (e EntityList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityList. +func (e *EntityList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &e.NextLink) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EntityMapping. +func (e EntityMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "entityType", e.EntityType) + populate(objectMap, "fieldMappings", e.FieldMappings) + return json.Marshal(objectMap) +} + +// GetEntityQuery implements the EntityQueryClassification interface for type EntityQuery. +func (e *EntityQuery) GetEntityQuery() *EntityQuery { return e } + +// GetEntityQueryItem implements the EntityQueryItemClassification interface for type EntityQueryItem. +func (e *EntityQueryItem) GetEntityQueryItem() *EntityQueryItem { return e } + +// MarshalJSON implements the json.Marshaller interface for type EntityQueryItemProperties. +func (e EntityQueryItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataTypes", e.DataTypes) + populate(objectMap, "entitiesFilter", &e.EntitiesFilter) + populate(objectMap, "inputEntityType", e.InputEntityType) + populate(objectMap, "requiredInputFieldsSets", e.RequiredInputFieldsSets) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type EntityQueryList. +func (e EntityQueryList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueryList. +func (e *EntityQueryList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &e.NextLink) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityQueryClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntityQueryTemplate implements the EntityQueryTemplateClassification interface for type EntityQueryTemplate. +func (e *EntityQueryTemplate) GetEntityQueryTemplate() *EntityQueryTemplate { return e } + +// MarshalJSON implements the json.Marshaller interface for type EntityQueryTemplateList. +func (e EntityQueryTemplateList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueryTemplateList. +func (e *EntityQueryTemplateList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &e.NextLink) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityQueryTemplateClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type EntityTimelineItem. +func (e *EntityTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { return e } + +// MarshalJSON implements the json.Marshaller interface for type EntityTimelineParameters. +func (e EntityTimelineParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", e.EndTime) + populate(objectMap, "kinds", e.Kinds) + populate(objectMap, "numberOfBucket", e.NumberOfBucket) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityTimelineParameters. +func (e *EntityTimelineParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &e.EndTime) + delete(rawMsg, key) + case "kinds": + err = unpopulate(val, &e.Kinds) + delete(rawMsg, key) + case "numberOfBucket": + err = unpopulate(val, &e.NumberOfBucket) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EntityTimelineResponse. +func (e EntityTimelineResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metaData", e.MetaData) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityTimelineResponse. +func (e *EntityTimelineResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "metaData": + err = unpopulate(val, &e.MetaData) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityTimelineItemClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpansionEntityQueriesProperties. +func (e ExpansionEntityQueriesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataSources", e.DataSources) + populate(objectMap, "displayName", e.DisplayName) + populate(objectMap, "inputEntityType", e.InputEntityType) + populate(objectMap, "inputFields", e.InputFields) + populate(objectMap, "outputEntityTypes", e.OutputEntityTypes) + populate(objectMap, "queryTemplate", e.QueryTemplate) + return json.Marshal(objectMap) +} + +// GetEntityQuery implements the EntityQueryClassification interface for type ExpansionEntityQuery. +func (e *ExpansionEntityQuery) GetEntityQuery() *EntityQuery { + return &EntityQuery{ + Kind: e.Kind, + Etag: e.Etag, + ID: e.ID, + Name: e.Name, + Type: e.Type, + SystemData: e.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ExpansionEntityQuery. +func (e ExpansionEntityQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + objectMap["kind"] = EntityQueryKindExpansion + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpansionEntityQuery. +func (e *ExpansionEntityQuery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &e.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &e.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpansionResultsMetadata. +func (e ExpansionResultsMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregations", e.Aggregations) + return json.Marshal(objectMap) +} + +// GetSettings implements the SettingsClassification interface for type EyesOn. +func (e *EyesOn) GetSettings() *Settings { + return &Settings{ + Kind: e.Kind, + Etag: e.Etag, + ID: e.ID, + Name: e.Name, + Type: e.Type, + SystemData: e.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type EyesOn. +func (e EyesOn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", e.Etag) + populate(objectMap, "id", e.ID) + objectMap["kind"] = SettingKindEyesOn + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "systemData", e.SystemData) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EyesOn. +func (e *EyesOn) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &e.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &e.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type FileEntity. +func (f *FileEntity) GetEntity() *Entity { + return &Entity{ + Kind: f.Kind, + ID: f.ID, + Name: f.Name, + Type: f.Type, + SystemData: f.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type FileEntity. +func (f FileEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + objectMap["kind"] = EntityKindFile + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileEntity. +func (f *FileEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &f.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileEntityProperties. +func (f FileEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", f.AdditionalData) + populate(objectMap, "directory", f.Directory) + populate(objectMap, "fileHashEntityIds", f.FileHashEntityIDs) + populate(objectMap, "fileName", f.FileName) + populate(objectMap, "friendlyName", f.FriendlyName) + populate(objectMap, "hostEntityId", f.HostEntityID) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type FileHashEntity. +func (f *FileHashEntity) GetEntity() *Entity { + return &Entity{ + Kind: f.Kind, + ID: f.ID, + Name: f.Name, + Type: f.Type, + SystemData: f.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type FileHashEntity. +func (f FileHashEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + objectMap["kind"] = EntityKindFileHash + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FileHashEntity. +func (f *FileHashEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &f.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FileHashEntityProperties. +func (f FileHashEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", f.AdditionalData) + populate(objectMap, "algorithm", f.Algorithm) + populate(objectMap, "friendlyName", f.FriendlyName) + populate(objectMap, "hashValue", f.HashValue) + return json.Marshal(objectMap) +} + +// GetAlertRule implements the AlertRuleClassification interface for type FusionAlertRule. +func (f *FusionAlertRule) GetAlertRule() *AlertRule { + return &AlertRule{ + Kind: f.Kind, + Etag: f.Etag, + ID: f.ID, + Name: f.Name, + Type: f.Type, + SystemData: f.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type FusionAlertRule. +func (f FusionAlertRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", f.Etag) + populate(objectMap, "id", f.ID) + objectMap["kind"] = AlertRuleKindFusion + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRule. +func (f *FusionAlertRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &f.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &f.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleProperties. +func (f FusionAlertRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRuleTemplateName", f.AlertRuleTemplateName) + populate(objectMap, "description", f.Description) + populate(objectMap, "displayName", f.DisplayName) + populate(objectMap, "enabled", f.Enabled) + populateTimeRFC3339(objectMap, "lastModifiedUtc", f.LastModifiedUTC) + populate(objectMap, "scenarioExclusionPatterns", f.ScenarioExclusionPatterns) + populate(objectMap, "severity", f.Severity) + populate(objectMap, "sourceSettings", f.SourceSettings) + populate(objectMap, "tactics", f.Tactics) + populate(objectMap, "techniques", f.Techniques) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRuleProperties. +func (f *FusionAlertRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRuleTemplateName": + err = unpopulate(val, &f.AlertRuleTemplateName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &f.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &f.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &f.Enabled) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, &f.LastModifiedUTC) + delete(rawMsg, key) + case "scenarioExclusionPatterns": + err = unpopulate(val, &f.ScenarioExclusionPatterns) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &f.Severity) + delete(rawMsg, key) + case "sourceSettings": + err = unpopulate(val, &f.SourceSettings) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &f.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &f.Techniques) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type FusionAlertRuleTemplate. +func (f *FusionAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { + return &AlertRuleTemplate{ + Kind: f.Kind, + ID: f.ID, + Name: f.Name, + Type: f.Type, + SystemData: f.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleTemplate. +func (f FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", f.ID) + objectMap["kind"] = AlertRuleKindFusion + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "systemData", f.SystemData) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRuleTemplate. +func (f *FusionAlertRuleTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &f.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleTemplateProperties. +func (f FusionAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRulesCreatedByTemplateCount", f.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", f.CreatedDateUTC) + populate(objectMap, "description", f.Description) + populate(objectMap, "displayName", f.DisplayName) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", f.LastUpdatedDateUTC) + populate(objectMap, "requiredDataConnectors", f.RequiredDataConnectors) + populate(objectMap, "severity", f.Severity) + populate(objectMap, "sourceSettings", f.SourceSettings) + populate(objectMap, "status", f.Status) + populate(objectMap, "tactics", f.Tactics) + populate(objectMap, "techniques", f.Techniques) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRuleTemplateProperties. +func (f *FusionAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &f.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &f.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &f.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &f.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &f.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &f.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &f.Severity) + delete(rawMsg, key) + case "sourceSettings": + err = unpopulate(val, &f.SourceSettings) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &f.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &f.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &f.Techniques) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FusionSourceSettings. +func (f FusionSourceSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", f.Enabled) + populate(objectMap, "sourceName", f.SourceName) + populate(objectMap, "sourceSubTypes", f.SourceSubTypes) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type FusionSubTypeSeverityFilter. +func (f FusionSubTypeSeverityFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filters", f.Filters) + populate(objectMap, "isSupported", f.IsSupported) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type FusionTemplateSourceSetting. +func (f FusionTemplateSourceSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sourceName", f.SourceName) + populate(objectMap, "sourceSubTypes", f.SourceSubTypes) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type FusionTemplateSubTypeSeverityFilter. +func (f FusionTemplateSubTypeSeverityFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "isSupported", f.IsSupported) + populate(objectMap, "severityFilters", f.SeverityFilters) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GetInsightsResultsMetadata. +func (g GetInsightsResultsMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errors", g.Errors) + populate(objectMap, "totalCount", g.TotalCount) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GetQueriesResponse. +func (g GetQueriesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetQueriesResponse. +func (g *GetQueriesResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + g.Value, err = unmarshalEntityQueryItemClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupingConfiguration. +func (g GroupingConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "enabled", g.Enabled) + populate(objectMap, "groupByAlertDetails", g.GroupByAlertDetails) + populate(objectMap, "groupByCustomDetails", g.GroupByCustomDetails) + populate(objectMap, "groupByEntities", g.GroupByEntities) + populate(objectMap, "lookbackDuration", g.LookbackDuration) + populate(objectMap, "matchingMethod", g.MatchingMethod) + populate(objectMap, "reopenClosedIncident", g.ReopenClosedIncident) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type HostEntity. +func (h *HostEntity) GetEntity() *Entity { + return &Entity{ + Kind: h.Kind, + ID: h.ID, + Name: h.Name, + Type: h.Type, + SystemData: h.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type HostEntity. +func (h HostEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", h.ID) + objectMap["kind"] = EntityKindHost + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "systemData", h.SystemData) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostEntity. +func (h *HostEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &h.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &h.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &h.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &h.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &h.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostEntityProperties. +func (h HostEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", h.AdditionalData) + populate(objectMap, "azureID", h.AzureID) + populate(objectMap, "dnsDomain", h.DNSDomain) + populate(objectMap, "friendlyName", h.FriendlyName) + populate(objectMap, "hostName", h.HostName) + populate(objectMap, "isDomainJoined", h.IsDomainJoined) + populate(objectMap, "netBiosName", h.NetBiosName) + populate(objectMap, "ntDomain", h.NtDomain) + populate(objectMap, "osFamily", h.OSFamily) + populate(objectMap, "osVersion", h.OSVersion) + populate(objectMap, "omsAgentID", h.OmsAgentID) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type HuntingBookmark. +func (h *HuntingBookmark) GetEntity() *Entity { + return &Entity{ + Kind: h.Kind, + ID: h.ID, + Name: h.Name, + Type: h.Type, + SystemData: h.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type HuntingBookmark. +func (h HuntingBookmark) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", h.ID) + objectMap["kind"] = EntityKindBookmark + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "systemData", h.SystemData) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HuntingBookmark. +func (h *HuntingBookmark) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &h.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &h.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &h.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &h.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &h.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HuntingBookmarkProperties. +func (h HuntingBookmarkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", h.AdditionalData) + populateTimeRFC3339(objectMap, "created", h.Created) + populate(objectMap, "createdBy", h.CreatedBy) + populate(objectMap, "displayName", h.DisplayName) + populateTimeRFC3339(objectMap, "eventTime", h.EventTime) + populate(objectMap, "friendlyName", h.FriendlyName) + populate(objectMap, "incidentInfo", h.IncidentInfo) + populate(objectMap, "labels", h.Labels) + populate(objectMap, "notes", h.Notes) + populate(objectMap, "query", h.Query) + populate(objectMap, "queryResult", h.QueryResult) + populateTimeRFC3339(objectMap, "updated", h.Updated) + populate(objectMap, "updatedBy", h.UpdatedBy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HuntingBookmarkProperties. +func (h *HuntingBookmarkProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, &h.AdditionalData) + delete(rawMsg, key) + case "created": + err = unpopulateTimeRFC3339(val, &h.Created) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &h.CreatedBy) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &h.DisplayName) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, &h.EventTime) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &h.FriendlyName) + delete(rawMsg, key) + case "incidentInfo": + err = unpopulate(val, &h.IncidentInfo) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, &h.Labels) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, &h.Notes) + delete(rawMsg, key) + case "query": + err = unpopulate(val, &h.Query) + delete(rawMsg, key) + case "queryResult": + err = unpopulate(val, &h.QueryResult) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, &h.Updated) + delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, &h.UpdatedBy) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type IPEntity. +func (i *IPEntity) GetEntity() *Entity { + return &Entity{ + Kind: i.Kind, + ID: i.ID, + Name: i.Name, + Type: i.Type, + SystemData: i.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type IPEntity. +func (i IPEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + objectMap["kind"] = EntityKindIP + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPEntity. +func (i *IPEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &i.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPEntityProperties. +func (i IPEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", i.AdditionalData) + populate(objectMap, "address", i.Address) + populate(objectMap, "friendlyName", i.FriendlyName) + populate(objectMap, "location", i.Location) + populate(objectMap, "threatIntelligence", i.ThreatIntelligence) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentAdditionalData. +func (i IncidentAdditionalData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertProductNames", i.AlertProductNames) + populate(objectMap, "alertsCount", i.AlertsCount) + populate(objectMap, "bookmarksCount", i.BookmarksCount) + populate(objectMap, "commentsCount", i.CommentsCount) + populate(objectMap, "providerIncidentUrl", i.ProviderIncidentURL) + populate(objectMap, "tactics", i.Tactics) + populate(objectMap, "techniques", i.Techniques) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentAlertList. +func (i IncidentAlertList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentBookmarkList. +func (i IncidentBookmarkList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentCommentList. +func (i IncidentCommentList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentCommentProperties. +func (i IncidentCommentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", i.Author) + populateTimeRFC3339(objectMap, "createdTimeUtc", i.CreatedTimeUTC) + populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", i.LastModifiedTimeUTC) + populate(objectMap, "message", i.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IncidentCommentProperties. +func (i *IncidentCommentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, &i.Author) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, &i.CreatedTimeUTC) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, &i.LastModifiedTimeUTC) + delete(rawMsg, key) + case "message": + err = unpopulate(val, &i.Message) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentEntitiesResponse. +func (i IncidentEntitiesResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "entities", i.Entities) + populate(objectMap, "metaData", i.MetaData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IncidentEntitiesResponse. +func (i *IncidentEntitiesResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "entities": + i.Entities, err = unmarshalEntityClassificationArray(val) + delete(rawMsg, key) + case "metaData": + err = unpopulate(val, &i.MetaData) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentList. +func (i IncidentList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentProperties. +func (i IncidentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", i.AdditionalData) + populate(objectMap, "classification", i.Classification) + populate(objectMap, "classificationComment", i.ClassificationComment) + populate(objectMap, "classificationReason", i.ClassificationReason) + populateTimeRFC3339(objectMap, "createdTimeUtc", i.CreatedTimeUTC) + populate(objectMap, "description", i.Description) + populateTimeRFC3339(objectMap, "firstActivityTimeUtc", i.FirstActivityTimeUTC) + populate(objectMap, "incidentNumber", i.IncidentNumber) + populate(objectMap, "incidentUrl", i.IncidentURL) + populate(objectMap, "labels", i.Labels) + populateTimeRFC3339(objectMap, "lastActivityTimeUtc", i.LastActivityTimeUTC) + populateTimeRFC3339(objectMap, "lastModifiedTimeUtc", i.LastModifiedTimeUTC) + populate(objectMap, "owner", i.Owner) + populate(objectMap, "providerIncidentId", i.ProviderIncidentID) + populate(objectMap, "providerName", i.ProviderName) + populate(objectMap, "relatedAnalyticRuleIds", i.RelatedAnalyticRuleIDs) + populate(objectMap, "severity", i.Severity) + populate(objectMap, "status", i.Status) + populate(objectMap, "teamInformation", i.TeamInformation) + populate(objectMap, "title", i.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IncidentProperties. +func (i *IncidentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, &i.AdditionalData) + delete(rawMsg, key) + case "classification": + err = unpopulate(val, &i.Classification) + delete(rawMsg, key) + case "classificationComment": + err = unpopulate(val, &i.ClassificationComment) + delete(rawMsg, key) + case "classificationReason": + err = unpopulate(val, &i.ClassificationReason) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, &i.CreatedTimeUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &i.Description) + delete(rawMsg, key) + case "firstActivityTimeUtc": + err = unpopulateTimeRFC3339(val, &i.FirstActivityTimeUTC) + delete(rawMsg, key) + case "incidentNumber": + err = unpopulate(val, &i.IncidentNumber) + delete(rawMsg, key) + case "incidentUrl": + err = unpopulate(val, &i.IncidentURL) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, &i.Labels) + delete(rawMsg, key) + case "lastActivityTimeUtc": + err = unpopulateTimeRFC3339(val, &i.LastActivityTimeUTC) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, &i.LastModifiedTimeUTC) + delete(rawMsg, key) + case "owner": + err = unpopulate(val, &i.Owner) + delete(rawMsg, key) + case "providerIncidentId": + err = unpopulate(val, &i.ProviderIncidentID) + delete(rawMsg, key) + case "providerName": + err = unpopulate(val, &i.ProviderName) + delete(rawMsg, key) + case "relatedAnalyticRuleIds": + err = unpopulate(val, &i.RelatedAnalyticRuleIDs) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &i.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &i.Status) + delete(rawMsg, key) + case "teamInformation": + err = unpopulate(val, &i.TeamInformation) + delete(rawMsg, key) + case "title": + err = unpopulate(val, &i.Title) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IncidentPropertiesAction. +func (i IncidentPropertiesAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "classification", i.Classification) + populate(objectMap, "classificationComment", i.ClassificationComment) + populate(objectMap, "classificationReason", i.ClassificationReason) + populate(objectMap, "labels", i.Labels) + populate(objectMap, "owner", i.Owner) + populate(objectMap, "severity", i.Severity) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// GetEntityQueryItem implements the EntityQueryItemClassification interface for type InsightQueryItem. +func (i *InsightQueryItem) GetEntityQueryItem() *EntityQueryItem { + return &EntityQueryItem{ + ID: i.ID, + Name: i.Name, + Type: i.Type, + Kind: i.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type InsightQueryItem. +func (i InsightQueryItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + objectMap["kind"] = EntityQueryKindInsight + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InsightQueryItem. +func (i *InsightQueryItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &i.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InsightQueryItemProperties. +func (i InsightQueryItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalQuery", i.AdditionalQuery) + populate(objectMap, "baseQuery", i.BaseQuery) + populate(objectMap, "chartQuery", &i.ChartQuery) + populate(objectMap, "dataTypes", i.DataTypes) + populate(objectMap, "defaultTimeRange", i.DefaultTimeRange) + populate(objectMap, "description", i.Description) + populate(objectMap, "displayName", i.DisplayName) + populate(objectMap, "entitiesFilter", &i.EntitiesFilter) + populate(objectMap, "inputEntityType", i.InputEntityType) + populate(objectMap, "referenceTimeRange", i.ReferenceTimeRange) + populate(objectMap, "requiredInputFieldsSets", i.RequiredInputFieldsSets) + populate(objectMap, "tableQuery", i.TableQuery) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InsightQueryItemPropertiesTableQuery. +func (i InsightQueryItemPropertiesTableQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columnsDefinitions", i.ColumnsDefinitions) + populate(objectMap, "queriesDefinitions", i.QueriesDefinitions) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem. +func (i InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "filter", i.Filter) + populate(objectMap, "linkColumnsDefinitions", i.LinkColumnsDefinitions) + populate(objectMap, "project", i.Project) + populate(objectMap, "summarize", i.Summarize) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InsightsTableResult. +func (i InsightsTableResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "columns", i.Columns) + populate(objectMap, "rows", i.Rows) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InstructionSteps. +func (i InstructionSteps) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", i.Description) + populate(objectMap, "instructions", i.Instructions) + populate(objectMap, "title", i.Title) + return json.Marshal(objectMap) +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type IoTCheckRequirements. +func (i *IoTCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: i.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type IoTCheckRequirements. +func (i IoTCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindIOT + populate(objectMap, "properties", i.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTCheckRequirements. +func (i *IoTCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &i.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &i.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type IoTDataConnector. +func (i *IoTDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: i.Kind, + Etag: i.Etag, + ID: i.ID, + Name: i.Name, + Type: i.Type, + SystemData: i.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type IoTDataConnector. +func (i IoTDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", i.Etag) + populate(objectMap, "id", i.ID) + objectMap["kind"] = DataConnectorKindIOT + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTDataConnector. +func (i *IoTDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &i.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &i.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type IoTDeviceEntity. +func (i *IoTDeviceEntity) GetEntity() *Entity { + return &Entity{ + Kind: i.Kind, + ID: i.ID, + Name: i.Name, + Type: i.Type, + SystemData: i.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type IoTDeviceEntity. +func (i IoTDeviceEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + objectMap["kind"] = EntityKindIoTDevice + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IoTDeviceEntity. +func (i *IoTDeviceEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &i.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IoTDeviceEntityProperties. +func (i IoTDeviceEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", i.AdditionalData) + populate(objectMap, "deviceId", i.DeviceID) + populate(objectMap, "deviceName", i.DeviceName) + populate(objectMap, "deviceType", i.DeviceType) + populate(objectMap, "edgeId", i.EdgeID) + populate(objectMap, "firmwareVersion", i.FirmwareVersion) + populate(objectMap, "friendlyName", i.FriendlyName) + populate(objectMap, "hostEntityId", i.HostEntityID) + populate(objectMap, "ipAddressEntityId", i.IPAddressEntityID) + populate(objectMap, "iotHubEntityId", i.IotHubEntityID) + populate(objectMap, "iotSecurityAgentId", i.IotSecurityAgentID) + populate(objectMap, "macAddress", i.MacAddress) + populate(objectMap, "model", i.Model) + populate(objectMap, "operatingSystem", i.OperatingSystem) + populate(objectMap, "protocols", i.Protocols) + populate(objectMap, "serialNumber", i.SerialNumber) + populate(objectMap, "source", i.Source) + populate(objectMap, "threatIntelligence", i.ThreatIntelligence) + populate(objectMap, "vendor", i.Vendor) + return json.Marshal(objectMap) +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MCASCheckRequirements. +func (m *MCASCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MCASCheckRequirements. +func (m MCASCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindMicrosoftCloudAppSecurity + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MCASCheckRequirements. +func (m *MCASCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type MCASDataConnector. +func (m *MCASDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: m.Kind, + Etag: m.Etag, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MCASDataConnector. +func (m MCASDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + objectMap["kind"] = DataConnectorKindMicrosoftCloudAppSecurity + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MCASDataConnector. +func (m *MCASDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MDATPCheckRequirements. +func (m *MDATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MDATPCheckRequirements. +func (m MDATPCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindMicrosoftDefenderAdvancedThreatProtection + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MDATPCheckRequirements. +func (m *MDATPCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type MDATPDataConnector. +func (m *MDATPDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: m.Kind, + Etag: m.Etag, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MDATPDataConnector. +func (m MDATPDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + objectMap["kind"] = DataConnectorKindMicrosoftDefenderAdvancedThreatProtection + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MDATPDataConnector. +func (m *MDATPDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRule implements the AlertRuleClassification interface for type MLBehaviorAnalyticsAlertRule. +func (m *MLBehaviorAnalyticsAlertRule) GetAlertRule() *AlertRule { + return &AlertRule{ + Kind: m.Kind, + Etag: m.Etag, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRule. +func (m MLBehaviorAnalyticsAlertRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + objectMap["kind"] = AlertRuleKindMLBehaviorAnalytics + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRule. +func (m *MLBehaviorAnalyticsAlertRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRuleProperties. +func (m MLBehaviorAnalyticsAlertRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRuleTemplateName", m.AlertRuleTemplateName) + populate(objectMap, "description", m.Description) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "enabled", m.Enabled) + populateTimeRFC3339(objectMap, "lastModifiedUtc", m.LastModifiedUTC) + populate(objectMap, "severity", m.Severity) + populate(objectMap, "tactics", m.Tactics) + populate(objectMap, "techniques", m.Techniques) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRuleProperties. +func (m *MLBehaviorAnalyticsAlertRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRuleTemplateName": + err = unpopulate(val, &m.AlertRuleTemplateName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &m.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &m.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &m.Enabled) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, &m.LastModifiedUTC) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &m.Severity) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &m.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &m.Techniques) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type MLBehaviorAnalyticsAlertRuleTemplate. +func (m *MLBehaviorAnalyticsAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { + return &AlertRuleTemplate{ + Kind: m.Kind, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRuleTemplate. +func (m MLBehaviorAnalyticsAlertRuleTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + objectMap["kind"] = AlertRuleKindMLBehaviorAnalytics + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRuleTemplate. +func (m *MLBehaviorAnalyticsAlertRuleTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MLBehaviorAnalyticsAlertRuleTemplateProperties. +func (m MLBehaviorAnalyticsAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRulesCreatedByTemplateCount", m.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", m.CreatedDateUTC) + populate(objectMap, "description", m.Description) + populate(objectMap, "displayName", m.DisplayName) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", m.LastUpdatedDateUTC) + populate(objectMap, "requiredDataConnectors", m.RequiredDataConnectors) + populate(objectMap, "severity", m.Severity) + populate(objectMap, "status", m.Status) + populate(objectMap, "tactics", m.Tactics) + populate(objectMap, "techniques", m.Techniques) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MLBehaviorAnalyticsAlertRuleTemplateProperties. +func (m *MLBehaviorAnalyticsAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &m.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &m.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &m.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &m.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &m.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &m.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &m.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &m.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &m.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &m.Techniques) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MSTICheckRequirements. +func (m *MSTICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MSTICheckRequirements. +func (m MSTICheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindMicrosoftThreatIntelligence + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSTICheckRequirements. +func (m *MSTICheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type MSTIDataConnector. +func (m *MSTIDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: m.Kind, + Etag: m.Etag, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MSTIDataConnector. +func (m MSTIDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + objectMap["kind"] = DataConnectorKindMicrosoftThreatIntelligence + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSTIDataConnector. +func (m *MSTIDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type MTPDataConnector. +func (m *MTPDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: m.Kind, + Etag: m.Etag, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MTPDataConnector. +func (m MTPDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + objectMap["kind"] = DataConnectorKindMicrosoftThreatProtection + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MTPDataConnector. +func (m *MTPDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type MailClusterEntity. +func (m *MailClusterEntity) GetEntity() *Entity { + return &Entity{ + Kind: m.Kind, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MailClusterEntity. +func (m MailClusterEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + objectMap["kind"] = EntityKindMailCluster + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MailClusterEntity. +func (m *MailClusterEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MailClusterEntityProperties. +func (m MailClusterEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", m.AdditionalData) + populate(objectMap, "clusterGroup", m.ClusterGroup) + populateTimeRFC3339(objectMap, "clusterQueryEndTime", m.ClusterQueryEndTime) + populateTimeRFC3339(objectMap, "clusterQueryStartTime", m.ClusterQueryStartTime) + populate(objectMap, "clusterSourceIdentifier", m.ClusterSourceIdentifier) + populate(objectMap, "clusterSourceType", m.ClusterSourceType) + populate(objectMap, "countByDeliveryStatus", &m.CountByDeliveryStatus) + populate(objectMap, "countByProtectionStatus", &m.CountByProtectionStatus) + populate(objectMap, "countByThreatType", &m.CountByThreatType) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "isVolumeAnomaly", m.IsVolumeAnomaly) + populate(objectMap, "mailCount", m.MailCount) + populate(objectMap, "networkMessageIds", m.NetworkMessageIDs) + populate(objectMap, "query", m.Query) + populateTimeRFC3339(objectMap, "queryTime", m.QueryTime) + populate(objectMap, "source", m.Source) + populate(objectMap, "threats", m.Threats) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MailClusterEntityProperties. +func (m *MailClusterEntityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, &m.AdditionalData) + delete(rawMsg, key) + case "clusterGroup": + err = unpopulate(val, &m.ClusterGroup) + delete(rawMsg, key) + case "clusterQueryEndTime": + err = unpopulateTimeRFC3339(val, &m.ClusterQueryEndTime) + delete(rawMsg, key) + case "clusterQueryStartTime": + err = unpopulateTimeRFC3339(val, &m.ClusterQueryStartTime) + delete(rawMsg, key) + case "clusterSourceIdentifier": + err = unpopulate(val, &m.ClusterSourceIdentifier) + delete(rawMsg, key) + case "clusterSourceType": + err = unpopulate(val, &m.ClusterSourceType) + delete(rawMsg, key) + case "countByDeliveryStatus": + err = unpopulate(val, &m.CountByDeliveryStatus) + delete(rawMsg, key) + case "countByProtectionStatus": + err = unpopulate(val, &m.CountByProtectionStatus) + delete(rawMsg, key) + case "countByThreatType": + err = unpopulate(val, &m.CountByThreatType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &m.FriendlyName) + delete(rawMsg, key) + case "isVolumeAnomaly": + err = unpopulate(val, &m.IsVolumeAnomaly) + delete(rawMsg, key) + case "mailCount": + err = unpopulate(val, &m.MailCount) + delete(rawMsg, key) + case "networkMessageIds": + err = unpopulate(val, &m.NetworkMessageIDs) + delete(rawMsg, key) + case "query": + err = unpopulate(val, &m.Query) + delete(rawMsg, key) + case "queryTime": + err = unpopulateTimeRFC3339(val, &m.QueryTime) + delete(rawMsg, key) + case "source": + err = unpopulate(val, &m.Source) + delete(rawMsg, key) + case "threats": + err = unpopulate(val, &m.Threats) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type MailMessageEntity. +func (m *MailMessageEntity) GetEntity() *Entity { + return &Entity{ + Kind: m.Kind, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MailMessageEntity. +func (m MailMessageEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + objectMap["kind"] = EntityKindMailMessage + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MailMessageEntity. +func (m *MailMessageEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MailMessageEntityProperties. +func (m MailMessageEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", m.AdditionalData) + populate(objectMap, "antispamDirection", m.AntispamDirection) + populate(objectMap, "bodyFingerprintBin1", m.BodyFingerprintBin1) + populate(objectMap, "bodyFingerprintBin2", m.BodyFingerprintBin2) + populate(objectMap, "bodyFingerprintBin3", m.BodyFingerprintBin3) + populate(objectMap, "bodyFingerprintBin4", m.BodyFingerprintBin4) + populate(objectMap, "bodyFingerprintBin5", m.BodyFingerprintBin5) + populate(objectMap, "deliveryAction", m.DeliveryAction) + populate(objectMap, "deliveryLocation", m.DeliveryLocation) + populate(objectMap, "fileEntityIds", m.FileEntityIDs) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "internetMessageId", m.InternetMessageID) + populate(objectMap, "language", m.Language) + populate(objectMap, "networkMessageId", m.NetworkMessageID) + populate(objectMap, "p1Sender", m.P1Sender) + populate(objectMap, "p1SenderDisplayName", m.P1SenderDisplayName) + populate(objectMap, "p1SenderDomain", m.P1SenderDomain) + populate(objectMap, "p2Sender", m.P2Sender) + populate(objectMap, "p2SenderDisplayName", m.P2SenderDisplayName) + populate(objectMap, "p2SenderDomain", m.P2SenderDomain) + populateTimeRFC3339(objectMap, "receiveDate", m.ReceiveDate) + populate(objectMap, "recipient", m.Recipient) + populate(objectMap, "senderIP", m.SenderIP) + populate(objectMap, "subject", m.Subject) + populate(objectMap, "threatDetectionMethods", m.ThreatDetectionMethods) + populate(objectMap, "threats", m.Threats) + populate(objectMap, "urls", m.Urls) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MailMessageEntityProperties. +func (m *MailMessageEntityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, &m.AdditionalData) + delete(rawMsg, key) + case "antispamDirection": + err = unpopulate(val, &m.AntispamDirection) + delete(rawMsg, key) + case "bodyFingerprintBin1": + err = unpopulate(val, &m.BodyFingerprintBin1) + delete(rawMsg, key) + case "bodyFingerprintBin2": + err = unpopulate(val, &m.BodyFingerprintBin2) + delete(rawMsg, key) + case "bodyFingerprintBin3": + err = unpopulate(val, &m.BodyFingerprintBin3) + delete(rawMsg, key) + case "bodyFingerprintBin4": + err = unpopulate(val, &m.BodyFingerprintBin4) + delete(rawMsg, key) + case "bodyFingerprintBin5": + err = unpopulate(val, &m.BodyFingerprintBin5) + delete(rawMsg, key) + case "deliveryAction": + err = unpopulate(val, &m.DeliveryAction) + delete(rawMsg, key) + case "deliveryLocation": + err = unpopulate(val, &m.DeliveryLocation) + delete(rawMsg, key) + case "fileEntityIds": + err = unpopulate(val, &m.FileEntityIDs) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &m.FriendlyName) + delete(rawMsg, key) + case "internetMessageId": + err = unpopulate(val, &m.InternetMessageID) + delete(rawMsg, key) + case "language": + err = unpopulate(val, &m.Language) + delete(rawMsg, key) + case "networkMessageId": + err = unpopulate(val, &m.NetworkMessageID) + delete(rawMsg, key) + case "p1Sender": + err = unpopulate(val, &m.P1Sender) + delete(rawMsg, key) + case "p1SenderDisplayName": + err = unpopulate(val, &m.P1SenderDisplayName) + delete(rawMsg, key) + case "p1SenderDomain": + err = unpopulate(val, &m.P1SenderDomain) + delete(rawMsg, key) + case "p2Sender": + err = unpopulate(val, &m.P2Sender) + delete(rawMsg, key) + case "p2SenderDisplayName": + err = unpopulate(val, &m.P2SenderDisplayName) + delete(rawMsg, key) + case "p2SenderDomain": + err = unpopulate(val, &m.P2SenderDomain) + delete(rawMsg, key) + case "receiveDate": + err = unpopulateTimeRFC3339(val, &m.ReceiveDate) + delete(rawMsg, key) + case "recipient": + err = unpopulate(val, &m.Recipient) + delete(rawMsg, key) + case "senderIP": + err = unpopulate(val, &m.SenderIP) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, &m.Subject) + delete(rawMsg, key) + case "threatDetectionMethods": + err = unpopulate(val, &m.ThreatDetectionMethods) + delete(rawMsg, key) + case "threats": + err = unpopulate(val, &m.Threats) + delete(rawMsg, key) + case "urls": + err = unpopulate(val, &m.Urls) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type MailboxEntity. +func (m *MailboxEntity) GetEntity() *Entity { + return &Entity{ + Kind: m.Kind, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MailboxEntity. +func (m MailboxEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + objectMap["kind"] = EntityKindMailbox + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MailboxEntity. +func (m *MailboxEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MailboxEntityProperties. +func (m MailboxEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", m.AdditionalData) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "externalDirectoryObjectId", m.ExternalDirectoryObjectID) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "mailboxPrimaryAddress", m.MailboxPrimaryAddress) + populate(objectMap, "upn", m.Upn) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type MalwareEntity. +func (m *MalwareEntity) GetEntity() *Entity { + return &Entity{ + Kind: m.Kind, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MalwareEntity. +func (m MalwareEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + objectMap["kind"] = EntityKindMalware + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MalwareEntity. +func (m *MalwareEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MalwareEntityProperties. +func (m MalwareEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", m.AdditionalData) + populate(objectMap, "category", m.Category) + populate(objectMap, "fileEntityIds", m.FileEntityIDs) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "malwareName", m.MalwareName) + populate(objectMap, "processEntityIds", m.ProcessEntityIDs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetadataCategories. +func (m MetadataCategories) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "domains", m.Domains) + populate(objectMap, "verticals", m.Verticals) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetadataDependencies. +func (m MetadataDependencies) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentId", m.ContentID) + populate(objectMap, "criteria", m.Criteria) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "name", m.Name) + populate(objectMap, "operator", m.Operator) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetadataList. +func (m MetadataList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetadataPatch. +func (m MetadataPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MetadataProperties. +func (m MetadataProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", m.Author) + populate(objectMap, "categories", m.Categories) + populate(objectMap, "contentId", m.ContentID) + populate(objectMap, "contentSchemaVersion", m.ContentSchemaVersion) + populate(objectMap, "customVersion", m.CustomVersion) + populate(objectMap, "dependencies", m.Dependencies) + populateDateType(objectMap, "firstPublishDate", m.FirstPublishDate) + populate(objectMap, "icon", m.Icon) + populate(objectMap, "kind", m.Kind) + populateDateType(objectMap, "lastPublishDate", m.LastPublishDate) + populate(objectMap, "parentId", m.ParentID) + populate(objectMap, "previewImages", m.PreviewImages) + populate(objectMap, "previewImagesDark", m.PreviewImagesDark) + populate(objectMap, "providers", m.Providers) + populate(objectMap, "source", m.Source) + populate(objectMap, "support", m.Support) + populate(objectMap, "threatAnalysisTactics", m.ThreatAnalysisTactics) + populate(objectMap, "threatAnalysisTechniques", m.ThreatAnalysisTechniques) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataProperties. +func (m *MetadataProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, &m.Author) + delete(rawMsg, key) + case "categories": + err = unpopulate(val, &m.Categories) + delete(rawMsg, key) + case "contentId": + err = unpopulate(val, &m.ContentID) + delete(rawMsg, key) + case "contentSchemaVersion": + err = unpopulate(val, &m.ContentSchemaVersion) + delete(rawMsg, key) + case "customVersion": + err = unpopulate(val, &m.CustomVersion) + delete(rawMsg, key) + case "dependencies": + err = unpopulate(val, &m.Dependencies) + delete(rawMsg, key) + case "firstPublishDate": + err = unpopulateDateType(val, &m.FirstPublishDate) + delete(rawMsg, key) + case "icon": + err = unpopulate(val, &m.Icon) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "lastPublishDate": + err = unpopulateDateType(val, &m.LastPublishDate) + delete(rawMsg, key) + case "parentId": + err = unpopulate(val, &m.ParentID) + delete(rawMsg, key) + case "previewImages": + err = unpopulate(val, &m.PreviewImages) + delete(rawMsg, key) + case "previewImagesDark": + err = unpopulate(val, &m.PreviewImagesDark) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, &m.Providers) + delete(rawMsg, key) + case "source": + err = unpopulate(val, &m.Source) + delete(rawMsg, key) + case "support": + err = unpopulate(val, &m.Support) + delete(rawMsg, key) + case "threatAnalysisTactics": + err = unpopulate(val, &m.ThreatAnalysisTactics) + delete(rawMsg, key) + case "threatAnalysisTechniques": + err = unpopulate(val, &m.ThreatAnalysisTechniques) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &m.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MetadataPropertiesPatch. +func (m MetadataPropertiesPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", m.Author) + populate(objectMap, "categories", m.Categories) + populate(objectMap, "contentId", m.ContentID) + populate(objectMap, "contentSchemaVersion", m.ContentSchemaVersion) + populate(objectMap, "customVersion", m.CustomVersion) + populate(objectMap, "dependencies", m.Dependencies) + populateDateType(objectMap, "firstPublishDate", m.FirstPublishDate) + populate(objectMap, "icon", m.Icon) + populate(objectMap, "kind", m.Kind) + populateDateType(objectMap, "lastPublishDate", m.LastPublishDate) + populate(objectMap, "parentId", m.ParentID) + populate(objectMap, "previewImages", m.PreviewImages) + populate(objectMap, "previewImagesDark", m.PreviewImagesDark) + populate(objectMap, "providers", m.Providers) + populate(objectMap, "source", m.Source) + populate(objectMap, "support", m.Support) + populate(objectMap, "threatAnalysisTactics", m.ThreatAnalysisTactics) + populate(objectMap, "threatAnalysisTechniques", m.ThreatAnalysisTechniques) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MetadataPropertiesPatch. +func (m *MetadataPropertiesPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, &m.Author) + delete(rawMsg, key) + case "categories": + err = unpopulate(val, &m.Categories) + delete(rawMsg, key) + case "contentId": + err = unpopulate(val, &m.ContentID) + delete(rawMsg, key) + case "contentSchemaVersion": + err = unpopulate(val, &m.ContentSchemaVersion) + delete(rawMsg, key) + case "customVersion": + err = unpopulate(val, &m.CustomVersion) + delete(rawMsg, key) + case "dependencies": + err = unpopulate(val, &m.Dependencies) + delete(rawMsg, key) + case "firstPublishDate": + err = unpopulateDateType(val, &m.FirstPublishDate) + delete(rawMsg, key) + case "icon": + err = unpopulate(val, &m.Icon) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "lastPublishDate": + err = unpopulateDateType(val, &m.LastPublishDate) + delete(rawMsg, key) + case "parentId": + err = unpopulate(val, &m.ParentID) + delete(rawMsg, key) + case "previewImages": + err = unpopulate(val, &m.PreviewImages) + delete(rawMsg, key) + case "previewImagesDark": + err = unpopulate(val, &m.PreviewImagesDark) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, &m.Providers) + delete(rawMsg, key) + case "source": + err = unpopulate(val, &m.Source) + delete(rawMsg, key) + case "support": + err = unpopulate(val, &m.Support) + delete(rawMsg, key) + case "threatAnalysisTactics": + err = unpopulate(val, &m.ThreatAnalysisTactics) + delete(rawMsg, key) + case "threatAnalysisTechniques": + err = unpopulate(val, &m.ThreatAnalysisTechniques) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &m.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRule implements the AlertRuleClassification interface for type MicrosoftSecurityIncidentCreationAlertRule. +func (m *MicrosoftSecurityIncidentCreationAlertRule) GetAlertRule() *AlertRule { + return &AlertRule{ + Kind: m.Kind, + Etag: m.Etag, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRule. +func (m MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", m.Etag) + populate(objectMap, "id", m.ID) + objectMap["kind"] = AlertRuleKindMicrosoftSecurityIncidentCreation + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRule. +func (m *MicrosoftSecurityIncidentCreationAlertRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties. +func (m MicrosoftSecurityIncidentCreationAlertRuleCommonProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayNamesExcludeFilter", m.DisplayNamesExcludeFilter) + populate(objectMap, "displayNamesFilter", m.DisplayNamesFilter) + populate(objectMap, "productFilter", m.ProductFilter) + populate(objectMap, "severitiesFilter", m.SeveritiesFilter) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleProperties. +func (m MicrosoftSecurityIncidentCreationAlertRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRuleTemplateName", m.AlertRuleTemplateName) + populate(objectMap, "description", m.Description) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "displayNamesExcludeFilter", m.DisplayNamesExcludeFilter) + populate(objectMap, "displayNamesFilter", m.DisplayNamesFilter) + populate(objectMap, "enabled", m.Enabled) + populateTimeRFC3339(objectMap, "lastModifiedUtc", m.LastModifiedUTC) + populate(objectMap, "productFilter", m.ProductFilter) + populate(objectMap, "severitiesFilter", m.SeveritiesFilter) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleProperties. +func (m *MicrosoftSecurityIncidentCreationAlertRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRuleTemplateName": + err = unpopulate(val, &m.AlertRuleTemplateName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &m.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &m.DisplayName) + delete(rawMsg, key) + case "displayNamesExcludeFilter": + err = unpopulate(val, &m.DisplayNamesExcludeFilter) + delete(rawMsg, key) + case "displayNamesFilter": + err = unpopulate(val, &m.DisplayNamesFilter) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &m.Enabled) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, &m.LastModifiedUTC) + delete(rawMsg, key) + case "productFilter": + err = unpopulate(val, &m.ProductFilter) + delete(rawMsg, key) + case "severitiesFilter": + err = unpopulate(val, &m.SeveritiesFilter) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { + return &AlertRuleTemplate{ + Kind: m.Kind, + ID: m.ID, + Name: m.Name, + Type: m.Type, + SystemData: m.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (m MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + objectMap["kind"] = AlertRuleKindMicrosoftSecurityIncidentCreation + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &m.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties. +func (m MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRulesCreatedByTemplateCount", m.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", m.CreatedDateUTC) + populate(objectMap, "description", m.Description) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "displayNamesExcludeFilter", m.DisplayNamesExcludeFilter) + populate(objectMap, "displayNamesFilter", m.DisplayNamesFilter) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", m.LastUpdatedDateUTC) + populate(objectMap, "productFilter", m.ProductFilter) + populate(objectMap, "requiredDataConnectors", m.RequiredDataConnectors) + populate(objectMap, "severitiesFilter", m.SeveritiesFilter) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties. +func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &m.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &m.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &m.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &m.DisplayName) + delete(rawMsg, key) + case "displayNamesExcludeFilter": + err = unpopulate(val, &m.DisplayNamesExcludeFilter) + delete(rawMsg, key) + case "displayNamesFilter": + err = unpopulate(val, &m.DisplayNamesFilter) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &m.LastUpdatedDateUTC) + delete(rawMsg, key) + case "productFilter": + err = unpopulate(val, &m.ProductFilter) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &m.RequiredDataConnectors) + delete(rawMsg, key) + case "severitiesFilter": + err = unpopulate(val, &m.SeveritiesFilter) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &m.Status) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MtpCheckRequirements. +func (m *MtpCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type MtpCheckRequirements. +func (m MtpCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindMicrosoftThreatProtection + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MtpCheckRequirements. +func (m *MtpCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &m.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRule implements the AlertRuleClassification interface for type NrtAlertRule. +func (n *NrtAlertRule) GetAlertRule() *AlertRule { + return &AlertRule{ + Kind: n.Kind, + Etag: n.Etag, + ID: n.ID, + Name: n.Name, + Type: n.Type, + SystemData: n.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRule. +func (n NrtAlertRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", n.Etag) + populate(objectMap, "id", n.ID) + objectMap["kind"] = AlertRuleKindNRT + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRule. +func (n *NrtAlertRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &n.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &n.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &n.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &n.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleProperties. +func (n NrtAlertRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertDetailsOverride", n.AlertDetailsOverride) + populate(objectMap, "alertRuleTemplateName", n.AlertRuleTemplateName) + populate(objectMap, "customDetails", n.CustomDetails) + populate(objectMap, "description", n.Description) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "enabled", n.Enabled) + populate(objectMap, "entityMappings", n.EntityMappings) + populate(objectMap, "incidentConfiguration", n.IncidentConfiguration) + populateTimeRFC3339(objectMap, "lastModifiedUtc", n.LastModifiedUTC) + populate(objectMap, "query", n.Query) + populate(objectMap, "severity", n.Severity) + populate(objectMap, "suppressionDuration", n.SuppressionDuration) + populate(objectMap, "suppressionEnabled", n.SuppressionEnabled) + populate(objectMap, "tactics", n.Tactics) + populate(objectMap, "techniques", n.Techniques) + populate(objectMap, "templateVersion", n.TemplateVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRuleProperties. +func (n *NrtAlertRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertDetailsOverride": + err = unpopulate(val, &n.AlertDetailsOverride) + delete(rawMsg, key) + case "alertRuleTemplateName": + err = unpopulate(val, &n.AlertRuleTemplateName) + delete(rawMsg, key) + case "customDetails": + err = unpopulate(val, &n.CustomDetails) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &n.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &n.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &n.Enabled) + delete(rawMsg, key) + case "entityMappings": + err = unpopulate(val, &n.EntityMappings) + delete(rawMsg, key) + case "incidentConfiguration": + err = unpopulate(val, &n.IncidentConfiguration) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, &n.LastModifiedUTC) + delete(rawMsg, key) + case "query": + err = unpopulate(val, &n.Query) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &n.Severity) + delete(rawMsg, key) + case "suppressionDuration": + err = unpopulate(val, &n.SuppressionDuration) + delete(rawMsg, key) + case "suppressionEnabled": + err = unpopulate(val, &n.SuppressionEnabled) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &n.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &n.Techniques) + delete(rawMsg, key) + case "templateVersion": + err = unpopulate(val, &n.TemplateVersion) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type NrtAlertRuleTemplate. +func (n *NrtAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { + return &AlertRuleTemplate{ + Kind: n.Kind, + ID: n.ID, + Name: n.Name, + Type: n.Type, + SystemData: n.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleTemplate. +func (n NrtAlertRuleTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + objectMap["kind"] = AlertRuleKindNRT + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRuleTemplate. +func (n *NrtAlertRuleTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &n.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &n.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &n.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &n.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &n.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleTemplateProperties. +func (n NrtAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertDetailsOverride", n.AlertDetailsOverride) + populate(objectMap, "alertRulesCreatedByTemplateCount", n.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", n.CreatedDateUTC) + populate(objectMap, "customDetails", n.CustomDetails) + populate(objectMap, "description", n.Description) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "entityMappings", n.EntityMappings) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", n.LastUpdatedDateUTC) + populate(objectMap, "query", n.Query) + populate(objectMap, "requiredDataConnectors", n.RequiredDataConnectors) + populate(objectMap, "severity", n.Severity) + populate(objectMap, "status", n.Status) + populate(objectMap, "tactics", n.Tactics) + populate(objectMap, "techniques", n.Techniques) + populate(objectMap, "version", n.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NrtAlertRuleTemplateProperties. +func (n *NrtAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertDetailsOverride": + err = unpopulate(val, &n.AlertDetailsOverride) + delete(rawMsg, key) + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &n.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &n.CreatedDateUTC) + delete(rawMsg, key) + case "customDetails": + err = unpopulate(val, &n.CustomDetails) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &n.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &n.DisplayName) + delete(rawMsg, key) + case "entityMappings": + err = unpopulate(val, &n.EntityMappings) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &n.LastUpdatedDateUTC) + delete(rawMsg, key) + case "query": + err = unpopulate(val, &n.Query) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &n.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &n.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &n.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &n.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &n.Techniques) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &n.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type Office365ProjectCheckRequirements. +func (o *Office365ProjectCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type Office365ProjectCheckRequirements. +func (o Office365ProjectCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindOffice365Project + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Office365ProjectCheckRequirements. +func (o *Office365ProjectCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type Office365ProjectDataConnector. +func (o *Office365ProjectDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: o.Kind, + Etag: o.Etag, + ID: o.ID, + Name: o.Name, + Type: o.Type, + SystemData: o.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type Office365ProjectDataConnector. +func (o Office365ProjectDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + objectMap["kind"] = DataConnectorKindOffice365Project + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Office365ProjectDataConnector. +func (o *Office365ProjectDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &o.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &o.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficeATPCheckRequirements. +func (o *OfficeATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type OfficeATPCheckRequirements. +func (o OfficeATPCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindOfficeATP + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeATPCheckRequirements. +func (o *OfficeATPCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type OfficeATPDataConnector. +func (o *OfficeATPDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: o.Kind, + Etag: o.Etag, + ID: o.ID, + Name: o.Name, + Type: o.Type, + SystemData: o.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type OfficeATPDataConnector. +func (o OfficeATPDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + objectMap["kind"] = DataConnectorKindOfficeATP + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeATPDataConnector. +func (o *OfficeATPDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &o.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &o.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OfficeConsentList. +func (o OfficeConsentList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// GetDataConnector implements the DataConnectorClassification interface for type OfficeDataConnector. +func (o *OfficeDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: o.Kind, + Etag: o.Etag, + ID: o.ID, + Name: o.Name, + Type: o.Type, + SystemData: o.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type OfficeDataConnector. +func (o OfficeDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + objectMap["kind"] = DataConnectorKindOffice365 + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeDataConnector. +func (o *OfficeDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &o.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &o.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficeIRMCheckRequirements. +func (o *OfficeIRMCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type OfficeIRMCheckRequirements. +func (o OfficeIRMCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindOfficeIRM + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeIRMCheckRequirements. +func (o *OfficeIRMCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type OfficeIRMDataConnector. +func (o *OfficeIRMDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: o.Kind, + Etag: o.Etag, + ID: o.ID, + Name: o.Name, + Type: o.Type, + SystemData: o.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type OfficeIRMDataConnector. +func (o OfficeIRMDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + objectMap["kind"] = DataConnectorKindOfficeIRM + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeIRMDataConnector. +func (o *OfficeIRMDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &o.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &o.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficePowerBICheckRequirements. +func (o *OfficePowerBICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type OfficePowerBICheckRequirements. +func (o OfficePowerBICheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindOfficePowerBI + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfficePowerBICheckRequirements. +func (o *OfficePowerBICheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type OfficePowerBIDataConnector. +func (o *OfficePowerBIDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: o.Kind, + Etag: o.Etag, + ID: o.ID, + Name: o.Name, + Type: o.Type, + SystemData: o.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type OfficePowerBIDataConnector. +func (o OfficePowerBIDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", o.Etag) + populate(objectMap, "id", o.ID) + objectMap["kind"] = DataConnectorKindOfficePowerBI + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "systemData", o.SystemData) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfficePowerBIDataConnector. +func (o *OfficePowerBIDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &o.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &o.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &o.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &o.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &o.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &o.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationsList. +func (o OperationsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Permissions. +func (p Permissions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customs", p.Customs) + populate(objectMap, "resourceProvider", p.ResourceProvider) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type ProcessEntity. +func (p *ProcessEntity) GetEntity() *Entity { + return &Entity{ + Kind: p.Kind, + ID: p.ID, + Name: p.Name, + Type: p.Type, + SystemData: p.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessEntity. +func (p ProcessEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + objectMap["kind"] = EntityKindProcess + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProcessEntity. +func (p *ProcessEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &p.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &p.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &p.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &p.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &p.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProcessEntityProperties. +func (p ProcessEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountEntityId", p.AccountEntityID) + populate(objectMap, "additionalData", p.AdditionalData) + populate(objectMap, "commandLine", p.CommandLine) + populateTimeRFC3339(objectMap, "creationTimeUtc", p.CreationTimeUTC) + populate(objectMap, "elevationToken", p.ElevationToken) + populate(objectMap, "friendlyName", p.FriendlyName) + populate(objectMap, "hostEntityId", p.HostEntityID) + populate(objectMap, "hostLogonSessionEntityId", p.HostLogonSessionEntityID) + populate(objectMap, "imageFileEntityId", p.ImageFileEntityID) + populate(objectMap, "parentProcessEntityId", p.ParentProcessEntityID) + populate(objectMap, "processId", p.ProcessID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProcessEntityProperties. +func (p *ProcessEntityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "accountEntityId": + err = unpopulate(val, &p.AccountEntityID) + delete(rawMsg, key) + case "additionalData": + err = unpopulate(val, &p.AdditionalData) + delete(rawMsg, key) + case "commandLine": + err = unpopulate(val, &p.CommandLine) + delete(rawMsg, key) + case "creationTimeUtc": + err = unpopulateTimeRFC3339(val, &p.CreationTimeUTC) + delete(rawMsg, key) + case "elevationToken": + err = unpopulate(val, &p.ElevationToken) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &p.FriendlyName) + delete(rawMsg, key) + case "hostEntityId": + err = unpopulate(val, &p.HostEntityID) + delete(rawMsg, key) + case "hostLogonSessionEntityId": + err = unpopulate(val, &p.HostLogonSessionEntityID) + delete(rawMsg, key) + case "imageFileEntityId": + err = unpopulate(val, &p.ImageFileEntityID) + delete(rawMsg, key) + case "parentProcessEntityId": + err = unpopulate(val, &p.ParentProcessEntityID) + delete(rawMsg, key) + case "processId": + err = unpopulate(val, &p.ProcessID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAutomationRuleCondition implements the AutomationRuleConditionClassification interface for type PropertyConditionProperties. +func (p *PropertyConditionProperties) GetAutomationRuleCondition() *AutomationRuleCondition { + return &AutomationRuleCondition{ + ConditionType: p.ConditionType, + } +} + +// MarshalJSON implements the json.Marshaller interface for type PropertyConditionProperties. +func (p PropertyConditionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "conditionProperties", p.ConditionProperties) + objectMap["conditionType"] = ConditionTypeProperty + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertyConditionProperties. +func (p *PropertyConditionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "conditionProperties": + err = unpopulate(val, &p.ConditionProperties) + delete(rawMsg, key) + case "conditionType": + err = unpopulate(val, &p.ConditionType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QueryBasedAlertRuleTemplateProperties. +func (q QueryBasedAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertDetailsOverride", q.AlertDetailsOverride) + populate(objectMap, "customDetails", q.CustomDetails) + populate(objectMap, "entityMappings", q.EntityMappings) + populate(objectMap, "query", q.Query) + populate(objectMap, "severity", q.Severity) + populate(objectMap, "version", q.Version) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type RegistryKeyEntity. +func (r *RegistryKeyEntity) GetEntity() *Entity { + return &Entity{ + Kind: r.Kind, + ID: r.ID, + Name: r.Name, + Type: r.Type, + SystemData: r.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type RegistryKeyEntity. +func (r RegistryKeyEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + objectMap["kind"] = EntityKindRegistryKey + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryKeyEntity. +func (r *RegistryKeyEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &r.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &r.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistryKeyEntityProperties. +func (r RegistryKeyEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", r.AdditionalData) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "hive", r.Hive) + populate(objectMap, "key", r.Key) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type RegistryValueEntity. +func (r *RegistryValueEntity) GetEntity() *Entity { + return &Entity{ + Kind: r.Kind, + ID: r.ID, + Name: r.Name, + Type: r.Type, + SystemData: r.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type RegistryValueEntity. +func (r RegistryValueEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + objectMap["kind"] = EntityKindRegistryValue + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "systemData", r.SystemData) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistryValueEntity. +func (r *RegistryValueEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &r.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &r.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &r.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &r.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistryValueEntityProperties. +func (r RegistryValueEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", r.AdditionalData) + populate(objectMap, "friendlyName", r.FriendlyName) + populate(objectMap, "keyEntityId", r.KeyEntityID) + populate(objectMap, "valueData", r.ValueData) + populate(objectMap, "valueName", r.ValueName) + populate(objectMap, "valueType", r.ValueType) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RelationList. +func (r RelationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Repo. +func (r Repo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "branches", r.Branches) + populate(objectMap, "fullName", r.FullName) + populate(objectMap, "url", r.URL) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RepoList. +func (r RepoList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Repository. +func (r Repository) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "branch", r.Branch) + populate(objectMap, "deploymentLogsUrl", r.DeploymentLogsURL) + populate(objectMap, "displayUrl", r.DisplayURL) + populate(objectMap, "pathMapping", r.PathMapping) + populate(objectMap, "url", r.URL) + return json.Marshal(objectMap) +} + +// GetAlertRule implements the AlertRuleClassification interface for type ScheduledAlertRule. +func (s *ScheduledAlertRule) GetAlertRule() *AlertRule { + return &AlertRule{ + Kind: s.Kind, + Etag: s.Etag, + ID: s.ID, + Name: s.Name, + Type: s.Type, + SystemData: s.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRule. +func (s ScheduledAlertRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + objectMap["kind"] = AlertRuleKindScheduled + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRule. +func (s *ScheduledAlertRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &s.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &s.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRuleCommonProperties. +func (s ScheduledAlertRuleCommonProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertDetailsOverride", s.AlertDetailsOverride) + populate(objectMap, "customDetails", s.CustomDetails) + populate(objectMap, "entityMappings", s.EntityMappings) + populate(objectMap, "eventGroupingSettings", s.EventGroupingSettings) + populate(objectMap, "query", s.Query) + populate(objectMap, "queryFrequency", s.QueryFrequency) + populate(objectMap, "queryPeriod", s.QueryPeriod) + populate(objectMap, "severity", s.Severity) + populate(objectMap, "triggerOperator", s.TriggerOperator) + populate(objectMap, "triggerThreshold", s.TriggerThreshold) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRuleProperties. +func (s ScheduledAlertRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertDetailsOverride", s.AlertDetailsOverride) + populate(objectMap, "alertRuleTemplateName", s.AlertRuleTemplateName) + populate(objectMap, "customDetails", s.CustomDetails) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "enabled", s.Enabled) + populate(objectMap, "entityMappings", s.EntityMappings) + populate(objectMap, "eventGroupingSettings", s.EventGroupingSettings) + populate(objectMap, "incidentConfiguration", s.IncidentConfiguration) + populateTimeRFC3339(objectMap, "lastModifiedUtc", s.LastModifiedUTC) + populate(objectMap, "query", s.Query) + populate(objectMap, "queryFrequency", s.QueryFrequency) + populate(objectMap, "queryPeriod", s.QueryPeriod) + populate(objectMap, "severity", s.Severity) + populate(objectMap, "suppressionDuration", s.SuppressionDuration) + populate(objectMap, "suppressionEnabled", s.SuppressionEnabled) + populate(objectMap, "tactics", s.Tactics) + populate(objectMap, "techniques", s.Techniques) + populate(objectMap, "templateVersion", s.TemplateVersion) + populate(objectMap, "triggerOperator", s.TriggerOperator) + populate(objectMap, "triggerThreshold", s.TriggerThreshold) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRuleProperties. +func (s *ScheduledAlertRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertDetailsOverride": + err = unpopulate(val, &s.AlertDetailsOverride) + delete(rawMsg, key) + case "alertRuleTemplateName": + err = unpopulate(val, &s.AlertRuleTemplateName) + delete(rawMsg, key) + case "customDetails": + err = unpopulate(val, &s.CustomDetails) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &s.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &s.Enabled) + delete(rawMsg, key) + case "entityMappings": + err = unpopulate(val, &s.EntityMappings) + delete(rawMsg, key) + case "eventGroupingSettings": + err = unpopulate(val, &s.EventGroupingSettings) + delete(rawMsg, key) + case "incidentConfiguration": + err = unpopulate(val, &s.IncidentConfiguration) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, &s.LastModifiedUTC) + delete(rawMsg, key) + case "query": + err = unpopulate(val, &s.Query) + delete(rawMsg, key) + case "queryFrequency": + err = unpopulate(val, &s.QueryFrequency) + delete(rawMsg, key) + case "queryPeriod": + err = unpopulate(val, &s.QueryPeriod) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &s.Severity) + delete(rawMsg, key) + case "suppressionDuration": + err = unpopulate(val, &s.SuppressionDuration) + delete(rawMsg, key) + case "suppressionEnabled": + err = unpopulate(val, &s.SuppressionEnabled) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &s.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &s.Techniques) + delete(rawMsg, key) + case "templateVersion": + err = unpopulate(val, &s.TemplateVersion) + delete(rawMsg, key) + case "triggerOperator": + err = unpopulate(val, &s.TriggerOperator) + delete(rawMsg, key) + case "triggerThreshold": + err = unpopulate(val, &s.TriggerThreshold) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type ScheduledAlertRuleTemplate. +func (s *ScheduledAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { + return &AlertRuleTemplate{ + Kind: s.Kind, + ID: s.ID, + Name: s.Name, + Type: s.Type, + SystemData: s.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRuleTemplate. +func (s ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + objectMap["kind"] = AlertRuleKindScheduled + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRuleTemplate. +func (s *ScheduledAlertRuleTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &s.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &s.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRuleTemplateProperties. +func (s ScheduledAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertDetailsOverride", s.AlertDetailsOverride) + populate(objectMap, "alertRulesCreatedByTemplateCount", s.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", s.CreatedDateUTC) + populate(objectMap, "customDetails", s.CustomDetails) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "entityMappings", s.EntityMappings) + populate(objectMap, "eventGroupingSettings", s.EventGroupingSettings) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", s.LastUpdatedDateUTC) + populate(objectMap, "query", s.Query) + populate(objectMap, "queryFrequency", s.QueryFrequency) + populate(objectMap, "queryPeriod", s.QueryPeriod) + populate(objectMap, "requiredDataConnectors", s.RequiredDataConnectors) + populate(objectMap, "severity", s.Severity) + populate(objectMap, "status", s.Status) + populate(objectMap, "tactics", s.Tactics) + populate(objectMap, "techniques", s.Techniques) + populate(objectMap, "triggerOperator", s.TriggerOperator) + populate(objectMap, "triggerThreshold", s.TriggerThreshold) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduledAlertRuleTemplateProperties. +func (s *ScheduledAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertDetailsOverride": + err = unpopulate(val, &s.AlertDetailsOverride) + delete(rawMsg, key) + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &s.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &s.CreatedDateUTC) + delete(rawMsg, key) + case "customDetails": + err = unpopulate(val, &s.CustomDetails) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &s.DisplayName) + delete(rawMsg, key) + case "entityMappings": + err = unpopulate(val, &s.EntityMappings) + delete(rawMsg, key) + case "eventGroupingSettings": + err = unpopulate(val, &s.EventGroupingSettings) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &s.LastUpdatedDateUTC) + delete(rawMsg, key) + case "query": + err = unpopulate(val, &s.Query) + delete(rawMsg, key) + case "queryFrequency": + err = unpopulate(val, &s.QueryFrequency) + delete(rawMsg, key) + case "queryPeriod": + err = unpopulate(val, &s.QueryPeriod) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &s.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &s.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &s.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &s.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &s.Techniques) + delete(rawMsg, key) + case "triggerOperator": + err = unpopulate(val, &s.TriggerOperator) + delete(rawMsg, key) + case "triggerThreshold": + err = unpopulate(val, &s.TriggerThreshold) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &s.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type SecurityAlert. +func (s *SecurityAlert) GetEntity() *Entity { + return &Entity{ + Kind: s.Kind, + ID: s.ID, + Name: s.Name, + Type: s.Type, + SystemData: s.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityAlert. +func (s SecurityAlert) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + objectMap["kind"] = EntityKindSecurityAlert + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlert. +func (s *SecurityAlert) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &s.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &s.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityAlertProperties. +func (s SecurityAlertProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", s.AdditionalData) + populate(objectMap, "alertDisplayName", s.AlertDisplayName) + populate(objectMap, "alertLink", s.AlertLink) + populate(objectMap, "alertType", s.AlertType) + populate(objectMap, "compromisedEntity", s.CompromisedEntity) + populate(objectMap, "confidenceLevel", s.ConfidenceLevel) + populate(objectMap, "confidenceReasons", s.ConfidenceReasons) + populate(objectMap, "confidenceScore", s.ConfidenceScore) + populate(objectMap, "confidenceScoreStatus", s.ConfidenceScoreStatus) + populate(objectMap, "description", s.Description) + populateTimeRFC3339(objectMap, "endTimeUtc", s.EndTimeUTC) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "intent", s.Intent) + populateTimeRFC3339(objectMap, "processingEndTime", s.ProcessingEndTime) + populate(objectMap, "productComponentName", s.ProductComponentName) + populate(objectMap, "productName", s.ProductName) + populate(objectMap, "productVersion", s.ProductVersion) + populate(objectMap, "providerAlertId", s.ProviderAlertID) + populate(objectMap, "remediationSteps", s.RemediationSteps) + populate(objectMap, "resourceIdentifiers", s.ResourceIdentifiers) + populate(objectMap, "severity", s.Severity) + populateTimeRFC3339(objectMap, "startTimeUtc", s.StartTimeUTC) + populate(objectMap, "status", s.Status) + populate(objectMap, "systemAlertId", s.SystemAlertID) + populate(objectMap, "tactics", s.Tactics) + populateTimeRFC3339(objectMap, "timeGenerated", s.TimeGenerated) + populate(objectMap, "vendorName", s.VendorName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertProperties. +func (s *SecurityAlertProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, &s.AdditionalData) + delete(rawMsg, key) + case "alertDisplayName": + err = unpopulate(val, &s.AlertDisplayName) + delete(rawMsg, key) + case "alertLink": + err = unpopulate(val, &s.AlertLink) + delete(rawMsg, key) + case "alertType": + err = unpopulate(val, &s.AlertType) + delete(rawMsg, key) + case "compromisedEntity": + err = unpopulate(val, &s.CompromisedEntity) + delete(rawMsg, key) + case "confidenceLevel": + err = unpopulate(val, &s.ConfidenceLevel) + delete(rawMsg, key) + case "confidenceReasons": + err = unpopulate(val, &s.ConfidenceReasons) + delete(rawMsg, key) + case "confidenceScore": + err = unpopulate(val, &s.ConfidenceScore) + delete(rawMsg, key) + case "confidenceScoreStatus": + err = unpopulate(val, &s.ConfidenceScoreStatus) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &s.Description) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulateTimeRFC3339(val, &s.EndTimeUTC) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &s.FriendlyName) + delete(rawMsg, key) + case "intent": + err = unpopulate(val, &s.Intent) + delete(rawMsg, key) + case "processingEndTime": + err = unpopulateTimeRFC3339(val, &s.ProcessingEndTime) + delete(rawMsg, key) + case "productComponentName": + err = unpopulate(val, &s.ProductComponentName) + delete(rawMsg, key) + case "productName": + err = unpopulate(val, &s.ProductName) + delete(rawMsg, key) + case "productVersion": + err = unpopulate(val, &s.ProductVersion) + delete(rawMsg, key) + case "providerAlertId": + err = unpopulate(val, &s.ProviderAlertID) + delete(rawMsg, key) + case "remediationSteps": + err = unpopulate(val, &s.RemediationSteps) + delete(rawMsg, key) + case "resourceIdentifiers": + err = unpopulate(val, &s.ResourceIdentifiers) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &s.Severity) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, &s.StartTimeUTC) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &s.Status) + delete(rawMsg, key) + case "systemAlertId": + err = unpopulate(val, &s.SystemAlertID) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &s.Tactics) + delete(rawMsg, key) + case "timeGenerated": + err = unpopulateTimeRFC3339(val, &s.TimeGenerated) + delete(rawMsg, key) + case "vendorName": + err = unpopulate(val, &s.VendorName) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type SecurityAlertTimelineItem. +func (s *SecurityAlertTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { + return &EntityTimelineItem{ + Kind: s.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityAlertTimelineItem. +func (s SecurityAlertTimelineItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertType", s.AlertType) + populate(objectMap, "azureResourceId", s.AzureResourceID) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populateTimeRFC3339(objectMap, "endTimeUtc", s.EndTimeUTC) + objectMap["kind"] = EntityTimelineKindSecurityAlert + populate(objectMap, "productName", s.ProductName) + populate(objectMap, "severity", s.Severity) + populateTimeRFC3339(objectMap, "startTimeUtc", s.StartTimeUTC) + populateTimeRFC3339(objectMap, "timeGenerated", s.TimeGenerated) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertTimelineItem. +func (s *SecurityAlertTimelineItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertType": + err = unpopulate(val, &s.AlertType) + delete(rawMsg, key) + case "azureResourceId": + err = unpopulate(val, &s.AzureResourceID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &s.DisplayName) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulateTimeRFC3339(val, &s.EndTimeUTC) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &s.Kind) + delete(rawMsg, key) + case "productName": + err = unpopulate(val, &s.ProductName) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &s.Severity) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, &s.StartTimeUTC) + delete(rawMsg, key) + case "timeGenerated": + err = unpopulateTimeRFC3339(val, &s.TimeGenerated) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetEntity implements the EntityClassification interface for type SecurityGroupEntity. +func (s *SecurityGroupEntity) GetEntity() *Entity { + return &Entity{ + Kind: s.Kind, + ID: s.ID, + Name: s.Name, + Type: s.Type, + SystemData: s.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityGroupEntity. +func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + objectMap["kind"] = EntityKindSecurityGroup + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityGroupEntity. +func (s *SecurityGroupEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &s.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &s.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityGroupEntityProperties. +func (s SecurityGroupEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", s.AdditionalData) + populate(objectMap, "distinguishedName", s.DistinguishedName) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "objectGuid", s.ObjectGUID) + populate(objectMap, "sid", s.Sid) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SentinelOnboardingStatesList. +func (s SentinelOnboardingStatesList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SettingList. +func (s SettingList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SettingList. +func (s *SettingList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + s.Value, err = unmarshalSettingsClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetSettings implements the SettingsClassification interface for type Settings. +func (s *Settings) GetSettings() *Settings { return s } + +// MarshalJSON implements the json.Marshaller interface for type SourceControlList. +func (s SourceControlList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SourceControlProperties. +func (s SourceControlProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentTypes", s.ContentTypes) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "id", s.ID) + populate(objectMap, "lastDeploymentInfo", s.LastDeploymentInfo) + populate(objectMap, "repoType", s.RepoType) + populate(objectMap, "repository", s.Repository) + populate(objectMap, "repositoryResourceInfo", s.RepositoryResourceInfo) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type SubmissionMailEntity. +func (s *SubmissionMailEntity) GetEntity() *Entity { + return &Entity{ + Kind: s.Kind, + ID: s.ID, + Name: s.Name, + Type: s.Type, + SystemData: s.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type SubmissionMailEntity. +func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + objectMap["kind"] = EntityKindSubmissionMail + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubmissionMailEntity. +func (s *SubmissionMailEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &s.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &s.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &s.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubmissionMailEntityProperties. +func (s SubmissionMailEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", s.AdditionalData) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "networkMessageId", s.NetworkMessageID) + populate(objectMap, "recipient", s.Recipient) + populate(objectMap, "reportType", s.ReportType) + populate(objectMap, "sender", s.Sender) + populate(objectMap, "senderIp", s.SenderIP) + populate(objectMap, "subject", s.Subject) + populateTimeRFC3339(objectMap, "submissionDate", s.SubmissionDate) + populate(objectMap, "submissionId", s.SubmissionID) + populate(objectMap, "submitter", s.Submitter) + populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubmissionMailEntityProperties. +func (s *SubmissionMailEntityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, &s.AdditionalData) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &s.FriendlyName) + delete(rawMsg, key) + case "networkMessageId": + err = unpopulate(val, &s.NetworkMessageID) + delete(rawMsg, key) + case "recipient": + err = unpopulate(val, &s.Recipient) + delete(rawMsg, key) + case "reportType": + err = unpopulate(val, &s.ReportType) + delete(rawMsg, key) + case "sender": + err = unpopulate(val, &s.Sender) + delete(rawMsg, key) + case "senderIp": + err = unpopulate(val, &s.SenderIP) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, &s.Subject) + delete(rawMsg, key) + case "submissionDate": + err = unpopulateTimeRFC3339(val, &s.SubmissionDate) + delete(rawMsg, key) + case "submissionId": + err = unpopulate(val, &s.SubmissionID) + delete(rawMsg, key) + case "submitter": + err = unpopulate(val, &s.Submitter) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, &s.Timestamp) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type TICheckRequirements. +func (t *TICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: t.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type TICheckRequirements. +func (t TICheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindThreatIntelligence + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TICheckRequirements. +func (t *TICheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &t.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &t.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type TIDataConnector. +func (t *TIDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: t.Kind, + Etag: t.Etag, + ID: t.ID, + Name: t.Name, + Type: t.Type, + SystemData: t.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type TIDataConnector. +func (t TIDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", t.Etag) + populate(objectMap, "id", t.ID) + objectMap["kind"] = DataConnectorKindThreatIntelligence + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TIDataConnector. +func (t *TIDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &t.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &t.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TIDataConnectorProperties. +func (t TIDataConnectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataTypes", t.DataTypes) + populate(objectMap, "tenantId", t.TenantID) + populateTimeRFC3339(objectMap, "tipLookbackPeriod", t.TipLookbackPeriod) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TIDataConnectorProperties. +func (t *TIDataConnectorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "dataTypes": + err = unpopulate(val, &t.DataTypes) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, &t.TenantID) + delete(rawMsg, key) + case "tipLookbackPeriod": + err = unpopulateTimeRFC3339(val, &t.TipLookbackPeriod) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TeamInformation. +func (t TeamInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", t.Description) + populate(objectMap, "name", t.Name) + populate(objectMap, "primaryChannelUrl", t.PrimaryChannelURL) + populateTimeRFC3339(objectMap, "teamCreationTimeUtc", t.TeamCreationTimeUTC) + populate(objectMap, "teamId", t.TeamID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TeamInformation. +func (t *TeamInformation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, &t.Description) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &t.Name) + delete(rawMsg, key) + case "primaryChannelUrl": + err = unpopulate(val, &t.PrimaryChannelURL) + delete(rawMsg, key) + case "teamCreationTimeUtc": + err = unpopulateTimeRFC3339(val, &t.TeamCreationTimeUTC) + delete(rawMsg, key) + case "teamId": + err = unpopulate(val, &t.TeamID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TeamProperties. +func (t TeamProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupIds", t.GroupIDs) + populate(objectMap, "memberIds", t.MemberIDs) + populate(objectMap, "teamDescription", t.TeamDescription) + populate(objectMap, "teamName", t.TeamName) + return json.Marshal(objectMap) +} + +// GetAlertRule implements the AlertRuleClassification interface for type ThreatIntelligenceAlertRule. +func (t *ThreatIntelligenceAlertRule) GetAlertRule() *AlertRule { + return &AlertRule{ + Kind: t.Kind, + Etag: t.Etag, + ID: t.ID, + Name: t.Name, + Type: t.Type, + SystemData: t.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRule. +func (t ThreatIntelligenceAlertRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", t.Etag) + populate(objectMap, "id", t.ID) + objectMap["kind"] = AlertRuleKindThreatIntelligence + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRule. +func (t *ThreatIntelligenceAlertRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &t.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &t.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleProperties. +func (t ThreatIntelligenceAlertRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRuleTemplateName", t.AlertRuleTemplateName) + populate(objectMap, "description", t.Description) + populate(objectMap, "displayName", t.DisplayName) + populate(objectMap, "enabled", t.Enabled) + populateTimeRFC3339(objectMap, "lastModifiedUtc", t.LastModifiedUTC) + populate(objectMap, "severity", t.Severity) + populate(objectMap, "tactics", t.Tactics) + populate(objectMap, "techniques", t.Techniques) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRuleProperties. +func (t *ThreatIntelligenceAlertRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRuleTemplateName": + err = unpopulate(val, &t.AlertRuleTemplateName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &t.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &t.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, &t.Enabled) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, &t.LastModifiedUTC) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &t.Severity) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &t.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &t.Techniques) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type ThreatIntelligenceAlertRuleTemplate. +func (t *ThreatIntelligenceAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { + return &AlertRuleTemplate{ + Kind: t.Kind, + ID: t.ID, + Name: t.Name, + Type: t.Type, + SystemData: t.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleTemplate. +func (t ThreatIntelligenceAlertRuleTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + objectMap["kind"] = AlertRuleKindThreatIntelligence + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRuleTemplate. +func (t *ThreatIntelligenceAlertRuleTemplate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &t.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleTemplateProperties. +func (t ThreatIntelligenceAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "alertRulesCreatedByTemplateCount", t.AlertRulesCreatedByTemplateCount) + populateTimeRFC3339(objectMap, "createdDateUTC", t.CreatedDateUTC) + populate(objectMap, "description", t.Description) + populate(objectMap, "displayName", t.DisplayName) + populateTimeRFC3339(objectMap, "lastUpdatedDateUTC", t.LastUpdatedDateUTC) + populate(objectMap, "requiredDataConnectors", t.RequiredDataConnectors) + populate(objectMap, "severity", t.Severity) + populate(objectMap, "status", t.Status) + populate(objectMap, "tactics", t.Tactics) + populate(objectMap, "techniques", t.Techniques) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceAlertRuleTemplateProperties. +func (t *ThreatIntelligenceAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, &t.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, &t.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &t.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &t.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, &t.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, &t.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, &t.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &t.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, &t.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, &t.Techniques) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAppendTags. +func (t ThreatIntelligenceAppendTags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "threatIntelligenceTags", t.ThreatIntelligenceTags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceExternalReference. +func (t ThreatIntelligenceExternalReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", t.Description) + populate(objectMap, "externalId", t.ExternalID) + populate(objectMap, "hashes", t.Hashes) + populate(objectMap, "sourceName", t.SourceName) + populate(objectMap, "url", t.URL) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceFilteringCriteria. +func (t ThreatIntelligenceFilteringCriteria) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "ids", t.IDs) + populate(objectMap, "includeDisabled", t.IncludeDisabled) + populate(objectMap, "keywords", t.Keywords) + populate(objectMap, "maxConfidence", t.MaxConfidence) + populate(objectMap, "maxValidUntil", t.MaxValidUntil) + populate(objectMap, "minConfidence", t.MinConfidence) + populate(objectMap, "minValidUntil", t.MinValidUntil) + populate(objectMap, "pageSize", t.PageSize) + populate(objectMap, "patternTypes", t.PatternTypes) + populate(objectMap, "skipToken", t.SkipToken) + populate(objectMap, "sortBy", t.SortBy) + populate(objectMap, "sources", t.Sources) + populate(objectMap, "threatTypes", t.ThreatTypes) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceGranularMarkingModel. +func (t ThreatIntelligenceGranularMarkingModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "language", t.Language) + populate(objectMap, "markingRef", t.MarkingRef) + populate(objectMap, "selectors", t.Selectors) + return json.Marshal(objectMap) +} + +// GetThreatIntelligenceInformation implements the ThreatIntelligenceInformationClassification interface for type ThreatIntelligenceIndicatorModel. +func (t *ThreatIntelligenceIndicatorModel) GetThreatIntelligenceInformation() *ThreatIntelligenceInformation { + return &ThreatIntelligenceInformation{ + Kind: t.Kind, + Etag: t.Etag, + ID: t.ID, + Name: t.Name, + Type: t.Type, + SystemData: t.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceIndicatorModel. +func (t ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", t.Etag) + populate(objectMap, "id", t.ID) + objectMap["kind"] = ThreatIntelligenceResourceKindEnumIndicator + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorModel. +func (t *ThreatIntelligenceIndicatorModel) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &t.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &t.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceIndicatorProperties. +func (t ThreatIntelligenceIndicatorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", t.AdditionalData) + populate(objectMap, "confidence", t.Confidence) + populate(objectMap, "created", t.Created) + populate(objectMap, "createdByRef", t.CreatedByRef) + populate(objectMap, "defanged", t.Defanged) + populate(objectMap, "description", t.Description) + populate(objectMap, "displayName", t.DisplayName) + populate(objectMap, "extensions", t.Extensions) + populate(objectMap, "externalId", t.ExternalID) + populate(objectMap, "externalLastUpdatedTimeUtc", t.ExternalLastUpdatedTimeUTC) + populate(objectMap, "externalReferences", t.ExternalReferences) + populate(objectMap, "friendlyName", t.FriendlyName) + populate(objectMap, "granularMarkings", t.GranularMarkings) + populate(objectMap, "indicatorTypes", t.IndicatorTypes) + populate(objectMap, "killChainPhases", t.KillChainPhases) + populate(objectMap, "labels", t.Labels) + populate(objectMap, "language", t.Language) + populate(objectMap, "lastUpdatedTimeUtc", t.LastUpdatedTimeUTC) + populate(objectMap, "modified", t.Modified) + populate(objectMap, "objectMarkingRefs", t.ObjectMarkingRefs) + populate(objectMap, "parsedPattern", t.ParsedPattern) + populate(objectMap, "pattern", t.Pattern) + populate(objectMap, "patternType", t.PatternType) + populate(objectMap, "patternVersion", t.PatternVersion) + populate(objectMap, "revoked", t.Revoked) + populate(objectMap, "source", t.Source) + populate(objectMap, "threatIntelligenceTags", t.ThreatIntelligenceTags) + populate(objectMap, "threatTypes", t.ThreatTypes) + populate(objectMap, "validFrom", t.ValidFrom) + populate(objectMap, "validUntil", t.ValidUntil) + return json.Marshal(objectMap) +} + +// GetThreatIntelligenceInformation implements the ThreatIntelligenceInformationClassification interface for type ThreatIntelligenceInformation. +func (t *ThreatIntelligenceInformation) GetThreatIntelligenceInformation() *ThreatIntelligenceInformation { + return t +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceInformationList. +func (t ThreatIntelligenceInformationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceInformationList. +func (t *ThreatIntelligenceInformationList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, &t.NextLink) + delete(rawMsg, key) + case "value": + t.Value, err = unmarshalThreatIntelligenceInformationClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceMetric. +func (t ThreatIntelligenceMetric) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "lastUpdatedTimeUtc", t.LastUpdatedTimeUTC) + populate(objectMap, "patternTypeMetrics", t.PatternTypeMetrics) + populate(objectMap, "sourceMetrics", t.SourceMetrics) + populate(objectMap, "threatTypeMetrics", t.ThreatTypeMetrics) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceMetricsList. +func (t ThreatIntelligenceMetricsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceParsedPattern. +func (t ThreatIntelligenceParsedPattern) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "patternTypeKey", t.PatternTypeKey) + populate(objectMap, "patternTypeValues", t.PatternTypeValues) + return json.Marshal(objectMap) +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type TiTaxiiCheckRequirements. +func (t *TiTaxiiCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: t.Kind, + } +} + +// MarshalJSON implements the json.Marshaller interface for type TiTaxiiCheckRequirements. +func (t TiTaxiiCheckRequirements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["kind"] = DataConnectorKindThreatIntelligenceTaxii + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TiTaxiiCheckRequirements. +func (t *TiTaxiiCheckRequirements) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, &t.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &t.Properties) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetDataConnector implements the DataConnectorClassification interface for type TiTaxiiDataConnector. +func (t *TiTaxiiDataConnector) GetDataConnector() *DataConnector { + return &DataConnector{ + Kind: t.Kind, + Etag: t.Etag, + ID: t.ID, + Name: t.Name, + Type: t.Type, + SystemData: t.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type TiTaxiiDataConnector. +func (t TiTaxiiDataConnector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", t.Etag) + populate(objectMap, "id", t.ID) + objectMap["kind"] = DataConnectorKindThreatIntelligenceTaxii + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TiTaxiiDataConnector. +func (t *TiTaxiiDataConnector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &t.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &t.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TiTaxiiDataConnectorProperties. +func (t TiTaxiiDataConnectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "collectionId", t.CollectionID) + populate(objectMap, "dataTypes", t.DataTypes) + populate(objectMap, "friendlyName", t.FriendlyName) + populate(objectMap, "password", t.Password) + populate(objectMap, "pollingFrequency", t.PollingFrequency) + populateTimeRFC3339(objectMap, "taxiiLookbackPeriod", t.TaxiiLookbackPeriod) + populate(objectMap, "taxiiServer", t.TaxiiServer) + populate(objectMap, "tenantId", t.TenantID) + populate(objectMap, "userName", t.UserName) + populate(objectMap, "workspaceId", t.WorkspaceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TiTaxiiDataConnectorProperties. +func (t *TiTaxiiDataConnectorProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "collectionId": + err = unpopulate(val, &t.CollectionID) + delete(rawMsg, key) + case "dataTypes": + err = unpopulate(val, &t.DataTypes) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &t.FriendlyName) + delete(rawMsg, key) + case "password": + err = unpopulate(val, &t.Password) + delete(rawMsg, key) + case "pollingFrequency": + err = unpopulate(val, &t.PollingFrequency) + delete(rawMsg, key) + case "taxiiLookbackPeriod": + err = unpopulateTimeRFC3339(val, &t.TaxiiLookbackPeriod) + delete(rawMsg, key) + case "taxiiServer": + err = unpopulate(val, &t.TaxiiServer) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, &t.TenantID) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, &t.UserName) + delete(rawMsg, key) + case "workspaceId": + err = unpopulate(val, &t.WorkspaceID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TimelineResultsMetadata. +func (t TimelineResultsMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "aggregations", t.Aggregations) + populate(objectMap, "errors", t.Errors) + populate(objectMap, "totalCount", t.TotalCount) + return json.Marshal(objectMap) +} + +// GetEntity implements the EntityClassification interface for type URLEntity. +func (u *URLEntity) GetEntity() *Entity { + return &Entity{ + Kind: u.Kind, + ID: u.ID, + Name: u.Name, + Type: u.Type, + SystemData: u.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type URLEntity. +func (u URLEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", u.ID) + objectMap["kind"] = EntityKindURL + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type URLEntity. +func (u *URLEntity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &u.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &u.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &u.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type URLEntityProperties. +func (u URLEntityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalData", u.AdditionalData) + populate(objectMap, "friendlyName", u.FriendlyName) + populate(objectMap, "url", u.URL) + return json.Marshal(objectMap) +} + +// GetSettings implements the SettingsClassification interface for type Ueba. +func (u *Ueba) GetSettings() *Settings { + return &Settings{ + Kind: u.Kind, + Etag: u.Etag, + ID: u.ID, + Name: u.Name, + Type: u.Type, + SystemData: u.SystemData, + } +} + +// MarshalJSON implements the json.Marshaller interface for type Ueba. +func (u Ueba) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", u.Etag) + populate(objectMap, "id", u.ID) + objectMap["kind"] = SettingKindUeba + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "systemData", u.SystemData) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Ueba. +func (u *Ueba) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, &u.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, &u.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, &u.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &u.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UebaProperties. +func (u UebaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dataSources", u.DataSources) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WatchlistItemList. +func (w WatchlistItemList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WatchlistItemProperties. +func (w WatchlistItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "created", w.Created) + populate(objectMap, "createdBy", w.CreatedBy) + populate(objectMap, "entityMapping", w.EntityMapping) + populate(objectMap, "isDeleted", w.IsDeleted) + populate(objectMap, "itemsKeyValue", w.ItemsKeyValue) + populate(objectMap, "tenantId", w.TenantID) + populateTimeRFC3339(objectMap, "updated", w.Updated) + populate(objectMap, "updatedBy", w.UpdatedBy) + populate(objectMap, "watchlistItemId", w.WatchlistItemID) + populate(objectMap, "watchlistItemType", w.WatchlistItemType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WatchlistItemProperties. +func (w *WatchlistItemProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "created": + err = unpopulateTimeRFC3339(val, &w.Created) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &w.CreatedBy) + delete(rawMsg, key) + case "entityMapping": + err = unpopulate(val, &w.EntityMapping) + delete(rawMsg, key) + case "isDeleted": + err = unpopulate(val, &w.IsDeleted) + delete(rawMsg, key) + case "itemsKeyValue": + err = unpopulate(val, &w.ItemsKeyValue) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, &w.TenantID) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, &w.Updated) + delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, &w.UpdatedBy) + delete(rawMsg, key) + case "watchlistItemId": + err = unpopulate(val, &w.WatchlistItemID) + delete(rawMsg, key) + case "watchlistItemType": + err = unpopulate(val, &w.WatchlistItemType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WatchlistList. +func (w WatchlistList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WatchlistProperties. +func (w WatchlistProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentType", w.ContentType) + populateTimeRFC3339(objectMap, "created", w.Created) + populate(objectMap, "createdBy", w.CreatedBy) + populate(objectMap, "defaultDuration", w.DefaultDuration) + populate(objectMap, "description", w.Description) + populate(objectMap, "displayName", w.DisplayName) + populate(objectMap, "isDeleted", w.IsDeleted) + populate(objectMap, "itemsSearchKey", w.ItemsSearchKey) + populate(objectMap, "labels", w.Labels) + populate(objectMap, "numberOfLinesToSkip", w.NumberOfLinesToSkip) + populate(objectMap, "provider", w.Provider) + populate(objectMap, "rawContent", w.RawContent) + populate(objectMap, "source", w.Source) + populate(objectMap, "sourceType", w.SourceType) + populate(objectMap, "tenantId", w.TenantID) + populateTimeRFC3339(objectMap, "updated", w.Updated) + populate(objectMap, "updatedBy", w.UpdatedBy) + populate(objectMap, "uploadStatus", w.UploadStatus) + populate(objectMap, "watchlistAlias", w.WatchlistAlias) + populate(objectMap, "watchlistId", w.WatchlistID) + populate(objectMap, "watchlistType", w.WatchlistType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WatchlistProperties. +func (w *WatchlistProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "contentType": + err = unpopulate(val, &w.ContentType) + delete(rawMsg, key) + case "created": + err = unpopulateTimeRFC3339(val, &w.Created) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &w.CreatedBy) + delete(rawMsg, key) + case "defaultDuration": + err = unpopulate(val, &w.DefaultDuration) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &w.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, &w.DisplayName) + delete(rawMsg, key) + case "isDeleted": + err = unpopulate(val, &w.IsDeleted) + delete(rawMsg, key) + case "itemsSearchKey": + err = unpopulate(val, &w.ItemsSearchKey) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, &w.Labels) + delete(rawMsg, key) + case "numberOfLinesToSkip": + err = unpopulate(val, &w.NumberOfLinesToSkip) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, &w.Provider) + delete(rawMsg, key) + case "rawContent": + err = unpopulate(val, &w.RawContent) + delete(rawMsg, key) + case "source": + err = unpopulate(val, &w.Source) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, &w.SourceType) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, &w.TenantID) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, &w.Updated) + delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, &w.UpdatedBy) + delete(rawMsg, key) + case "uploadStatus": + err = unpopulate(val, &w.UploadStatus) + delete(rawMsg, key) + case "watchlistAlias": + err = unpopulate(val, &w.WatchlistAlias) + delete(rawMsg, key) + case "watchlistId": + err = unpopulate(val, &w.WatchlistID) + delete(rawMsg, key) + case "watchlistType": + err = unpopulate(val, &w.WatchlistType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +func populate(m map[string]interface{}, k string, v interface{}) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_officeconsents_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_officeconsents_client.go index f329c14cb3f0..c0570e4c936c 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_officeconsents_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_officeconsents_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type OfficeConsentsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewOfficeConsentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *OfficeConsentsClient { +func NewOfficeConsentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OfficeConsentsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &OfficeConsentsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Delete - Delete the office365 consent. @@ -67,7 +72,7 @@ func (client *OfficeConsentsClient) Delete(ctx context.Context, resourceGroupNam if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return OfficeConsentsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return OfficeConsentsClientDeleteResponse{RawResponse: resp}, nil + return OfficeConsentsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -94,7 +99,7 @@ func (client *OfficeConsentsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -145,7 +150,7 @@ func (client *OfficeConsentsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -153,7 +158,7 @@ func (client *OfficeConsentsClient) getCreateRequest(ctx context.Context, resour // getHandleResponse handles the Get response. func (client *OfficeConsentsClient) getHandleResponse(resp *http.Response) (OfficeConsentsClientGetResponse, error) { - result := OfficeConsentsClientGetResponse{RawResponse: resp} + result := OfficeConsentsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OfficeConsent); err != nil { return OfficeConsentsClientGetResponse{}, err } @@ -165,16 +170,32 @@ func (client *OfficeConsentsClient) getHandleResponse(resp *http.Response) (Offi // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - OfficeConsentsClientListOptions contains the optional parameters for the OfficeConsentsClient.List method. -func (client *OfficeConsentsClient) List(resourceGroupName string, workspaceName string, options *OfficeConsentsClientListOptions) *OfficeConsentsClientListPager { - return &OfficeConsentsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *OfficeConsentsClient) List(resourceGroupName string, workspaceName string, options *OfficeConsentsClientListOptions) *runtime.Pager[OfficeConsentsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OfficeConsentsClientListResponse]{ + More: func(page OfficeConsentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OfficeConsentsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OfficeConsentList.NextLink) + Fetcher: func(ctx context.Context, page *OfficeConsentsClientListResponse) (OfficeConsentsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OfficeConsentsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OfficeConsentsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OfficeConsentsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -197,7 +218,7 @@ func (client *OfficeConsentsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -205,7 +226,7 @@ func (client *OfficeConsentsClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *OfficeConsentsClient) listHandleResponse(resp *http.Response) (OfficeConsentsClientListResponse, error) { - result := OfficeConsentsClientListResponse{RawResponse: resp} + result := OfficeConsentsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OfficeConsentList); err != nil { return OfficeConsentsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go index 32da6950686e..fd049d8ae20e 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -13,6 +13,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -28,34 +29,54 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *OperationsClient { +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &OperationsClient{ - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - Lists all operations available Azure Security Insights Resource Provider. // If the operation fails it returns an *azcore.ResponseError type. // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager { - return &OperationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *OperationsClient) List(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationsList.NextLink) + Fetcher: func(ctx context.Context, page *OperationsClientListResponse) (OperationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return OperationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OperationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -66,7 +87,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -74,7 +95,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationsList); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_pagers.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_pagers.go deleted file mode 100644 index 45775b9c2df1..000000000000 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_pagers.go +++ /dev/null @@ -1,1259 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurityinsights - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// ActionsClientListByAlertRulePager provides operations for iterating over paged responses. -type ActionsClientListByAlertRulePager struct { - client *ActionsClient - current ActionsClientListByAlertRuleResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ActionsClientListByAlertRuleResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ActionsClientListByAlertRulePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ActionsClientListByAlertRulePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ActionsList.NextLink == nil || len(*p.current.ActionsList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByAlertRuleHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ActionsClientListByAlertRuleResponse page. -func (p *ActionsClientListByAlertRulePager) PageResponse() ActionsClientListByAlertRuleResponse { - return p.current -} - -// AlertRuleTemplatesClientListPager provides operations for iterating over paged responses. -type AlertRuleTemplatesClientListPager struct { - client *AlertRuleTemplatesClient - current AlertRuleTemplatesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AlertRuleTemplatesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AlertRuleTemplatesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AlertRuleTemplatesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AlertRuleTemplatesList.NextLink == nil || len(*p.current.AlertRuleTemplatesList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AlertRuleTemplatesClientListResponse page. -func (p *AlertRuleTemplatesClientListPager) PageResponse() AlertRuleTemplatesClientListResponse { - return p.current -} - -// AlertRulesClientListPager provides operations for iterating over paged responses. -type AlertRulesClientListPager struct { - client *AlertRulesClient - current AlertRulesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AlertRulesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AlertRulesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AlertRulesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AlertRulesList.NextLink == nil || len(*p.current.AlertRulesList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AlertRulesClientListResponse page. -func (p *AlertRulesClientListPager) PageResponse() AlertRulesClientListResponse { - return p.current -} - -// AutomationRulesClientListPager provides operations for iterating over paged responses. -type AutomationRulesClientListPager struct { - client *AutomationRulesClient - current AutomationRulesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AutomationRulesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AutomationRulesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AutomationRulesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AutomationRulesList.NextLink == nil || len(*p.current.AutomationRulesList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AutomationRulesClientListResponse page. -func (p *AutomationRulesClientListPager) PageResponse() AutomationRulesClientListResponse { - return p.current -} - -// BookmarkRelationsClientListPager provides operations for iterating over paged responses. -type BookmarkRelationsClientListPager struct { - client *BookmarkRelationsClient - current BookmarkRelationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, BookmarkRelationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *BookmarkRelationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *BookmarkRelationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.RelationList.NextLink == nil || len(*p.current.RelationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current BookmarkRelationsClientListResponse page. -func (p *BookmarkRelationsClientListPager) PageResponse() BookmarkRelationsClientListResponse { - return p.current -} - -// BookmarksClientListPager provides operations for iterating over paged responses. -type BookmarksClientListPager struct { - client *BookmarksClient - current BookmarksClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, BookmarksClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *BookmarksClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *BookmarksClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.BookmarkList.NextLink == nil || len(*p.current.BookmarkList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current BookmarksClientListResponse page. -func (p *BookmarksClientListPager) PageResponse() BookmarksClientListResponse { - return p.current -} - -// DataConnectorsClientListPager provides operations for iterating over paged responses. -type DataConnectorsClientListPager struct { - client *DataConnectorsClient - current DataConnectorsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, DataConnectorsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *DataConnectorsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *DataConnectorsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.DataConnectorList.NextLink == nil || len(*p.current.DataConnectorList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current DataConnectorsClientListResponse page. -func (p *DataConnectorsClientListPager) PageResponse() DataConnectorsClientListResponse { - return p.current -} - -// EntitiesClientListPager provides operations for iterating over paged responses. -type EntitiesClientListPager struct { - client *EntitiesClient - current EntitiesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, EntitiesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *EntitiesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *EntitiesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.EntityList.NextLink == nil || len(*p.current.EntityList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current EntitiesClientListResponse page. -func (p *EntitiesClientListPager) PageResponse() EntitiesClientListResponse { - return p.current -} - -// EntitiesRelationsClientListPager provides operations for iterating over paged responses. -type EntitiesRelationsClientListPager struct { - client *EntitiesRelationsClient - current EntitiesRelationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, EntitiesRelationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *EntitiesRelationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *EntitiesRelationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.RelationList.NextLink == nil || len(*p.current.RelationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current EntitiesRelationsClientListResponse page. -func (p *EntitiesRelationsClientListPager) PageResponse() EntitiesRelationsClientListResponse { - return p.current -} - -// EntityQueriesClientListPager provides operations for iterating over paged responses. -type EntityQueriesClientListPager struct { - client *EntityQueriesClient - current EntityQueriesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, EntityQueriesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *EntityQueriesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *EntityQueriesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.EntityQueryList.NextLink == nil || len(*p.current.EntityQueryList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current EntityQueriesClientListResponse page. -func (p *EntityQueriesClientListPager) PageResponse() EntityQueriesClientListResponse { - return p.current -} - -// EntityQueryTemplatesClientListPager provides operations for iterating over paged responses. -type EntityQueryTemplatesClientListPager struct { - client *EntityQueryTemplatesClient - current EntityQueryTemplatesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, EntityQueryTemplatesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *EntityQueryTemplatesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *EntityQueryTemplatesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.EntityQueryTemplateList.NextLink == nil || len(*p.current.EntityQueryTemplateList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current EntityQueryTemplatesClientListResponse page. -func (p *EntityQueryTemplatesClientListPager) PageResponse() EntityQueryTemplatesClientListResponse { - return p.current -} - -// IncidentCommentsClientListPager provides operations for iterating over paged responses. -type IncidentCommentsClientListPager struct { - client *IncidentCommentsClient - current IncidentCommentsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, IncidentCommentsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *IncidentCommentsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *IncidentCommentsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.IncidentCommentList.NextLink == nil || len(*p.current.IncidentCommentList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current IncidentCommentsClientListResponse page. -func (p *IncidentCommentsClientListPager) PageResponse() IncidentCommentsClientListResponse { - return p.current -} - -// IncidentRelationsClientListPager provides operations for iterating over paged responses. -type IncidentRelationsClientListPager struct { - client *IncidentRelationsClient - current IncidentRelationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, IncidentRelationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *IncidentRelationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *IncidentRelationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.RelationList.NextLink == nil || len(*p.current.RelationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current IncidentRelationsClientListResponse page. -func (p *IncidentRelationsClientListPager) PageResponse() IncidentRelationsClientListResponse { - return p.current -} - -// IncidentsClientListPager provides operations for iterating over paged responses. -type IncidentsClientListPager struct { - client *IncidentsClient - current IncidentsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, IncidentsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *IncidentsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *IncidentsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.IncidentList.NextLink == nil || len(*p.current.IncidentList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current IncidentsClientListResponse page. -func (p *IncidentsClientListPager) PageResponse() IncidentsClientListResponse { - return p.current -} - -// MetadataClientListPager provides operations for iterating over paged responses. -type MetadataClientListPager struct { - client *MetadataClient - current MetadataClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, MetadataClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *MetadataClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *MetadataClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.MetadataList.NextLink == nil || len(*p.current.MetadataList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current MetadataClientListResponse page. -func (p *MetadataClientListPager) PageResponse() MetadataClientListResponse { - return p.current -} - -// OfficeConsentsClientListPager provides operations for iterating over paged responses. -type OfficeConsentsClientListPager struct { - client *OfficeConsentsClient - current OfficeConsentsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OfficeConsentsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OfficeConsentsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OfficeConsentsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OfficeConsentList.NextLink == nil || len(*p.current.OfficeConsentList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OfficeConsentsClientListResponse page. -func (p *OfficeConsentsClientListPager) PageResponse() OfficeConsentsClientListResponse { - return p.current -} - -// OperationsClientListPager provides operations for iterating over paged responses. -type OperationsClientListPager struct { - client *OperationsClient - current OperationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OperationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OperationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OperationsList.NextLink == nil || len(*p.current.OperationsList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OperationsClientListResponse page. -func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse { - return p.current -} - -// SourceControlClientListRepositoriesPager provides operations for iterating over paged responses. -type SourceControlClientListRepositoriesPager struct { - client *SourceControlClient - current SourceControlClientListRepositoriesResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SourceControlClientListRepositoriesResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *SourceControlClientListRepositoriesPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *SourceControlClientListRepositoriesPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.RepoList.NextLink == nil || len(*p.current.RepoList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listRepositoriesHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current SourceControlClientListRepositoriesResponse page. -func (p *SourceControlClientListRepositoriesPager) PageResponse() SourceControlClientListRepositoriesResponse { - return p.current -} - -// SourceControlsClientListPager provides operations for iterating over paged responses. -type SourceControlsClientListPager struct { - client *SourceControlsClient - current SourceControlsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SourceControlsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *SourceControlsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *SourceControlsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.SourceControlList.NextLink == nil || len(*p.current.SourceControlList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current SourceControlsClientListResponse page. -func (p *SourceControlsClientListPager) PageResponse() SourceControlsClientListResponse { - return p.current -} - -// ThreatIntelligenceIndicatorClientQueryIndicatorsPager provides operations for iterating over paged responses. -type ThreatIntelligenceIndicatorClientQueryIndicatorsPager struct { - client *ThreatIntelligenceIndicatorClient - current ThreatIntelligenceIndicatorClientQueryIndicatorsResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ThreatIntelligenceIndicatorClientQueryIndicatorsResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ThreatIntelligenceIndicatorClientQueryIndicatorsPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ThreatIntelligenceIndicatorClientQueryIndicatorsPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ThreatIntelligenceInformationList.NextLink == nil || len(*p.current.ThreatIntelligenceInformationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.queryIndicatorsHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ThreatIntelligenceIndicatorClientQueryIndicatorsResponse page. -func (p *ThreatIntelligenceIndicatorClientQueryIndicatorsPager) PageResponse() ThreatIntelligenceIndicatorClientQueryIndicatorsResponse { - return p.current -} - -// ThreatIntelligenceIndicatorsClientListPager provides operations for iterating over paged responses. -type ThreatIntelligenceIndicatorsClientListPager struct { - client *ThreatIntelligenceIndicatorsClient - current ThreatIntelligenceIndicatorsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ThreatIntelligenceIndicatorsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ThreatIntelligenceIndicatorsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ThreatIntelligenceIndicatorsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ThreatIntelligenceInformationList.NextLink == nil || len(*p.current.ThreatIntelligenceInformationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ThreatIntelligenceIndicatorsClientListResponse page. -func (p *ThreatIntelligenceIndicatorsClientListPager) PageResponse() ThreatIntelligenceIndicatorsClientListResponse { - return p.current -} - -// WatchlistItemsClientListPager provides operations for iterating over paged responses. -type WatchlistItemsClientListPager struct { - client *WatchlistItemsClient - current WatchlistItemsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, WatchlistItemsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *WatchlistItemsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *WatchlistItemsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.WatchlistItemList.NextLink == nil || len(*p.current.WatchlistItemList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current WatchlistItemsClientListResponse page. -func (p *WatchlistItemsClientListPager) PageResponse() WatchlistItemsClientListResponse { - return p.current -} - -// WatchlistsClientListPager provides operations for iterating over paged responses. -type WatchlistsClientListPager struct { - client *WatchlistsClient - current WatchlistsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, WatchlistsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *WatchlistsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *WatchlistsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.WatchlistList.NextLink == nil || len(*p.current.WatchlistList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current WatchlistsClientListResponse page. -func (p *WatchlistsClientListPager) PageResponse() WatchlistsClientListResponse { - return p.current -} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go index 83d45887fa8a..b20c2cbf7e3d 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -206,6 +206,8 @@ func unmarshalDataConnectorClassification(rawMsg json.RawMessage) (DataConnector b = &Dynamics365DataConnector{} case string(DataConnectorKindGenericUI): b = &CodelessUIDataConnector{} + case string(DataConnectorKindIOT): + b = &IoTDataConnector{} case string(DataConnectorKindMicrosoftCloudAppSecurity): b = &MCASDataConnector{} case string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection): diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_productsettings_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_productsettings_client.go index 2718bb5196c7..b11f1c388517 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_productsettings_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_productsettings_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type ProductSettingsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewProductSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ProductSettingsClient { +func NewProductSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ProductSettingsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Delete - Delete setting of the product. @@ -67,7 +72,7 @@ func (client *ProductSettingsClient) Delete(ctx context.Context, resourceGroupNa if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ProductSettingsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ProductSettingsClientDeleteResponse{RawResponse: resp}, nil + return ProductSettingsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -94,7 +99,7 @@ func (client *ProductSettingsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -145,7 +150,7 @@ func (client *ProductSettingsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -153,7 +158,7 @@ func (client *ProductSettingsClient) getCreateRequest(ctx context.Context, resou // getHandleResponse handles the Get response. func (client *ProductSettingsClient) getHandleResponse(resp *http.Response) (ProductSettingsClientGetResponse, error) { - result := ProductSettingsClientGetResponse{RawResponse: resp} + result := ProductSettingsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return ProductSettingsClientGetResponse{}, err } @@ -200,7 +205,7 @@ func (client *ProductSettingsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -208,7 +213,7 @@ func (client *ProductSettingsClient) listCreateRequest(ctx context.Context, reso // listHandleResponse handles the List response. func (client *ProductSettingsClient) listHandleResponse(resp *http.Response) (ProductSettingsClientListResponse, error) { - result := ProductSettingsClientListResponse{RawResponse: resp} + result := ProductSettingsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SettingList); err != nil { return ProductSettingsClientListResponse{}, err } @@ -261,7 +266,7 @@ func (client *ProductSettingsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, settings) @@ -269,7 +274,7 @@ func (client *ProductSettingsClient) updateCreateRequest(ctx context.Context, re // updateHandleResponse handles the Update response. func (client *ProductSettingsClient) updateHandleResponse(resp *http.Response) (ProductSettingsClientUpdateResponse, error) { - result := ProductSettingsClientUpdateResponse{RawResponse: resp} + result := ProductSettingsClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return ProductSettingsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go index 70a90b1e7369..dd2ea9cb9750 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -8,64 +8,33 @@ package armsecurityinsights -import "net/http" - // ActionsClientCreateOrUpdateResponse contains the response from method ActionsClient.CreateOrUpdate. type ActionsClientCreateOrUpdateResponse struct { - ActionsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ActionsClientCreateOrUpdateResult contains the result from method ActionsClient.CreateOrUpdate. -type ActionsClientCreateOrUpdateResult struct { ActionResponse } // ActionsClientDeleteResponse contains the response from method ActionsClient.Delete. type ActionsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ActionsClientGetResponse contains the response from method ActionsClient.Get. type ActionsClientGetResponse struct { - ActionsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ActionsClientGetResult contains the result from method ActionsClient.Get. -type ActionsClientGetResult struct { ActionResponse } // ActionsClientListByAlertRuleResponse contains the response from method ActionsClient.ListByAlertRule. type ActionsClientListByAlertRuleResponse struct { - ActionsClientListByAlertRuleResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ActionsClientListByAlertRuleResult contains the result from method ActionsClient.ListByAlertRule. -type ActionsClientListByAlertRuleResult struct { ActionsList } // AlertRuleTemplatesClientGetResponse contains the response from method AlertRuleTemplatesClient.Get. type AlertRuleTemplatesClientGetResponse struct { - AlertRuleTemplatesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AlertRuleTemplatesClientGetResult contains the result from method AlertRuleTemplatesClient.Get. -type AlertRuleTemplatesClientGetResult struct { AlertRuleTemplateClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplatesClientGetResult. -func (a *AlertRuleTemplatesClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRuleTemplatesClientGetResponse. +func (a *AlertRuleTemplatesClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalAlertRuleTemplateClassification(data) if err != nil { return err @@ -76,30 +45,16 @@ func (a *AlertRuleTemplatesClientGetResult) UnmarshalJSON(data []byte) error { // AlertRuleTemplatesClientListResponse contains the response from method AlertRuleTemplatesClient.List. type AlertRuleTemplatesClientListResponse struct { - AlertRuleTemplatesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AlertRuleTemplatesClientListResult contains the result from method AlertRuleTemplatesClient.List. -type AlertRuleTemplatesClientListResult struct { AlertRuleTemplatesList } // AlertRulesClientCreateOrUpdateResponse contains the response from method AlertRulesClient.CreateOrUpdate. type AlertRulesClientCreateOrUpdateResponse struct { - AlertRulesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AlertRulesClientCreateOrUpdateResult contains the result from method AlertRulesClient.CreateOrUpdate. -type AlertRulesClientCreateOrUpdateResult struct { AlertRuleClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulesClientCreateOrUpdateResult. -func (a *AlertRulesClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulesClientCreateOrUpdateResponse. +func (a *AlertRulesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalAlertRuleClassification(data) if err != nil { return err @@ -110,24 +65,16 @@ func (a *AlertRulesClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error // AlertRulesClientDeleteResponse contains the response from method AlertRulesClient.Delete. type AlertRulesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // AlertRulesClientGetResponse contains the response from method AlertRulesClient.Get. type AlertRulesClientGetResponse struct { - AlertRulesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AlertRulesClientGetResult contains the result from method AlertRulesClient.Get. -type AlertRulesClientGetResult struct { AlertRuleClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulesClientGetResult. -func (a *AlertRulesClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulesClientGetResponse. +func (a *AlertRulesClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalAlertRuleClassification(data) if err != nil { return err @@ -138,206 +85,92 @@ func (a *AlertRulesClientGetResult) UnmarshalJSON(data []byte) error { // AlertRulesClientListResponse contains the response from method AlertRulesClient.List. type AlertRulesClientListResponse struct { - AlertRulesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AlertRulesClientListResult contains the result from method AlertRulesClient.List. -type AlertRulesClientListResult struct { AlertRulesList } // AutomationRulesClientCreateOrUpdateResponse contains the response from method AutomationRulesClient.CreateOrUpdate. type AutomationRulesClientCreateOrUpdateResponse struct { - AutomationRulesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AutomationRulesClientCreateOrUpdateResult contains the result from method AutomationRulesClient.CreateOrUpdate. -type AutomationRulesClientCreateOrUpdateResult struct { AutomationRule } // AutomationRulesClientDeleteResponse contains the response from method AutomationRulesClient.Delete. type AutomationRulesClientDeleteResponse struct { - AutomationRulesClientDeleteResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AutomationRulesClientDeleteResult contains the result from method AutomationRulesClient.Delete. -type AutomationRulesClientDeleteResult struct { // Anything Interface interface{} } // AutomationRulesClientGetResponse contains the response from method AutomationRulesClient.Get. type AutomationRulesClientGetResponse struct { - AutomationRulesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AutomationRulesClientGetResult contains the result from method AutomationRulesClient.Get. -type AutomationRulesClientGetResult struct { AutomationRule } // AutomationRulesClientListResponse contains the response from method AutomationRulesClient.List. type AutomationRulesClientListResponse struct { - AutomationRulesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AutomationRulesClientListResult contains the result from method AutomationRulesClient.List. -type AutomationRulesClientListResult struct { AutomationRulesList } -// AutomationRulesClientManualTriggerPlaybookResponse contains the response from method AutomationRulesClient.ManualTriggerPlaybook. -type AutomationRulesClientManualTriggerPlaybookResponse struct { - AutomationRulesClientManualTriggerPlaybookResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AutomationRulesClientManualTriggerPlaybookResult contains the result from method AutomationRulesClient.ManualTriggerPlaybook. -type AutomationRulesClientManualTriggerPlaybookResult struct { - // Anything - Interface interface{} -} - // BookmarkClientExpandResponse contains the response from method BookmarkClient.Expand. type BookmarkClientExpandResponse struct { - BookmarkClientExpandResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BookmarkClientExpandResult contains the result from method BookmarkClient.Expand. -type BookmarkClientExpandResult struct { BookmarkExpandResponse } // BookmarkRelationsClientCreateOrUpdateResponse contains the response from method BookmarkRelationsClient.CreateOrUpdate. type BookmarkRelationsClientCreateOrUpdateResponse struct { - BookmarkRelationsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BookmarkRelationsClientCreateOrUpdateResult contains the result from method BookmarkRelationsClient.CreateOrUpdate. -type BookmarkRelationsClientCreateOrUpdateResult struct { Relation } // BookmarkRelationsClientDeleteResponse contains the response from method BookmarkRelationsClient.Delete. type BookmarkRelationsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // BookmarkRelationsClientGetResponse contains the response from method BookmarkRelationsClient.Get. type BookmarkRelationsClientGetResponse struct { - BookmarkRelationsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BookmarkRelationsClientGetResult contains the result from method BookmarkRelationsClient.Get. -type BookmarkRelationsClientGetResult struct { Relation } // BookmarkRelationsClientListResponse contains the response from method BookmarkRelationsClient.List. type BookmarkRelationsClientListResponse struct { - BookmarkRelationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BookmarkRelationsClientListResult contains the result from method BookmarkRelationsClient.List. -type BookmarkRelationsClientListResult struct { RelationList } // BookmarksClientCreateOrUpdateResponse contains the response from method BookmarksClient.CreateOrUpdate. type BookmarksClientCreateOrUpdateResponse struct { - BookmarksClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BookmarksClientCreateOrUpdateResult contains the result from method BookmarksClient.CreateOrUpdate. -type BookmarksClientCreateOrUpdateResult struct { Bookmark } // BookmarksClientDeleteResponse contains the response from method BookmarksClient.Delete. type BookmarksClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // BookmarksClientGetResponse contains the response from method BookmarksClient.Get. type BookmarksClientGetResponse struct { - BookmarksClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BookmarksClientGetResult contains the result from method BookmarksClient.Get. -type BookmarksClientGetResult struct { Bookmark } // BookmarksClientListResponse contains the response from method BookmarksClient.List. type BookmarksClientListResponse struct { - BookmarksClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// BookmarksClientListResult contains the result from method BookmarksClient.List. -type BookmarksClientListResult struct { BookmarkList } // DataConnectorsCheckRequirementsClientPostResponse contains the response from method DataConnectorsCheckRequirementsClient.Post. type DataConnectorsCheckRequirementsClientPostResponse struct { - DataConnectorsCheckRequirementsClientPostResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DataConnectorsCheckRequirementsClientPostResult contains the result from method DataConnectorsCheckRequirementsClient.Post. -type DataConnectorsCheckRequirementsClientPostResult struct { DataConnectorRequirementsState } // DataConnectorsClientConnectResponse contains the response from method DataConnectorsClient.Connect. type DataConnectorsClientConnectResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // DataConnectorsClientCreateOrUpdateResponse contains the response from method DataConnectorsClient.CreateOrUpdate. type DataConnectorsClientCreateOrUpdateResponse struct { - DataConnectorsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DataConnectorsClientCreateOrUpdateResult contains the result from method DataConnectorsClient.CreateOrUpdate. -type DataConnectorsClientCreateOrUpdateResult struct { DataConnectorClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectorsClientCreateOrUpdateResult. -func (d *DataConnectorsClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectorsClientCreateOrUpdateResponse. +func (d *DataConnectorsClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalDataConnectorClassification(data) if err != nil { return err @@ -348,30 +181,21 @@ func (d *DataConnectorsClientCreateOrUpdateResult) UnmarshalJSON(data []byte) er // DataConnectorsClientDeleteResponse contains the response from method DataConnectorsClient.Delete. type DataConnectorsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // DataConnectorsClientDisconnectResponse contains the response from method DataConnectorsClient.Disconnect. type DataConnectorsClientDisconnectResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // DataConnectorsClientGetResponse contains the response from method DataConnectorsClient.Get. type DataConnectorsClientGetResponse struct { - DataConnectorsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DataConnectorsClientGetResult contains the result from method DataConnectorsClient.Get. -type DataConnectorsClientGetResult struct { DataConnectorClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectorsClientGetResult. -func (d *DataConnectorsClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataConnectorsClientGetResponse. +func (d *DataConnectorsClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalDataConnectorClassification(data) if err != nil { return err @@ -382,66 +206,31 @@ func (d *DataConnectorsClientGetResult) UnmarshalJSON(data []byte) error { // DataConnectorsClientListResponse contains the response from method DataConnectorsClient.List. type DataConnectorsClientListResponse struct { - DataConnectorsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DataConnectorsClientListResult contains the result from method DataConnectorsClient.List. -type DataConnectorsClientListResult struct { DataConnectorList } // DomainWhoisClientGetResponse contains the response from method DomainWhoisClient.Get. type DomainWhoisClientGetResponse struct { - DomainWhoisClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DomainWhoisClientGetResult contains the result from method DomainWhoisClient.Get. -type DomainWhoisClientGetResult struct { EnrichmentDomainWhois } // EntitiesClientExpandResponse contains the response from method EntitiesClient.Expand. type EntitiesClientExpandResponse struct { - EntitiesClientExpandResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntitiesClientExpandResult contains the result from method EntitiesClient.Expand. -type EntitiesClientExpandResult struct { EntityExpandResponse } // EntitiesClientGetInsightsResponse contains the response from method EntitiesClient.GetInsights. type EntitiesClientGetInsightsResponse struct { - EntitiesClientGetInsightsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntitiesClientGetInsightsResult contains the result from method EntitiesClient.GetInsights. -type EntitiesClientGetInsightsResult struct { EntityGetInsightsResponse } // EntitiesClientGetResponse contains the response from method EntitiesClient.Get. type EntitiesClientGetResponse struct { - EntitiesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntitiesClientGetResult contains the result from method EntitiesClient.Get. -type EntitiesClientGetResult struct { EntityClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type EntitiesClientGetResult. -func (e *EntitiesClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EntitiesClientGetResponse. +func (e *EntitiesClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalEntityClassification(data) if err != nil { return err @@ -452,66 +241,31 @@ func (e *EntitiesClientGetResult) UnmarshalJSON(data []byte) error { // EntitiesClientListResponse contains the response from method EntitiesClient.List. type EntitiesClientListResponse struct { - EntitiesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntitiesClientListResult contains the result from method EntitiesClient.List. -type EntitiesClientListResult struct { EntityList } // EntitiesClientQueriesResponse contains the response from method EntitiesClient.Queries. type EntitiesClientQueriesResponse struct { - EntitiesClientQueriesResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntitiesClientQueriesResult contains the result from method EntitiesClient.Queries. -type EntitiesClientQueriesResult struct { GetQueriesResponse } // EntitiesGetTimelineClientListResponse contains the response from method EntitiesGetTimelineClient.List. type EntitiesGetTimelineClientListResponse struct { - EntitiesGetTimelineClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntitiesGetTimelineClientListResult contains the result from method EntitiesGetTimelineClient.List. -type EntitiesGetTimelineClientListResult struct { EntityTimelineResponse } // EntitiesRelationsClientListResponse contains the response from method EntitiesRelationsClient.List. type EntitiesRelationsClientListResponse struct { - EntitiesRelationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntitiesRelationsClientListResult contains the result from method EntitiesRelationsClient.List. -type EntitiesRelationsClientListResult struct { RelationList } // EntityQueriesClientCreateOrUpdateResponse contains the response from method EntityQueriesClient.CreateOrUpdate. type EntityQueriesClientCreateOrUpdateResponse struct { - EntityQueriesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntityQueriesClientCreateOrUpdateResult contains the result from method EntityQueriesClient.CreateOrUpdate. -type EntityQueriesClientCreateOrUpdateResult struct { EntityQueryClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueriesClientCreateOrUpdateResult. -func (e *EntityQueriesClientCreateOrUpdateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueriesClientCreateOrUpdateResponse. +func (e *EntityQueriesClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalEntityQueryClassification(data) if err != nil { return err @@ -522,24 +276,16 @@ func (e *EntityQueriesClientCreateOrUpdateResult) UnmarshalJSON(data []byte) err // EntityQueriesClientDeleteResponse contains the response from method EntityQueriesClient.Delete. type EntityQueriesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // EntityQueriesClientGetResponse contains the response from method EntityQueriesClient.Get. type EntityQueriesClientGetResponse struct { - EntityQueriesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntityQueriesClientGetResult contains the result from method EntityQueriesClient.Get. -type EntityQueriesClientGetResult struct { EntityQueryClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueriesClientGetResult. -func (e *EntityQueriesClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueriesClientGetResponse. +func (e *EntityQueriesClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalEntityQueryClassification(data) if err != nil { return err @@ -550,30 +296,16 @@ func (e *EntityQueriesClientGetResult) UnmarshalJSON(data []byte) error { // EntityQueriesClientListResponse contains the response from method EntityQueriesClient.List. type EntityQueriesClientListResponse struct { - EntityQueriesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntityQueriesClientListResult contains the result from method EntityQueriesClient.List. -type EntityQueriesClientListResult struct { EntityQueryList } // EntityQueryTemplatesClientGetResponse contains the response from method EntityQueryTemplatesClient.Get. type EntityQueryTemplatesClientGetResponse struct { - EntityQueryTemplatesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntityQueryTemplatesClientGetResult contains the result from method EntityQueryTemplatesClient.Get. -type EntityQueryTemplatesClientGetResult struct { EntityQueryTemplateClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueryTemplatesClientGetResult. -func (e *EntityQueryTemplatesClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type EntityQueryTemplatesClientGetResponse. +func (e *EntityQueryTemplatesClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalEntityQueryTemplateClassification(data) if err != nil { return err @@ -584,330 +316,162 @@ func (e *EntityQueryTemplatesClientGetResult) UnmarshalJSON(data []byte) error { // EntityQueryTemplatesClientListResponse contains the response from method EntityQueryTemplatesClient.List. type EntityQueryTemplatesClientListResponse struct { - EntityQueryTemplatesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntityQueryTemplatesClientListResult contains the result from method EntityQueryTemplatesClient.List. -type EntityQueryTemplatesClientListResult struct { EntityQueryTemplateList } // EntityRelationsClientGetRelationResponse contains the response from method EntityRelationsClient.GetRelation. type EntityRelationsClientGetRelationResponse struct { - EntityRelationsClientGetRelationResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// EntityRelationsClientGetRelationResult contains the result from method EntityRelationsClient.GetRelation. -type EntityRelationsClientGetRelationResult struct { Relation } // IPGeodataClientGetResponse contains the response from method IPGeodataClient.Get. type IPGeodataClientGetResponse struct { - IPGeodataClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IPGeodataClientGetResult contains the result from method IPGeodataClient.Get. -type IPGeodataClientGetResult struct { EnrichmentIPGeodata } // IncidentCommentsClientCreateOrUpdateResponse contains the response from method IncidentCommentsClient.CreateOrUpdate. type IncidentCommentsClientCreateOrUpdateResponse struct { - IncidentCommentsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentCommentsClientCreateOrUpdateResult contains the result from method IncidentCommentsClient.CreateOrUpdate. -type IncidentCommentsClientCreateOrUpdateResult struct { IncidentComment } // IncidentCommentsClientDeleteResponse contains the response from method IncidentCommentsClient.Delete. type IncidentCommentsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // IncidentCommentsClientGetResponse contains the response from method IncidentCommentsClient.Get. type IncidentCommentsClientGetResponse struct { - IncidentCommentsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentCommentsClientGetResult contains the result from method IncidentCommentsClient.Get. -type IncidentCommentsClientGetResult struct { IncidentComment } // IncidentCommentsClientListResponse contains the response from method IncidentCommentsClient.List. type IncidentCommentsClientListResponse struct { - IncidentCommentsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentCommentsClientListResult contains the result from method IncidentCommentsClient.List. -type IncidentCommentsClientListResult struct { IncidentCommentList } // IncidentRelationsClientCreateOrUpdateResponse contains the response from method IncidentRelationsClient.CreateOrUpdate. type IncidentRelationsClientCreateOrUpdateResponse struct { - IncidentRelationsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentRelationsClientCreateOrUpdateResult contains the result from method IncidentRelationsClient.CreateOrUpdate. -type IncidentRelationsClientCreateOrUpdateResult struct { Relation } // IncidentRelationsClientDeleteResponse contains the response from method IncidentRelationsClient.Delete. type IncidentRelationsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // IncidentRelationsClientGetResponse contains the response from method IncidentRelationsClient.Get. type IncidentRelationsClientGetResponse struct { - IncidentRelationsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentRelationsClientGetResult contains the result from method IncidentRelationsClient.Get. -type IncidentRelationsClientGetResult struct { Relation } // IncidentRelationsClientListResponse contains the response from method IncidentRelationsClient.List. type IncidentRelationsClientListResponse struct { - IncidentRelationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentRelationsClientListResult contains the result from method IncidentRelationsClient.List. -type IncidentRelationsClientListResult struct { RelationList } // IncidentsClientCreateOrUpdateResponse contains the response from method IncidentsClient.CreateOrUpdate. type IncidentsClientCreateOrUpdateResponse struct { - IncidentsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentsClientCreateOrUpdateResult contains the result from method IncidentsClient.CreateOrUpdate. -type IncidentsClientCreateOrUpdateResult struct { Incident } // IncidentsClientCreateTeamResponse contains the response from method IncidentsClient.CreateTeam. type IncidentsClientCreateTeamResponse struct { - IncidentsClientCreateTeamResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentsClientCreateTeamResult contains the result from method IncidentsClient.CreateTeam. -type IncidentsClientCreateTeamResult struct { TeamInformation } // IncidentsClientDeleteResponse contains the response from method IncidentsClient.Delete. type IncidentsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // IncidentsClientGetResponse contains the response from method IncidentsClient.Get. type IncidentsClientGetResponse struct { - IncidentsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentsClientGetResult contains the result from method IncidentsClient.Get. -type IncidentsClientGetResult struct { Incident } // IncidentsClientListAlertsResponse contains the response from method IncidentsClient.ListAlerts. type IncidentsClientListAlertsResponse struct { - IncidentsClientListAlertsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentsClientListAlertsResult contains the result from method IncidentsClient.ListAlerts. -type IncidentsClientListAlertsResult struct { IncidentAlertList } // IncidentsClientListBookmarksResponse contains the response from method IncidentsClient.ListBookmarks. type IncidentsClientListBookmarksResponse struct { - IncidentsClientListBookmarksResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentsClientListBookmarksResult contains the result from method IncidentsClient.ListBookmarks. -type IncidentsClientListBookmarksResult struct { IncidentBookmarkList } // IncidentsClientListEntitiesResponse contains the response from method IncidentsClient.ListEntities. type IncidentsClientListEntitiesResponse struct { - IncidentsClientListEntitiesResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IncidentsClientListEntitiesResult contains the result from method IncidentsClient.ListEntities. -type IncidentsClientListEntitiesResult struct { IncidentEntitiesResponse } // IncidentsClientListResponse contains the response from method IncidentsClient.List. type IncidentsClientListResponse struct { - IncidentsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + IncidentList } -// IncidentsClientListResult contains the result from method IncidentsClient.List. -type IncidentsClientListResult struct { - IncidentList +// IncidentsClientRunPlaybookResponse contains the response from method IncidentsClient.RunPlaybook. +type IncidentsClientRunPlaybookResponse struct { + // Anything + Interface interface{} } // MetadataClientCreateResponse contains the response from method MetadataClient.Create. type MetadataClientCreateResponse struct { - MetadataClientCreateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MetadataClientCreateResult contains the result from method MetadataClient.Create. -type MetadataClientCreateResult struct { MetadataModel } // MetadataClientDeleteResponse contains the response from method MetadataClient.Delete. type MetadataClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // MetadataClientGetResponse contains the response from method MetadataClient.Get. type MetadataClientGetResponse struct { - MetadataClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MetadataClientGetResult contains the result from method MetadataClient.Get. -type MetadataClientGetResult struct { MetadataModel } // MetadataClientListResponse contains the response from method MetadataClient.List. type MetadataClientListResponse struct { - MetadataClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MetadataClientListResult contains the result from method MetadataClient.List. -type MetadataClientListResult struct { MetadataList } // MetadataClientUpdateResponse contains the response from method MetadataClient.Update. type MetadataClientUpdateResponse struct { - MetadataClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MetadataClientUpdateResult contains the result from method MetadataClient.Update. -type MetadataClientUpdateResult struct { MetadataModel } // OfficeConsentsClientDeleteResponse contains the response from method OfficeConsentsClient.Delete. type OfficeConsentsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // OfficeConsentsClientGetResponse contains the response from method OfficeConsentsClient.Get. type OfficeConsentsClientGetResponse struct { - OfficeConsentsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OfficeConsentsClientGetResult contains the result from method OfficeConsentsClient.Get. -type OfficeConsentsClientGetResult struct { OfficeConsent } // OfficeConsentsClientListResponse contains the response from method OfficeConsentsClient.List. type OfficeConsentsClientListResponse struct { - OfficeConsentsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OfficeConsentsClientListResult contains the result from method OfficeConsentsClient.List. -type OfficeConsentsClientListResult struct { OfficeConsentList } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationsList } // ProductSettingsClientDeleteResponse contains the response from method ProductSettingsClient.Delete. type ProductSettingsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ProductSettingsClientGetResponse contains the response from method ProductSettingsClient.Get. type ProductSettingsClientGetResponse struct { - ProductSettingsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ProductSettingsClientGetResult contains the result from method ProductSettingsClient.Get. -type ProductSettingsClientGetResult struct { SettingsClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductSettingsClientGetResult. -func (p *ProductSettingsClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductSettingsClientGetResponse. +func (p *ProductSettingsClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalSettingsClassification(data) if err != nil { return err @@ -918,30 +482,16 @@ func (p *ProductSettingsClientGetResult) UnmarshalJSON(data []byte) error { // ProductSettingsClientListResponse contains the response from method ProductSettingsClient.List. type ProductSettingsClientListResponse struct { - ProductSettingsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ProductSettingsClientListResult contains the result from method ProductSettingsClient.List. -type ProductSettingsClientListResult struct { SettingList } // ProductSettingsClientUpdateResponse contains the response from method ProductSettingsClient.Update. type ProductSettingsClientUpdateResponse struct { - ProductSettingsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ProductSettingsClientUpdateResult contains the result from method ProductSettingsClient.Update. -type ProductSettingsClientUpdateResult struct { SettingsClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProductSettingsClientUpdateResult. -func (p *ProductSettingsClientUpdateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductSettingsClientUpdateResponse. +func (p *ProductSettingsClientUpdateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalSettingsClassification(data) if err != nil { return err @@ -952,120 +502,61 @@ func (p *ProductSettingsClientUpdateResult) UnmarshalJSON(data []byte) error { // SentinelOnboardingStatesClientCreateResponse contains the response from method SentinelOnboardingStatesClient.Create. type SentinelOnboardingStatesClientCreateResponse struct { - SentinelOnboardingStatesClientCreateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SentinelOnboardingStatesClientCreateResult contains the result from method SentinelOnboardingStatesClient.Create. -type SentinelOnboardingStatesClientCreateResult struct { SentinelOnboardingState } // SentinelOnboardingStatesClientDeleteResponse contains the response from method SentinelOnboardingStatesClient.Delete. type SentinelOnboardingStatesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // SentinelOnboardingStatesClientGetResponse contains the response from method SentinelOnboardingStatesClient.Get. type SentinelOnboardingStatesClientGetResponse struct { - SentinelOnboardingStatesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SentinelOnboardingStatesClientGetResult contains the result from method SentinelOnboardingStatesClient.Get. -type SentinelOnboardingStatesClientGetResult struct { SentinelOnboardingState } // SentinelOnboardingStatesClientListResponse contains the response from method SentinelOnboardingStatesClient.List. type SentinelOnboardingStatesClientListResponse struct { - SentinelOnboardingStatesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SentinelOnboardingStatesClientListResult contains the result from method SentinelOnboardingStatesClient.List. -type SentinelOnboardingStatesClientListResult struct { SentinelOnboardingStatesList } // SourceControlClientListRepositoriesResponse contains the response from method SourceControlClient.ListRepositories. type SourceControlClientListRepositoriesResponse struct { - SourceControlClientListRepositoriesResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SourceControlClientListRepositoriesResult contains the result from method SourceControlClient.ListRepositories. -type SourceControlClientListRepositoriesResult struct { RepoList } // SourceControlsClientCreateResponse contains the response from method SourceControlsClient.Create. type SourceControlsClientCreateResponse struct { - SourceControlsClientCreateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SourceControlsClientCreateResult contains the result from method SourceControlsClient.Create. -type SourceControlsClientCreateResult struct { SourceControl } // SourceControlsClientDeleteResponse contains the response from method SourceControlsClient.Delete. type SourceControlsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // SourceControlsClientGetResponse contains the response from method SourceControlsClient.Get. type SourceControlsClientGetResponse struct { - SourceControlsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SourceControlsClientGetResult contains the result from method SourceControlsClient.Get. -type SourceControlsClientGetResult struct { SourceControl } // SourceControlsClientListResponse contains the response from method SourceControlsClient.List. type SourceControlsClientListResponse struct { - SourceControlsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SourceControlsClientListResult contains the result from method SourceControlsClient.List. -type SourceControlsClientListResult struct { SourceControlList } // ThreatIntelligenceIndicatorClientAppendTagsResponse contains the response from method ThreatIntelligenceIndicatorClient.AppendTags. type ThreatIntelligenceIndicatorClientAppendTagsResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ThreatIntelligenceIndicatorClientCreateIndicatorResponse contains the response from method ThreatIntelligenceIndicatorClient.CreateIndicator. type ThreatIntelligenceIndicatorClientCreateIndicatorResponse struct { - ThreatIntelligenceIndicatorClientCreateIndicatorResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ThreatIntelligenceIndicatorClientCreateIndicatorResult contains the result from method ThreatIntelligenceIndicatorClient.CreateIndicator. -type ThreatIntelligenceIndicatorClientCreateIndicatorResult struct { ThreatIntelligenceInformationClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientCreateIndicatorResult. -func (t *ThreatIntelligenceIndicatorClientCreateIndicatorResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientCreateIndicatorResponse. +func (t *ThreatIntelligenceIndicatorClientCreateIndicatorResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalThreatIntelligenceInformationClassification(data) if err != nil { return err @@ -1076,18 +567,11 @@ func (t *ThreatIntelligenceIndicatorClientCreateIndicatorResult) UnmarshalJSON(d // ThreatIntelligenceIndicatorClientCreateResponse contains the response from method ThreatIntelligenceIndicatorClient.Create. type ThreatIntelligenceIndicatorClientCreateResponse struct { - ThreatIntelligenceIndicatorClientCreateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ThreatIntelligenceIndicatorClientCreateResult contains the result from method ThreatIntelligenceIndicatorClient.Create. -type ThreatIntelligenceIndicatorClientCreateResult struct { ThreatIntelligenceInformationClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientCreateResult. -func (t *ThreatIntelligenceIndicatorClientCreateResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientCreateResponse. +func (t *ThreatIntelligenceIndicatorClientCreateResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalThreatIntelligenceInformationClassification(data) if err != nil { return err @@ -1098,24 +582,16 @@ func (t *ThreatIntelligenceIndicatorClientCreateResult) UnmarshalJSON(data []byt // ThreatIntelligenceIndicatorClientDeleteResponse contains the response from method ThreatIntelligenceIndicatorClient.Delete. type ThreatIntelligenceIndicatorClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ThreatIntelligenceIndicatorClientGetResponse contains the response from method ThreatIntelligenceIndicatorClient.Get. type ThreatIntelligenceIndicatorClientGetResponse struct { - ThreatIntelligenceIndicatorClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ThreatIntelligenceIndicatorClientGetResult contains the result from method ThreatIntelligenceIndicatorClient.Get. -type ThreatIntelligenceIndicatorClientGetResult struct { ThreatIntelligenceInformationClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientGetResult. -func (t *ThreatIntelligenceIndicatorClientGetResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientGetResponse. +func (t *ThreatIntelligenceIndicatorClientGetResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalThreatIntelligenceInformationClassification(data) if err != nil { return err @@ -1126,30 +602,16 @@ func (t *ThreatIntelligenceIndicatorClientGetResult) UnmarshalJSON(data []byte) // ThreatIntelligenceIndicatorClientQueryIndicatorsResponse contains the response from method ThreatIntelligenceIndicatorClient.QueryIndicators. type ThreatIntelligenceIndicatorClientQueryIndicatorsResponse struct { - ThreatIntelligenceIndicatorClientQueryIndicatorsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ThreatIntelligenceIndicatorClientQueryIndicatorsResult contains the result from method ThreatIntelligenceIndicatorClient.QueryIndicators. -type ThreatIntelligenceIndicatorClientQueryIndicatorsResult struct { ThreatIntelligenceInformationList } // ThreatIntelligenceIndicatorClientReplaceTagsResponse contains the response from method ThreatIntelligenceIndicatorClient.ReplaceTags. type ThreatIntelligenceIndicatorClientReplaceTagsResponse struct { - ThreatIntelligenceIndicatorClientReplaceTagsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ThreatIntelligenceIndicatorClientReplaceTagsResult contains the result from method ThreatIntelligenceIndicatorClient.ReplaceTags. -type ThreatIntelligenceIndicatorClientReplaceTagsResult struct { ThreatIntelligenceInformationClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientReplaceTagsResult. -func (t *ThreatIntelligenceIndicatorClientReplaceTagsResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ThreatIntelligenceIndicatorClientReplaceTagsResponse. +func (t *ThreatIntelligenceIndicatorClientReplaceTagsResponse) UnmarshalJSON(data []byte) error { res, err := unmarshalThreatIntelligenceInformationClassification(data) if err != nil { return err @@ -1160,108 +622,53 @@ func (t *ThreatIntelligenceIndicatorClientReplaceTagsResult) UnmarshalJSON(data // ThreatIntelligenceIndicatorMetricsClientListResponse contains the response from method ThreatIntelligenceIndicatorMetricsClient.List. type ThreatIntelligenceIndicatorMetricsClientListResponse struct { - ThreatIntelligenceIndicatorMetricsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ThreatIntelligenceIndicatorMetricsClientListResult contains the result from method ThreatIntelligenceIndicatorMetricsClient.List. -type ThreatIntelligenceIndicatorMetricsClientListResult struct { ThreatIntelligenceMetricsList } // ThreatIntelligenceIndicatorsClientListResponse contains the response from method ThreatIntelligenceIndicatorsClient.List. type ThreatIntelligenceIndicatorsClientListResponse struct { - ThreatIntelligenceIndicatorsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ThreatIntelligenceIndicatorsClientListResult contains the result from method ThreatIntelligenceIndicatorsClient.List. -type ThreatIntelligenceIndicatorsClientListResult struct { ThreatIntelligenceInformationList } // WatchlistItemsClientCreateOrUpdateResponse contains the response from method WatchlistItemsClient.CreateOrUpdate. type WatchlistItemsClientCreateOrUpdateResponse struct { - WatchlistItemsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WatchlistItemsClientCreateOrUpdateResult contains the result from method WatchlistItemsClient.CreateOrUpdate. -type WatchlistItemsClientCreateOrUpdateResult struct { WatchlistItem } // WatchlistItemsClientDeleteResponse contains the response from method WatchlistItemsClient.Delete. type WatchlistItemsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // WatchlistItemsClientGetResponse contains the response from method WatchlistItemsClient.Get. type WatchlistItemsClientGetResponse struct { - WatchlistItemsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WatchlistItemsClientGetResult contains the result from method WatchlistItemsClient.Get. -type WatchlistItemsClientGetResult struct { WatchlistItem } // WatchlistItemsClientListResponse contains the response from method WatchlistItemsClient.List. type WatchlistItemsClientListResponse struct { - WatchlistItemsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WatchlistItemsClientListResult contains the result from method WatchlistItemsClient.List. -type WatchlistItemsClientListResult struct { WatchlistItemList } // WatchlistsClientCreateOrUpdateResponse contains the response from method WatchlistsClient.CreateOrUpdate. type WatchlistsClientCreateOrUpdateResponse struct { - WatchlistsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WatchlistsClientCreateOrUpdateResult contains the result from method WatchlistsClient.CreateOrUpdate. -type WatchlistsClientCreateOrUpdateResult struct { Watchlist + // AzureAsyncOperation contains the information returned from the Azure-AsyncOperation header response. + AzureAsyncOperation *string } // WatchlistsClientDeleteResponse contains the response from method WatchlistsClient.Delete. type WatchlistsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // AzureAsyncOperation contains the information returned from the Azure-AsyncOperation header response. + AzureAsyncOperation *string } // WatchlistsClientGetResponse contains the response from method WatchlistsClient.Get. type WatchlistsClientGetResponse struct { - WatchlistsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WatchlistsClientGetResult contains the result from method WatchlistsClient.Get. -type WatchlistsClientGetResult struct { Watchlist } // WatchlistsClientListResponse contains the response from method WatchlistsClient.List. type WatchlistsClientListResponse struct { - WatchlistsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WatchlistsClientListResult contains the result from method WatchlistsClient.List. -type WatchlistsClientListResult struct { WatchlistList } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go index 409a0b930905..a2b8ddbe4dbd 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type SentinelOnboardingStatesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewSentinelOnboardingStatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SentinelOnboardingStatesClient { +func NewSentinelOnboardingStatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SentinelOnboardingStatesClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &SentinelOnboardingStatesClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Create - Create Sentinel onboarding state @@ -95,7 +100,7 @@ func (client *SentinelOnboardingStatesClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.SentinelOnboardingStateParameter != nil { @@ -106,7 +111,7 @@ func (client *SentinelOnboardingStatesClient) createCreateRequest(ctx context.Co // createHandleResponse handles the Create response. func (client *SentinelOnboardingStatesClient) createHandleResponse(resp *http.Response) (SentinelOnboardingStatesClientCreateResponse, error) { - result := SentinelOnboardingStatesClientCreateResponse{RawResponse: resp} + result := SentinelOnboardingStatesClientCreateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SentinelOnboardingState); err != nil { return SentinelOnboardingStatesClientCreateResponse{}, err } @@ -132,7 +137,7 @@ func (client *SentinelOnboardingStatesClient) Delete(ctx context.Context, resour if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return SentinelOnboardingStatesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return SentinelOnboardingStatesClientDeleteResponse{RawResponse: resp}, nil + return SentinelOnboardingStatesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -159,7 +164,7 @@ func (client *SentinelOnboardingStatesClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -211,7 +216,7 @@ func (client *SentinelOnboardingStatesClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -219,7 +224,7 @@ func (client *SentinelOnboardingStatesClient) getCreateRequest(ctx context.Conte // getHandleResponse handles the Get response. func (client *SentinelOnboardingStatesClient) getHandleResponse(resp *http.Response) (SentinelOnboardingStatesClientGetResponse, error) { - result := SentinelOnboardingStatesClientGetResponse{RawResponse: resp} + result := SentinelOnboardingStatesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SentinelOnboardingState); err != nil { return SentinelOnboardingStatesClientGetResponse{}, err } @@ -267,7 +272,7 @@ func (client *SentinelOnboardingStatesClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -275,7 +280,7 @@ func (client *SentinelOnboardingStatesClient) listCreateRequest(ctx context.Cont // listHandleResponse handles the List response. func (client *SentinelOnboardingStatesClient) listHandleResponse(resp *http.Response) (SentinelOnboardingStatesClientListResponse, error) { - result := SentinelOnboardingStatesClientListResponse{RawResponse: resp} + result := SentinelOnboardingStatesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SentinelOnboardingStatesList); err != nil { return SentinelOnboardingStatesClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrol_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrol_client.go index e0e2f83bbede..795294623b24 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrol_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrol_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type SourceControlClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewSourceControlClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SourceControlClient { +func NewSourceControlClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SourceControlClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &SourceControlClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // ListRepositories - Gets a list of repositories metadata. @@ -56,16 +61,32 @@ func NewSourceControlClient(subscriptionID string, credential azcore.TokenCreden // repoType - The repo type. // options - SourceControlClientListRepositoriesOptions contains the optional parameters for the SourceControlClient.ListRepositories // method. -func (client *SourceControlClient) ListRepositories(resourceGroupName string, workspaceName string, repoType RepoType, options *SourceControlClientListRepositoriesOptions) *SourceControlClientListRepositoriesPager { - return &SourceControlClientListRepositoriesPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listRepositoriesCreateRequest(ctx, resourceGroupName, workspaceName, repoType, options) +func (client *SourceControlClient) ListRepositories(resourceGroupName string, workspaceName string, repoType RepoType, options *SourceControlClientListRepositoriesOptions) *runtime.Pager[SourceControlClientListRepositoriesResponse] { + return runtime.NewPager(runtime.PageProcessor[SourceControlClientListRepositoriesResponse]{ + More: func(page SourceControlClientListRepositoriesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp SourceControlClientListRepositoriesResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.RepoList.NextLink) + Fetcher: func(ctx context.Context, page *SourceControlClientListRepositoriesResponse) (SourceControlClientListRepositoriesResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listRepositoriesCreateRequest(ctx, resourceGroupName, workspaceName, repoType, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SourceControlClientListRepositoriesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SourceControlClientListRepositoriesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SourceControlClientListRepositoriesResponse{}, runtime.NewResponseError(resp) + } + return client.listRepositoriesHandleResponse(resp) }, - } + }) } // listRepositoriesCreateRequest creates the ListRepositories request. @@ -88,7 +109,7 @@ func (client *SourceControlClient) listRepositoriesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, repoType) @@ -96,7 +117,7 @@ func (client *SourceControlClient) listRepositoriesCreateRequest(ctx context.Con // listRepositoriesHandleResponse handles the ListRepositories response. func (client *SourceControlClient) listRepositoriesHandleResponse(resp *http.Response) (SourceControlClientListRepositoriesResponse, error) { - result := SourceControlClientListRepositoriesResponse{RawResponse: resp} + result := SourceControlClientListRepositoriesResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RepoList); err != nil { return SourceControlClientListRepositoriesResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrols_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrols_client.go index e8f09400d678..2347d6a69655 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrols_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrols_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type SourceControlsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewSourceControlsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SourceControlsClient { +func NewSourceControlsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SourceControlsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &SourceControlsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // Create - Creates a source control. @@ -95,7 +100,7 @@ func (client *SourceControlsClient) createCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, sourceControl) @@ -103,7 +108,7 @@ func (client *SourceControlsClient) createCreateRequest(ctx context.Context, res // createHandleResponse handles the Create response. func (client *SourceControlsClient) createHandleResponse(resp *http.Response) (SourceControlsClientCreateResponse, error) { - result := SourceControlsClientCreateResponse{RawResponse: resp} + result := SourceControlsClientCreateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SourceControl); err != nil { return SourceControlsClientCreateResponse{}, err } @@ -128,7 +133,7 @@ func (client *SourceControlsClient) Delete(ctx context.Context, resourceGroupNam if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return SourceControlsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return SourceControlsClientDeleteResponse{RawResponse: resp}, nil + return SourceControlsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -155,7 +160,7 @@ func (client *SourceControlsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -206,7 +211,7 @@ func (client *SourceControlsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -214,7 +219,7 @@ func (client *SourceControlsClient) getCreateRequest(ctx context.Context, resour // getHandleResponse handles the Get response. func (client *SourceControlsClient) getHandleResponse(resp *http.Response) (SourceControlsClientGetResponse, error) { - result := SourceControlsClientGetResponse{RawResponse: resp} + result := SourceControlsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SourceControl); err != nil { return SourceControlsClientGetResponse{}, err } @@ -226,16 +231,32 @@ func (client *SourceControlsClient) getHandleResponse(resp *http.Response) (Sour // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - SourceControlsClientListOptions contains the optional parameters for the SourceControlsClient.List method. -func (client *SourceControlsClient) List(resourceGroupName string, workspaceName string, options *SourceControlsClientListOptions) *SourceControlsClientListPager { - return &SourceControlsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *SourceControlsClient) List(resourceGroupName string, workspaceName string, options *SourceControlsClientListOptions) *runtime.Pager[SourceControlsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[SourceControlsClientListResponse]{ + More: func(page SourceControlsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp SourceControlsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SourceControlList.NextLink) + Fetcher: func(ctx context.Context, page *SourceControlsClientListResponse) (SourceControlsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SourceControlsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SourceControlsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SourceControlsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -258,7 +279,7 @@ func (client *SourceControlsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -266,7 +287,7 @@ func (client *SourceControlsClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *SourceControlsClient) listHandleResponse(resp *http.Response) (SourceControlsClientListResponse, error) { - result := SourceControlsClientListResponse{RawResponse: resp} + result := SourceControlsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SourceControlList); err != nil { return SourceControlsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go index 165cd518fff5..fb1c53338e4c 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type ThreatIntelligenceIndicatorClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewThreatIntelligenceIndicatorClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ThreatIntelligenceIndicatorClient { +func NewThreatIntelligenceIndicatorClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ThreatIntelligenceIndicatorClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ThreatIntelligenceIndicatorClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // AppendTags - Append tags to a threat intelligence indicator. @@ -69,7 +74,7 @@ func (client *ThreatIntelligenceIndicatorClient) AppendTags(ctx context.Context, if !runtime.HasStatusCode(resp, http.StatusOK) { return ThreatIntelligenceIndicatorClientAppendTagsResponse{}, runtime.NewResponseError(resp) } - return ThreatIntelligenceIndicatorClientAppendTagsResponse{RawResponse: resp}, nil + return ThreatIntelligenceIndicatorClientAppendTagsResponse{}, nil } // appendTagsCreateRequest creates the AppendTags request. @@ -96,7 +101,7 @@ func (client *ThreatIntelligenceIndicatorClient) appendTagsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, threatIntelligenceAppendTags) @@ -110,7 +115,7 @@ func (client *ThreatIntelligenceIndicatorClient) appendTagsCreateRequest(ctx con // threatIntelligenceProperties - Properties of threat intelligence indicators to create and update. // options - ThreatIntelligenceIndicatorClientCreateOptions contains the optional parameters for the ThreatIntelligenceIndicatorClient.Create // method. -func (client *ThreatIntelligenceIndicatorClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceProperties ThreatIntelligenceIndicatorModelForRequestBody, options *ThreatIntelligenceIndicatorClientCreateOptions) (ThreatIntelligenceIndicatorClientCreateResponse, error) { +func (client *ThreatIntelligenceIndicatorClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceProperties ThreatIntelligenceIndicatorModel, options *ThreatIntelligenceIndicatorClientCreateOptions) (ThreatIntelligenceIndicatorClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, workspaceName, name, threatIntelligenceProperties, options) if err != nil { return ThreatIntelligenceIndicatorClientCreateResponse{}, err @@ -126,7 +131,7 @@ func (client *ThreatIntelligenceIndicatorClient) Create(ctx context.Context, res } // createCreateRequest creates the Create request. -func (client *ThreatIntelligenceIndicatorClient) createCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceProperties ThreatIntelligenceIndicatorModelForRequestBody, options *ThreatIntelligenceIndicatorClientCreateOptions) (*policy.Request, error) { +func (client *ThreatIntelligenceIndicatorClient) createCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceProperties ThreatIntelligenceIndicatorModel, options *ThreatIntelligenceIndicatorClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -149,7 +154,7 @@ func (client *ThreatIntelligenceIndicatorClient) createCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, threatIntelligenceProperties) @@ -157,7 +162,7 @@ func (client *ThreatIntelligenceIndicatorClient) createCreateRequest(ctx context // createHandleResponse handles the Create response. func (client *ThreatIntelligenceIndicatorClient) createHandleResponse(resp *http.Response) (ThreatIntelligenceIndicatorClientCreateResponse, error) { - result := ThreatIntelligenceIndicatorClientCreateResponse{RawResponse: resp} + result := ThreatIntelligenceIndicatorClientCreateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return ThreatIntelligenceIndicatorClientCreateResponse{}, err } @@ -171,7 +176,7 @@ func (client *ThreatIntelligenceIndicatorClient) createHandleResponse(resp *http // threatIntelligenceProperties - Properties of threat intelligence indicators to create and update. // options - ThreatIntelligenceIndicatorClientCreateIndicatorOptions contains the optional parameters for the ThreatIntelligenceIndicatorClient.CreateIndicator // method. -func (client *ThreatIntelligenceIndicatorClient) CreateIndicator(ctx context.Context, resourceGroupName string, workspaceName string, threatIntelligenceProperties ThreatIntelligenceIndicatorModelForRequestBody, options *ThreatIntelligenceIndicatorClientCreateIndicatorOptions) (ThreatIntelligenceIndicatorClientCreateIndicatorResponse, error) { +func (client *ThreatIntelligenceIndicatorClient) CreateIndicator(ctx context.Context, resourceGroupName string, workspaceName string, threatIntelligenceProperties ThreatIntelligenceIndicatorModel, options *ThreatIntelligenceIndicatorClientCreateIndicatorOptions) (ThreatIntelligenceIndicatorClientCreateIndicatorResponse, error) { req, err := client.createIndicatorCreateRequest(ctx, resourceGroupName, workspaceName, threatIntelligenceProperties, options) if err != nil { return ThreatIntelligenceIndicatorClientCreateIndicatorResponse{}, err @@ -187,7 +192,7 @@ func (client *ThreatIntelligenceIndicatorClient) CreateIndicator(ctx context.Con } // createIndicatorCreateRequest creates the CreateIndicator request. -func (client *ThreatIntelligenceIndicatorClient) createIndicatorCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, threatIntelligenceProperties ThreatIntelligenceIndicatorModelForRequestBody, options *ThreatIntelligenceIndicatorClientCreateIndicatorOptions) (*policy.Request, error) { +func (client *ThreatIntelligenceIndicatorClient) createIndicatorCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, threatIntelligenceProperties ThreatIntelligenceIndicatorModel, options *ThreatIntelligenceIndicatorClientCreateIndicatorOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +211,7 @@ func (client *ThreatIntelligenceIndicatorClient) createIndicatorCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, threatIntelligenceProperties) @@ -214,7 +219,7 @@ func (client *ThreatIntelligenceIndicatorClient) createIndicatorCreateRequest(ct // createIndicatorHandleResponse handles the CreateIndicator response. func (client *ThreatIntelligenceIndicatorClient) createIndicatorHandleResponse(resp *http.Response) (ThreatIntelligenceIndicatorClientCreateIndicatorResponse, error) { - result := ThreatIntelligenceIndicatorClientCreateIndicatorResponse{RawResponse: resp} + result := ThreatIntelligenceIndicatorClientCreateIndicatorResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return ThreatIntelligenceIndicatorClientCreateIndicatorResponse{}, err } @@ -240,7 +245,7 @@ func (client *ThreatIntelligenceIndicatorClient) Delete(ctx context.Context, res if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ThreatIntelligenceIndicatorClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ThreatIntelligenceIndicatorClientDeleteResponse{RawResponse: resp}, nil + return ThreatIntelligenceIndicatorClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -267,7 +272,7 @@ func (client *ThreatIntelligenceIndicatorClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -319,7 +324,7 @@ func (client *ThreatIntelligenceIndicatorClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -327,7 +332,7 @@ func (client *ThreatIntelligenceIndicatorClient) getCreateRequest(ctx context.Co // getHandleResponse handles the Get response. func (client *ThreatIntelligenceIndicatorClient) getHandleResponse(resp *http.Response) (ThreatIntelligenceIndicatorClientGetResponse, error) { - result := ThreatIntelligenceIndicatorClientGetResponse{RawResponse: resp} + result := ThreatIntelligenceIndicatorClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return ThreatIntelligenceIndicatorClientGetResponse{}, err } @@ -341,16 +346,32 @@ func (client *ThreatIntelligenceIndicatorClient) getHandleResponse(resp *http.Re // threatIntelligenceFilteringCriteria - Filtering criteria for querying threat intelligence indicators. // options - ThreatIntelligenceIndicatorClientQueryIndicatorsOptions contains the optional parameters for the ThreatIntelligenceIndicatorClient.QueryIndicators // method. -func (client *ThreatIntelligenceIndicatorClient) QueryIndicators(resourceGroupName string, workspaceName string, threatIntelligenceFilteringCriteria ThreatIntelligenceFilteringCriteria, options *ThreatIntelligenceIndicatorClientQueryIndicatorsOptions) *ThreatIntelligenceIndicatorClientQueryIndicatorsPager { - return &ThreatIntelligenceIndicatorClientQueryIndicatorsPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.queryIndicatorsCreateRequest(ctx, resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, options) +func (client *ThreatIntelligenceIndicatorClient) QueryIndicators(resourceGroupName string, workspaceName string, threatIntelligenceFilteringCriteria ThreatIntelligenceFilteringCriteria, options *ThreatIntelligenceIndicatorClientQueryIndicatorsOptions) *runtime.Pager[ThreatIntelligenceIndicatorClientQueryIndicatorsResponse] { + return runtime.NewPager(runtime.PageProcessor[ThreatIntelligenceIndicatorClientQueryIndicatorsResponse]{ + More: func(page ThreatIntelligenceIndicatorClientQueryIndicatorsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ThreatIntelligenceIndicatorClientQueryIndicatorsResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ThreatIntelligenceInformationList.NextLink) + Fetcher: func(ctx context.Context, page *ThreatIntelligenceIndicatorClientQueryIndicatorsResponse) (ThreatIntelligenceIndicatorClientQueryIndicatorsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.queryIndicatorsCreateRequest(ctx, resourceGroupName, workspaceName, threatIntelligenceFilteringCriteria, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ThreatIntelligenceIndicatorClientQueryIndicatorsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ThreatIntelligenceIndicatorClientQueryIndicatorsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ThreatIntelligenceIndicatorClientQueryIndicatorsResponse{}, runtime.NewResponseError(resp) + } + return client.queryIndicatorsHandleResponse(resp) }, - } + }) } // queryIndicatorsCreateRequest creates the QueryIndicators request. @@ -373,7 +394,7 @@ func (client *ThreatIntelligenceIndicatorClient) queryIndicatorsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, threatIntelligenceFilteringCriteria) @@ -381,7 +402,7 @@ func (client *ThreatIntelligenceIndicatorClient) queryIndicatorsCreateRequest(ct // queryIndicatorsHandleResponse handles the QueryIndicators response. func (client *ThreatIntelligenceIndicatorClient) queryIndicatorsHandleResponse(resp *http.Response) (ThreatIntelligenceIndicatorClientQueryIndicatorsResponse, error) { - result := ThreatIntelligenceIndicatorClientQueryIndicatorsResponse{RawResponse: resp} + result := ThreatIntelligenceIndicatorClientQueryIndicatorsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ThreatIntelligenceInformationList); err != nil { return ThreatIntelligenceIndicatorClientQueryIndicatorsResponse{}, err } @@ -396,7 +417,7 @@ func (client *ThreatIntelligenceIndicatorClient) queryIndicatorsHandleResponse(r // threatIntelligenceReplaceTags - Tags in the threat intelligence indicator to be replaced. // options - ThreatIntelligenceIndicatorClientReplaceTagsOptions contains the optional parameters for the ThreatIntelligenceIndicatorClient.ReplaceTags // method. -func (client *ThreatIntelligenceIndicatorClient) ReplaceTags(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceReplaceTags ThreatIntelligenceIndicatorModelForRequestBody, options *ThreatIntelligenceIndicatorClientReplaceTagsOptions) (ThreatIntelligenceIndicatorClientReplaceTagsResponse, error) { +func (client *ThreatIntelligenceIndicatorClient) ReplaceTags(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceReplaceTags ThreatIntelligenceIndicatorModel, options *ThreatIntelligenceIndicatorClientReplaceTagsOptions) (ThreatIntelligenceIndicatorClientReplaceTagsResponse, error) { req, err := client.replaceTagsCreateRequest(ctx, resourceGroupName, workspaceName, name, threatIntelligenceReplaceTags, options) if err != nil { return ThreatIntelligenceIndicatorClientReplaceTagsResponse{}, err @@ -412,7 +433,7 @@ func (client *ThreatIntelligenceIndicatorClient) ReplaceTags(ctx context.Context } // replaceTagsCreateRequest creates the ReplaceTags request. -func (client *ThreatIntelligenceIndicatorClient) replaceTagsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceReplaceTags ThreatIntelligenceIndicatorModelForRequestBody, options *ThreatIntelligenceIndicatorClientReplaceTagsOptions) (*policy.Request, error) { +func (client *ThreatIntelligenceIndicatorClient) replaceTagsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, name string, threatIntelligenceReplaceTags ThreatIntelligenceIndicatorModel, options *ThreatIntelligenceIndicatorClientReplaceTagsOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/{name}/replaceTags" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -435,7 +456,7 @@ func (client *ThreatIntelligenceIndicatorClient) replaceTagsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, threatIntelligenceReplaceTags) @@ -443,7 +464,7 @@ func (client *ThreatIntelligenceIndicatorClient) replaceTagsCreateRequest(ctx co // replaceTagsHandleResponse handles the ReplaceTags response. func (client *ThreatIntelligenceIndicatorClient) replaceTagsHandleResponse(resp *http.Response) (ThreatIntelligenceIndicatorClientReplaceTagsResponse, error) { - result := ThreatIntelligenceIndicatorClientReplaceTagsResponse{RawResponse: resp} + result := ThreatIntelligenceIndicatorClientReplaceTagsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { return ThreatIntelligenceIndicatorClientReplaceTagsResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go index 9b17a763fc7a..bf0caa120668 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type ThreatIntelligenceIndicatorMetricsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewThreatIntelligenceIndicatorMetricsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ThreatIntelligenceIndicatorMetricsClient { +func NewThreatIntelligenceIndicatorMetricsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ThreatIntelligenceIndicatorMetricsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ThreatIntelligenceIndicatorMetricsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). @@ -90,7 +95,7 @@ func (client *ThreatIntelligenceIndicatorMetricsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -98,7 +103,7 @@ func (client *ThreatIntelligenceIndicatorMetricsClient) listCreateRequest(ctx co // listHandleResponse handles the List response. func (client *ThreatIntelligenceIndicatorMetricsClient) listHandleResponse(resp *http.Response) (ThreatIntelligenceIndicatorMetricsClientListResponse, error) { - result := ThreatIntelligenceIndicatorMetricsClientListResponse{RawResponse: resp} + result := ThreatIntelligenceIndicatorMetricsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ThreatIntelligenceMetricsList); err != nil { return ThreatIntelligenceIndicatorMetricsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go index c02d3eb7fe62..b1cfb10443e9 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -34,20 +35,24 @@ type ThreatIntelligenceIndicatorsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewThreatIntelligenceIndicatorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ThreatIntelligenceIndicatorsClient { +func NewThreatIntelligenceIndicatorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ThreatIntelligenceIndicatorsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &ThreatIntelligenceIndicatorsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // List - Get all threat intelligence indicators. @@ -56,16 +61,32 @@ func NewThreatIntelligenceIndicatorsClient(subscriptionID string, credential azc // workspaceName - The name of the workspace. // options - ThreatIntelligenceIndicatorsClientListOptions contains the optional parameters for the ThreatIntelligenceIndicatorsClient.List // method. -func (client *ThreatIntelligenceIndicatorsClient) List(resourceGroupName string, workspaceName string, options *ThreatIntelligenceIndicatorsClientListOptions) *ThreatIntelligenceIndicatorsClientListPager { - return &ThreatIntelligenceIndicatorsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *ThreatIntelligenceIndicatorsClient) List(resourceGroupName string, workspaceName string, options *ThreatIntelligenceIndicatorsClientListOptions) *runtime.Pager[ThreatIntelligenceIndicatorsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[ThreatIntelligenceIndicatorsClientListResponse]{ + More: func(page ThreatIntelligenceIndicatorsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ThreatIntelligenceIndicatorsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ThreatIntelligenceInformationList.NextLink) + Fetcher: func(ctx context.Context, page *ThreatIntelligenceIndicatorsClientListResponse) (ThreatIntelligenceIndicatorsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ThreatIntelligenceIndicatorsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ThreatIntelligenceIndicatorsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ThreatIntelligenceIndicatorsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -88,7 +109,7 @@ func (client *ThreatIntelligenceIndicatorsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -108,7 +129,7 @@ func (client *ThreatIntelligenceIndicatorsClient) listCreateRequest(ctx context. // listHandleResponse handles the List response. func (client *ThreatIntelligenceIndicatorsClient) listHandleResponse(resp *http.Response) (ThreatIntelligenceIndicatorsClientListResponse, error) { - result := ThreatIntelligenceIndicatorsClientListResponse{RawResponse: resp} + result := ThreatIntelligenceIndicatorsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ThreatIntelligenceInformationList); err != nil { return ThreatIntelligenceIndicatorsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_time_rfc3339.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_time_rfc3339.go index ddd6deada56b..e8aa867a667d 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go index 3615bf91ebe7..7a9d0f4a1c5b 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,20 +34,24 @@ type WatchlistItemsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewWatchlistItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *WatchlistItemsClient { +func NewWatchlistItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WatchlistItemsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &WatchlistItemsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Creates or updates a watchlist item. @@ -101,7 +106,7 @@ func (client *WatchlistItemsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, watchlistItem) @@ -109,7 +114,7 @@ func (client *WatchlistItemsClient) createOrUpdateCreateRequest(ctx context.Cont // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *WatchlistItemsClient) createOrUpdateHandleResponse(resp *http.Response) (WatchlistItemsClientCreateOrUpdateResponse, error) { - result := WatchlistItemsClientCreateOrUpdateResponse{RawResponse: resp} + result := WatchlistItemsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.WatchlistItem); err != nil { return WatchlistItemsClientCreateOrUpdateResponse{}, err } @@ -135,7 +140,7 @@ func (client *WatchlistItemsClient) Delete(ctx context.Context, resourceGroupNam if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return WatchlistItemsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return WatchlistItemsClientDeleteResponse{RawResponse: resp}, nil + return WatchlistItemsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -166,7 +171,7 @@ func (client *WatchlistItemsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -222,7 +227,7 @@ func (client *WatchlistItemsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -230,7 +235,7 @@ func (client *WatchlistItemsClient) getCreateRequest(ctx context.Context, resour // getHandleResponse handles the Get response. func (client *WatchlistItemsClient) getHandleResponse(resp *http.Response) (WatchlistItemsClientGetResponse, error) { - result := WatchlistItemsClientGetResponse{RawResponse: resp} + result := WatchlistItemsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.WatchlistItem); err != nil { return WatchlistItemsClientGetResponse{}, err } @@ -243,16 +248,32 @@ func (client *WatchlistItemsClient) getHandleResponse(resp *http.Response) (Watc // workspaceName - The name of the workspace. // watchlistAlias - Watchlist Alias // options - WatchlistItemsClientListOptions contains the optional parameters for the WatchlistItemsClient.List method. -func (client *WatchlistItemsClient) List(resourceGroupName string, workspaceName string, watchlistAlias string, options *WatchlistItemsClientListOptions) *WatchlistItemsClientListPager { - return &WatchlistItemsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, watchlistAlias, options) +func (client *WatchlistItemsClient) List(resourceGroupName string, workspaceName string, watchlistAlias string, options *WatchlistItemsClientListOptions) *runtime.Pager[WatchlistItemsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[WatchlistItemsClientListResponse]{ + More: func(page WatchlistItemsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp WatchlistItemsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.WatchlistItemList.NextLink) + Fetcher: func(ctx context.Context, page *WatchlistItemsClientListResponse) (WatchlistItemsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, watchlistAlias, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WatchlistItemsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WatchlistItemsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WatchlistItemsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -279,7 +300,10 @@ func (client *WatchlistItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -287,7 +311,7 @@ func (client *WatchlistItemsClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *WatchlistItemsClient) listHandleResponse(resp *http.Response) (WatchlistItemsClientListResponse, error) { - result := WatchlistItemsClientListResponse{RawResponse: resp} + result := WatchlistItemsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.WatchlistItemList); err != nil { return WatchlistItemsClientListResponse{}, err } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go index 2e1e0cdabffc..87ed973a56f2 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//go:build go1.18 +// +build go1.18 // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. @@ -14,6 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" @@ -33,25 +34,32 @@ type WatchlistsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewWatchlistsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *WatchlistsClient { +func NewWatchlistsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WatchlistsClient, error) { if options == nil { options = &arm.ClientOptions{} } - ep := options.Endpoint - if len(ep) == 0 { - ep = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err } client := &WatchlistsClient{ subscriptionID: subscriptionID, - host: string(ep), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options), + host: ep, + pl: pl, } - return client + return client, nil } -// CreateOrUpdate - Creates or updates a watchlist and its watchlist items (bulk creation, e.g. through text/csv content type). -// To create a Watchlist and its items, we should call this endpoint with rawContent and -// contentType properties. +// CreateOrUpdate - Create or update a Watchlist and its Watchlist Items (bulk creation, e.g. through text/csv content type). +// To create a Watchlist and its Items, we should call this endpoint with either rawContent or a +// valid SAR URI and contentType properties. The rawContent is mainly used for small watchlist (content size below 3.8 MB). +// The SAS URI enables the creation of large watchlist, where the content size can +// go up to 500 MB. The status of processing such large file can be polled through the URL returned in Azure-AsyncOperation +// header. // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. @@ -98,7 +106,7 @@ func (client *WatchlistsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, watchlist) @@ -106,7 +114,10 @@ func (client *WatchlistsClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *WatchlistsClient) createOrUpdateHandleResponse(resp *http.Response) (WatchlistsClientCreateOrUpdateResponse, error) { - result := WatchlistsClientCreateOrUpdateResponse{RawResponse: resp} + result := WatchlistsClientCreateOrUpdateResponse{} + if val := resp.Header.Get("Azure-AsyncOperation"); val != "" { + result.AzureAsyncOperation = &val + } if err := runtime.UnmarshalAsJSON(resp, &result.Watchlist); err != nil { return WatchlistsClientCreateOrUpdateResponse{}, err } @@ -131,7 +142,7 @@ func (client *WatchlistsClient) Delete(ctx context.Context, resourceGroupName st if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return WatchlistsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return WatchlistsClientDeleteResponse{RawResponse: resp}, nil + return client.deleteHandleResponse(resp) } // deleteCreateRequest creates the Delete request. @@ -158,12 +169,21 @@ func (client *WatchlistsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil } +// deleteHandleResponse handles the Delete response. +func (client *WatchlistsClient) deleteHandleResponse(resp *http.Response) (WatchlistsClientDeleteResponse, error) { + result := WatchlistsClientDeleteResponse{} + if val := resp.Header.Get("Azure-AsyncOperation"); val != "" { + result.AzureAsyncOperation = &val + } + return result, nil +} + // Get - Gets a watchlist, without its watchlist items. // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The name of the resource group. The name is case insensitive. @@ -209,7 +229,7 @@ func (client *WatchlistsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -217,7 +237,7 @@ func (client *WatchlistsClient) getCreateRequest(ctx context.Context, resourceGr // getHandleResponse handles the Get response. func (client *WatchlistsClient) getHandleResponse(resp *http.Response) (WatchlistsClientGetResponse, error) { - result := WatchlistsClientGetResponse{RawResponse: resp} + result := WatchlistsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Watchlist); err != nil { return WatchlistsClientGetResponse{}, err } @@ -229,16 +249,32 @@ func (client *WatchlistsClient) getHandleResponse(resp *http.Response) (Watchlis // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - WatchlistsClientListOptions contains the optional parameters for the WatchlistsClient.List method. -func (client *WatchlistsClient) List(resourceGroupName string, workspaceName string, options *WatchlistsClientListOptions) *WatchlistsClientListPager { - return &WatchlistsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *WatchlistsClient) List(resourceGroupName string, workspaceName string, options *WatchlistsClientListOptions) *runtime.Pager[WatchlistsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[WatchlistsClientListResponse]{ + More: func(page WatchlistsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp WatchlistsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.WatchlistList.NextLink) + Fetcher: func(ctx context.Context, page *WatchlistsClientListResponse) (WatchlistsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return WatchlistsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WatchlistsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WatchlistsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -261,7 +297,10 @@ func (client *WatchlistsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01-preview") + reqQP.Set("api-version", "2022-04-01-preview") + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -269,7 +308,7 @@ func (client *WatchlistsClient) listCreateRequest(ctx context.Context, resourceG // listHandleResponse handles the List response. func (client *WatchlistsClient) listHandleResponse(resp *http.Response) (WatchlistsClientListResponse, error) { - result := WatchlistsClientListResponse{RawResponse: resp} + result := WatchlistsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.WatchlistList); err != nil { return WatchlistsClientListResponse{}, err }