diff --git a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md index 2d1330f70222..3c165e86c677 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md +++ b/sdk/resourcemanager/appplatform/armappplatform/CHANGELOG.md @@ -1,5 +1,449 @@ # Release History +## 1.1.0-beta.1 (2022-05-19) +### Features Added + +- New const `ProbeActionTypeTCPSocketAction` +- New const `APIPortalProvisioningStateSucceeded` +- New const `CertificateResourceProvisioningStateFailed` +- New const `CertificateResourceProvisioningStateDeleting` +- New const `StorageTypeStorageAccount` +- New const `APIPortalProvisioningStateCreating` +- New const `GatewayProvisioningStateSucceeded` +- New const `CustomDomainResourceProvisioningStateFailed` +- New const `CustomDomainResourceProvisioningStateSucceeded` +- New const `APIPortalProvisioningStateUpdating` +- New const `CustomDomainResourceProvisioningStateCreating` +- New const `PowerStateStopped` +- New const `PowerStateRunning` +- New const `CertificateResourceProvisioningStateCreating` +- New const `GatewayProvisioningStateFailed` +- New const `TypeAzureFileVolume` +- New const `ProbeActionTypeHTTPGetAction` +- New const `CertificateResourceProvisioningStateSucceeded` +- New const `GatewayProvisioningStateUpdating` +- New const `CertificateResourceProvisioningStateUpdating` +- New const `GatewayProvisioningStateDeleting` +- New const `GatewayProvisioningStateCreating` +- New const `HTTPSchemeTypeHTTPS` +- New const `HTTPSchemeTypeHTTP` +- New const `ProbeActionTypeExecAction` +- New const `APIPortalProvisioningStateDeleting` +- New const `APIPortalProvisioningStateFailed` +- New const `CustomDomainResourceProvisioningStateDeleting` +- New const `CustomDomainResourceProvisioningStateUpdating` +- New function `*StorageAccount.GetStorageProperties() *StorageProperties` +- New function `PossiblePowerStateValues() []PowerState` +- New function `*TCPSocketAction.GetProbeAction() *ProbeAction` +- New function `StorageAccount.MarshalJSON() ([]byte, error)` +- New function `AzureFileVolume.MarshalJSON() ([]byte, error)` +- New function `*StorageProperties.GetStorageProperties() *StorageProperties` +- New function `GatewayAPIRoute.MarshalJSON() ([]byte, error)` +- New function `ExecAction.MarshalJSON() ([]byte, error)` +- New function `StorageResource.MarshalJSON() ([]byte, error)` +- New function `*AzureFileVolume.GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties` +- New function `*ProbeAction.GetProbeAction() *ProbeAction` +- New function `PossibleStorageTypeValues() []StorageType` +- New function `PossibleCertificateResourceProvisioningStateValues() []CertificateResourceProvisioningState` +- New function `PossibleGatewayProvisioningStateValues() []GatewayProvisioningState` +- New function `Probe.MarshalJSON() ([]byte, error)` +- New function `*ExecAction.UnmarshalJSON([]byte) error` +- New function `TCPSocketAction.MarshalJSON() ([]byte, error)` +- New function `*StorageAccount.UnmarshalJSON([]byte) error` +- New function `GatewayCorsProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleTypeValues() []Type` +- New function `ManagedIdentityProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleAPIPortalProvisioningStateValues() []APIPortalProvisioningState` +- New function `*TCPSocketAction.UnmarshalJSON([]byte) error` +- New function `PossibleProbeActionTypeValues() []ProbeActionType` +- New function `*CustomContainerUserSourceInfo.GetUserSourceInfo() *UserSourceInfo` +- New function `*ServicesClient.BeginStart(context.Context, string, string, *ServicesClientBeginStartOptions) (*runtime.Poller[ServicesClientStartResponse], error)` +- New function `SsoProperties.MarshalJSON() ([]byte, error)` +- New function `*CustomContainerUserSourceInfo.UnmarshalJSON([]byte) error` +- New function `CustomContainer.MarshalJSON() ([]byte, error)` +- New function `*CustomPersistentDiskProperties.GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties` +- New function `GatewayRouteConfigProperties.MarshalJSON() ([]byte, error)` +- New function `CustomPersistentDiskResource.MarshalJSON() ([]byte, error)` +- New function `*StorageResource.UnmarshalJSON([]byte) error` +- New function `CustomPersistentDiskProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleCustomDomainResourceProvisioningStateValues() []CustomDomainResourceProvisioningState` +- New function `CustomContainerUserSourceInfo.MarshalJSON() ([]byte, error)` +- New function `*HTTPGetAction.GetProbeAction() *ProbeAction` +- New function `*Probe.UnmarshalJSON([]byte) error` +- New function `*CustomPersistentDiskResource.UnmarshalJSON([]byte) error` +- New function `*ExecAction.GetProbeAction() *ProbeAction` +- New function `GatewayProperties.MarshalJSON() ([]byte, error)` +- New function `*AzureFileVolume.UnmarshalJSON([]byte) error` +- New function `*ServicesClient.BeginStop(context.Context, string, string, *ServicesClientBeginStopOptions) (*runtime.Poller[ServicesClientStopResponse], error)` +- New function `GatewayOperatorProperties.MarshalJSON() ([]byte, error)` +- New function `*HTTPGetAction.UnmarshalJSON([]byte) error` +- New function `HTTPGetAction.MarshalJSON() ([]byte, error)` +- New function `PossibleHTTPSchemeTypeValues() []HTTPSchemeType` +- New function `APIPortalProperties.MarshalJSON() ([]byte, error)` +- New struct `APIPortalCustomDomainProperties` +- New struct `APIPortalCustomDomainResource` +- New struct `APIPortalCustomDomainResourceCollection` +- New struct `APIPortalCustomDomainsClientBeginCreateOrUpdateOptions` +- New struct `APIPortalCustomDomainsClientBeginDeleteOptions` +- New struct `APIPortalCustomDomainsClientCreateOrUpdateResponse` +- New struct `APIPortalCustomDomainsClientDeleteResponse` +- New struct `APIPortalCustomDomainsClientGetOptions` +- New struct `APIPortalCustomDomainsClientGetResponse` +- New struct `APIPortalCustomDomainsClientListOptions` +- New struct `APIPortalCustomDomainsClientListResponse` +- New struct `APIPortalInstance` +- New struct `APIPortalProperties` +- New struct `APIPortalResource` +- New struct `APIPortalResourceCollection` +- New struct `APIPortalResourceRequests` +- New struct `APIPortalsClientBeginCreateOrUpdateOptions` +- New struct `APIPortalsClientBeginDeleteOptions` +- New struct `APIPortalsClientCreateOrUpdateResponse` +- New struct `APIPortalsClientDeleteResponse` +- New struct `APIPortalsClientGetOptions` +- New struct `APIPortalsClientGetResponse` +- New struct `APIPortalsClientListOptions` +- New struct `APIPortalsClientListResponse` +- New struct `APIPortalsClientValidateDomainOptions` +- New struct `APIPortalsClientValidateDomainResponse` +- New struct `AppVNetAddons` +- New struct `AzureFileVolume` +- New struct `BuildResourceRequests` +- New struct `ContainerProbeSettings` +- New struct `CustomContainer` +- New struct `CustomContainerUserSourceInfo` +- New struct `CustomPersistentDiskProperties` +- New struct `CustomPersistentDiskResource` +- New struct `ExecAction` +- New struct `GatewayAPIMetadataProperties` +- New struct `GatewayAPIRoute` +- New struct `GatewayCorsProperties` +- New struct `GatewayCustomDomainProperties` +- New struct `GatewayCustomDomainResource` +- New struct `GatewayCustomDomainResourceCollection` +- New struct `GatewayCustomDomainsClientBeginCreateOrUpdateOptions` +- New struct `GatewayCustomDomainsClientBeginDeleteOptions` +- New struct `GatewayCustomDomainsClientCreateOrUpdateResponse` +- New struct `GatewayCustomDomainsClientDeleteResponse` +- New struct `GatewayCustomDomainsClientGetOptions` +- New struct `GatewayCustomDomainsClientGetResponse` +- New struct `GatewayCustomDomainsClientListOptions` +- New struct `GatewayCustomDomainsClientListResponse` +- New struct `GatewayInstance` +- New struct `GatewayOperatorProperties` +- New struct `GatewayOperatorResourceRequests` +- New struct `GatewayProperties` +- New struct `GatewayResource` +- New struct `GatewayResourceCollection` +- New struct `GatewayResourceRequests` +- New struct `GatewayRouteConfigOpenAPIProperties` +- New struct `GatewayRouteConfigProperties` +- New struct `GatewayRouteConfigResource` +- New struct `GatewayRouteConfigResourceCollection` +- New struct `GatewayRouteConfigsClientBeginCreateOrUpdateOptions` +- New struct `GatewayRouteConfigsClientBeginDeleteOptions` +- New struct `GatewayRouteConfigsClientCreateOrUpdateResponse` +- New struct `GatewayRouteConfigsClientDeleteResponse` +- New struct `GatewayRouteConfigsClientGetOptions` +- New struct `GatewayRouteConfigsClientGetResponse` +- New struct `GatewayRouteConfigsClientListOptions` +- New struct `GatewayRouteConfigsClientListResponse` +- New struct `GatewaysClientBeginCreateOrUpdateOptions` +- New struct `GatewaysClientBeginDeleteOptions` +- New struct `GatewaysClientCreateOrUpdateResponse` +- New struct `GatewaysClientDeleteResponse` +- New struct `GatewaysClientGetOptions` +- New struct `GatewaysClientGetResponse` +- New struct `GatewaysClientListOptions` +- New struct `GatewaysClientListResponse` +- New struct `GatewaysClientValidateDomainOptions` +- New struct `GatewaysClientValidateDomainResponse` +- New struct `HTTPGetAction` +- New struct `ImageRegistryCredential` +- New struct `IngressConfig` +- New struct `MarketplaceResource` +- New struct `Probe` +- New struct `ProbeAction` +- New struct `ServiceVNetAddons` +- New struct `ServicesClientBeginStartOptions` +- New struct `ServicesClientBeginStopOptions` +- New struct `ServicesClientStartResponse` +- New struct `ServicesClientStopResponse` +- New struct `SsoProperties` +- New struct `StorageAccount` +- New struct `StorageProperties` +- New struct `StorageResource` +- New struct `StorageResourceCollection` +- New struct `StoragesClientBeginCreateOrUpdateOptions` +- New struct `StoragesClientBeginDeleteOptions` +- New struct `StoragesClientCreateOrUpdateResponse` +- New struct `StoragesClientDeleteResponse` +- New struct `StoragesClientGetOptions` +- New struct `StoragesClientGetResponse` +- New struct `StoragesClientListOptions` +- New struct `StoragesClientListResponse` +- New struct `TCPSocketAction` +- New struct `UserAssignedManagedIdentity` +- New field `ProvisioningState` in struct `KeyVaultCertificateProperties` +- New field `ProvisioningState` in struct `CertificateProperties` +- New field `IngressConfig` in struct `NetworkProfile` +- New field `LivenessProbe` in struct `DeploymentSettings` +- New field `ReadinessProbe` in struct `DeploymentSettings` +- New field `StartupProbe` in struct `DeploymentSettings` +- New field `TerminationGracePeriodSeconds` in struct `DeploymentSettings` +- New field `ContainerProbeSettings` in struct `DeploymentSettings` +- New field `ResourceRequests` in struct `BuildProperties` +- New field `ProvisioningState` in struct `CustomDomainProperties` +- New field `MarketplaceResource` in struct `ClusterResourceProperties` +- New field `VnetAddons` in struct `ClusterResourceProperties` +- New field `PowerState` in struct `ClusterResourceProperties` +- New field `UserAssignedIdentities` in struct `ManagedIdentityProperties` +- New field `ProvisioningState` in struct `ContentCertificateProperties` +- New field `CustomPersistentDisks` in struct `AppResourceProperties` +- New field `VnetAddons` in struct `AppResourceProperties` + + +## 1.1.0-beta.1 (2022-05-19) +### Features Added + +- New const `PowerStateStopped` +- New const `CustomDomainResourceProvisioningStateFailed` +- New const `CertificateResourceProvisioningStateSucceeded` +- New const `StorageTypeStorageAccount` +- New const `CustomDomainResourceProvisioningStateSucceeded` +- New const `HTTPSchemeTypeHTTP` +- New const `TypeAzureFileVolume` +- New const `GatewayProvisioningStateFailed` +- New const `APIPortalProvisioningStateSucceeded` +- New const `APIPortalProvisioningStateCreating` +- New const `CertificateResourceProvisioningStateFailed` +- New const `APIPortalProvisioningStateFailed` +- New const `CustomDomainResourceProvisioningStateDeleting` +- New const `APIPortalProvisioningStateDeleting` +- New const `CertificateResourceProvisioningStateUpdating` +- New const `GatewayProvisioningStateSucceeded` +- New const `ProbeActionTypeHTTPGetAction` +- New const `CertificateResourceProvisioningStateDeleting` +- New const `APIPortalProvisioningStateUpdating` +- New const `CertificateResourceProvisioningStateCreating` +- New const `PowerStateRunning` +- New const `GatewayProvisioningStateUpdating` +- New const `CustomDomainResourceProvisioningStateCreating` +- New const `GatewayProvisioningStateDeleting` +- New const `ProbeActionTypeExecAction` +- New const `GatewayProvisioningStateCreating` +- New const `CustomDomainResourceProvisioningStateUpdating` +- New const `ProbeActionTypeTCPSocketAction` +- New const `HTTPSchemeTypeHTTPS` +- New function `ExecAction.MarshalJSON() ([]byte, error)` +- New function `*GatewaysClient.BeginDelete(context.Context, string, string, string, *GatewaysClientBeginDeleteOptions) (*runtime.Poller[GatewaysClientDeleteResponse], error)` +- New function `PossibleStorageTypeValues() []StorageType` +- New function `NewGatewayRouteConfigsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GatewayRouteConfigsClient, error)` +- New function `CustomContainerUserSourceInfo.MarshalJSON() ([]byte, error)` +- New function `PossibleTypeValues() []Type` +- New function `GatewayRouteConfigProperties.MarshalJSON() ([]byte, error)` +- New function `NewAPIPortalCustomDomainsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIPortalCustomDomainsClient, error)` +- New function `*CustomPersistentDiskResource.UnmarshalJSON([]byte) error` +- New function `*HTTPGetAction.UnmarshalJSON([]byte) error` +- New function `*GatewayRouteConfigsClient.NewListPager(string, string, string, *GatewayRouteConfigsClientListOptions) *runtime.Pager[GatewayRouteConfigsClientListResponse]` +- New function `*GatewayRouteConfigsClient.Get(context.Context, string, string, string, string, *GatewayRouteConfigsClientGetOptions) (GatewayRouteConfigsClientGetResponse, error)` +- New function `*TCPSocketAction.GetProbeAction() *ProbeAction` +- New function `*APIPortalsClient.Get(context.Context, string, string, string, *APIPortalsClientGetOptions) (APIPortalsClientGetResponse, error)` +- New function `*ServicesClient.BeginStop(context.Context, string, string, *ServicesClientBeginStopOptions) (*runtime.Poller[ServicesClientStopResponse], error)` +- New function `TCPSocketAction.MarshalJSON() ([]byte, error)` +- New function `*APIPortalCustomDomainsClient.NewListPager(string, string, string, *APIPortalCustomDomainsClientListOptions) *runtime.Pager[APIPortalCustomDomainsClientListResponse]` +- New function `PossiblePowerStateValues() []PowerState` +- New function `NewAPIPortalsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIPortalsClient, error)` +- New function `*StoragesClient.BeginCreateOrUpdate(context.Context, string, string, string, StorageResource, *StoragesClientBeginCreateOrUpdateOptions) (*runtime.Poller[StoragesClientCreateOrUpdateResponse], error)` +- New function `HTTPGetAction.MarshalJSON() ([]byte, error)` +- New function `CustomContainer.MarshalJSON() ([]byte, error)` +- New function `AzureFileVolume.MarshalJSON() ([]byte, error)` +- New function `APIPortalProperties.MarshalJSON() ([]byte, error)` +- New function `*StorageAccount.UnmarshalJSON([]byte) error` +- New function `*APIPortalsClient.NewListPager(string, string, *APIPortalsClientListOptions) *runtime.Pager[APIPortalsClientListResponse]` +- New function `PossibleAPIPortalProvisioningStateValues() []APIPortalProvisioningState` +- New function `*APIPortalCustomDomainsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, APIPortalCustomDomainResource, *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalCustomDomainsClientCreateOrUpdateResponse], error)` +- New function `*APIPortalsClient.BeginDelete(context.Context, string, string, string, *APIPortalsClientBeginDeleteOptions) (*runtime.Poller[APIPortalsClientDeleteResponse], error)` +- New function `CustomPersistentDiskResource.MarshalJSON() ([]byte, error)` +- New function `*APIPortalsClient.ValidateDomain(context.Context, string, string, string, CustomDomainValidatePayload, *APIPortalsClientValidateDomainOptions) (APIPortalsClientValidateDomainResponse, error)` +- New function `PossibleHTTPSchemeTypeValues() []HTTPSchemeType` +- New function `*StorageAccount.GetStorageProperties() *StorageProperties` +- New function `*APIPortalCustomDomainsClient.BeginDelete(context.Context, string, string, string, string, *APIPortalCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[APIPortalCustomDomainsClientDeleteResponse], error)` +- New function `*AzureFileVolume.GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties` +- New function `*StorageProperties.GetStorageProperties() *StorageProperties` +- New function `*TCPSocketAction.UnmarshalJSON([]byte) error` +- New function `ManagedIdentityProperties.MarshalJSON() ([]byte, error)` +- New function `NewGatewayCustomDomainsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GatewayCustomDomainsClient, error)` +- New function `*APIPortalsClient.BeginCreateOrUpdate(context.Context, string, string, string, APIPortalResource, *APIPortalsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalsClientCreateOrUpdateResponse], error)` +- New function `*HTTPGetAction.GetProbeAction() *ProbeAction` +- New function `StorageAccount.MarshalJSON() ([]byte, error)` +- New function `CustomPersistentDiskProperties.MarshalJSON() ([]byte, error)` +- New function `SsoProperties.MarshalJSON() ([]byte, error)` +- New function `NewStoragesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*StoragesClient, error)` +- New function `PossibleCertificateResourceProvisioningStateValues() []CertificateResourceProvisioningState` +- New function `GatewayOperatorProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleCustomDomainResourceProvisioningStateValues() []CustomDomainResourceProvisioningState` +- New function `*CustomContainerUserSourceInfo.GetUserSourceInfo() *UserSourceInfo` +- New function `*StoragesClient.BeginDelete(context.Context, string, string, string, *StoragesClientBeginDeleteOptions) (*runtime.Poller[StoragesClientDeleteResponse], error)` +- New function `*StorageResource.UnmarshalJSON([]byte) error` +- New function `*ExecAction.GetProbeAction() *ProbeAction` +- New function `*GatewayRouteConfigsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, GatewayRouteConfigResource, *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayRouteConfigsClientCreateOrUpdateResponse], error)` +- New function `NewGatewaysClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GatewaysClient, error)` +- New function `*AzureFileVolume.UnmarshalJSON([]byte) error` +- New function `*ServicesClient.BeginStart(context.Context, string, string, *ServicesClientBeginStartOptions) (*runtime.Poller[ServicesClientStartResponse], error)` +- New function `*Probe.UnmarshalJSON([]byte) error` +- New function `PossibleProbeActionTypeValues() []ProbeActionType` +- New function `*GatewaysClient.Get(context.Context, string, string, string, *GatewaysClientGetOptions) (GatewaysClientGetResponse, error)` +- New function `*ExecAction.UnmarshalJSON([]byte) error` +- New function `*GatewayCustomDomainsClient.NewListPager(string, string, string, *GatewayCustomDomainsClientListOptions) *runtime.Pager[GatewayCustomDomainsClientListResponse]` +- New function `*GatewayCustomDomainsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, GatewayCustomDomainResource, *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayCustomDomainsClientCreateOrUpdateResponse], error)` +- New function `*GatewaysClient.BeginCreateOrUpdate(context.Context, string, string, string, GatewayResource, *GatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewaysClientCreateOrUpdateResponse], error)` +- New function `*ProbeAction.GetProbeAction() *ProbeAction` +- New function `*APIPortalCustomDomainsClient.Get(context.Context, string, string, string, string, *APIPortalCustomDomainsClientGetOptions) (APIPortalCustomDomainsClientGetResponse, error)` +- New function `PossibleGatewayProvisioningStateValues() []GatewayProvisioningState` +- New function `*GatewayCustomDomainsClient.BeginDelete(context.Context, string, string, string, string, *GatewayCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[GatewayCustomDomainsClientDeleteResponse], error)` +- New function `*CustomPersistentDiskProperties.GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties` +- New function `*GatewaysClient.NewListPager(string, string, *GatewaysClientListOptions) *runtime.Pager[GatewaysClientListResponse]` +- New function `*GatewayRouteConfigsClient.BeginDelete(context.Context, string, string, string, string, *GatewayRouteConfigsClientBeginDeleteOptions) (*runtime.Poller[GatewayRouteConfigsClientDeleteResponse], error)` +- New function `*CustomContainerUserSourceInfo.UnmarshalJSON([]byte) error` +- New function `GatewayCorsProperties.MarshalJSON() ([]byte, error)` +- New function `GatewayProperties.MarshalJSON() ([]byte, error)` +- New function `StorageResource.MarshalJSON() ([]byte, error)` +- New function `*StoragesClient.Get(context.Context, string, string, string, *StoragesClientGetOptions) (StoragesClientGetResponse, error)` +- New function `*GatewaysClient.ValidateDomain(context.Context, string, string, string, CustomDomainValidatePayload, *GatewaysClientValidateDomainOptions) (GatewaysClientValidateDomainResponse, error)` +- New function `*GatewayCustomDomainsClient.Get(context.Context, string, string, string, string, *GatewayCustomDomainsClientGetOptions) (GatewayCustomDomainsClientGetResponse, error)` +- New function `GatewayAPIRoute.MarshalJSON() ([]byte, error)` +- New function `Probe.MarshalJSON() ([]byte, error)` +- New function `*StoragesClient.NewListPager(string, string, *StoragesClientListOptions) *runtime.Pager[StoragesClientListResponse]` +- New struct `APIPortalCustomDomainProperties` +- New struct `APIPortalCustomDomainResource` +- New struct `APIPortalCustomDomainResourceCollection` +- New struct `APIPortalCustomDomainsClient` +- New struct `APIPortalCustomDomainsClientBeginCreateOrUpdateOptions` +- New struct `APIPortalCustomDomainsClientBeginDeleteOptions` +- New struct `APIPortalCustomDomainsClientCreateOrUpdateResponse` +- New struct `APIPortalCustomDomainsClientDeleteResponse` +- New struct `APIPortalCustomDomainsClientGetOptions` +- New struct `APIPortalCustomDomainsClientGetResponse` +- New struct `APIPortalCustomDomainsClientListOptions` +- New struct `APIPortalCustomDomainsClientListResponse` +- New struct `APIPortalInstance` +- New struct `APIPortalProperties` +- New struct `APIPortalResource` +- New struct `APIPortalResourceCollection` +- New struct `APIPortalResourceRequests` +- New struct `APIPortalsClient` +- New struct `APIPortalsClientBeginCreateOrUpdateOptions` +- New struct `APIPortalsClientBeginDeleteOptions` +- New struct `APIPortalsClientCreateOrUpdateResponse` +- New struct `APIPortalsClientDeleteResponse` +- New struct `APIPortalsClientGetOptions` +- New struct `APIPortalsClientGetResponse` +- New struct `APIPortalsClientListOptions` +- New struct `APIPortalsClientListResponse` +- New struct `APIPortalsClientValidateDomainOptions` +- New struct `APIPortalsClientValidateDomainResponse` +- New struct `AppVNetAddons` +- New struct `AzureFileVolume` +- New struct `BuildResourceRequests` +- New struct `ContainerProbeSettings` +- New struct `CustomContainer` +- New struct `CustomContainerUserSourceInfo` +- New struct `CustomPersistentDiskProperties` +- New struct `CustomPersistentDiskResource` +- New struct `ExecAction` +- New struct `GatewayAPIMetadataProperties` +- New struct `GatewayAPIRoute` +- New struct `GatewayCorsProperties` +- New struct `GatewayCustomDomainProperties` +- New struct `GatewayCustomDomainResource` +- New struct `GatewayCustomDomainResourceCollection` +- New struct `GatewayCustomDomainsClient` +- New struct `GatewayCustomDomainsClientBeginCreateOrUpdateOptions` +- New struct `GatewayCustomDomainsClientBeginDeleteOptions` +- New struct `GatewayCustomDomainsClientCreateOrUpdateResponse` +- New struct `GatewayCustomDomainsClientDeleteResponse` +- New struct `GatewayCustomDomainsClientGetOptions` +- New struct `GatewayCustomDomainsClientGetResponse` +- New struct `GatewayCustomDomainsClientListOptions` +- New struct `GatewayCustomDomainsClientListResponse` +- New struct `GatewayInstance` +- New struct `GatewayOperatorProperties` +- New struct `GatewayOperatorResourceRequests` +- New struct `GatewayProperties` +- New struct `GatewayResource` +- New struct `GatewayResourceCollection` +- New struct `GatewayResourceRequests` +- New struct `GatewayRouteConfigOpenAPIProperties` +- New struct `GatewayRouteConfigProperties` +- New struct `GatewayRouteConfigResource` +- New struct `GatewayRouteConfigResourceCollection` +- New struct `GatewayRouteConfigsClient` +- New struct `GatewayRouteConfigsClientBeginCreateOrUpdateOptions` +- New struct `GatewayRouteConfigsClientBeginDeleteOptions` +- New struct `GatewayRouteConfigsClientCreateOrUpdateResponse` +- New struct `GatewayRouteConfigsClientDeleteResponse` +- New struct `GatewayRouteConfigsClientGetOptions` +- New struct `GatewayRouteConfigsClientGetResponse` +- New struct `GatewayRouteConfigsClientListOptions` +- New struct `GatewayRouteConfigsClientListResponse` +- New struct `GatewaysClient` +- New struct `GatewaysClientBeginCreateOrUpdateOptions` +- New struct `GatewaysClientBeginDeleteOptions` +- New struct `GatewaysClientCreateOrUpdateResponse` +- New struct `GatewaysClientDeleteResponse` +- New struct `GatewaysClientGetOptions` +- New struct `GatewaysClientGetResponse` +- New struct `GatewaysClientListOptions` +- New struct `GatewaysClientListResponse` +- New struct `GatewaysClientValidateDomainOptions` +- New struct `GatewaysClientValidateDomainResponse` +- New struct `HTTPGetAction` +- New struct `ImageRegistryCredential` +- New struct `IngressConfig` +- New struct `MarketplaceResource` +- New struct `Probe` +- New struct `ProbeAction` +- New struct `ServiceVNetAddons` +- New struct `ServicesClientBeginStartOptions` +- New struct `ServicesClientBeginStopOptions` +- New struct `ServicesClientStartResponse` +- New struct `ServicesClientStopResponse` +- New struct `SsoProperties` +- New struct `StorageAccount` +- New struct `StorageProperties` +- New struct `StorageResource` +- New struct `StorageResourceCollection` +- New struct `StoragesClient` +- New struct `StoragesClientBeginCreateOrUpdateOptions` +- New struct `StoragesClientBeginDeleteOptions` +- New struct `StoragesClientCreateOrUpdateResponse` +- New struct `StoragesClientDeleteResponse` +- New struct `StoragesClientGetOptions` +- New struct `StoragesClientGetResponse` +- New struct `StoragesClientListOptions` +- New struct `StoragesClientListResponse` +- New struct `TCPSocketAction` +- New struct `UserAssignedManagedIdentity` +- New field `ProvisioningState` in struct `KeyVaultCertificateProperties` +- New field `ProvisioningState` in struct `CertificateProperties` +- New field `UserAssignedIdentities` in struct `ManagedIdentityProperties` +- New field `StartupProbe` in struct `DeploymentSettings` +- New field `TerminationGracePeriodSeconds` in struct `DeploymentSettings` +- New field `ContainerProbeSettings` in struct `DeploymentSettings` +- New field `LivenessProbe` in struct `DeploymentSettings` +- New field `ReadinessProbe` in struct `DeploymentSettings` +- New field `ProvisioningState` in struct `CustomDomainProperties` +- New field `ResourceRequests` in struct `BuildProperties` +- New field `IngressConfig` in struct `NetworkProfile` +- New field `ProvisioningState` in struct `ContentCertificateProperties` +- New field `CustomPersistentDisks` in struct `AppResourceProperties` +- New field `VnetAddons` in struct `AppResourceProperties` +- New field `PowerState` in struct `ClusterResourceProperties` +- New field `VnetAddons` in struct `ClusterResourceProperties` +- New field `MarketplaceResource` in struct `ClusterResourceProperties` + + ## 1.0.0 (2022-05-17) ### Breaking Changes diff --git a/sdk/resourcemanager/appplatform/armappplatform/autorest.md b/sdk/resourcemanager/appplatform/armappplatform/autorest.md index 811fe6d019da..32109c12bbcc 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/autorest.md +++ b/sdk/resourcemanager/appplatform/armappplatform/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-2022-04 require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/appplatform/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appplatform/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/appplatform/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/appplatform/armappplatform/go.mod b/sdk/resourcemanager/appplatform/armappplatform/go.mod index 6ee7d9e50998..9f12a7c95468 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.mod +++ b/sdk/resourcemanager/appplatform/armappplatform/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappp go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/appplatform/armappplatform/go.sum b/sdk/resourcemanager/appplatform/armappplatform/go.sum index ed5b814680ee..3f874a3bc5a6 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/go.sum +++ b/sdk/resourcemanager/appplatform/armappplatform/go.sum @@ -1,33 +1,12 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -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.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -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/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/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/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_apps_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_apps_client_test.go deleted file mode 100644 index 5122b28974b2..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_apps_client_test.go +++ /dev/null @@ -1,260 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_Get.json -func ExampleAppsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "myapp", - &armappplatform.AppsClientGetOptions{SyncStatus: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_CreateOrUpdate.json -func ExampleAppsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - armappplatform.AppResource{ - Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), - }, - Location: to.Ptr("eastus"), - Properties: &armappplatform.AppResourceProperties{ - AddonConfigs: map[string]map[string]interface{}{ - "ApplicationConfigurationService": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/configurationServices/myacs", - }, - "ServiceRegistry": { - "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/serviceRegistries/myServiceRegistry", - }, - }, - EnableEndToEndTLS: to.Ptr(false), - Fqdn: to.Ptr("myapp.mydomain.com"), - HTTPSOnly: to.Ptr(false), - LoadedCertificates: []*armappplatform.LoadedCertificate{ - { - LoadTrustStore: to.Ptr(false), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert1"), - }, - { - LoadTrustStore: to.Ptr(true), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/certificates/mycert2"), - }}, - PersistentDisk: &armappplatform.PersistentDisk{ - MountPath: to.Ptr("/mypersistentdisk"), - SizeInGB: to.Ptr[int32](2), - }, - Public: to.Ptr(true), - TemporaryDisk: &armappplatform.TemporaryDisk{ - MountPath: to.Ptr("/mytemporarydisk"), - SizeInGB: to.Ptr[int32](2), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_Delete.json -func ExampleAppsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "myapp", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_Update.json -func ExampleAppsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - armappplatform.AppResource{ - Identity: &armappplatform.ManagedIdentityProperties{ - Type: to.Ptr(armappplatform.ManagedIdentityTypeSystemAssigned), - }, - Location: to.Ptr("eastus"), - Properties: &armappplatform.AppResourceProperties{ - EnableEndToEndTLS: to.Ptr(false), - Fqdn: to.Ptr("myapp.mydomain.com"), - HTTPSOnly: to.Ptr(false), - PersistentDisk: &armappplatform.PersistentDisk{ - MountPath: to.Ptr("/mypersistentdisk"), - SizeInGB: to.Ptr[int32](2), - }, - Public: to.Ptr(true), - TemporaryDisk: &armappplatform.TemporaryDisk{ - MountPath: to.Ptr("/mytemporarydisk"), - SizeInGB: to.Ptr[int32](2), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_List.json -func ExampleAppsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myservice", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_SetActiveDeployments.json -func ExampleAppsClient_BeginSetActiveDeployments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSetActiveDeployments(ctx, - "myResourceGroup", - "myservice", - "myapp", - armappplatform.ActiveDeploymentCollection{ - ActiveDeploymentNames: []*string{ - to.Ptr("default")}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Apps_ValidateDomain.json -func ExampleAppsClient_ValidateDomain() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewAppsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ValidateDomain(ctx, - "myResourceGroup", - "myservice", - "myapp", - armappplatform.CustomDomainValidatePayload{ - Name: to.Ptr("mydomain.io"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_bindings_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_bindings_client_test.go deleted file mode 100644 index dcab586cfc30..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_bindings_client_test.go +++ /dev/null @@ -1,170 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_Get.json -func ExampleBindingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mybinding", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_CreateOrUpdate.json -func ExampleBindingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mybinding", - armappplatform.BindingResource{ - Properties: &armappplatform.BindingResourceProperties{ - BindingParameters: map[string]interface{}{ - "apiType": "SQL", - "databaseName": "db1", - }, - Key: to.Ptr("xxxx"), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.DocumentDB/databaseAccounts/my-cosmosdb-1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_Delete.json -func ExampleBindingsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mybinding", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_Update.json -func ExampleBindingsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mybinding", - armappplatform.BindingResource{ - Properties: &armappplatform.BindingResourceProperties{ - BindingParameters: map[string]interface{}{ - "apiType": "SQL", - "databaseName": "db1", - }, - Key: to.Ptr("xxxx"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Bindings_List.json -func ExampleBindingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBindingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myservice", - "myapp", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildpackbinding_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildpackbinding_client_test.go deleted file mode 100644 index 679837baca7d..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildpackbinding_client_test.go +++ /dev/null @@ -1,142 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_Get.json -func ExampleBuildpackBindingClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildpackBindingClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "default", - "default", - "myBuildpackBinding", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_CreateOrUpdate.json -func ExampleBuildpackBindingClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildpackBindingClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "default", - "default", - "myBuildpackBinding", - armappplatform.BuildpackBindingResource{ - Properties: &armappplatform.BuildpackBindingProperties{ - BindingType: to.Ptr(armappplatform.BindingTypeApplicationInsights), - LaunchProperties: &armappplatform.BuildpackBindingLaunchProperties{ - Properties: map[string]*string{ - "abc": to.Ptr("def"), - "any-string": to.Ptr("any-string"), - "sampling-rate": to.Ptr("12.0"), - }, - Secrets: map[string]*string{ - "connection-string": to.Ptr("XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXX;XXXXXXXXXXXXXXXXX=XXXXXXXXXXXXXXXXXXX"), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_Delete.json -func ExampleBuildpackBindingClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildpackBindingClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "default", - "default", - "myBuildpackBinding", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildpackBinding_List.json -func ExampleBuildpackBindingClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildpackBindingClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myservice", - "default", - "default", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildservice_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildservice_client_test.go deleted file mode 100644 index 85693c602ef9..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildservice_client_test.go +++ /dev/null @@ -1,324 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListBuildServices.json -func ExampleBuildServiceClient_NewListBuildServicesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBuildServicesPager("myResourceGroup", - "myservice", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuildService.json -func ExampleBuildServiceClient_GetBuildService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetBuildService(ctx, - "myResourceGroup", - "myservice", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListBuilds.json -func ExampleBuildServiceClient_NewListBuildsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBuildsPager("myResourceGroup", - "myservice", - "default", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuild.json -func ExampleBuildServiceClient_GetBuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetBuild(ctx, - "myResourceGroup", - "myservice", - "default", - "mybuild", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_CreateOrUpdateBuild.json -func ExampleBuildServiceClient_CreateOrUpdateBuild() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdateBuild(ctx, - "myResourceGroup", - "myservice", - "default", - "mybuild", - armappplatform.Build{ - Properties: &armappplatform.BuildProperties{ - AgentPool: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/agentPools/default"), - Builder: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.AppPlatform/Spring/myservice/buildServices/default/builders/default"), - Env: map[string]*string{ - "environmentVariable": to.Ptr("test"), - }, - RelativePath: to.Ptr("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855-20210601-3ed9f4a2-986b-4bbd-b833-a42dccb2f777"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListBuildResults.json -func ExampleBuildServiceClient_NewListBuildResultsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBuildResultsPager("myResourceGroup", - "myservice", - "default", - "mybuild", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuildResult.json -func ExampleBuildServiceClient_GetBuildResult() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetBuildResult(ctx, - "myResourceGroup", - "myservice", - "default", - "mybuild", - "123", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetBuildResultLog.json -func ExampleBuildServiceClient_GetBuildResultLog() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetBuildResultLog(ctx, - "myResourceGroup", - "myservice", - "default", - "mybuild", - "123", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListSupportedBuildpacks.json -func ExampleBuildServiceClient_ListSupportedBuildpacks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSupportedBuildpacks(ctx, - "myResourceGroup", - "myservice", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetSupportedBuildpack.json -func ExampleBuildServiceClient_GetSupportedBuildpack() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSupportedBuildpack(ctx, - "myResourceGroup", - "myservice", - "default", - "tanzu-buildpacks-java-azure", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_ListSupportedStacks.json -func ExampleBuildServiceClient_ListSupportedStacks() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSupportedStacks(ctx, - "myResourceGroup", - "myservice", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildService_GetSupportedStack.json -func ExampleBuildServiceClient_GetSupportedStack() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewBuildServiceClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSupportedStack(ctx, - "myResourceGroup", - "myservice", - "default", - "io.buildpacks.stacks.bionic-base", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_configservers_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_configservers_client_test.go deleted file mode 100644 index 991167ea3698..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_configservers_client_test.go +++ /dev/null @@ -1,150 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_Get.json -func ExampleConfigServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_UpdatePut.json -func ExampleConfigServersClient_BeginUpdatePut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdatePut(ctx, - "myResourceGroup", - "myservice", - armappplatform.ConfigServerResource{ - Properties: &armappplatform.ConfigServerProperties{ - ConfigServer: &armappplatform.ConfigServerSettings{ - GitProperty: &armappplatform.ConfigServerGitProperty{ - Label: to.Ptr("master"), - SearchPaths: []*string{ - to.Ptr("/")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_UpdatePatch.json -func ExampleConfigServersClient_BeginUpdatePatch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdatePatch(ctx, - "myResourceGroup", - "myservice", - armappplatform.ConfigServerResource{ - Properties: &armappplatform.ConfigServerProperties{ - ConfigServer: &armappplatform.ConfigServerSettings{ - GitProperty: &armappplatform.ConfigServerGitProperty{ - Label: to.Ptr("master"), - SearchPaths: []*string{ - to.Ptr("/")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigServers_Validate.json -func ExampleConfigServersClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigServersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidate(ctx, - "myResourceGroup", - "myservice", - armappplatform.ConfigServerSettings{ - GitProperty: &armappplatform.ConfigServerGitProperty{ - Label: to.Ptr("master"), - SearchPaths: []*string{ - to.Ptr("/")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository.git"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_configurationservices_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_configurationservices_client_test.go deleted file mode 100644 index cd920be13024..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_configurationservices_client_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_Get.json -func ExampleConfigurationServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigurationServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_CreateOrUpdate.json -func ExampleConfigurationServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigurationServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "default", - armappplatform.ConfigurationServiceResource{ - Properties: &armappplatform.ConfigurationServiceProperties{ - Settings: &armappplatform.ConfigurationServiceSettings{ - GitProperty: &armappplatform.ConfigurationServiceGitProperty{ - Repositories: []*armappplatform.ConfigurationServiceGitRepository{ - { - Name: to.Ptr("fake"), - Label: to.Ptr("master"), - Patterns: []*string{ - to.Ptr("app/dev")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository"), - }}, - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_Delete.json -func ExampleConfigurationServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigurationServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_List.json -func ExampleConfigurationServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigurationServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myservice", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ConfigurationServices_Validate.json -func ExampleConfigurationServicesClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewConfigurationServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidate(ctx, - "myResourceGroup", - "myservice", - "default", - armappplatform.ConfigurationServiceSettings{ - GitProperty: &armappplatform.ConfigurationServiceGitProperty{ - Repositories: []*armappplatform.ConfigurationServiceGitRepository{ - { - Name: to.Ptr("fake"), - Label: to.Ptr("master"), - Patterns: []*string{ - to.Ptr("app/dev")}, - URI: to.Ptr("https://github.com/fake-user/fake-repository"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_customdomains_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_customdomains_client_test.go deleted file mode 100644 index d550d2c71f97..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_customdomains_client_test.go +++ /dev/null @@ -1,163 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_Get.json -func ExampleCustomDomainsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydomain.com", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_CreateOrUpdate.json -func ExampleCustomDomainsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydomain.com", - armappplatform.CustomDomainResource{ - Properties: &armappplatform.CustomDomainProperties{ - CertName: to.Ptr("mycert"), - Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_Delete.json -func ExampleCustomDomainsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydomain.com", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_Update.json -func ExampleCustomDomainsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydomain.com", - armappplatform.CustomDomainResource{ - Properties: &armappplatform.CustomDomainProperties{ - CertName: to.Ptr("mycert"), - Thumbprint: to.Ptr("934367bf1c97033f877db0f15cb1b586957d3133"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/CustomDomains_List.json -func ExampleCustomDomainsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewCustomDomainsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myservice", - "myapp", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_deployments_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_deployments_client_test.go deleted file mode 100644 index 4e06575d1702..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_deployments_client_test.go +++ /dev/null @@ -1,387 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Get.json -func ExampleDeploymentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_CreateOrUpdate.json -func ExampleDeploymentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - armappplatform.DeploymentResource{ - Properties: &armappplatform.DeploymentResourceProperties{ - DeploymentSettings: &armappplatform.DeploymentSettings{ - AddonConfigs: map[string]map[string]interface{}{ - "ApplicationConfigurationService": { - "patterns": []interface{}{ - "mypattern", - }, - }, - }, - EnvironmentVariables: map[string]*string{ - "env": to.Ptr("test"), - }, - ResourceRequests: &armappplatform.ResourceRequests{ - CPU: to.Ptr("1000m"), - Memory: to.Ptr("3Gi"), - }, - }, - Source: &armappplatform.SourceUploadedUserSourceInfo{ - Type: to.Ptr("Source"), - Version: to.Ptr("1.0"), - RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - ArtifactSelector: to.Ptr("sub-module-1"), - }, - }, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Capacity: to.Ptr[int32](1), - Tier: to.Ptr("Standard"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Delete.json -func ExampleDeploymentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Update.json -func ExampleDeploymentsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - armappplatform.DeploymentResource{ - Properties: &armappplatform.DeploymentResourceProperties{ - Source: &armappplatform.SourceUploadedUserSourceInfo{ - Type: to.Ptr("Source"), - Version: to.Ptr("1.0"), - RelativePath: to.Ptr("resources/a172cedcae47474b615c54d510a5d84a8dea3032e958587430b413538be3f333-2019082605-e3095339-1723-44b7-8b5e-31b1003978bc"), - ArtifactSelector: to.Ptr("sub-module-1"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_List.json -func ExampleDeploymentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - "myservice", - "myapp", - &armappplatform.DeploymentsClientListOptions{Version: []string{}}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_ListForCluster.json -func ExampleDeploymentsClient_NewListForClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListForClusterPager("myResourceGroup", - "myservice", - &armappplatform.DeploymentsClientListForClusterOptions{Version: []string{}}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Start.json -func ExampleDeploymentsClient_BeginStart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStart(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Stop.json -func ExampleDeploymentsClient_BeginStop() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStop(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_Restart.json -func ExampleDeploymentsClient_BeginRestart() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestart(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_GenerateHeapDump.json -func ExampleDeploymentsClient_BeginGenerateHeapDump() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGenerateHeapDump(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - armappplatform.DiagnosticParameters{ - AppInstance: to.Ptr("myappinstance"), - FilePath: to.Ptr("/byos/diagnose"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_GenerateThreadDump.json -func ExampleDeploymentsClient_BeginGenerateThreadDump() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGenerateThreadDump(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - armappplatform.DiagnosticParameters{ - AppInstance: to.Ptr("myappinstance"), - FilePath: to.Ptr("/byos/diagnose"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Deployments_StartJFR.json -func ExampleDeploymentsClient_BeginStartJFR() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewDeploymentsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginStartJFR(ctx, - "myResourceGroup", - "myservice", - "myapp", - "mydeployment", - armappplatform.DiagnosticParameters{ - AppInstance: to.Ptr("myappinstance"), - Duration: to.Ptr("60s"), - FilePath: to.Ptr("/byos/diagnose"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_monitoringsettings_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_monitoringsettings_client_test.go deleted file mode 100644 index b7149b37e668..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_monitoringsettings_client_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/MonitoringSettings_Get.json -func ExampleMonitoringSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewMonitoringSettingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/MonitoringSettings_UpdatePut.json -func ExampleMonitoringSettingsClient_BeginUpdatePut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewMonitoringSettingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdatePut(ctx, - "myResourceGroup", - "myservice", - armappplatform.MonitoringSettingResource{ - Properties: &armappplatform.MonitoringSettingProperties{ - AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - AppInsightsSamplingRate: to.Ptr[float64](10), - TraceEnabled: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/MonitoringSettings_UpdatePatch.json -func ExampleMonitoringSettingsClient_BeginUpdatePatch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewMonitoringSettingsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdatePatch(ctx, - "myResourceGroup", - "myservice", - armappplatform.MonitoringSettingResource{ - Properties: &armappplatform.MonitoringSettingProperties{ - AppInsightsInstrumentationKey: to.Ptr("00000000-0000-0000-0000-000000000000"), - AppInsightsSamplingRate: to.Ptr[float64](10), - TraceEnabled: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_services_client_test.go b/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_services_client_test.go deleted file mode 100644 index 1b68176f00f5..000000000000 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_services_client_test.go +++ /dev/null @@ -1,301 +0,0 @@ -//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 armappplatform_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/appplatform/armappplatform" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_Get.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_CreateOrUpdate.json -func ExampleServicesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - armappplatform.ServiceResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armappplatform.ClusterResourceProperties{}, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_Delete.json -func ExampleServicesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_Update.json -func ExampleServicesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "myResourceGroup", - "myservice", - armappplatform.ServiceResource{ - Location: to.Ptr("eastus"), - Tags: map[string]*string{ - "key1": to.Ptr("value1"), - }, - Properties: &armappplatform.ClusterResourceProperties{}, - SKU: &armappplatform.SKU{ - Name: to.Ptr("S0"), - Tier: to.Ptr("Standard"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_ListTestKeys.json -func ExampleServicesClient_ListTestKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListTestKeys(ctx, - "myResourceGroup", - "myservice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_RegenerateTestKey.json -func ExampleServicesClient_RegenerateTestKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RegenerateTestKey(ctx, - "myResourceGroup", - "myservice", - armappplatform.RegenerateTestKeyRequestPayload{ - KeyType: to.Ptr(armappplatform.TestKeyTypePrimary), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_DisableTestEndpoint.json -func ExampleServicesClient_DisableTestEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DisableTestEndpoint(ctx, - "myResourceGroup", - "myservice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_EnableTestEndpoint.json -func ExampleServicesClient_EnableTestEndpoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.EnableTestEndpoint(ctx, - "myResourceGroup", - "myservice", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_CheckNameAvailability.json -func ExampleServicesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - "eastus", - armappplatform.NameAvailabilityParameters{ - Name: to.Ptr("myservice"), - Type: to.Ptr("Microsoft.AppPlatform/Spring"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_ListBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Services_List.json -func ExampleServicesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armappplatform.NewServicesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myResourceGroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apiportalcustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apiportalcustomdomains_client.go new file mode 100644 index 000000000000..3577b5197299 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apiportalcustomdomains_client.go @@ -0,0 +1,349 @@ +//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 armappplatform + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// APIPortalCustomDomainsClient contains the methods for the APIPortalCustomDomains group. +// Don't use this type directly, use NewAPIPortalCustomDomainsClient() instead. +type APIPortalCustomDomainsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAPIPortalCustomDomainsClient creates a new instance of APIPortalCustomDomainsClient with the specified values. +// subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewAPIPortalCustomDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIPortalCustomDomainsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &APIPortalCustomDomainsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update the API portal custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// domainName - The name of the API portal custom domain. +// apiPortalCustomDomainResource - The API portal custom domain for the create or update operation +// options - APIPortalCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginCreateOrUpdate +// method. +func (client *APIPortalCustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalCustomDomainsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalCustomDomainsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalCustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or update the API portal custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *APIPortalCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, apiPortalCustomDomainResource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *APIPortalCustomDomainsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, apiPortalCustomDomainResource APIPortalCustomDomainResource, options *APIPortalCustomDomainsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, apiPortalCustomDomainResource) +} + +// BeginDelete - Delete the API portal custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// domainName - The name of the API portal custom domain. +// options - APIPortalCustomDomainsClientBeginDeleteOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginDelete +// method. +func (client *APIPortalCustomDomainsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[APIPortalCustomDomainsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalCustomDomainsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalCustomDomainsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete the API portal custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *APIPortalCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *APIPortalCustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the API portal custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// domainName - The name of the API portal custom domain. +// options - APIPortalCustomDomainsClientGetOptions contains the optional parameters for the APIPortalCustomDomainsClient.Get +// method. +func (client *APIPortalCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientGetOptions) (APIPortalCustomDomainsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, domainName, options) + if err != nil { + return APIPortalCustomDomainsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIPortalCustomDomainsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalCustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *APIPortalCustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, domainName string, options *APIPortalCustomDomainsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains/{domainName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *APIPortalCustomDomainsClient) getHandleResponse(resp *http.Response) (APIPortalCustomDomainsClientGetResponse, error) { + result := APIPortalCustomDomainsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalCustomDomainResource); err != nil { + return APIPortalCustomDomainsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all API portal custom domains. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// options - APIPortalCustomDomainsClientListOptions contains the optional parameters for the APIPortalCustomDomainsClient.List +// method. +func (client *APIPortalCustomDomainsClient) NewListPager(resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalCustomDomainsClientListOptions) *runtime.Pager[APIPortalCustomDomainsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[APIPortalCustomDomainsClientListResponse]{ + More: func(page APIPortalCustomDomainsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APIPortalCustomDomainsClientListResponse) (APIPortalCustomDomainsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APIPortalCustomDomainsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIPortalCustomDomainsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalCustomDomainsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *APIPortalCustomDomainsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalCustomDomainsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/domains" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *APIPortalCustomDomainsClient) listHandleResponse(resp *http.Response) (APIPortalCustomDomainsClientListResponse, error) { + result := APIPortalCustomDomainsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalCustomDomainResourceCollection); err != nil { + return APIPortalCustomDomainsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apiportals_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apiportals_client.go new file mode 100644 index 000000000000..b6f7382be129 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apiportals_client.go @@ -0,0 +1,390 @@ +//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 armappplatform + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// APIPortalsClient contains the methods for the APIPortals group. +// Don't use this type directly, use NewAPIPortalsClient() instead. +type APIPortalsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAPIPortalsClient creates a new instance of APIPortalsClient with the specified values. +// subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewAPIPortalsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIPortalsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &APIPortalsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create the default API portal or update the existing API portal. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// apiPortalResource - The API portal for the create or update operation +// options - APIPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalsClient.BeginCreateOrUpdate +// method. +func (client *APIPortalsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIPortalsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, apiPortalName, apiPortalResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create the default API portal or update the existing API portal. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *APIPortalsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, apiPortalResource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *APIPortalsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, apiPortalResource APIPortalResource, options *APIPortalsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, apiPortalResource) +} + +// BeginDelete - Delete the default API portal. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// options - APIPortalsClientBeginDeleteOptions contains the optional parameters for the APIPortalsClient.BeginDelete method. +func (client *APIPortalsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*runtime.Poller[APIPortalsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, apiPortalName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[APIPortalsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[APIPortalsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete the default API portal. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *APIPortalsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *APIPortalsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the API portal and its properties. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// options - APIPortalsClientGetOptions contains the optional parameters for the APIPortalsClient.Get method. +func (client *APIPortalsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientGetOptions) (APIPortalsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, options) + if err != nil { + return APIPortalsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIPortalsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *APIPortalsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, options *APIPortalsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *APIPortalsClient) getHandleResponse(resp *http.Response) (APIPortalsClientGetResponse, error) { + result := APIPortalsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalResource); err != nil { + return APIPortalsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handles requests to list all resources in a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// options - APIPortalsClientListOptions contains the optional parameters for the APIPortalsClient.List method. +func (client *APIPortalsClient) NewListPager(resourceGroupName string, serviceName string, options *APIPortalsClientListOptions) *runtime.Pager[APIPortalsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[APIPortalsClientListResponse]{ + More: func(page APIPortalsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APIPortalsClientListResponse) (APIPortalsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APIPortalsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIPortalsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *APIPortalsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *APIPortalsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *APIPortalsClient) listHandleResponse(resp *http.Response) (APIPortalsClientListResponse, error) { + result := APIPortalsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APIPortalResourceCollection); err != nil { + return APIPortalsClientListResponse{}, err + } + return result, nil +} + +// ValidateDomain - Check the domains are valid as well as not in use. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// apiPortalName - The name of API portal. +// validatePayload - Custom domain payload to be validated +// options - APIPortalsClientValidateDomainOptions contains the optional parameters for the APIPortalsClient.ValidateDomain +// method. +func (client *APIPortalsClient) ValidateDomain(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, validatePayload CustomDomainValidatePayload, options *APIPortalsClientValidateDomainOptions) (APIPortalsClientValidateDomainResponse, error) { + req, err := client.validateDomainCreateRequest(ctx, resourceGroupName, serviceName, apiPortalName, validatePayload, options) + if err != nil { + return APIPortalsClientValidateDomainResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIPortalsClientValidateDomainResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIPortalsClientValidateDomainResponse{}, runtime.NewResponseError(resp) + } + return client.validateDomainHandleResponse(resp) +} + +// validateDomainCreateRequest creates the ValidateDomain request. +func (client *APIPortalsClient) validateDomainCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiPortalName string, validatePayload CustomDomainValidatePayload, options *APIPortalsClientValidateDomainOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/apiPortals/{apiPortalName}/validateDomain" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiPortalName == "" { + return nil, errors.New("parameter apiPortalName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiPortalName}", url.PathEscape(apiPortalName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, validatePayload) +} + +// validateDomainHandleResponse handles the ValidateDomain response. +func (client *APIPortalsClient) validateDomainHandleResponse(resp *http.Response) (APIPortalsClientValidateDomainResponse, error) { + result := APIPortalsClientValidateDomainResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomDomainValidateResult); err != nil { + return APIPortalsClientValidateDomainResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apps_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apps_client.go index 857b424b41b4..b8f4a1fa2503 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apps_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_apps_client.go @@ -57,7 +57,7 @@ func NewAppsClient(subscriptionID string, credential azcore.TokenCredential, opt // BeginCreateOrUpdate - Create a new App or update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -71,9 +71,7 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AppsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[AppsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -81,7 +79,7 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup // CreateOrUpdate - Create a new App or update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *AppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { @@ -121,7 +119,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, appResource) @@ -129,7 +127,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou // BeginDelete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -141,9 +139,7 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AppsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[AppsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -151,7 +147,7 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Operation to delete an App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *AppsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, options *AppsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, options) if err != nil { @@ -191,7 +187,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +195,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Get an App and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -244,7 +240,7 @@ func (client *AppsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.SyncStatus != nil { reqQP.Set("syncStatus", *options.SyncStatus) } @@ -264,7 +260,7 @@ func (client *AppsClient) getHandleResponse(resp *http.Response) (AppsClientGetR // GetResourceUploadURL - Get an resource upload URL for an App, which may be artifacts or source archive. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -310,7 +306,7 @@ func (client *AppsClient) getResourceUploadURLCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,7 +323,7 @@ func (client *AppsClient) getResourceUploadURLHandleResponse(resp *http.Response // NewListPager - Handles requests to list all resources in a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -380,7 +376,7 @@ func (client *AppsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -397,7 +393,7 @@ func (client *AppsClient) listHandleResponse(resp *http.Response) (AppsClientLis // BeginSetActiveDeployments - Set existing Deployment under the app as active // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -411,9 +407,7 @@ func (client *AppsClient) BeginSetActiveDeployments(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AppsClientSetActiveDeploymentsResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientSetActiveDeploymentsResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[AppsClientSetActiveDeploymentsResponse](options.ResumeToken, client.pl, nil) } @@ -421,7 +415,7 @@ func (client *AppsClient) BeginSetActiveDeployments(ctx context.Context, resourc // SetActiveDeployments - Set existing Deployment under the app as active // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *AppsClient) setActiveDeployments(ctx context.Context, resourceGroupName string, serviceName string, appName string, activeDeploymentCollection ActiveDeploymentCollection, options *AppsClientBeginSetActiveDeploymentsOptions) (*http.Response, error) { req, err := client.setActiveDeploymentsCreateRequest(ctx, resourceGroupName, serviceName, appName, activeDeploymentCollection, options) if err != nil { @@ -461,7 +455,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, activeDeploymentCollection) @@ -469,7 +463,7 @@ func (client *AppsClient) setActiveDeploymentsCreateRequest(ctx context.Context, // BeginUpdate - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -482,9 +476,7 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[AppsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[AppsClientUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[AppsClientUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -492,7 +484,7 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str // Update - Operation to update an exiting App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *AppsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, appResource AppResource, options *AppsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, appResource, options) if err != nil { @@ -532,7 +524,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, appResource) @@ -540,7 +532,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup // ValidateDomain - Check the resource name is valid as well as not in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -586,7 +578,7 @@ func (client *AppsClient) validateDomainCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, validatePayload) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_bindings_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_bindings_client.go index 174374af626c..ff1be9058cd1 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_bindings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_bindings_client.go @@ -57,7 +57,7 @@ func NewBindingsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Create a new Binding or update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -72,9 +72,7 @@ func (client *BindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BindingsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BindingsClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BindingsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -82,7 +80,7 @@ func (client *BindingsClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Binding or update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BindingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource BindingResource, options *BindingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { @@ -126,7 +124,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bindingResource) @@ -134,7 +132,7 @@ func (client *BindingsClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -147,9 +145,7 @@ func (client *BindingsClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BindingsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BindingsClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BindingsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -157,7 +153,7 @@ func (client *BindingsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BindingsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, options *BindingsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, options) if err != nil { @@ -201,7 +197,7 @@ func (client *BindingsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +205,7 @@ func (client *BindingsClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get a Binding and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -259,7 +255,7 @@ func (client *BindingsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,7 +272,7 @@ func (client *BindingsClient) getHandleResponse(resp *http.Response) (BindingsCl // NewListPager - Handles requests to list all resources in an App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -334,7 +330,7 @@ func (client *BindingsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +347,7 @@ func (client *BindingsClient) listHandleResponse(resp *http.Response) (BindingsC // BeginUpdate - Operation to update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -365,9 +361,7 @@ func (client *BindingsClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BindingsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BindingsClientUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BindingsClientUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -375,7 +369,7 @@ func (client *BindingsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting Binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BindingsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, bindingName string, bindingResource BindingResource, options *BindingsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, bindingName, bindingResource, options) if err != nil { @@ -419,7 +413,7 @@ func (client *BindingsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bindingResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildpackbinding_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildpackbinding_client.go index 2f5ef021e0a9..135f5719ee47 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildpackbinding_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildpackbinding_client.go @@ -57,7 +57,7 @@ func NewBuildpackBindingClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Create or update a buildpack binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -73,9 +73,7 @@ func (client *BuildpackBindingClient) BeginCreateOrUpdate(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BuildpackBindingClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildpackBindingClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BuildpackBindingClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -83,7 +81,7 @@ func (client *BuildpackBindingClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Create or update a buildpack binding. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BuildpackBindingClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, buildpackBindingName string, buildpackBinding BuildpackBindingResource, options *BuildpackBindingClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, buildpackBinding, options) if err != nil { @@ -131,7 +129,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, buildpackBinding) @@ -139,7 +137,7 @@ func (client *BuildpackBindingClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -154,9 +152,7 @@ func (client *BuildpackBindingClient) BeginDelete(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BuildpackBindingClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildpackBindingClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BuildpackBindingClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -164,7 +160,7 @@ func (client *BuildpackBindingClient) BeginDelete(ctx context.Context, resourceG // Delete - Operation to delete a Buildpack Binding // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BuildpackBindingClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, buildpackBindingName string, options *BuildpackBindingClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, buildpackBindingName, options) if err != nil { @@ -212,7 +208,7 @@ func (client *BuildpackBindingClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +216,7 @@ func (client *BuildpackBindingClient) deleteCreateRequest(ctx context.Context, r // Get - Get a buildpack binding by name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -275,7 +271,7 @@ func (client *BuildpackBindingClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -292,7 +288,7 @@ func (client *BuildpackBindingClient) getHandleResponse(resp *http.Response) (Bu // NewListPager - Handles requests to list all buildpack bindings in a builder. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -355,7 +351,7 @@ func (client *BuildpackBindingClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservice_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservice_client.go index 2ec394887085..158963140798 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservice_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservice_client.go @@ -57,7 +57,7 @@ func NewBuildServiceClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdateBuild - Create or update a KPack build. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -109,7 +109,7 @@ func (client *BuildServiceClient) createOrUpdateBuildCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, buildParam) @@ -126,7 +126,7 @@ func (client *BuildServiceClient) createOrUpdateBuildHandleResponse(resp *http.R // GetBuild - Get a KPack build. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -176,7 +176,7 @@ func (client *BuildServiceClient) getBuildCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *BuildServiceClient) getBuildHandleResponse(resp *http.Response) (B // GetBuildResult - Get a KPack build result. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -249,7 +249,7 @@ func (client *BuildServiceClient) getBuildResultCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +266,7 @@ func (client *BuildServiceClient) getBuildResultHandleResponse(resp *http.Respon // GetBuildResultLog - Get a KPack build result log download URL. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -322,7 +322,7 @@ func (client *BuildServiceClient) getBuildResultLogCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -339,7 +339,7 @@ func (client *BuildServiceClient) getBuildResultLogHandleResponse(resp *http.Res // GetBuildService - Get a build service resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -385,7 +385,7 @@ func (client *BuildServiceClient) getBuildServiceCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +402,7 @@ func (client *BuildServiceClient) getBuildServiceHandleResponse(resp *http.Respo // GetResourceUploadURL - Get an resource upload URL for build service, which may be artifacts or source archive. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -448,7 +448,7 @@ func (client *BuildServiceClient) getResourceUploadURLCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,7 +465,7 @@ func (client *BuildServiceClient) getResourceUploadURLHandleResponse(resp *http. // GetSupportedBuildpack - Get the supported buildpack resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -516,7 +516,7 @@ func (client *BuildServiceClient) getSupportedBuildpackCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -533,7 +533,7 @@ func (client *BuildServiceClient) getSupportedBuildpackHandleResponse(resp *http // GetSupportedStack - Get the supported stack resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -584,7 +584,7 @@ func (client *BuildServiceClient) getSupportedStackCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -601,7 +601,7 @@ func (client *BuildServiceClient) getSupportedStackHandleResponse(resp *http.Res // NewListBuildResultsPager - List KPack build results. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -665,7 +665,7 @@ func (client *BuildServiceClient) listBuildResultsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -682,7 +682,7 @@ func (client *BuildServiceClient) listBuildResultsHandleResponse(resp *http.Resp // NewListBuildServicesPager - List build services resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -736,7 +736,7 @@ func (client *BuildServiceClient) listBuildServicesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -753,7 +753,7 @@ func (client *BuildServiceClient) listBuildServicesHandleResponse(resp *http.Res // NewListBuildsPager - List KPack builds. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -811,7 +811,7 @@ func (client *BuildServiceClient) listBuildsCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -828,7 +828,7 @@ func (client *BuildServiceClient) listBuildsHandleResponse(resp *http.Response) // ListSupportedBuildpacks - Get all supported buildpacks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -874,7 +874,7 @@ func (client *BuildServiceClient) listSupportedBuildpacksCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -891,7 +891,7 @@ func (client *BuildServiceClient) listSupportedBuildpacksHandleResponse(resp *ht // ListSupportedStacks - Get all supported stacks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -937,7 +937,7 @@ func (client *BuildServiceClient) listSupportedStacksCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildserviceagentpool_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildserviceagentpool_client.go index d627529b8c59..4f0ae10fa7d8 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildserviceagentpool_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildserviceagentpool_client.go @@ -57,7 +57,7 @@ func NewBuildServiceAgentPoolClient(subscriptionID string, credential azcore.Tok // Get - Get build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -108,7 +108,7 @@ func (client *BuildServiceAgentPoolClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +125,7 @@ func (client *BuildServiceAgentPoolClient) getHandleResponse(resp *http.Response // NewListPager - List build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -184,7 +184,7 @@ func (client *BuildServiceAgentPoolClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *BuildServiceAgentPoolClient) listHandleResponse(resp *http.Respons // BeginUpdatePut - Create or update build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -216,9 +216,7 @@ func (client *BuildServiceAgentPoolClient) BeginUpdatePut(ctx context.Context, r if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BuildServiceAgentPoolClientUpdatePutResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildServiceAgentPoolClientUpdatePutResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BuildServiceAgentPoolClientUpdatePutResponse](options.ResumeToken, client.pl, nil) } @@ -226,7 +224,7 @@ func (client *BuildServiceAgentPoolClient) BeginUpdatePut(ctx context.Context, r // UpdatePut - Create or update build service agent pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BuildServiceAgentPoolClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, agentPoolName string, agentPoolResource BuildServiceAgentPoolResource, options *BuildServiceAgentPoolClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, agentPoolName, agentPoolResource, options) if err != nil { @@ -270,7 +268,7 @@ func (client *BuildServiceAgentPoolClient) updatePutCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, agentPoolResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservicebuilder_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservicebuilder_client.go index a354fb0628ea..642d7661b3c2 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservicebuilder_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_buildservicebuilder_client.go @@ -57,7 +57,7 @@ func NewBuildServiceBuilderClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Create or update a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -72,9 +72,7 @@ func (client *BuildServiceBuilderClient) BeginCreateOrUpdate(ctx context.Context if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BuildServiceBuilderClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildServiceBuilderClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BuildServiceBuilderClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -82,7 +80,7 @@ func (client *BuildServiceBuilderClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Create or update a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BuildServiceBuilderClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, builderResource BuilderResource, options *BuildServiceBuilderClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, builderResource, options) if err != nil { @@ -126,7 +124,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, builderResource) @@ -134,7 +132,7 @@ func (client *BuildServiceBuilderClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -148,9 +146,7 @@ func (client *BuildServiceBuilderClient) BeginDelete(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[BuildServiceBuilderClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[BuildServiceBuilderClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[BuildServiceBuilderClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -158,7 +154,7 @@ func (client *BuildServiceBuilderClient) BeginDelete(ctx context.Context, resour // Delete - Delete a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *BuildServiceBuilderClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, buildServiceName string, builderName string, options *BuildServiceBuilderClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, buildServiceName, builderName, options) if err != nil { @@ -202,7 +198,7 @@ func (client *BuildServiceBuilderClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -210,7 +206,7 @@ func (client *BuildServiceBuilderClient) deleteCreateRequest(ctx context.Context // Get - Get a KPack builder. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -260,7 +256,7 @@ func (client *BuildServiceBuilderClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +273,7 @@ func (client *BuildServiceBuilderClient) getHandleResponse(resp *http.Response) // NewListPager - List KPack builders result. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -336,7 +332,7 @@ func (client *BuildServiceBuilderClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_certificates_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_certificates_client.go index 722808300a58..bb307b761f51 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_certificates_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_certificates_client.go @@ -57,7 +57,7 @@ func NewCertificatesClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Create or update certificate resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -71,9 +71,7 @@ func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CertificatesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CertificatesClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[CertificatesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -81,7 +79,7 @@ func (client *CertificatesClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Create or update certificate resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *CertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, certificateResource CertificateResource, options *CertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, certificateName, certificateResource, options) if err != nil { @@ -121,7 +119,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, certificateResource) @@ -129,7 +127,7 @@ func (client *CertificatesClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -142,9 +140,7 @@ func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CertificatesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CertificatesClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[CertificatesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -152,7 +148,7 @@ func (client *CertificatesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *CertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, certificateName string, options *CertificatesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, certificateName, options) if err != nil { @@ -192,7 +188,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +196,7 @@ func (client *CertificatesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get the certificate resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -245,7 +241,7 @@ func (client *CertificatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,7 +258,7 @@ func (client *CertificatesClient) getHandleResponse(resp *http.Response) (Certif // NewListPager - List all the certificates of one user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -315,7 +311,7 @@ func (client *CertificatesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configservers_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configservers_client.go index bc236f328c5e..e7a0ac1a083d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configservers_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configservers_client.go @@ -57,7 +57,7 @@ func NewConfigServersClient(subscriptionID string, credential azcore.TokenCreden // Get - Get the config server and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -97,7 +97,7 @@ func (client *ConfigServersClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *ConfigServersClient) getHandleResponse(resp *http.Response) (Confi // BeginUpdatePatch - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -127,9 +127,7 @@ func (client *ConfigServersClient) BeginUpdatePatch(ctx context.Context, resourc if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConfigServersClientUpdatePatchResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigServersClientUpdatePatchResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ConfigServersClientUpdatePatchResponse](options.ResumeToken, client.pl, nil) } @@ -137,7 +135,7 @@ func (client *ConfigServersClient) BeginUpdatePatch(ctx context.Context, resourc // UpdatePatch - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ConfigServersClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePatchOptions) (*http.Response, error) { req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { @@ -173,7 +171,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerResource) @@ -181,7 +179,7 @@ func (client *ConfigServersClient) updatePatchCreateRequest(ctx context.Context, // BeginUpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -194,9 +192,7 @@ func (client *ConfigServersClient) BeginUpdatePut(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConfigServersClientUpdatePutResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigServersClientUpdatePutResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ConfigServersClientUpdatePutResponse](options.ResumeToken, client.pl, nil) } @@ -204,7 +200,7 @@ func (client *ConfigServersClient) BeginUpdatePut(ctx context.Context, resourceG // UpdatePut - Update the config server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ConfigServersClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, configServerResource ConfigServerResource, options *ConfigServersClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, configServerResource, options) if err != nil { @@ -240,7 +236,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerResource) @@ -248,7 +244,7 @@ func (client *ConfigServersClient) updatePutCreateRequest(ctx context.Context, r // BeginValidate - Check if the config server settings are valid. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -271,7 +267,7 @@ func (client *ConfigServersClient) BeginValidate(ctx context.Context, resourceGr // Validate - Check if the config server settings are valid. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ConfigServersClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configServerSettings ConfigServerSettings, options *ConfigServersClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configServerSettings, options) if err != nil { @@ -307,7 +303,7 @@ func (client *ConfigServersClient) validateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configServerSettings) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configurationservices_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configurationservices_client.go index 902ea4deab0e..c2a45071f5af 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configurationservices_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_configurationservices_client.go @@ -58,7 +58,7 @@ func NewConfigurationServicesClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Create the default Application Configuration Service or update the existing Application Configuration // Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -72,9 +72,7 @@ func (client *ConfigurationServicesClient) BeginCreateOrUpdate(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConfigurationServicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigurationServicesClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ConfigurationServicesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -83,7 +81,7 @@ func (client *ConfigurationServicesClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Create the default Application Configuration Service or update the existing Application Configuration // Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ConfigurationServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, configurationServiceResource ConfigurationServiceResource, options *ConfigurationServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, configurationServiceResource, options) if err != nil { @@ -123,7 +121,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configurationServiceResource) @@ -131,7 +129,7 @@ func (client *ConfigurationServicesClient) createOrUpdateCreateRequest(ctx conte // BeginDelete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -144,9 +142,7 @@ func (client *ConfigurationServicesClient) BeginDelete(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ConfigurationServicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ConfigurationServicesClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ConfigurationServicesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -154,7 +150,7 @@ func (client *ConfigurationServicesClient) BeginDelete(ctx context.Context, reso // Delete - Disable the default Application Configuration Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ConfigurationServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, options *ConfigurationServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, options) if err != nil { @@ -194,7 +190,7 @@ func (client *ConfigurationServicesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,7 +198,7 @@ func (client *ConfigurationServicesClient) deleteCreateRequest(ctx context.Conte // Get - Get the Application Configuration Service and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -248,7 +244,7 @@ func (client *ConfigurationServicesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +261,7 @@ func (client *ConfigurationServicesClient) getHandleResponse(resp *http.Response // NewListPager - Handles requests to list all resources in a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -319,7 +315,7 @@ func (client *ConfigurationServicesClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -336,7 +332,7 @@ func (client *ConfigurationServicesClient) listHandleResponse(resp *http.Respons // BeginValidate - Check if the Application Configuration Service settings are valid. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -360,7 +356,7 @@ func (client *ConfigurationServicesClient) BeginValidate(ctx context.Context, re // Validate - Check if the Application Configuration Service settings are valid. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ConfigurationServicesClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configurationServiceName string, settings ConfigurationServiceSettings, options *ConfigurationServicesClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configurationServiceName, settings, options) if err != nil { @@ -400,7 +396,7 @@ func (client *ConfigurationServicesClient) validateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, settings) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_constants.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_constants.go index c5afde7230ed..49ab06989fe6 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_constants.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_constants.go @@ -10,9 +10,31 @@ package armappplatform const ( moduleName = "armappplatform" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) +// APIPortalProvisioningState - State of the API portal. +type APIPortalProvisioningState string + +const ( + APIPortalProvisioningStateCreating APIPortalProvisioningState = "Creating" + APIPortalProvisioningStateDeleting APIPortalProvisioningState = "Deleting" + APIPortalProvisioningStateFailed APIPortalProvisioningState = "Failed" + APIPortalProvisioningStateSucceeded APIPortalProvisioningState = "Succeeded" + APIPortalProvisioningStateUpdating APIPortalProvisioningState = "Updating" +) + +// PossibleAPIPortalProvisioningStateValues returns the possible values for the APIPortalProvisioningState const type. +func PossibleAPIPortalProvisioningStateValues() []APIPortalProvisioningState { + return []APIPortalProvisioningState{ + APIPortalProvisioningStateCreating, + APIPortalProvisioningStateDeleting, + APIPortalProvisioningStateFailed, + APIPortalProvisioningStateSucceeded, + APIPortalProvisioningStateUpdating, + } +} + // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. type ActionType string @@ -183,6 +205,28 @@ func PossibleBuildpackBindingProvisioningStateValues() []BuildpackBindingProvisi } } +// CertificateResourceProvisioningState - Provisioning state of the Certificate +type CertificateResourceProvisioningState string + +const ( + CertificateResourceProvisioningStateCreating CertificateResourceProvisioningState = "Creating" + CertificateResourceProvisioningStateDeleting CertificateResourceProvisioningState = "Deleting" + CertificateResourceProvisioningStateFailed CertificateResourceProvisioningState = "Failed" + CertificateResourceProvisioningStateSucceeded CertificateResourceProvisioningState = "Succeeded" + CertificateResourceProvisioningStateUpdating CertificateResourceProvisioningState = "Updating" +) + +// PossibleCertificateResourceProvisioningStateValues returns the possible values for the CertificateResourceProvisioningState const type. +func PossibleCertificateResourceProvisioningStateValues() []CertificateResourceProvisioningState { + return []CertificateResourceProvisioningState{ + CertificateResourceProvisioningStateCreating, + CertificateResourceProvisioningStateDeleting, + CertificateResourceProvisioningStateFailed, + CertificateResourceProvisioningStateSucceeded, + CertificateResourceProvisioningStateUpdating, + } +} + // ConfigServerState - State of the config server. type ConfigServerState string @@ -247,6 +291,28 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// CustomDomainResourceProvisioningState - Provisioning state of the Domain +type CustomDomainResourceProvisioningState string + +const ( + CustomDomainResourceProvisioningStateCreating CustomDomainResourceProvisioningState = "Creating" + CustomDomainResourceProvisioningStateDeleting CustomDomainResourceProvisioningState = "Deleting" + CustomDomainResourceProvisioningStateFailed CustomDomainResourceProvisioningState = "Failed" + CustomDomainResourceProvisioningStateSucceeded CustomDomainResourceProvisioningState = "Succeeded" + CustomDomainResourceProvisioningStateUpdating CustomDomainResourceProvisioningState = "Updating" +) + +// PossibleCustomDomainResourceProvisioningStateValues returns the possible values for the CustomDomainResourceProvisioningState const type. +func PossibleCustomDomainResourceProvisioningStateValues() []CustomDomainResourceProvisioningState { + return []CustomDomainResourceProvisioningState{ + CustomDomainResourceProvisioningStateCreating, + CustomDomainResourceProvisioningStateDeleting, + CustomDomainResourceProvisioningStateFailed, + CustomDomainResourceProvisioningStateSucceeded, + CustomDomainResourceProvisioningStateUpdating, + } +} + // DeploymentResourceProvisioningState - Provisioning state of the Deployment type DeploymentResourceProvisioningState string @@ -283,6 +349,47 @@ func PossibleDeploymentResourceStatusValues() []DeploymentResourceStatus { } } +// GatewayProvisioningState - State of the Spring Cloud Gateway. +type GatewayProvisioningState string + +const ( + GatewayProvisioningStateCreating GatewayProvisioningState = "Creating" + GatewayProvisioningStateDeleting GatewayProvisioningState = "Deleting" + GatewayProvisioningStateFailed GatewayProvisioningState = "Failed" + GatewayProvisioningStateSucceeded GatewayProvisioningState = "Succeeded" + GatewayProvisioningStateUpdating GatewayProvisioningState = "Updating" +) + +// PossibleGatewayProvisioningStateValues returns the possible values for the GatewayProvisioningState const type. +func PossibleGatewayProvisioningStateValues() []GatewayProvisioningState { + return []GatewayProvisioningState{ + GatewayProvisioningStateCreating, + GatewayProvisioningStateDeleting, + GatewayProvisioningStateFailed, + GatewayProvisioningStateSucceeded, + GatewayProvisioningStateUpdating, + } +} + +// HTTPSchemeType - Scheme to use for connecting to the host. Defaults to HTTP. +// Possible enum values: +// * "HTTP" means that the scheme used will be http:// +// * "HTTPS" means that the scheme used will be https:// +type HTTPSchemeType string + +const ( + HTTPSchemeTypeHTTP HTTPSchemeType = "HTTP" + HTTPSchemeTypeHTTPS HTTPSchemeType = "HTTPS" +) + +// PossibleHTTPSchemeTypeValues returns the possible values for the HTTPSchemeType const type. +func PossibleHTTPSchemeTypeValues() []HTTPSchemeType { + return []HTTPSchemeType{ + HTTPSchemeTypeHTTP, + HTTPSchemeTypeHTTPS, + } +} + // KPackBuildStageProvisioningState - The provisioning state of this build stage resource. type KPackBuildStageProvisioningState string @@ -363,6 +470,40 @@ func PossibleMonitoringSettingStateValues() []MonitoringSettingState { } } +// PowerState - Power state of the Service +type PowerState string + +const ( + PowerStateRunning PowerState = "Running" + PowerStateStopped PowerState = "Stopped" +) + +// PossiblePowerStateValues returns the possible values for the PowerState const type. +func PossiblePowerStateValues() []PowerState { + return []PowerState{ + PowerStateRunning, + PowerStateStopped, + } +} + +// ProbeActionType - The type of the action to take to perform the health check. +type ProbeActionType string + +const ( + ProbeActionTypeExecAction ProbeActionType = "ExecAction" + ProbeActionTypeHTTPGetAction ProbeActionType = "HTTPGetAction" + ProbeActionTypeTCPSocketAction ProbeActionType = "TCPSocketAction" +) + +// PossibleProbeActionTypeValues returns the possible values for the ProbeActionType const type. +func PossibleProbeActionTypeValues() []ProbeActionType { + return []ProbeActionType{ + ProbeActionTypeExecAction, + ProbeActionTypeHTTPGetAction, + ProbeActionTypeTCPSocketAction, + } +} + // ProvisioningState - Provisioning state of the Service type ProvisioningState string @@ -469,6 +610,20 @@ func PossibleServiceRegistryProvisioningStateValues() []ServiceRegistryProvision } } +// StorageType - The type of the storage. +type StorageType string + +const ( + StorageTypeStorageAccount StorageType = "StorageAccount" +) + +// PossibleStorageTypeValues returns the possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{ + StorageTypeStorageAccount, + } +} + // SupportedRuntimePlatform - The platform of this runtime version (possible values: "Java" or ".NET"). type SupportedRuntimePlatform string @@ -536,3 +691,17 @@ func PossibleTrafficDirectionValues() []TrafficDirection { TrafficDirectionOutbound, } } + +// Type - The type of the underlying resource to mount as a persistent disk. +type Type string + +const ( + TypeAzureFileVolume Type = "AzureFileVolume" +) + +// PossibleTypeValues returns the possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{ + TypeAzureFileVolume, + } +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_customdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_customdomains_client.go index c5e0e1de7a6d..26f0f87e9828 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_customdomains_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_customdomains_client.go @@ -57,7 +57,7 @@ func NewCustomDomainsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Create or update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -72,9 +72,7 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CustomDomainsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CustomDomainsClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -82,7 +80,7 @@ func (client *CustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Create or update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *CustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, domainResource CustomDomainResource, options *CustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { @@ -126,7 +124,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainResource) @@ -134,7 +132,7 @@ func (client *CustomDomainsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -148,9 +146,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CustomDomainsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CustomDomainsClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -158,7 +154,7 @@ func (client *CustomDomainsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Delete the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *CustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, options *CustomDomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, options) if err != nil { @@ -202,7 +198,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -210,7 +206,7 @@ func (client *CustomDomainsClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -260,7 +256,7 @@ func (client *CustomDomainsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -277,7 +273,7 @@ func (client *CustomDomainsClient) getHandleResponse(resp *http.Response) (Custo // NewListPager - List the custom domains of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -335,7 +331,7 @@ func (client *CustomDomainsClient) listCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -352,7 +348,7 @@ func (client *CustomDomainsClient) listHandleResponse(resp *http.Response) (Cust // BeginUpdate - Update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -367,9 +363,7 @@ func (client *CustomDomainsClient) BeginUpdate(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[CustomDomainsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[CustomDomainsClientUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[CustomDomainsClientUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -377,7 +371,7 @@ func (client *CustomDomainsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Update custom domain of one lifecycle application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *CustomDomainsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, domainName string, domainResource CustomDomainResource, options *CustomDomainsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, domainName, domainResource, options) if err != nil { @@ -421,7 +415,7 @@ func (client *CustomDomainsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_deployments_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_deployments_client.go index f982bf4869c7..f76592f369b2 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_deployments_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_deployments_client.go @@ -57,7 +57,7 @@ func NewDeploymentsClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Create a new Deployment or update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -72,9 +72,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -82,7 +80,7 @@ func (client *DeploymentsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create a new Deployment or update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource DeploymentResource, options *DeploymentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { @@ -126,7 +124,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, deploymentResource) @@ -134,7 +132,7 @@ func (client *DeploymentsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -147,9 +145,7 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -157,7 +153,7 @@ func (client *DeploymentsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Operation to delete a Deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -201,7 +197,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -209,7 +205,7 @@ func (client *DeploymentsClient) deleteCreateRequest(ctx context.Context, resour // BeginGenerateHeapDump - Generate Heap Dump // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -224,9 +220,7 @@ func (client *DeploymentsClient) BeginGenerateHeapDump(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientGenerateHeapDumpResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientGenerateHeapDumpResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientGenerateHeapDumpResponse](options.ResumeToken, client.pl, nil) } @@ -234,7 +228,7 @@ func (client *DeploymentsClient) BeginGenerateHeapDump(ctx context.Context, reso // GenerateHeapDump - Generate Heap Dump // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) generateHeapDump(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginGenerateHeapDumpOptions) (*http.Response, error) { req, err := client.generateHeapDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -278,7 +272,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -286,7 +280,7 @@ func (client *DeploymentsClient) generateHeapDumpCreateRequest(ctx context.Conte // BeginGenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -301,9 +295,7 @@ func (client *DeploymentsClient) BeginGenerateThreadDump(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientGenerateThreadDumpResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientGenerateThreadDumpResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientGenerateThreadDumpResponse](options.ResumeToken, client.pl, nil) } @@ -311,7 +303,7 @@ func (client *DeploymentsClient) BeginGenerateThreadDump(ctx context.Context, re // GenerateThreadDump - Generate Thread Dump // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) generateThreadDump(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginGenerateThreadDumpOptions) (*http.Response, error) { req, err := client.generateThreadDumpCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -355,7 +347,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -363,7 +355,7 @@ func (client *DeploymentsClient) generateThreadDumpCreateRequest(ctx context.Con // Get - Get a Deployment and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -413,7 +405,7 @@ func (client *DeploymentsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -430,7 +422,7 @@ func (client *DeploymentsClient) getHandleResponse(resp *http.Response) (Deploym // GetLogFileURL - Get deployment log file URL // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -481,7 +473,7 @@ func (client *DeploymentsClient) getLogFileURLCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -498,7 +490,7 @@ func (client *DeploymentsClient) getLogFileURLHandleResponse(resp *http.Response // NewListPager - Handles requests to list all resources in an App. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -556,7 +548,7 @@ func (client *DeploymentsClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -578,7 +570,7 @@ func (client *DeploymentsClient) listHandleResponse(resp *http.Response) (Deploy // NewListForClusterPager - List deployments for a certain service // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -632,7 +624,7 @@ func (client *DeploymentsClient) listForClusterCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.Version != nil { for _, qv := range options.Version { reqQP.Add("version", qv) @@ -654,7 +646,7 @@ func (client *DeploymentsClient) listForClusterHandleResponse(resp *http.Respons // BeginRestart - Restart the deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -668,9 +660,7 @@ func (client *DeploymentsClient) BeginRestart(ctx context.Context, resourceGroup if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientRestartResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientRestartResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientRestartResponse](options.ResumeToken, client.pl, nil) } @@ -678,7 +668,7 @@ func (client *DeploymentsClient) BeginRestart(ctx context.Context, resourceGroup // Restart - Restart the deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) restart(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -722,7 +712,7 @@ func (client *DeploymentsClient) restartCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -730,7 +720,7 @@ func (client *DeploymentsClient) restartCreateRequest(ctx context.Context, resou // BeginStart - Start the deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -743,9 +733,7 @@ func (client *DeploymentsClient) BeginStart(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientStartResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientStartResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStartResponse](options.ResumeToken, client.pl, nil) } @@ -753,7 +741,7 @@ func (client *DeploymentsClient) BeginStart(ctx context.Context, resourceGroupNa // Start - Start the deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) start(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -797,7 +785,7 @@ func (client *DeploymentsClient) startCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -805,7 +793,7 @@ func (client *DeploymentsClient) startCreateRequest(ctx context.Context, resourc // BeginStartJFR - Start JFR // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -820,9 +808,7 @@ func (client *DeploymentsClient) BeginStartJFR(ctx context.Context, resourceGrou if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientStartJFRResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientStartJFRResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStartJFRResponse](options.ResumeToken, client.pl, nil) } @@ -830,7 +816,7 @@ func (client *DeploymentsClient) BeginStartJFR(ctx context.Context, resourceGrou // StartJFR - Start JFR // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) startJFR(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, diagnosticParameters DiagnosticParameters, options *DeploymentsClientBeginStartJFROptions) (*http.Response, error) { req, err := client.startJFRCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, diagnosticParameters, options) if err != nil { @@ -874,7 +860,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, diagnosticParameters) @@ -882,7 +868,7 @@ func (client *DeploymentsClient) startJFRCreateRequest(ctx context.Context, reso // BeginStop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -895,9 +881,7 @@ func (client *DeploymentsClient) BeginStop(ctx context.Context, resourceGroupNam if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientStopResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientStopResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientStopResponse](options.ResumeToken, client.pl, nil) } @@ -905,7 +889,7 @@ func (client *DeploymentsClient) BeginStop(ctx context.Context, resourceGroupNam // Stop - Stop the deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) stop(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, options *DeploymentsClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, options) if err != nil { @@ -949,7 +933,7 @@ func (client *DeploymentsClient) stopCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -957,7 +941,7 @@ func (client *DeploymentsClient) stopCreateRequest(ctx context.Context, resource // BeginUpdate - Operation to update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -971,9 +955,7 @@ func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupN if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DeploymentsClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[DeploymentsClientUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[DeploymentsClientUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -981,7 +963,7 @@ func (client *DeploymentsClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - Operation to update an exiting Deployment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *DeploymentsClient) update(ctx context.Context, resourceGroupName string, serviceName string, appName string, deploymentName string, deploymentResource DeploymentResource, options *DeploymentsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, appName, deploymentName, deploymentResource, options) if err != nil { @@ -1025,7 +1007,7 @@ func (client *DeploymentsClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, deploymentResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gatewaycustomdomains_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gatewaycustomdomains_client.go new file mode 100644 index 000000000000..9ea68585a421 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gatewaycustomdomains_client.go @@ -0,0 +1,349 @@ +//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 armappplatform + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// GatewayCustomDomainsClient contains the methods for the GatewayCustomDomains group. +// Don't use this type directly, use NewGatewayCustomDomainsClient() instead. +type GatewayCustomDomainsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewGatewayCustomDomainsClient creates a new instance of GatewayCustomDomainsClient with the specified values. +// subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewGatewayCustomDomainsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayCustomDomainsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &GatewayCustomDomainsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update the Spring Cloud Gateway custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// domainName - The name of the Spring Cloud Gateway custom domain. +// gatewayCustomDomainResource - The gateway custom domain resource for the create or update operation +// options - GatewayCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginCreateOrUpdate +// method. +func (client *GatewayCustomDomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayCustomDomainsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayCustomDomainsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayCustomDomainsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or update the Spring Cloud Gateway custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *GatewayCustomDomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, gatewayCustomDomainResource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GatewayCustomDomainsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, gatewayCustomDomainResource GatewayCustomDomainResource, options *GatewayCustomDomainsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, gatewayCustomDomainResource) +} + +// BeginDelete - Delete the Spring Cloud Gateway custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// domainName - The name of the Spring Cloud Gateway custom domain. +// options - GatewayCustomDomainsClientBeginDeleteOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginDelete +// method. +func (client *GatewayCustomDomainsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*runtime.Poller[GatewayCustomDomainsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayCustomDomainsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayCustomDomainsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete the Spring Cloud Gateway custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *GatewayCustomDomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GatewayCustomDomainsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the Spring Cloud Gateway custom domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// domainName - The name of the Spring Cloud Gateway custom domain. +// options - GatewayCustomDomainsClientGetOptions contains the optional parameters for the GatewayCustomDomainsClient.Get +// method. +func (client *GatewayCustomDomainsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientGetOptions) (GatewayCustomDomainsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, domainName, options) + if err != nil { + return GatewayCustomDomainsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GatewayCustomDomainsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayCustomDomainsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GatewayCustomDomainsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, domainName string, options *GatewayCustomDomainsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains/{domainName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GatewayCustomDomainsClient) getHandleResponse(resp *http.Response) (GatewayCustomDomainsClientGetResponse, error) { + result := GatewayCustomDomainsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayCustomDomainResource); err != nil { + return GatewayCustomDomainsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all Spring Cloud Gateway custom domains. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// options - GatewayCustomDomainsClientListOptions contains the optional parameters for the GatewayCustomDomainsClient.List +// method. +func (client *GatewayCustomDomainsClient) NewListPager(resourceGroupName string, serviceName string, gatewayName string, options *GatewayCustomDomainsClientListOptions) *runtime.Pager[GatewayCustomDomainsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GatewayCustomDomainsClientListResponse]{ + More: func(page GatewayCustomDomainsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GatewayCustomDomainsClientListResponse) (GatewayCustomDomainsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GatewayCustomDomainsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GatewayCustomDomainsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayCustomDomainsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GatewayCustomDomainsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewayCustomDomainsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/domains" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GatewayCustomDomainsClient) listHandleResponse(resp *http.Response) (GatewayCustomDomainsClientListResponse, error) { + result := GatewayCustomDomainsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayCustomDomainResourceCollection); err != nil { + return GatewayCustomDomainsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gatewayrouteconfigs_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gatewayrouteconfigs_client.go new file mode 100644 index 000000000000..24c53e296329 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gatewayrouteconfigs_client.go @@ -0,0 +1,350 @@ +//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 armappplatform + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// GatewayRouteConfigsClient contains the methods for the GatewayRouteConfigs group. +// Don't use this type directly, use NewGatewayRouteConfigsClient() instead. +type GatewayRouteConfigsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewGatewayRouteConfigsClient creates a new instance of GatewayRouteConfigsClient with the specified values. +// subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewGatewayRouteConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayRouteConfigsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &GatewayRouteConfigsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway +// route configs. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// routeConfigName - The name of the Spring Cloud Gateway route config. +// gatewayRouteConfigResource - The Spring Cloud Gateway route config for the create or update operation +// options - GatewayRouteConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginCreateOrUpdate +// method. +func (client *GatewayRouteConfigsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, gatewayRouteConfigResource GatewayRouteConfigResource, options *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewayRouteConfigsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayRouteConfigsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayRouteConfigsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create the default Spring Cloud Gateway route configs or update the existing Spring Cloud Gateway route +// configs. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *GatewayRouteConfigsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, gatewayRouteConfigResource GatewayRouteConfigResource, options *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, gatewayRouteConfigResource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GatewayRouteConfigsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, gatewayRouteConfigResource GatewayRouteConfigResource, options *GatewayRouteConfigsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if routeConfigName == "" { + return nil, errors.New("parameter routeConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeConfigName}", url.PathEscape(routeConfigName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, gatewayRouteConfigResource) +} + +// BeginDelete - Delete the Spring Cloud Gateway route config. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// routeConfigName - The name of the Spring Cloud Gateway route config. +// options - GatewayRouteConfigsClientBeginDeleteOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginDelete +// method. +func (client *GatewayRouteConfigsClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*runtime.Poller[GatewayRouteConfigsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewayRouteConfigsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GatewayRouteConfigsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete the Spring Cloud Gateway route config. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *GatewayRouteConfigsClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GatewayRouteConfigsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if routeConfigName == "" { + return nil, errors.New("parameter routeConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeConfigName}", url.PathEscape(routeConfigName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the Spring Cloud Gateway route configs. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// routeConfigName - The name of the Spring Cloud Gateway route config. +// options - GatewayRouteConfigsClientGetOptions contains the optional parameters for the GatewayRouteConfigsClient.Get method. +func (client *GatewayRouteConfigsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientGetOptions) (GatewayRouteConfigsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, routeConfigName, options) + if err != nil { + return GatewayRouteConfigsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GatewayRouteConfigsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayRouteConfigsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GatewayRouteConfigsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, routeConfigName string, options *GatewayRouteConfigsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs/{routeConfigName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + if routeConfigName == "" { + return nil, errors.New("parameter routeConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{routeConfigName}", url.PathEscape(routeConfigName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GatewayRouteConfigsClient) getHandleResponse(resp *http.Response) (GatewayRouteConfigsClientGetResponse, error) { + result := GatewayRouteConfigsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayRouteConfigResource); err != nil { + return GatewayRouteConfigsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handle requests to list all Spring Cloud Gateway route configs. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// options - GatewayRouteConfigsClientListOptions contains the optional parameters for the GatewayRouteConfigsClient.List +// method. +func (client *GatewayRouteConfigsClient) NewListPager(resourceGroupName string, serviceName string, gatewayName string, options *GatewayRouteConfigsClientListOptions) *runtime.Pager[GatewayRouteConfigsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GatewayRouteConfigsClientListResponse]{ + More: func(page GatewayRouteConfigsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GatewayRouteConfigsClientListResponse) (GatewayRouteConfigsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GatewayRouteConfigsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GatewayRouteConfigsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewayRouteConfigsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GatewayRouteConfigsClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewayRouteConfigsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/routeConfigs" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GatewayRouteConfigsClient) listHandleResponse(resp *http.Response) (GatewayRouteConfigsClientListResponse, error) { + result := GatewayRouteConfigsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayRouteConfigResourceCollection); err != nil { + return GatewayRouteConfigsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gateways_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gateways_client.go new file mode 100644 index 000000000000..6e7506255e17 --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_gateways_client.go @@ -0,0 +1,389 @@ +//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 armappplatform + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// GatewaysClient contains the methods for the Gateways group. +// Don't use this type directly, use NewGatewaysClient() instead. +type GatewaysClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewGatewaysClient creates a new instance of GatewaysClient with the specified values. +// subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewGatewaysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewaysClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &GatewaysClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// gatewayResource - The gateway for the create or update operation +// options - GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate +// method. +func (client *GatewaysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*runtime.Poller[GatewaysClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, gatewayName, gatewayResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewaysClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create the default Spring Cloud Gateway or update the existing Spring Cloud Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *GatewaysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, gatewayResource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GatewaysClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, gatewayResource GatewayResource, options *GatewaysClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, gatewayResource) +} + +// BeginDelete - Disable the default Spring Cloud Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// options - GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. +func (client *GatewaysClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*runtime.Poller[GatewaysClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GatewaysClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GatewaysClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Disable the default Spring Cloud Gateway. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *GatewaysClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GatewaysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the Spring Cloud Gateway and its properties. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// options - GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. +func (client *GatewaysClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientGetOptions) (GatewaysClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, options) + if err != nil { + return GatewaysClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GatewaysClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewaysClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GatewaysClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, options *GatewaysClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GatewaysClient) getHandleResponse(resp *http.Response) (GatewaysClientGetResponse, error) { + result := GatewaysClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResource); err != nil { + return GatewaysClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Handles requests to list all resources in a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// options - GatewaysClientListOptions contains the optional parameters for the GatewaysClient.List method. +func (client *GatewaysClient) NewListPager(resourceGroupName string, serviceName string, options *GatewaysClientListOptions) *runtime.Pager[GatewaysClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GatewaysClientListResponse]{ + More: func(page GatewaysClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GatewaysClientListResponse) (GatewaysClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GatewaysClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GatewaysClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewaysClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GatewaysClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *GatewaysClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GatewaysClient) listHandleResponse(resp *http.Response) (GatewaysClientListResponse, error) { + result := GatewaysClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GatewayResourceCollection); err != nil { + return GatewaysClientListResponse{}, err + } + return result, nil +} + +// ValidateDomain - Check the domains are valid as well as not in use. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// gatewayName - The name of Spring Cloud Gateway. +// validatePayload - Custom domain payload to be validated +// options - GatewaysClientValidateDomainOptions contains the optional parameters for the GatewaysClient.ValidateDomain method. +func (client *GatewaysClient) ValidateDomain(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, validatePayload CustomDomainValidatePayload, options *GatewaysClientValidateDomainOptions) (GatewaysClientValidateDomainResponse, error) { + req, err := client.validateDomainCreateRequest(ctx, resourceGroupName, serviceName, gatewayName, validatePayload, options) + if err != nil { + return GatewaysClientValidateDomainResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GatewaysClientValidateDomainResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GatewaysClientValidateDomainResponse{}, runtime.NewResponseError(resp) + } + return client.validateDomainHandleResponse(resp) +} + +// validateDomainCreateRequest creates the ValidateDomain request. +func (client *GatewaysClient) validateDomainCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, gatewayName string, validatePayload CustomDomainValidatePayload, options *GatewaysClientValidateDomainOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/gateways/{gatewayName}/validateDomain" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if gatewayName == "" { + return nil, errors.New("parameter gatewayName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{gatewayName}", url.PathEscape(gatewayName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, validatePayload) +} + +// validateDomainHandleResponse handles the ValidateDomain response. +func (client *GatewaysClient) validateDomainHandleResponse(resp *http.Response) (GatewaysClientValidateDomainResponse, error) { + result := GatewaysClientValidateDomainResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomDomainValidateResult); err != nil { + return GatewaysClientValidateDomainResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models.go index 98424bfea738..bd68f04ec7f5 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models.go @@ -10,6 +10,170 @@ package armappplatform import "time" +// APIPortalCustomDomainProperties - The properties of custom domain for API portal +type APIPortalCustomDomainProperties struct { + // The thumbprint of bound certificate. + Thumbprint *string `json:"thumbprint,omitempty"` +} + +// APIPortalCustomDomainResource - Custom domain of the API portal +type APIPortalCustomDomainResource struct { + // The properties of custom domain for API portal + Properties *APIPortalCustomDomainProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// APIPortalCustomDomainResourceCollection - Object that includes an array of API portal custom domain resources and a possible +// link for next set +type APIPortalCustomDomainResourceCollection struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` + + // Collection of API portal custom domain resources + Value []*APIPortalCustomDomainResource `json:"value,omitempty"` +} + +// APIPortalCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginCreateOrUpdate +// method. +type APIPortalCustomDomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalCustomDomainsClientBeginDeleteOptions contains the optional parameters for the APIPortalCustomDomainsClient.BeginDelete +// method. +type APIPortalCustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalCustomDomainsClientGetOptions contains the optional parameters for the APIPortalCustomDomainsClient.Get method. +type APIPortalCustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIPortalCustomDomainsClientListOptions contains the optional parameters for the APIPortalCustomDomainsClient.List method. +type APIPortalCustomDomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// APIPortalInstance - Collection of instances belong to the API portal +type APIPortalInstance struct { + // READ-ONLY; Name of the API portal instance + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Status of the API portal instance + Status *string `json:"status,omitempty" azure:"ro"` +} + +// APIPortalProperties - API portal properties payload +type APIPortalProperties struct { + // The array of resource Ids of gateway to integrate with API portal. + GatewayIDs []*string `json:"gatewayIds,omitempty"` + + // Indicate if only https is allowed. + HTTPSOnly *bool `json:"httpsOnly,omitempty"` + + // Indicates whether the API portal exposes endpoint. + Public *bool `json:"public,omitempty"` + + // Collection of OpenAPI source URL locations. + SourceUrls []*string `json:"sourceUrls,omitempty"` + + // Single sign-on related configuration + SsoProperties *SsoProperties `json:"ssoProperties,omitempty"` + + // READ-ONLY; Collection of instances belong to API portal. + Instances []*APIPortalInstance `json:"instances,omitempty" azure:"ro"` + + // READ-ONLY; State of the API portal. + ProvisioningState *APIPortalProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The requested resource quantity for required CPU and Memory. + ResourceRequests *APIPortalResourceRequests `json:"resourceRequests,omitempty" azure:"ro"` + + // READ-ONLY; URL of the API portal, exposed when 'public' is true. + URL *string `json:"url,omitempty" azure:"ro"` +} + +// APIPortalResource - API portal resource +type APIPortalResource struct { + // API portal properties payload + Properties *APIPortalProperties `json:"properties,omitempty"` + + // Sku of the API portal resource + SKU *SKU `json:"sku,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// APIPortalResourceCollection - Object that includes an array of API portal resources and a possible link for next set +type APIPortalResourceCollection struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` + + // Collection of API portal resources + Value []*APIPortalResource `json:"value,omitempty"` +} + +// APIPortalResourceRequests - Resource requests of the API portal +type APIPortalResourceRequests struct { + // READ-ONLY; Cpu allocated to each API portal instance + CPU *string `json:"cpu,omitempty" azure:"ro"` + + // READ-ONLY; Memory allocated to each API portal instance + Memory *string `json:"memory,omitempty" azure:"ro"` +} + +// APIPortalsClientBeginCreateOrUpdateOptions contains the optional parameters for the APIPortalsClient.BeginCreateOrUpdate +// method. +type APIPortalsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalsClientBeginDeleteOptions contains the optional parameters for the APIPortalsClient.BeginDelete method. +type APIPortalsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APIPortalsClientGetOptions contains the optional parameters for the APIPortalsClient.Get method. +type APIPortalsClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIPortalsClientListOptions contains the optional parameters for the APIPortalsClient.List method. +type APIPortalsClientListOptions struct { + // placeholder for future optional parameters +} + +// APIPortalsClientValidateDomainOptions contains the optional parameters for the APIPortalsClient.ValidateDomain method. +type APIPortalsClientValidateDomainOptions struct { + // placeholder for future optional parameters +} + // ActiveDeploymentCollection - Object that includes an array of Deployment resource name and set them as active. type ActiveDeploymentCollection struct { // Collection of Deployment name. @@ -54,6 +218,9 @@ type AppResourceProperties struct { // Collection of addons AddonConfigs map[string]map[string]interface{} `json:"addonConfigs,omitempty"` + // List of custom persistent disks + CustomPersistentDisks []*CustomPersistentDiskResource `json:"customPersistentDisks,omitempty"` + // Indicate if end to end TLS is enabled. EnableEndToEndTLS *bool `json:"enableEndToEndTLS,omitempty"` @@ -75,6 +242,9 @@ type AppResourceProperties struct { // Temporary disk settings TemporaryDisk *TemporaryDisk `json:"temporaryDisk,omitempty"` + // Additional App settings in vnet injection instance + VnetAddons *AppVNetAddons `json:"vnetAddons,omitempty"` + // READ-ONLY; Provisioning state of the App ProvisioningState *AppResourceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` @@ -82,6 +252,15 @@ type AppResourceProperties struct { URL *string `json:"url,omitempty" azure:"ro"` } +// AppVNetAddons - Additional App settings in vnet injection instance +type AppVNetAddons struct { + // Indicates whether the App in vnet injection instance exposes endpoint which could be accessed from internet. + PublicEndpoint *bool `json:"publicEndpoint,omitempty"` + + // READ-ONLY; URL of the App in vnet injection instance which could be accessed from internet + PublicEndpointURL *string `json:"publicEndpointUrl,omitempty" azure:"ro"` +} + // ApplicationInsightsAgentVersions - Application Insights agent versions properties payload type ApplicationInsightsAgentVersions struct { // READ-ONLY; Indicates the version of application insight java agent @@ -148,6 +327,34 @@ type AvailableRuntimeVersions struct { Value []*SupportedRuntimeVersion `json:"value,omitempty" azure:"ro"` } +// AzureFileVolume - The properties of the Azure File volume. Azure File shares are mounted as volumes. +type AzureFileVolume struct { + // REQUIRED; The mount path of the persistent disk. + MountPath *string `json:"mountPath,omitempty"` + + // REQUIRED; The share name of the Azure File share. + ShareName *string `json:"shareName,omitempty"` + + // REQUIRED; The type of the underlying resource to mount as a persistent disk. + Type *Type `json:"type,omitempty"` + + // These are the mount options for a persistent disk. + MountOptions []*string `json:"mountOptions,omitempty"` + + // Indicates whether the persistent disk is a readOnly one. + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// GetCustomPersistentDiskProperties implements the CustomPersistentDiskPropertiesClassification interface for type AzureFileVolume. +func (a *AzureFileVolume) GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties { + return &CustomPersistentDiskProperties{ + Type: a.Type, + MountPath: a.MountPath, + ReadOnly: a.ReadOnly, + MountOptions: a.MountOptions, + } +} + // BindingResource - Binding resource payload type BindingResource struct { // Properties of the Binding resource @@ -271,6 +478,9 @@ type BuildProperties struct { // The relative path of source code RelativePath *string `json:"relativePath,omitempty"` + // The customized build resource for this build + ResourceRequests *BuildResourceRequests `json:"resourceRequests,omitempty"` + // READ-ONLY; Provisioning state of the KPack build result ProvisioningState *BuildProvisioningState `json:"provisioningState,omitempty" azure:"ro"` @@ -278,6 +488,17 @@ type BuildProperties struct { TriggeredBuildResult *TriggeredBuildResult `json:"triggeredBuildResult,omitempty" azure:"ro"` } +// BuildResourceRequests - Resource request payload of Build Resource. +type BuildResourceRequests struct { + // Optional Cpu allocated to the build resource. 1 core can be represented by 1 or 1000m. The default value is 1, this should + // not exceed build service agent pool cpu size. + CPU *string `json:"cpu,omitempty"` + + // Optional Memory allocated to the build resource. 1 GB can be represented by 1Gi or 1024Mi. The default value is 2Gi, this + // should not exceed build service agent pool memory size. + Memory *string `json:"memory,omitempty"` +} + // BuildResult - Build result resource payload type BuildResult struct { // Properties of the build result resource @@ -722,6 +943,9 @@ type CertificateProperties struct { // READ-ONLY; The issuer of certificate. Issuer *string `json:"issuer,omitempty" azure:"ro"` + // READ-ONLY; Provisioning state of the Certificate + ProvisioningState *CertificateResourceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + // READ-ONLY; The subject name of certificate. SubjectName *string `json:"subjectName,omitempty" azure:"ro"` @@ -805,13 +1029,22 @@ type CloudErrorBody struct { // ClusterResourceProperties - Service properties payload type ClusterResourceProperties struct { + // Purchasing 3rd party product of the Service resource. + MarketplaceResource *MarketplaceResource `json:"marketplaceResource,omitempty"` + // Network profile of the Service NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` - ZoneRedundant *bool `json:"zoneRedundant,omitempty"` + + // Additional Service settings in vnet injection instance + VnetAddons *ServiceVNetAddons `json:"vnetAddons,omitempty"` + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` // READ-ONLY; Fully qualified dns name of the service instance Fqdn *string `json:"fqdn,omitempty" azure:"ro"` + // READ-ONLY; Power state of the Service + PowerState *PowerState `json:"powerState,omitempty" azure:"ro"` + // READ-ONLY; Provisioning state of the Service ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` @@ -1094,6 +1327,12 @@ type ConfigurationServicesClientListOptions struct { // placeholder for future optional parameters } +// ContainerProbeSettings - Container liveness and readiness probe settings +type ContainerProbeSettings struct { + // Indicates whether disable the liveness and readiness probe + DisableProbe *bool `json:"disableProbe,omitempty"` +} + // ContentCertificateProperties - Properties of certificate imported from key vault. type ContentCertificateProperties struct { // REQUIRED; The type of the certificate source. @@ -1117,6 +1356,9 @@ type ContentCertificateProperties struct { // READ-ONLY; The issuer of certificate. Issuer *string `json:"issuer,omitempty" azure:"ro"` + // READ-ONLY; Provisioning state of the Certificate + ProvisioningState *CertificateResourceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + // READ-ONLY; The subject name of certificate. SubjectName *string `json:"subjectName,omitempty" azure:"ro"` @@ -1127,14 +1369,56 @@ type ContentCertificateProperties struct { // GetCertificateProperties implements the CertificatePropertiesClassification interface for type ContentCertificateProperties. func (c *ContentCertificateProperties) GetCertificateProperties() *CertificateProperties { return &CertificateProperties{ - Type: c.Type, - Thumbprint: c.Thumbprint, - Issuer: c.Issuer, - IssuedDate: c.IssuedDate, - ExpirationDate: c.ExpirationDate, - ActivateDate: c.ActivateDate, - SubjectName: c.SubjectName, - DNSNames: c.DNSNames, + Type: c.Type, + Thumbprint: c.Thumbprint, + Issuer: c.Issuer, + IssuedDate: c.IssuedDate, + ExpirationDate: c.ExpirationDate, + ActivateDate: c.ActivateDate, + SubjectName: c.SubjectName, + DNSNames: c.DNSNames, + ProvisioningState: c.ProvisioningState, + } +} + +// CustomContainer - Custom container payload +type CustomContainer struct { + // Arguments to the entrypoint. The docker image's CMD is used if this is not provided. + Args []*string `json:"args,omitempty"` + + // Entrypoint array. Not executed within a shell. The docker image's ENTRYPOINT is used if this is not provided. + Command []*string `json:"command,omitempty"` + + // Container image of the custom container. This should be in the form of : without the server name of the registry + ContainerImage *string `json:"containerImage,omitempty"` + + // Credential of the image registry + ImageRegistryCredential *ImageRegistryCredential `json:"imageRegistryCredential,omitempty"` + + // Language framework of the container image uploaded + LanguageFramework *string `json:"languageFramework,omitempty"` + + // The name of the registry that contains the container image + Server *string `json:"server,omitempty"` +} + +// CustomContainerUserSourceInfo - Custom container user source info +type CustomContainerUserSourceInfo struct { + // REQUIRED; Type of the source uploaded + Type *string `json:"type,omitempty"` + + // Custom container payload + CustomContainer *CustomContainer `json:"customContainer,omitempty"` + + // Version of the source + Version *string `json:"version,omitempty"` +} + +// GetUserSourceInfo implements the UserSourceInfoClassification interface for type CustomContainerUserSourceInfo. +func (c *CustomContainerUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { + return &UserSourceInfo{ + Type: c.Type, + Version: c.Version, } } @@ -1148,6 +1432,9 @@ type CustomDomainProperties struct { // READ-ONLY; The app name of domain. AppName *string `json:"appName,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the Domain + ProvisioningState *CustomDomainResourceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } // CustomDomainResource - Custom domain resource payload. @@ -1221,6 +1508,44 @@ type CustomDomainsClientListOptions struct { // placeholder for future optional parameters } +// CustomPersistentDiskPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetCustomPersistentDiskProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileVolume, *CustomPersistentDiskProperties +type CustomPersistentDiskPropertiesClassification interface { + // GetCustomPersistentDiskProperties returns the CustomPersistentDiskProperties content of the underlying type. + GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties +} + +// CustomPersistentDiskProperties - Custom persistent disk resource payload. +type CustomPersistentDiskProperties struct { + // REQUIRED; The mount path of the persistent disk. + MountPath *string `json:"mountPath,omitempty"` + + // REQUIRED; The type of the underlying resource to mount as a persistent disk. + Type *Type `json:"type,omitempty"` + + // These are the mount options for a persistent disk. + MountOptions []*string `json:"mountOptions,omitempty"` + + // Indicates whether the persistent disk is a readOnly one. + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// GetCustomPersistentDiskProperties implements the CustomPersistentDiskPropertiesClassification interface for type CustomPersistentDiskProperties. +func (c *CustomPersistentDiskProperties) GetCustomPersistentDiskProperties() *CustomPersistentDiskProperties { + return c +} + +// CustomPersistentDiskResource - Custom persistent disk resource payload. +type CustomPersistentDiskResource struct { + // REQUIRED; The resource id of Azure Spring Apps Storage resource. + StorageID *string `json:"storageId,omitempty"` + + // Properties of the custom persistent disk resource payload. + CustomPersistentDiskProperties CustomPersistentDiskPropertiesClassification `json:"customPersistentDiskProperties,omitempty"` +} + // DeploymentInstance - Deployment instance payload type DeploymentInstance struct { // READ-ONLY; Discovery status of the deployment instance @@ -1298,13 +1623,40 @@ type DeploymentSettings struct { // Collection of addons AddonConfigs map[string]map[string]interface{} `json:"addonConfigs,omitempty"` + // Container liveness and readiness probe settings + ContainerProbeSettings *ContainerProbeSettings `json:"containerProbeSettings,omitempty"` + // Collection of environment variables EnvironmentVariables map[string]*string `json:"environmentVariables,omitempty"` + // Periodic probe of App Instance liveness. App Instance will be restarted if the probe fails. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + LivenessProbe *Probe `json:"livenessProbe,omitempty"` + + // Periodic probe of App Instance service readiness. App Instance will be removed from service endpoints if the probe fails. + // More info: + // https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + ReadinessProbe *Probe `json:"readinessProbe,omitempty"` + // The requested resource quantity for required CPU and Memory. It is recommended that using this field to represent the required // CPU and Memory, the old field cpu and memoryInGB will be deprecated // later. ResourceRequests *ResourceRequests `json:"resourceRequests,omitempty"` + + // StartupProbe indicates that the App Instance has successfully initialized. If specified, no other probes are executed until + // this completes successfully. If this probe fails, the Pod will be restarted, + // just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a App Instance's + // lifecycle, when it might take a long time to load data or warm a cache, + // than during steady-state operation. This cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + StartupProbe *Probe `json:"startupProbe,omitempty"` + + // Optional duration in seconds the App Instance needs to terminate gracefully. May be decreased in delete request. Value + // must be non-negative integer. The value zero indicates stop immediately via the + // kill signal (no opportunity to shut down). If this value is nil, the default grace period will be used instead. The grace + // period is the duration in seconds after the processes running in the App + // Instance are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this + // value longer than the expected cleanup time for your process. Defaults to 90 + // seconds. + TerminationGracePeriodSeconds *int32 `json:"terminationGracePeriodSeconds,omitempty"` } // DeploymentsClientBeginCreateOrUpdateOptions contains the optional parameters for the DeploymentsClient.BeginCreateOrUpdate @@ -1407,6 +1759,358 @@ type Error struct { Message *string `json:"message,omitempty"` } +// ExecAction describes a "run in container" action. +type ExecAction struct { + // REQUIRED; The type of the action to take to perform the health check. + Type *ProbeActionType `json:"type,omitempty"` + + // Command is the command line to execute inside the container, the working directory for the command is root ('/') in the + // container's filesystem. The command is not run inside a shell, so traditional + // shell instructions ('|', etc) won't work. To use a shell, you need to explicitly call out to that shell. Exit status of + // 0 is treated as live/healthy and non-zero is unhealthy. + Command []*string `json:"command,omitempty"` +} + +// GetProbeAction implements the ProbeActionClassification interface for type ExecAction. +func (e *ExecAction) GetProbeAction() *ProbeAction { + return &ProbeAction{ + Type: e.Type, + } +} + +// GatewayAPIMetadataProperties - API metadata property for Spring Cloud Gateway +type GatewayAPIMetadataProperties struct { + // Detailed description of the APIs available on the Gateway instance (default: Generated OpenAPI 3 document that describes + // the API routes configured.) + Description *string `json:"description,omitempty"` + + // Location of additional documentation for the APIs available on the Gateway instance + Documentation *string `json:"documentation,omitempty"` + + // Base URL that API consumers will use to access APIs on the Gateway instance. + ServerURL *string `json:"serverUrl,omitempty"` + + // Title describing the context of the APIs available on the Gateway instance (default: Spring Cloud Gateway for K8S) + Title *string `json:"title,omitempty"` + + // Version of APIs available on this Gateway instance (default: unspecified). + Version *string `json:"version,omitempty"` +} + +// GatewayAPIRoute - API route config of the Spring Cloud Gateway +type GatewayAPIRoute struct { + // A description, will be applied to methods in the generated OpenAPI documentation. + Description *string `json:"description,omitempty"` + + // To modify the request before sending it to the target endpoint, or the received response. + Filters []*string `json:"filters,omitempty"` + + // Route processing order. + Order *int32 `json:"order,omitempty"` + + // A number of conditions to evaluate a route for each request. Each predicate may be evaluated against request headers and + // parameter values. All of the predicates associated with a route must evaluate + // to true for the route to be matched to the request. + Predicates []*string `json:"predicates,omitempty"` + + // Enable sso validation. + SsoEnabled *bool `json:"ssoEnabled,omitempty"` + + // Classification tags, will be applied to methods in the generated OpenAPI documentation. + Tags []*string `json:"tags,omitempty"` + + // A title, will be applied to methods in the generated OpenAPI documentation. + Title *string `json:"title,omitempty"` + + // Pass currently-authenticated user's identity token to application service, default is 'false' + TokenRelay *bool `json:"tokenRelay,omitempty"` + + // Full uri, will override appName. + URI *string `json:"uri,omitempty"` +} + +// GatewayCorsProperties - Cross-Origin Resource Sharing property +type GatewayCorsProperties struct { + // Whether user credentials are supported on cross-site requests. Valid values: true, false. + AllowCredentials *bool `json:"allowCredentials,omitempty"` + + // Allowed headers in cross-site requests. The special value * allows actual requests to send any header. + AllowedHeaders []*string `json:"allowedHeaders,omitempty"` + + // Allowed HTTP methods on cross-site requests. The special value * allows all methods. If not set, GET and HEAD are allowed + // by default. + AllowedMethods []*string `json:"allowedMethods,omitempty"` + + // Allowed origins to make cross-site requests. The special value * allows all domains. + AllowedOrigins []*string `json:"allowedOrigins,omitempty"` + + // HTTP response headers to expose for cross-site requests. + ExposedHeaders []*string `json:"exposedHeaders,omitempty"` + + // How long, in seconds, the response from a pre-flight request can be cached by clients. + MaxAge *int32 `json:"maxAge,omitempty"` +} + +// GatewayCustomDomainProperties - The properties of custom domain for Spring Cloud Gateway +type GatewayCustomDomainProperties struct { + // The thumbprint of bound certificate. + Thumbprint *string `json:"thumbprint,omitempty"` +} + +// GatewayCustomDomainResource - Custom domain of the Spring Cloud Gateway +type GatewayCustomDomainResource struct { + // The properties of custom domain for Spring Cloud Gateway + Properties *GatewayCustomDomainProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// GatewayCustomDomainResourceCollection - Object that includes an array of Spring Cloud Gateway custom domain resources and +// a possible link for next set +type GatewayCustomDomainResourceCollection struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` + + // Collection of Spring Cloud Gateway custom domain resources + Value []*GatewayCustomDomainResource `json:"value,omitempty"` +} + +// GatewayCustomDomainsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginCreateOrUpdate +// method. +type GatewayCustomDomainsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayCustomDomainsClientBeginDeleteOptions contains the optional parameters for the GatewayCustomDomainsClient.BeginDelete +// method. +type GatewayCustomDomainsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayCustomDomainsClientGetOptions contains the optional parameters for the GatewayCustomDomainsClient.Get method. +type GatewayCustomDomainsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayCustomDomainsClientListOptions contains the optional parameters for the GatewayCustomDomainsClient.List method. +type GatewayCustomDomainsClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewayInstance - Collection of instances belong to the Spring Cloud Gateway +type GatewayInstance struct { + // READ-ONLY; Name of the Spring Cloud Gateway instance + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Status of the Spring Cloud Gateway instance + Status *string `json:"status,omitempty" azure:"ro"` +} + +// GatewayOperatorProperties - Properties of the Spring Cloud Gateway Operator. +type GatewayOperatorProperties struct { + // READ-ONLY; Collection of instances belong to Spring Cloud Gateway operator. + Instances []*GatewayInstance `json:"instances,omitempty" azure:"ro"` + + // READ-ONLY; The requested resource quantity for required CPU and Memory. + ResourceRequests *GatewayOperatorResourceRequests `json:"resourceRequests,omitempty" azure:"ro"` +} + +// GatewayOperatorResourceRequests - Properties of the Spring Cloud Gateway Operator. +type GatewayOperatorResourceRequests struct { + // READ-ONLY; Cpu allocated to each Spring Cloud Gateway Operator instance. + CPU *string `json:"cpu,omitempty" azure:"ro"` + + // READ-ONLY; Instance count of the Spring Cloud Gateway Operator. + InstanceCount *int32 `json:"instanceCount,omitempty" azure:"ro"` + + // READ-ONLY; Memory allocated to each Spring Cloud Gateway Operator instance. + Memory *string `json:"memory,omitempty" azure:"ro"` +} + +// GatewayProperties - Spring Cloud Gateway properties payload +type GatewayProperties struct { + // API metadata property for Spring Cloud Gateway + APIMetadataProperties *GatewayAPIMetadataProperties `json:"apiMetadataProperties,omitempty"` + + // Cross-Origin Resource Sharing property + CorsProperties *GatewayCorsProperties `json:"corsProperties,omitempty"` + + // Indicate if only https is allowed. + HTTPSOnly *bool `json:"httpsOnly,omitempty"` + + // Indicates whether the Spring Cloud Gateway exposes endpoint. + Public *bool `json:"public,omitempty"` + + // The requested resource quantity for required CPU and Memory. + ResourceRequests *GatewayResourceRequests `json:"resourceRequests,omitempty"` + + // Single sign-on related configuration + SsoProperties *SsoProperties `json:"ssoProperties,omitempty"` + + // READ-ONLY; Collection of instances belong to Spring Cloud Gateway. + Instances []*GatewayInstance `json:"instances,omitempty" azure:"ro"` + + // READ-ONLY; Properties of the Spring Cloud Gateway Operator. + OperatorProperties *GatewayOperatorProperties `json:"operatorProperties,omitempty" azure:"ro"` + + // READ-ONLY; State of the Spring Cloud Gateway. + ProvisioningState *GatewayProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; URL of the Spring Cloud Gateway, exposed when 'public' is true. + URL *string `json:"url,omitempty" azure:"ro"` +} + +// GatewayResource - Spring Cloud Gateway resource +type GatewayResource struct { + // Spring Cloud Gateway properties payload + Properties *GatewayProperties `json:"properties,omitempty"` + + // Sku of the Spring Cloud Gateway resource + SKU *SKU `json:"sku,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// GatewayResourceCollection - Object that includes an array of gateway resources and a possible link for next set +type GatewayResourceCollection struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` + + // Collection of gateway resources + Value []*GatewayResource `json:"value,omitempty"` +} + +// GatewayResourceRequests - Resource request payload of Spring Cloud Gateway. +type GatewayResourceRequests struct { + // Cpu allocated to each Spring Cloud Gateway instance. + CPU *string `json:"cpu,omitempty"` + + // Memory allocated to each Spring Cloud Gateway instance. + Memory *string `json:"memory,omitempty"` +} + +// GatewayRouteConfigOpenAPIProperties - OpenAPI properties of Spring Cloud Gateway route config. +type GatewayRouteConfigOpenAPIProperties struct { + // The URI of OpenAPI specification. + URI *string `json:"uri,omitempty"` +} + +// GatewayRouteConfigProperties - API route config of the Spring Cloud Gateway +type GatewayRouteConfigProperties struct { + // The resource Id of the Azure Spring Apps app, required unless route defines uri. + AppResourceID *string `json:"appResourceId,omitempty"` + + // OpenAPI properties of Spring Cloud Gateway route config. + OpenAPI *GatewayRouteConfigOpenAPIProperties `json:"openApi,omitempty"` + + // Array of API routes, each route contains properties such as title, uri, ssoEnabled, predicates, filters. + Routes []*GatewayAPIRoute `json:"routes,omitempty"` + + // READ-ONLY; State of the Spring Cloud Gateway route config. + ProvisioningState *GatewayProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// GatewayRouteConfigResource - Spring Cloud Gateway route config resource +type GatewayRouteConfigResource struct { + // API route config of the Spring Cloud Gateway + Properties *GatewayRouteConfigProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// GatewayRouteConfigResourceCollection - Object that includes an array of Spring Cloud Gateway route config resources and +// a possible link for next set +type GatewayRouteConfigResourceCollection struct { + // URL client should use to fetch the next page (per server side paging). It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` + + // Collection of Spring Cloud Gateway route config resources + Value []*GatewayRouteConfigResource `json:"value,omitempty"` +} + +// GatewayRouteConfigsClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginCreateOrUpdate +// method. +type GatewayRouteConfigsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayRouteConfigsClientBeginDeleteOptions contains the optional parameters for the GatewayRouteConfigsClient.BeginDelete +// method. +type GatewayRouteConfigsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewayRouteConfigsClientGetOptions contains the optional parameters for the GatewayRouteConfigsClient.Get method. +type GatewayRouteConfigsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewayRouteConfigsClientListOptions contains the optional parameters for the GatewayRouteConfigsClient.List method. +type GatewayRouteConfigsClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientBeginCreateOrUpdateOptions contains the optional parameters for the GatewaysClient.BeginCreateOrUpdate method. +type GatewaysClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewaysClientBeginDeleteOptions contains the optional parameters for the GatewaysClient.BeginDelete method. +type GatewaysClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GatewaysClientGetOptions contains the optional parameters for the GatewaysClient.Get method. +type GatewaysClientGetOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientListOptions contains the optional parameters for the GatewaysClient.List method. +type GatewaysClientListOptions struct { + // placeholder for future optional parameters +} + +// GatewaysClientValidateDomainOptions contains the optional parameters for the GatewaysClient.ValidateDomain method. +type GatewaysClientValidateDomainOptions struct { + // placeholder for future optional parameters +} + // GitPatternRepository - Git repository property payload for config server type GitPatternRepository struct { // REQUIRED; Name of the repository @@ -1443,6 +2147,43 @@ type GitPatternRepository struct { Username *string `json:"username,omitempty"` } +// HTTPGetAction describes an action based on HTTP Get requests. +type HTTPGetAction struct { + // REQUIRED; The type of the action to take to perform the health check. + Type *ProbeActionType `json:"type,omitempty"` + + // Path to access on the HTTP server. + Path *string `json:"path,omitempty"` + + // Scheme to use for connecting to the host. Defaults to HTTP. + // Possible enum values: + // * "HTTP" means that the scheme used will be http:// + // * "HTTPS" means that the scheme used will be https:// + Scheme *HTTPSchemeType `json:"scheme,omitempty"` +} + +// GetProbeAction implements the ProbeActionClassification interface for type HTTPGetAction. +func (h *HTTPGetAction) GetProbeAction() *ProbeAction { + return &ProbeAction{ + Type: h.Type, + } +} + +// ImageRegistryCredential - Credential of the image registry +type ImageRegistryCredential struct { + // The password of the image registry credential + Password *string `json:"password,omitempty"` + + // The username of the image registry credential + Username *string `json:"username,omitempty"` +} + +// IngressConfig - Ingress configuration payload for Azure Spring Apps resource. +type IngressConfig struct { + // Ingress read time out in seconds. + ReadTimeoutInSeconds *int32 `json:"readTimeoutInSeconds,omitempty"` +} + // JarUploadedUserSourceInfo - Uploaded Jar binary for a deployment type JarUploadedUserSourceInfo struct { // REQUIRED; Type of the source uploaded @@ -1510,6 +2251,9 @@ type KeyVaultCertificateProperties struct { // READ-ONLY; The issuer of certificate. Issuer *string `json:"issuer,omitempty" azure:"ro"` + // READ-ONLY; Provisioning state of the Certificate + ProvisioningState *CertificateResourceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + // READ-ONLY; The subject name of certificate. SubjectName *string `json:"subjectName,omitempty" azure:"ro"` @@ -1520,14 +2264,15 @@ type KeyVaultCertificateProperties struct { // GetCertificateProperties implements the CertificatePropertiesClassification interface for type KeyVaultCertificateProperties. func (k *KeyVaultCertificateProperties) GetCertificateProperties() *CertificateProperties { return &CertificateProperties{ - Type: k.Type, - Thumbprint: k.Thumbprint, - Issuer: k.Issuer, - IssuedDate: k.IssuedDate, - ExpirationDate: k.ExpirationDate, - ActivateDate: k.ActivateDate, - SubjectName: k.SubjectName, - DNSNames: k.DNSNames, + Type: k.Type, + Thumbprint: k.Thumbprint, + Issuer: k.Issuer, + IssuedDate: k.IssuedDate, + ExpirationDate: k.ExpirationDate, + ActivateDate: k.ActivateDate, + SubjectName: k.SubjectName, + DNSNames: k.DNSNames, + ProvisioningState: k.ProvisioningState, } } @@ -1568,6 +2313,21 @@ type ManagedIdentityProperties struct { // Type of the managed identity Type *ManagedIdentityType `json:"type,omitempty"` + + // Properties of user-assigned managed identities + UserAssignedIdentities map[string]*UserAssignedManagedIdentity `json:"userAssignedIdentities,omitempty"` +} + +// MarketplaceResource - Purchasing 3rd Party product for one Azure Spring Apps instance +type MarketplaceResource struct { + // The plan id of the 3rd Party Artifact that is being procured. + Plan *string `json:"plan,omitempty"` + + // The 3rd Party artifact that is being procured. + Product *string `json:"product,omitempty"` + + // The publisher id of the 3rd Party Artifact that is being bought. + Publisher *string `json:"publisher,omitempty"` } // MetricDimension - Specifications of the Dimension of metrics @@ -1742,6 +2502,9 @@ type NetworkProfile struct { // Fully qualified resource Id of the subnet to host customer apps in Azure Spring Apps AppSubnetID *string `json:"appSubnetId,omitempty"` + // Ingress configuration payload for Azure Spring Apps resource. + IngressConfig *IngressConfig `json:"ingressConfig,omitempty"` + // Azure Spring Apps service reserved CIDR ServiceCidr *string `json:"serviceCidr,omitempty"` @@ -1823,6 +2586,50 @@ type PersistentDisk struct { UsedInGB *int32 `json:"usedInGB,omitempty" azure:"ro"` } +// Probe describes a health check to be performed against an App Instance to determine whether it is alive or ready to receive +// traffic. +type Probe struct { + // REQUIRED; Indicate whether the probe is disabled. + DisableProbe *bool `json:"disableProbe,omitempty"` + + // Minimum consecutive failures for the probe to be considered failed after having succeeded. Minimum value is 1. + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + + // Number of seconds after the App Instance has started before probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` + + // How often (in seconds) to perform the probe. Minimum value is 1. + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + + // The action of the probe. + ProbeAction ProbeActionClassification `json:"probeAction,omitempty"` + + // Minimum consecutive successes for the probe to be considered successful after having failed. Must be 1 for liveness and + // startup. Minimum value is 1. + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + + // Number of seconds after which the probe times out. Minimum value is 1. + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` +} + +// ProbeActionClassification provides polymorphic access to related types. +// Call the interface's GetProbeAction() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExecAction, *HTTPGetAction, *ProbeAction, *TCPSocketAction +type ProbeActionClassification interface { + // GetProbeAction returns the ProbeAction content of the underlying type. + GetProbeAction() *ProbeAction +} + +// ProbeAction - The action of the probe. +type ProbeAction struct { + // REQUIRED; The type of the action to take to perform the health check. + Type *ProbeActionType `json:"type,omitempty"` +} + +// GetProbeAction implements the ProbeActionClassification interface for type ProbeAction. +func (p *ProbeAction) GetProbeAction() *ProbeAction { return p } + // ProxyResource - The resource model definition for a ARM proxy resource. It will have everything other than required location // and tags. type ProxyResource struct { @@ -2153,6 +2960,12 @@ type ServiceSpecification struct { MetricSpecifications []*MetricSpecification `json:"metricSpecifications,omitempty"` } +// ServiceVNetAddons - Additional Service settings in vnet injection instance +type ServiceVNetAddons struct { + // Indicates whether the log stream in vnet injection instance could be accessed from internet. + LogStreamPublicEndpoint *bool `json:"logStreamPublicEndpoint,omitempty"` +} + // ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. type ServicesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. @@ -2165,6 +2978,18 @@ type ServicesClientBeginDeleteOptions struct { ResumeToken string } +// ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. +type ServicesClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. +type ServicesClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ServicesClientBeginUpdateOptions contains the optional parameters for the ServicesClient.BeginUpdate method. type ServicesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -2248,6 +3073,21 @@ func (s *SourceUploadedUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { } } +// SsoProperties - Single sign-on related configuration +type SsoProperties struct { + // The public identifier for the application + ClientID *string `json:"clientId,omitempty"` + + // The secret known only to the application and the authorization server + ClientSecret *string `json:"clientSecret,omitempty"` + + // The URI of Issuer Identifier + IssuerURI *string `json:"issuerUri,omitempty"` + + // It defines the specific actions applications can be allowed to do on a user's behalf + Scope []*string `json:"scope,omitempty"` +} + // StackProperties - KPack ClusterStack properties payload type StackProperties struct { // Id of the ClusterStack. @@ -2257,6 +3097,92 @@ type StackProperties struct { Version *string `json:"version,omitempty"` } +// StorageAccount - storage resource of type Azure Storage Account. +type StorageAccount struct { + // REQUIRED; The account key of the Azure Storage Account. + AccountKey *string `json:"accountKey,omitempty"` + + // REQUIRED; The account name of the Azure Storage Account. + AccountName *string `json:"accountName,omitempty"` + + // REQUIRED; The type of the storage. + StorageType *StorageType `json:"storageType,omitempty"` +} + +// GetStorageProperties implements the StoragePropertiesClassification interface for type StorageAccount. +func (s *StorageAccount) GetStorageProperties() *StorageProperties { + return &StorageProperties{ + StorageType: s.StorageType, + } +} + +// StoragePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetStorageProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *StorageAccount, *StorageProperties +type StoragePropertiesClassification interface { + // GetStorageProperties returns the StorageProperties content of the underlying type. + GetStorageProperties() *StorageProperties +} + +// StorageProperties - Storage resource payload. +type StorageProperties struct { + // REQUIRED; The type of the storage. + StorageType *StorageType `json:"storageType,omitempty"` +} + +// GetStorageProperties implements the StoragePropertiesClassification interface for type StorageProperties. +func (s *StorageProperties) GetStorageProperties() *StorageProperties { return s } + +// StorageResource - Storage resource payload. +type StorageResource struct { + // Properties of the storage resource payload. + Properties StoragePropertiesClassification `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource Id for the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// StorageResourceCollection - Collection compose of storage resources list and a possible link for next page. +type StorageResourceCollection struct { + // The link to next page of storage list. + NextLink *string `json:"nextLink,omitempty"` + + // The storage resources list. + Value []*StorageResource `json:"value,omitempty"` +} + +// StoragesClientBeginCreateOrUpdateOptions contains the optional parameters for the StoragesClient.BeginCreateOrUpdate method. +type StoragesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StoragesClientBeginDeleteOptions contains the optional parameters for the StoragesClient.BeginDelete method. +type StoragesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// StoragesClientGetOptions contains the optional parameters for the StoragesClient.Get method. +type StoragesClientGetOptions struct { + // placeholder for future optional parameters +} + +// StoragesClientListOptions contains the optional parameters for the StoragesClient.List method. +type StoragesClientListOptions struct { + // placeholder for future optional parameters +} + // SupportedBuildpackResource - Supported buildpack resource payload type SupportedBuildpackResource struct { // Supported buildpack resource properties @@ -2360,6 +3286,19 @@ type SystemData struct { LastModifiedByType *LastModifiedByType `json:"lastModifiedByType,omitempty"` } +// TCPSocketAction describes an action based on opening a socket +type TCPSocketAction struct { + // REQUIRED; The type of the action to take to perform the health check. + Type *ProbeActionType `json:"type,omitempty"` +} + +// GetProbeAction implements the ProbeActionClassification interface for type TCPSocketAction. +func (t *TCPSocketAction) GetProbeAction() *ProbeAction { + return &ProbeAction{ + Type: t.Type, + } +} + // TemporaryDisk - Temporary disk payload type TemporaryDisk struct { // Mount path of the temporary disk @@ -2447,11 +3386,20 @@ func (u *UploadedUserSourceInfo) GetUserSourceInfo() *UserSourceInfo { } } +// UserAssignedManagedIdentity - The details of the user-assigned managed identity assigned to an App. +type UserAssignedManagedIdentity struct { + // READ-ONLY; Client Id of user-assigned managed identity. + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; Principal Id of user-assigned managed identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` +} + // UserSourceInfoClassification provides polymorphic access to related types. // Call the interface's GetUserSourceInfo() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *BuildResultUserSourceInfo, *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, *SourceUploadedUserSourceInfo, -// - *UploadedUserSourceInfo, *UserSourceInfo +// - *BuildResultUserSourceInfo, *CustomContainerUserSourceInfo, *JarUploadedUserSourceInfo, *NetCoreZipUploadedUserSourceInfo, +// - *SourceUploadedUserSourceInfo, *UploadedUserSourceInfo, *UserSourceInfo type UserSourceInfoClassification interface { // GetUserSourceInfo returns the UserSourceInfo content of the underlying type. GetUserSourceInfo() *UserSourceInfo diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models_serde.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models_serde.go index 35fb1fd34ec5..a3fb27d4f140 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models_serde.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_models_serde.go @@ -15,6 +15,21 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type APIPortalProperties. +func (a APIPortalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "gatewayIds", a.GatewayIDs) + populate(objectMap, "httpsOnly", a.HTTPSOnly) + populate(objectMap, "instances", a.Instances) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "public", a.Public) + populate(objectMap, "resourceRequests", a.ResourceRequests) + populate(objectMap, "sourceUrls", a.SourceUrls) + populate(objectMap, "ssoProperties", a.SsoProperties) + populate(objectMap, "url", a.URL) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type ActiveDeploymentCollection. func (a ActiveDeploymentCollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -39,6 +54,7 @@ func (a AppResource) MarshalJSON() ([]byte, error) { func (a AppResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "addonConfigs", a.AddonConfigs) + populate(objectMap, "customPersistentDisks", a.CustomPersistentDisks) populate(objectMap, "enableEndToEndTLS", a.EnableEndToEndTLS) populate(objectMap, "fqdn", a.Fqdn) populate(objectMap, "httpsOnly", a.HTTPSOnly) @@ -48,9 +64,53 @@ func (a AppResourceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "public", a.Public) populate(objectMap, "temporaryDisk", a.TemporaryDisk) populate(objectMap, "url", a.URL) + populate(objectMap, "vnetAddons", a.VnetAddons) return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type AzureFileVolume. +func (a AzureFileVolume) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "mountOptions", a.MountOptions) + populate(objectMap, "mountPath", a.MountPath) + populate(objectMap, "readOnly", a.ReadOnly) + populate(objectMap, "shareName", a.ShareName) + objectMap["type"] = TypeAzureFileVolume + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureFileVolume. +func (a *AzureFileVolume) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "mountOptions": + err = unpopulate(val, "MountOptions", &a.MountOptions) + delete(rawMsg, key) + case "mountPath": + err = unpopulate(val, "MountPath", &a.MountPath) + delete(rawMsg, key) + case "readOnly": + err = unpopulate(val, "ReadOnly", &a.ReadOnly) + delete(rawMsg, key) + case "shareName": + err = unpopulate(val, "ShareName", &a.ShareName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BindingResource. func (b BindingResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -84,6 +144,7 @@ func (b BuildProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "env", b.Env) populate(objectMap, "provisioningState", b.ProvisioningState) populate(objectMap, "relativePath", b.RelativePath) + populate(objectMap, "resourceRequests", b.ResourceRequests) populate(objectMap, "triggeredBuildResult", b.TriggeredBuildResult) return json.Marshal(objectMap) } @@ -166,6 +227,7 @@ func (c CertificateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "expirationDate", c.ExpirationDate) populate(objectMap, "issuedDate", c.IssuedDate) populate(objectMap, "issuer", c.Issuer) + populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "subjectName", c.SubjectName) populate(objectMap, "thumbprint", c.Thumbprint) objectMap["type"] = c.Type @@ -285,6 +347,7 @@ func (c ContentCertificateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "expirationDate", c.ExpirationDate) populate(objectMap, "issuedDate", c.IssuedDate) populate(objectMap, "issuer", c.Issuer) + populate(objectMap, "provisioningState", c.ProvisioningState) populate(objectMap, "subjectName", c.SubjectName) populate(objectMap, "thumbprint", c.Thumbprint) objectMap["type"] = "ContentCertificate" @@ -318,6 +381,9 @@ func (c *ContentCertificateProperties) UnmarshalJSON(data []byte) error { case "issuer": err = unpopulate(val, "Issuer", &c.Issuer) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) case "subjectName": err = unpopulate(val, "SubjectName", &c.SubjectName) delete(rawMsg, key) @@ -335,6 +401,53 @@ func (c *ContentCertificateProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CustomContainer. +func (c CustomContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "args", c.Args) + populate(objectMap, "command", c.Command) + populate(objectMap, "containerImage", c.ContainerImage) + populate(objectMap, "imageRegistryCredential", c.ImageRegistryCredential) + populate(objectMap, "languageFramework", c.LanguageFramework) + populate(objectMap, "server", c.Server) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CustomContainerUserSourceInfo. +func (c CustomContainerUserSourceInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customContainer", c.CustomContainer) + objectMap["type"] = "Container" + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomContainerUserSourceInfo. +func (c *CustomContainerUserSourceInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customContainer": + err = unpopulate(val, "CustomContainer", &c.CustomContainer) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CustomDomainResource. func (c CustomDomainResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -346,6 +459,47 @@ func (c CustomDomainResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type CustomPersistentDiskProperties. +func (c CustomPersistentDiskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "mountOptions", c.MountOptions) + populate(objectMap, "mountPath", c.MountPath) + populate(objectMap, "readOnly", c.ReadOnly) + objectMap["type"] = c.Type + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CustomPersistentDiskResource. +func (c CustomPersistentDiskResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customPersistentDiskProperties", c.CustomPersistentDiskProperties) + populate(objectMap, "storageId", c.StorageID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomPersistentDiskResource. +func (c *CustomPersistentDiskResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "customPersistentDiskProperties": + c.CustomPersistentDiskProperties, err = unmarshalCustomPersistentDiskPropertiesClassification(val) + delete(rawMsg, key) + case "storageId": + err = unpopulate(val, "StorageID", &c.StorageID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DeploymentResource. func (d DeploymentResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -409,8 +563,105 @@ func (d *DeploymentResourceProperties) UnmarshalJSON(data []byte) error { func (d DeploymentSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "addonConfigs", d.AddonConfigs) + populate(objectMap, "containerProbeSettings", d.ContainerProbeSettings) populate(objectMap, "environmentVariables", d.EnvironmentVariables) + populate(objectMap, "livenessProbe", d.LivenessProbe) + populate(objectMap, "readinessProbe", d.ReadinessProbe) populate(objectMap, "resourceRequests", d.ResourceRequests) + populate(objectMap, "startupProbe", d.StartupProbe) + populate(objectMap, "terminationGracePeriodSeconds", d.TerminationGracePeriodSeconds) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ExecAction. +func (e ExecAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "command", e.Command) + objectMap["type"] = ProbeActionTypeExecAction + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecAction. +func (e *ExecAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "command": + err = unpopulate(val, "Command", &e.Command) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayAPIRoute. +func (g GatewayAPIRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", g.Description) + populate(objectMap, "filters", g.Filters) + populate(objectMap, "order", g.Order) + populate(objectMap, "predicates", g.Predicates) + populate(objectMap, "ssoEnabled", g.SsoEnabled) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "title", g.Title) + populate(objectMap, "tokenRelay", g.TokenRelay) + populate(objectMap, "uri", g.URI) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayCorsProperties. +func (g GatewayCorsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allowCredentials", g.AllowCredentials) + populate(objectMap, "allowedHeaders", g.AllowedHeaders) + populate(objectMap, "allowedMethods", g.AllowedMethods) + populate(objectMap, "allowedOrigins", g.AllowedOrigins) + populate(objectMap, "exposedHeaders", g.ExposedHeaders) + populate(objectMap, "maxAge", g.MaxAge) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayOperatorProperties. +func (g GatewayOperatorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "instances", g.Instances) + populate(objectMap, "resourceRequests", g.ResourceRequests) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayProperties. +func (g GatewayProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "apiMetadataProperties", g.APIMetadataProperties) + populate(objectMap, "corsProperties", g.CorsProperties) + populate(objectMap, "httpsOnly", g.HTTPSOnly) + populate(objectMap, "instances", g.Instances) + populate(objectMap, "operatorProperties", g.OperatorProperties) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "public", g.Public) + populate(objectMap, "resourceRequests", g.ResourceRequests) + populate(objectMap, "ssoProperties", g.SsoProperties) + populate(objectMap, "url", g.URL) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayRouteConfigProperties. +func (g GatewayRouteConfigProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appResourceId", g.AppResourceID) + populate(objectMap, "openApi", g.OpenAPI) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "routes", g.Routes) return json.Marshal(objectMap) } @@ -431,6 +682,41 @@ func (g GitPatternRepository) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type HTTPGetAction. +func (h HTTPGetAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "path", h.Path) + populate(objectMap, "scheme", h.Scheme) + objectMap["type"] = ProbeActionTypeHTTPGetAction + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPGetAction. +func (h *HTTPGetAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "path": + err = unpopulate(val, "Path", &h.Path) + delete(rawMsg, key) + case "scheme": + err = unpopulate(val, "Scheme", &h.Scheme) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type JarUploadedUserSourceInfo. func (j JarUploadedUserSourceInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -485,6 +771,7 @@ func (k KeyVaultCertificateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "issuedDate", k.IssuedDate) populate(objectMap, "issuer", k.Issuer) populate(objectMap, "keyVaultCertName", k.KeyVaultCertName) + populate(objectMap, "provisioningState", k.ProvisioningState) populate(objectMap, "subjectName", k.SubjectName) populate(objectMap, "thumbprint", k.Thumbprint) objectMap["type"] = "KeyVaultCertificate" @@ -525,6 +812,9 @@ func (k *KeyVaultCertificateProperties) UnmarshalJSON(data []byte) error { case "keyVaultCertName": err = unpopulate(val, "KeyVaultCertName", &k.KeyVaultCertName) delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &k.ProvisioningState) + delete(rawMsg, key) case "subjectName": err = unpopulate(val, "SubjectName", &k.SubjectName) delete(rawMsg, key) @@ -545,6 +835,16 @@ func (k *KeyVaultCertificateProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ManagedIdentityProperties. +func (m ManagedIdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type MonitoringSettingResource. func (m MonitoringSettingResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -604,6 +904,7 @@ func (n NetworkProfile) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "appNetworkResourceGroup", n.AppNetworkResourceGroup) populate(objectMap, "appSubnetId", n.AppSubnetID) + populate(objectMap, "ingressConfig", n.IngressConfig) populate(objectMap, "outboundIPs", n.OutboundIPs) populate(objectMap, "requiredTraffics", n.RequiredTraffics) populate(objectMap, "serviceCidr", n.ServiceCidr) @@ -619,6 +920,57 @@ func (n NetworkProfileOutboundIPs) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type Probe. +func (p Probe) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "disableProbe", p.DisableProbe) + populate(objectMap, "failureThreshold", p.FailureThreshold) + populate(objectMap, "initialDelaySeconds", p.InitialDelaySeconds) + populate(objectMap, "periodSeconds", p.PeriodSeconds) + populate(objectMap, "probeAction", p.ProbeAction) + populate(objectMap, "successThreshold", p.SuccessThreshold) + populate(objectMap, "timeoutSeconds", p.TimeoutSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Probe. +func (p *Probe) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "disableProbe": + err = unpopulate(val, "DisableProbe", &p.DisableProbe) + delete(rawMsg, key) + case "failureThreshold": + err = unpopulate(val, "FailureThreshold", &p.FailureThreshold) + delete(rawMsg, key) + case "initialDelaySeconds": + err = unpopulate(val, "InitialDelaySeconds", &p.InitialDelaySeconds) + delete(rawMsg, key) + case "periodSeconds": + err = unpopulate(val, "PeriodSeconds", &p.PeriodSeconds) + delete(rawMsg, key) + case "probeAction": + p.ProbeAction, err = unmarshalProbeActionClassification(val) + delete(rawMsg, key) + case "successThreshold": + err = unpopulate(val, "SuccessThreshold", &p.SuccessThreshold) + delete(rawMsg, key) + case "timeoutSeconds": + err = unpopulate(val, "TimeoutSeconds", &p.TimeoutSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type RequiredTraffic. func (r RequiredTraffic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -696,6 +1048,94 @@ func (s *SourceUploadedUserSourceInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SsoProperties. +func (s SsoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "clientSecret", s.ClientSecret) + populate(objectMap, "issuerUri", s.IssuerURI) + populate(objectMap, "scope", s.Scope) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type StorageAccount. +func (s StorageAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountKey", s.AccountKey) + populate(objectMap, "accountName", s.AccountName) + objectMap["storageType"] = StorageTypeStorageAccount + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageAccount. +func (s *StorageAccount) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accountKey": + err = unpopulate(val, "AccountKey", &s.AccountKey) + delete(rawMsg, key) + case "accountName": + err = unpopulate(val, "AccountName", &s.AccountName) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &s.StorageType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StorageResource. +func (s StorageResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + 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 StorageResource. +func (s *StorageResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + s.Properties, err = unmarshalStoragePropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -743,6 +1183,33 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TCPSocketAction. +func (t TCPSocketAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = ProbeActionTypeTCPSocketAction + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TCPSocketAction. +func (t *TCPSocketAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_monitoringsettings_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_monitoringsettings_client.go index 2a6bc736c774..871b7b79379e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_monitoringsettings_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_monitoringsettings_client.go @@ -57,7 +57,7 @@ func NewMonitoringSettingsClient(subscriptionID string, credential azcore.TokenC // Get - Get the Monitoring Setting and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -97,7 +97,7 @@ func (client *MonitoringSettingsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *MonitoringSettingsClient) getHandleResponse(resp *http.Response) ( // BeginUpdatePatch - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -127,9 +127,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePatch(ctx context.Context, re if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MonitoringSettingsClientUpdatePatchResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[MonitoringSettingsClientUpdatePatchResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[MonitoringSettingsClientUpdatePatchResponse](options.ResumeToken, client.pl, nil) } @@ -137,7 +135,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePatch(ctx context.Context, re // UpdatePatch - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *MonitoringSettingsClient) updatePatch(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePatchOptions) (*http.Response, error) { req, err := client.updatePatchCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { @@ -173,7 +171,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitoringSettingResource) @@ -181,7 +179,7 @@ func (client *MonitoringSettingsClient) updatePatchCreateRequest(ctx context.Con // BeginUpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -194,9 +192,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePut(ctx context.Context, reso if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MonitoringSettingsClientUpdatePutResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[MonitoringSettingsClientUpdatePutResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[MonitoringSettingsClientUpdatePutResponse](options.ResumeToken, client.pl, nil) } @@ -204,7 +200,7 @@ func (client *MonitoringSettingsClient) BeginUpdatePut(ctx context.Context, reso // UpdatePut - Update the Monitoring Setting. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *MonitoringSettingsClient) updatePut(ctx context.Context, resourceGroupName string, serviceName string, monitoringSettingResource MonitoringSettingResource, options *MonitoringSettingsClientBeginUpdatePutOptions) (*http.Response, error) { req, err := client.updatePutCreateRequest(ctx, resourceGroupName, serviceName, monitoringSettingResource, options) if err != nil { @@ -240,7 +236,7 @@ func (client *MonitoringSettingsClient) updatePutCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, monitoringSettingResource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_operations_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_operations_client.go index bf155319a965..3cc9ddc641f2 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_operations_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.AppPlatform provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_polymorphic_helpers.go index 2622a76196ff..d3c67822054d 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_polymorphic_helpers.go @@ -30,6 +30,64 @@ func unmarshalCertificatePropertiesClassification(rawMsg json.RawMessage) (Certi return b, json.Unmarshal(rawMsg, b) } +func unmarshalCustomPersistentDiskPropertiesClassification(rawMsg json.RawMessage) (CustomPersistentDiskPropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b CustomPersistentDiskPropertiesClassification + switch m["type"] { + case string(TypeAzureFileVolume): + b = &AzureFileVolume{} + default: + b = &CustomPersistentDiskProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalProbeActionClassification(rawMsg json.RawMessage) (ProbeActionClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ProbeActionClassification + switch m["type"] { + case string(ProbeActionTypeExecAction): + b = &ExecAction{} + case string(ProbeActionTypeHTTPGetAction): + b = &HTTPGetAction{} + case string(ProbeActionTypeTCPSocketAction): + b = &TCPSocketAction{} + default: + b = &ProbeAction{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalStoragePropertiesClassification(rawMsg json.RawMessage) (StoragePropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b StoragePropertiesClassification + switch m["storageType"] { + case string(StorageTypeStorageAccount): + b = &StorageAccount{} + default: + b = &StorageProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} + func unmarshalUserSourceInfoClassification(rawMsg json.RawMessage) (UserSourceInfoClassification, error) { if rawMsg == nil { return nil, nil @@ -42,6 +100,8 @@ func unmarshalUserSourceInfoClassification(rawMsg json.RawMessage) (UserSourceIn switch m["type"] { case "BuildResult": b = &BuildResultUserSourceInfo{} + case "Container": + b = &CustomContainerUserSourceInfo{} case "Jar": b = &JarUploadedUserSourceInfo{} case "NetCoreZip": diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_response_types.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_response_types.go index 5cee045a630e..e2199814a154 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_response_types.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_response_types.go @@ -8,6 +8,51 @@ package armappplatform +// APIPortalCustomDomainsClientCreateOrUpdateResponse contains the response from method APIPortalCustomDomainsClient.CreateOrUpdate. +type APIPortalCustomDomainsClientCreateOrUpdateResponse struct { + APIPortalCustomDomainResource +} + +// APIPortalCustomDomainsClientDeleteResponse contains the response from method APIPortalCustomDomainsClient.Delete. +type APIPortalCustomDomainsClientDeleteResponse struct { + // placeholder for future response values +} + +// APIPortalCustomDomainsClientGetResponse contains the response from method APIPortalCustomDomainsClient.Get. +type APIPortalCustomDomainsClientGetResponse struct { + APIPortalCustomDomainResource +} + +// APIPortalCustomDomainsClientListResponse contains the response from method APIPortalCustomDomainsClient.List. +type APIPortalCustomDomainsClientListResponse struct { + APIPortalCustomDomainResourceCollection +} + +// APIPortalsClientCreateOrUpdateResponse contains the response from method APIPortalsClient.CreateOrUpdate. +type APIPortalsClientCreateOrUpdateResponse struct { + APIPortalResource +} + +// APIPortalsClientDeleteResponse contains the response from method APIPortalsClient.Delete. +type APIPortalsClientDeleteResponse struct { + // placeholder for future response values +} + +// APIPortalsClientGetResponse contains the response from method APIPortalsClient.Get. +type APIPortalsClientGetResponse struct { + APIPortalResource +} + +// APIPortalsClientListResponse contains the response from method APIPortalsClient.List. +type APIPortalsClientListResponse struct { + APIPortalResourceCollection +} + +// APIPortalsClientValidateDomainResponse contains the response from method APIPortalsClient.ValidateDomain. +type APIPortalsClientValidateDomainResponse struct { + CustomDomainValidateResult +} + // AppsClientCreateOrUpdateResponse contains the response from method AppsClient.CreateOrUpdate. type AppsClientCreateOrUpdateResponse struct { AppResource @@ -348,6 +393,71 @@ type DeploymentsClientUpdateResponse struct { DeploymentResource } +// GatewayCustomDomainsClientCreateOrUpdateResponse contains the response from method GatewayCustomDomainsClient.CreateOrUpdate. +type GatewayCustomDomainsClientCreateOrUpdateResponse struct { + GatewayCustomDomainResource +} + +// GatewayCustomDomainsClientDeleteResponse contains the response from method GatewayCustomDomainsClient.Delete. +type GatewayCustomDomainsClientDeleteResponse struct { + // placeholder for future response values +} + +// GatewayCustomDomainsClientGetResponse contains the response from method GatewayCustomDomainsClient.Get. +type GatewayCustomDomainsClientGetResponse struct { + GatewayCustomDomainResource +} + +// GatewayCustomDomainsClientListResponse contains the response from method GatewayCustomDomainsClient.List. +type GatewayCustomDomainsClientListResponse struct { + GatewayCustomDomainResourceCollection +} + +// GatewayRouteConfigsClientCreateOrUpdateResponse contains the response from method GatewayRouteConfigsClient.CreateOrUpdate. +type GatewayRouteConfigsClientCreateOrUpdateResponse struct { + GatewayRouteConfigResource +} + +// GatewayRouteConfigsClientDeleteResponse contains the response from method GatewayRouteConfigsClient.Delete. +type GatewayRouteConfigsClientDeleteResponse struct { + // placeholder for future response values +} + +// GatewayRouteConfigsClientGetResponse contains the response from method GatewayRouteConfigsClient.Get. +type GatewayRouteConfigsClientGetResponse struct { + GatewayRouteConfigResource +} + +// GatewayRouteConfigsClientListResponse contains the response from method GatewayRouteConfigsClient.List. +type GatewayRouteConfigsClientListResponse struct { + GatewayRouteConfigResourceCollection +} + +// GatewaysClientCreateOrUpdateResponse contains the response from method GatewaysClient.CreateOrUpdate. +type GatewaysClientCreateOrUpdateResponse struct { + GatewayResource +} + +// GatewaysClientDeleteResponse contains the response from method GatewaysClient.Delete. +type GatewaysClientDeleteResponse struct { + // placeholder for future response values +} + +// GatewaysClientGetResponse contains the response from method GatewaysClient.Get. +type GatewaysClientGetResponse struct { + GatewayResource +} + +// GatewaysClientListResponse contains the response from method GatewaysClient.List. +type GatewaysClientListResponse struct { + GatewayResourceCollection +} + +// GatewaysClientValidateDomainResponse contains the response from method GatewaysClient.ValidateDomain. +type GatewaysClientValidateDomainResponse struct { + CustomDomainValidateResult +} + // MonitoringSettingsClientGetResponse contains the response from method MonitoringSettingsClient.Get. type MonitoringSettingsClientGetResponse struct { MonitoringSettingResource @@ -448,7 +558,37 @@ type ServicesClientRegenerateTestKeyResponse struct { TestKeys } +// ServicesClientStartResponse contains the response from method ServicesClient.Start. +type ServicesClientStartResponse struct { + // placeholder for future response values +} + +// ServicesClientStopResponse contains the response from method ServicesClient.Stop. +type ServicesClientStopResponse struct { + // placeholder for future response values +} + // ServicesClientUpdateResponse contains the response from method ServicesClient.Update. type ServicesClientUpdateResponse struct { ServiceResource } + +// StoragesClientCreateOrUpdateResponse contains the response from method StoragesClient.CreateOrUpdate. +type StoragesClientCreateOrUpdateResponse struct { + StorageResource +} + +// StoragesClientDeleteResponse contains the response from method StoragesClient.Delete. +type StoragesClientDeleteResponse struct { + // placeholder for future response values +} + +// StoragesClientGetResponse contains the response from method StoragesClient.Get. +type StoragesClientGetResponse struct { + StorageResource +} + +// StoragesClientListResponse contains the response from method StoragesClient.List. +type StoragesClientListResponse struct { + StorageResourceCollection +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_runtimeversions_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_runtimeversions_client.go index da6a57a51b22..9913f18f59ab 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_runtimeversions_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_runtimeversions_client.go @@ -50,7 +50,7 @@ func NewRuntimeVersionsClient(credential azcore.TokenCredential, options *arm.Cl // ListRuntimeVersions - Lists all of the available runtime versions supported by Microsoft.AppPlatform provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // options - RuntimeVersionsClientListRuntimeVersionsOptions contains the optional parameters for the RuntimeVersionsClient.ListRuntimeVersions // method. func (client *RuntimeVersionsClient) ListRuntimeVersions(ctx context.Context, options *RuntimeVersionsClientListRuntimeVersionsOptions) (RuntimeVersionsClientListRuntimeVersionsResponse, error) { @@ -76,7 +76,7 @@ func (client *RuntimeVersionsClient) listRuntimeVersionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_serviceregistries_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_serviceregistries_client.go index d882d0f3fff7..86b84c0d7f19 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_serviceregistries_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_serviceregistries_client.go @@ -57,7 +57,7 @@ func NewServiceRegistriesClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Create the default Service Registry or update the existing Service Registry. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -70,9 +70,7 @@ func (client *ServiceRegistriesClient) BeginCreateOrUpdate(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServiceRegistriesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServiceRegistriesClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ServiceRegistriesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -80,7 +78,7 @@ func (client *ServiceRegistriesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Create the default Service Registry or update the existing Service Registry. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ServiceRegistriesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { @@ -120,7 +118,7 @@ func (client *ServiceRegistriesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,7 +126,7 @@ func (client *ServiceRegistriesClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Disable the default Service Registry. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -141,9 +139,7 @@ func (client *ServiceRegistriesClient) BeginDelete(ctx context.Context, resource if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServiceRegistriesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServiceRegistriesClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ServiceRegistriesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -151,7 +147,7 @@ func (client *ServiceRegistriesClient) BeginDelete(ctx context.Context, resource // Delete - Disable the default Service Registry. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ServiceRegistriesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, serviceRegistryName string, options *ServiceRegistriesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, serviceRegistryName, options) if err != nil { @@ -191,7 +187,7 @@ func (client *ServiceRegistriesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -199,7 +195,7 @@ func (client *ServiceRegistriesClient) deleteCreateRequest(ctx context.Context, // Get - Get the Service Registry and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -244,7 +240,7 @@ func (client *ServiceRegistriesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +257,7 @@ func (client *ServiceRegistriesClient) getHandleResponse(resp *http.Response) (S // NewListPager - Handles requests to list all resources in a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -314,7 +310,7 @@ func (client *ServiceRegistriesClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_services_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_services_client.go index c05b0a54d756..eeba9be0995c 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_services_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_services_client.go @@ -57,7 +57,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Checks that the resource name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // location - the region // availabilityParameters - Parameters supplied to the operation. // options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability @@ -93,7 +93,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, availabilityParameters) @@ -110,7 +110,7 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreateOrUpdate - Create a new Service or update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -123,9 +123,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServicesClientCreateOrUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServicesClientCreateOrUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ServicesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -133,7 +131,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create a new Service or update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { @@ -169,7 +167,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) @@ -177,7 +175,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Operation to delete a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -188,9 +186,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServicesClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServicesClientDeleteResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ServicesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -198,7 +194,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Operation to delete a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -234,7 +230,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +238,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // DisableTestEndpoint - Disable test endpoint functionality for a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -283,7 +279,7 @@ func (client *ServicesClient) disableTestEndpointCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,7 +287,7 @@ func (client *ServicesClient) disableTestEndpointCreateRequest(ctx context.Conte // EnableTestEndpoint - Enable test endpoint functionality for a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -332,7 +328,7 @@ func (client *ServicesClient) enableTestEndpointCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -349,7 +345,7 @@ func (client *ServicesClient) enableTestEndpointHandleResponse(resp *http.Respon // Get - Get a Service and its properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -389,7 +385,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -406,7 +402,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListPager - Handles requests to list all resources in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // options - ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. @@ -454,7 +450,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -471,7 +467,7 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC // NewListBySubscriptionPager - Handles requests to list all resources in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.ListBySubscription // method. func (client *ServicesClient) NewListBySubscriptionPager(options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse] { @@ -514,7 +510,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -531,7 +527,7 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon // ListTestKeys - List test keys for a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -571,7 +567,7 @@ func (client *ServicesClient) listTestKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -588,7 +584,7 @@ func (client *ServicesClient) listTestKeysHandleResponse(resp *http.Response) (S // RegenerateTestKey - Regenerate a test key for a Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -630,7 +626,7 @@ func (client *ServicesClient) regenerateTestKeyCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateTestKeyRequest) @@ -645,9 +641,135 @@ func (client *ServicesClient) regenerateTestKeyHandleResponse(resp *http.Respons return result, nil } +// BeginStart - Start a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// options - ServicesClientBeginStartOptions contains the optional parameters for the ServicesClient.BeginStart method. +func (client *ServicesClient) BeginStart(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*runtime.Poller[ServicesClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServicesClientStartResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ServicesClientStartResponse](options.ResumeToken, client.pl, nil) + } +} + +// Start - Start a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *ServicesClient) start(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*http.Response, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startCreateRequest creates the Start request. +func (client *ServicesClient) startCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/start" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginStop - Stop a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// options - ServicesClientBeginStopOptions contains the optional parameters for the ServicesClient.BeginStop method. +func (client *ServicesClient) BeginStop(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*runtime.Poller[ServicesClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServicesClientStopResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ServicesClientStopResponse](options.ResumeToken, client.pl, nil) + } +} + +// Stop - Stop a Service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *ServicesClient) stop(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*http.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ServicesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServicesClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/stop" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginUpdate - Operation to update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure // Resource Manager API or the portal. // serviceName - The name of the Service resource. @@ -659,9 +781,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServicesClientUpdateResponse]{ - FinalStateVia: runtime.FinalStateViaAzureAsyncOp, - }) + return runtime.NewPoller[ServicesClientUpdateResponse](resp, client.pl, nil) } else { return runtime.NewPollerFromResumeToken[ServicesClientUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -669,7 +789,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Operation to update an exiting Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, serviceName string, resource ServiceResource, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, resource, options) if err != nil { @@ -705,7 +825,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, resource) diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_skus_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_skus_client.go index 33b213bf86da..1da211f20fef 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_skus_client.go +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_skus_client.go @@ -57,7 +57,7 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt // NewListPager - Lists all of the available skus of the Microsoft.AppPlatform provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-04-01 +// Generated from API version 2022-05-01-preview // options - SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ @@ -99,7 +99,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-04-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/appplatform/armappplatform/zz_generated_storages_client.go b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_storages_client.go new file mode 100644 index 000000000000..eb1e030cc95e --- /dev/null +++ b/sdk/resourcemanager/appplatform/armappplatform/zz_generated_storages_client.go @@ -0,0 +1,326 @@ +//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 armappplatform + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// StoragesClient contains the methods for the Storages group. +// Don't use this type directly, use NewStoragesClient() instead. +type StoragesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewStoragesClient creates a new instance of StoragesClient with the specified values. +// subscriptionID - Gets subscription ID which uniquely identify the Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewStoragesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StoragesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &StoragesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Create or update storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// storageName - The name of the storage resource. +// storageResource - Parameters for the create or update operation +// options - StoragesClientBeginCreateOrUpdateOptions contains the optional parameters for the StoragesClient.BeginCreateOrUpdate +// method. +func (client *StoragesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*runtime.Poller[StoragesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, storageName, storageResource, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[StoragesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[StoragesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Create or update storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *StoragesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, storageName, storageResource, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *StoragesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, storageName string, storageResource StorageResource, options *StoragesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if storageName == "" { + return nil, errors.New("parameter storageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{storageName}", url.PathEscape(storageName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, storageResource) +} + +// BeginDelete - Delete the storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// storageName - The name of the storage resource. +// options - StoragesClientBeginDeleteOptions contains the optional parameters for the StoragesClient.BeginDelete method. +func (client *StoragesClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*runtime.Poller[StoragesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, storageName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[StoragesClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[StoragesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete the storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +func (client *StoragesClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, storageName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StoragesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if storageName == "" { + return nil, errors.New("parameter storageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{storageName}", url.PathEscape(storageName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// storageName - The name of the storage resource. +// options - StoragesClientGetOptions contains the optional parameters for the StoragesClient.Get method. +func (client *StoragesClient) Get(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientGetOptions) (StoragesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, storageName, options) + if err != nil { + return StoragesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StoragesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StoragesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *StoragesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, storageName string, options *StoragesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages/{storageName}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if storageName == "" { + return nil, errors.New("parameter storageName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{storageName}", url.PathEscape(storageName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *StoragesClient) getHandleResponse(resp *http.Response) (StoragesClientGetResponse, error) { + result := StoragesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StorageResource); err != nil { + return StoragesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List all the storages of one Azure Spring Apps resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// serviceName - The name of the Service resource. +// options - StoragesClientListOptions contains the optional parameters for the StoragesClient.List method. +func (client *StoragesClient) NewListPager(resourceGroupName string, serviceName string, options *StoragesClientListOptions) *runtime.Pager[StoragesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[StoragesClientListResponse]{ + More: func(page StoragesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StoragesClientListResponse) (StoragesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StoragesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StoragesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StoragesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *StoragesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *StoragesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppPlatform/Spring/{serviceName}/storages" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *StoragesClient) listHandleResponse(resp *http.Response) (StoragesClientListResponse, error) { + result := StoragesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StorageResourceCollection); err != nil { + return StoragesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md index 9c6f18270c7f..4259b29f3d79 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md +++ b/sdk/resourcemanager/cosmos/armcosmos/CHANGELOG.md @@ -1,5 +1,365 @@ # Release History +## 1.1.0-beta.1 (2022-05-19) +### Features Added + +- New const `ServiceTypeMaterializedViewsBuilder` +- New const `ServiceStatusRunning` +- New const `ThroughputPolicyTypeCustom` +- New const `ServiceStatusDeleting` +- New const `ServiceTypeSQLDedicatedGateway` +- New const `ServiceStatusStopped` +- New const `DataTransferComponentCosmosDBSQL` +- New const `EnableFullTextQueryFalse` +- New const `MongoRoleDefinitionTypeCustomRole` +- New const `EnableFullTextQueryTrue` +- New const `ContinuousTierContinuous7Days` +- New const `DataTransferComponentAzureBlobStorage` +- New const `ServiceStatusUpdating` +- New const `ServiceSizeCosmosD4S` +- New const `ServiceStatusError` +- New const `ServiceTypeGraphAPICompute` +- New const `ContinuousTierContinuous30Days` +- New const `ThroughputPolicyTypeEqual` +- New const `ServiceSizeCosmosD8S` +- New const `ThroughputPolicyTypeNone` +- New const `ServiceStatusCreating` +- New const `AuthenticationMethodLdap` +- New const `DataTransferComponentCosmosDBCassandra` +- New const `ServiceTypeDataTransfer` +- New const `EnableFullTextQueryNone` +- New const `MongoRoleDefinitionTypeBuiltInRole` +- New const `ServiceSizeCosmosD16S` +- New function `GraphAPIComputeServiceResourceProperties.MarshalJSON() ([]byte, error)` +- New function `*CassandraResourcesClient.GetCassandraViewThroughput(context.Context, string, string, string, string, *CassandraResourcesClientGetCassandraViewThroughputOptions) (CassandraResourcesClientGetCassandraViewThroughputResponse, error)` +- New function `SQLDedicatedGatewayServiceResourceProperties.MarshalJSON() ([]byte, error)` +- New function `GremlinDatabaseRestoreResource.MarshalJSON() ([]byte, error)` +- New function `MongoRoleDefinitionResource.MarshalJSON() ([]byte, error)` +- New function `*MaterializedViewsBuilderServiceResourceProperties.GetServiceResourceProperties() *ServiceResourceProperties` +- New function `PossibleThroughputPolicyTypeValues() []ThroughputPolicyType` +- New function `*CassandraResourcesClient.BeginDeleteCassandraView(context.Context, string, string, string, string, *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientDeleteCassandraViewResponse], error)` +- New function `PossibleDataTransferComponentValues() []DataTransferComponent` +- New function `DataTransferServiceResourceProperties.MarshalJSON() ([]byte, error)` +- New function `*AzureBlobDataTransferDataSourceSink.UnmarshalJSON([]byte) error` +- New function `MaterializedViewsBuilderServiceResourceProperties.MarshalJSON() ([]byte, error)` +- New function `*SQLDataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` +- New function `*CassandraResourcesClient.NewListCassandraViewsPager(string, string, string, *CassandraResourcesClientListCassandraViewsOptions) *runtime.Pager[CassandraResourcesClientListCassandraViewsResponse]` +- New function `*SQLDedicatedGatewayServiceResourceProperties.GetServiceResourceProperties() *ServiceResourceProperties` +- New function `*DataTransferJobProperties.UnmarshalJSON([]byte) error` +- New function `CassandraViewCreateUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `*ClientEncryptionKeyResource.UnmarshalJSON([]byte) error` +- New function `*MongoDBResourcesClient.NewListMongoUserDefinitionsPager(string, string, *MongoDBResourcesClientListMongoUserDefinitionsOptions) *runtime.Pager[MongoDBResourcesClientListMongoUserDefinitionsResponse]` +- New function `*MongoDBResourcesClient.GetMongoRoleDefinition(context.Context, string, string, string, *MongoDBResourcesClientGetMongoRoleDefinitionOptions) (MongoDBResourcesClientGetMongoRoleDefinitionResponse, error)` +- New function `*GremlinResourcesClient.BeginRetrieveContinuousBackupInformation(context.Context, string, string, string, string, ContinuousBackupRestoreLocation, *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[GremlinResourcesClientRetrieveContinuousBackupInformationResponse], error)` +- New function `*SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution(context.Context, string, string, string, string, RetrieveThroughputParameters, *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse], error)` +- New function `BackupResourceProperties.MarshalJSON() ([]byte, error)` +- New function `*BackupResourceProperties.UnmarshalJSON([]byte) error` +- New function `PossibleServiceStatusValues() []ServiceStatus` +- New function `*MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution(context.Context, string, string, string, string, RetrieveThroughputParameters, *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse], error)` +- New function `*CassandraDataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` +- New function `ClientEncryptionPolicy.MarshalJSON() ([]byte, error)` +- New function `*SQLDedicatedGatewayServiceResourceProperties.UnmarshalJSON([]byte) error` +- New function `*SQLDataTransferDataSourceSink.UnmarshalJSON([]byte) error` +- New function `*MongoDBResourcesClient.BeginDeleteMongoUserDefinition(context.Context, string, string, string, *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoUserDefinitionResponse], error)` +- New function `DataTransferJobProperties.MarshalJSON() ([]byte, error)` +- New function `*CassandraDataTransferDataSourceSink.UnmarshalJSON([]byte) error` +- New function `GraphResourceGetResults.MarshalJSON() ([]byte, error)` +- New function `*GraphAPIComputeServiceResourceProperties.UnmarshalJSON([]byte) error` +- New function `*MongoDBResourcesClient.GetMongoUserDefinition(context.Context, string, string, string, *MongoDBResourcesClientGetMongoUserDefinitionOptions) (MongoDBResourcesClientGetMongoUserDefinitionResponse, error)` +- New function `*CassandraClustersClient.NewListBackupsPager(string, string, *CassandraClustersClientListBackupsOptions) *runtime.Pager[CassandraClustersClientListBackupsResponse]` +- New function `*MongoDBResourcesClient.BeginDeleteMongoRoleDefinition(context.Context, string, string, string, *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoRoleDefinitionResponse], error)` +- New function `*SQLResourcesClient.BeginListSQLContainerPartitionMerge(context.Context, string, string, string, string, MergeParameters, *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*runtime.Poller[SQLResourcesClientListSQLContainerPartitionMergeResponse], error)` +- New function `*GraphAPIComputeServiceResourceProperties.GetServiceResourceProperties() *ServiceResourceProperties` +- New function `SQLDataTransferDataSourceSink.MarshalJSON() ([]byte, error)` +- New function `*ClientEncryptionKeyGetPropertiesResource.UnmarshalJSON([]byte) error` +- New function `PossibleEnableFullTextQueryValues() []EnableFullTextQuery` +- New function `AuthenticationMethodLdapProperties.MarshalJSON() ([]byte, error)` +- New function `ServiceResource.MarshalJSON() ([]byte, error)` +- New function `*DataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` +- New function `Privilege.MarshalJSON() ([]byte, error)` +- New function `RedistributeThroughputParameters.MarshalJSON() ([]byte, error)` +- New function `PossibleContinuousTierValues() []ContinuousTier` +- New function `CassandraDataTransferDataSourceSink.MarshalJSON() ([]byte, error)` +- New function `ClientEncryptionKeyResource.MarshalJSON() ([]byte, error)` +- New function `PossibleMongoRoleDefinitionTypeValues() []MongoRoleDefinitionType` +- New function `*SQLResourcesClient.NewListClientEncryptionKeysPager(string, string, string, *SQLResourcesClientListClientEncryptionKeysOptions) *runtime.Pager[SQLResourcesClientListClientEncryptionKeysResponse]` +- New function `*DataTransferServiceResourceProperties.UnmarshalJSON([]byte) error` +- New function `*MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition(context.Context, string, string, string, MongoUserDefinitionCreateUpdateParameters, *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse], error)` +- New function `PossibleServiceTypeValues() []ServiceType` +- New function `ClientEncryptionKeyGetPropertiesResource.MarshalJSON() ([]byte, error)` +- New function `*DataTransferServiceResourceProperties.GetServiceResourceProperties() *ServiceResourceProperties` +- New function `*CassandraResourcesClient.BeginCreateUpdateCassandraView(context.Context, string, string, string, string, CassandraViewCreateUpdateParameters, *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientCreateUpdateCassandraViewResponse], error)` +- New function `PhysicalPartitionThroughputInfoProperties.MarshalJSON() ([]byte, error)` +- New function `RetrieveThroughputParameters.MarshalJSON() ([]byte, error)` +- New function `*MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge(context.Context, string, string, string, string, MergeParameters, *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*runtime.Poller[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse], error)` +- New function `*ServiceResourceProperties.GetServiceResourceProperties() *ServiceResourceProperties` +- New function `*CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput(context.Context, string, string, string, string, *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse], error)` +- New function `RedistributeThroughputPropertiesResource.MarshalJSON() ([]byte, error)` +- New function `*CassandraResourcesClient.GetCassandraView(context.Context, string, string, string, string, *CassandraResourcesClientGetCassandraViewOptions) (CassandraResourcesClientGetCassandraViewResponse, error)` +- New function `PhysicalPartitionThroughputInfoResultPropertiesResource.MarshalJSON() ([]byte, error)` +- New function `*MongoDBResourcesClient.NewListMongoRoleDefinitionsPager(string, string, *MongoDBResourcesClientListMongoRoleDefinitionsOptions) *runtime.Pager[MongoDBResourcesClientListMongoRoleDefinitionsResponse]` +- New function `*SQLResourcesClient.BeginSQLContainerRedistributeThroughput(context.Context, string, string, string, string, RedistributeThroughputParameters, *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRedistributeThroughputResponse], error)` +- New function `*ServiceResourceProperties.UnmarshalJSON([]byte) error` +- New function `MongoUserDefinitionResource.MarshalJSON() ([]byte, error)` +- New function `GraphResourceCreateUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `*AzureBlobDataTransferDataSourceSink.GetDataTransferDataSourceSink() *DataTransferDataSourceSink` +- New function `*SQLResourcesClient.BeginCreateUpdateClientEncryptionKey(context.Context, string, string, string, string, ClientEncryptionKeyCreateUpdateParameters, *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse], error)` +- New function `PhysicalPartitionThroughputInfoResult.MarshalJSON() ([]byte, error)` +- New function `*ServiceResource.UnmarshalJSON([]byte) error` +- New function `*SQLResourcesClient.GetClientEncryptionKey(context.Context, string, string, string, string, *SQLResourcesClientGetClientEncryptionKeyOptions) (SQLResourcesClientGetClientEncryptionKeyResponse, error)` +- New function `ServiceResourceProperties.MarshalJSON() ([]byte, error)` +- New function `RetrieveThroughputPropertiesResource.MarshalJSON() ([]byte, error)` +- New function `AzureBlobDataTransferDataSourceSink.MarshalJSON() ([]byte, error)` +- New function `*MaterializedViewsBuilderServiceResourceProperties.UnmarshalJSON([]byte) error` +- New function `PossibleServiceSizeValues() []ServiceSize` +- New function `*CassandraResourcesClient.BeginUpdateCassandraViewThroughput(context.Context, string, string, string, string, ThroughputSettingsUpdateParameters, *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*runtime.Poller[CassandraResourcesClientUpdateCassandraViewThroughputResponse], error)` +- New function `*MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition(context.Context, string, string, string, MongoRoleDefinitionCreateUpdateParameters, *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse], error)` +- New function `*MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput(context.Context, string, string, string, string, RedistributeThroughputParameters, *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse], error)` +- New function `*TableResourcesClient.BeginRetrieveContinuousBackupInformation(context.Context, string, string, string, ContinuousBackupRestoreLocation, *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[TableResourcesClientRetrieveContinuousBackupInformationResponse], error)` +- New function `*CassandraClustersClient.GetBackup(context.Context, string, string, string, *CassandraClustersClientGetBackupOptions) (CassandraClustersClientGetBackupResponse, error)` +- New function `CassandraViewGetResults.MarshalJSON() ([]byte, error)` +- New function `*CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale(context.Context, string, string, string, string, *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse], error)` +- New struct `AuthenticationMethodLdapProperties` +- New struct `AzureBlobDataTransferDataSourceSink` +- New struct `BackupResource` +- New struct `BackupResourceProperties` +- New struct `CassandraClustersClientGetBackupOptions` +- New struct `CassandraClustersClientGetBackupResponse` +- New struct `CassandraClustersClientListBackupsOptions` +- New struct `CassandraClustersClientListBackupsResponse` +- New struct `CassandraDataTransferDataSourceSink` +- New struct `CassandraResourcesClientBeginCreateUpdateCassandraViewOptions` +- New struct `CassandraResourcesClientBeginDeleteCassandraViewOptions` +- New struct `CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions` +- New struct `CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions` +- New struct `CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions` +- New struct `CassandraResourcesClientCreateUpdateCassandraViewResponse` +- New struct `CassandraResourcesClientDeleteCassandraViewResponse` +- New struct `CassandraResourcesClientGetCassandraViewOptions` +- New struct `CassandraResourcesClientGetCassandraViewResponse` +- New struct `CassandraResourcesClientGetCassandraViewThroughputOptions` +- New struct `CassandraResourcesClientGetCassandraViewThroughputResponse` +- New struct `CassandraResourcesClientListCassandraViewsOptions` +- New struct `CassandraResourcesClientListCassandraViewsResponse` +- New struct `CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse` +- New struct `CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse` +- New struct `CassandraResourcesClientUpdateCassandraViewThroughputResponse` +- New struct `CassandraViewCreateUpdateParameters` +- New struct `CassandraViewCreateUpdateProperties` +- New struct `CassandraViewGetProperties` +- New struct `CassandraViewGetPropertiesOptions` +- New struct `CassandraViewGetPropertiesResource` +- New struct `CassandraViewGetResults` +- New struct `CassandraViewListResult` +- New struct `CassandraViewResource` +- New struct `ClientEncryptionIncludedPath` +- New struct `ClientEncryptionKeyCreateUpdateParameters` +- New struct `ClientEncryptionKeyCreateUpdateProperties` +- New struct `ClientEncryptionKeyGetProperties` +- New struct `ClientEncryptionKeyGetPropertiesResource` +- New struct `ClientEncryptionKeyGetResults` +- New struct `ClientEncryptionKeyResource` +- New struct `ClientEncryptionKeysListResult` +- New struct `ClientEncryptionPolicy` +- New struct `ContinuousModeProperties` +- New struct `CreateJobRequest` +- New struct `DataTransferDataSourceSink` +- New struct `DataTransferJobFeedResults` +- New struct `DataTransferJobGetResults` +- New struct `DataTransferJobProperties` +- New struct `DataTransferJobsClientCancelOptions` +- New struct `DataTransferJobsClientCancelResponse` +- New struct `DataTransferJobsClientCreateOptions` +- New struct `DataTransferJobsClientCreateResponse` +- New struct `DataTransferJobsClientGetOptions` +- New struct `DataTransferJobsClientGetResponse` +- New struct `DataTransferJobsClientListByDatabaseAccountOptions` +- New struct `DataTransferJobsClientListByDatabaseAccountResponse` +- New struct `DataTransferJobsClientPauseOptions` +- New struct `DataTransferJobsClientPauseResponse` +- New struct `DataTransferJobsClientResumeOptions` +- New struct `DataTransferJobsClientResumeResponse` +- New struct `DataTransferRegionalServiceResource` +- New struct `DataTransferServiceResource` +- New struct `DataTransferServiceResourceProperties` +- New struct `DiagnosticLogSettings` +- New struct `GraphAPIComputeRegionalServiceResource` +- New struct `GraphAPIComputeServiceResource` +- New struct `GraphAPIComputeServiceResourceProperties` +- New struct `GraphResource` +- New struct `GraphResourceCreateUpdateParameters` +- New struct `GraphResourceCreateUpdateProperties` +- New struct `GraphResourceGetProperties` +- New struct `GraphResourceGetPropertiesOptions` +- New struct `GraphResourceGetPropertiesResource` +- New struct `GraphResourceGetResults` +- New struct `GraphResourcesClientBeginCreateUpdateGraphOptions` +- New struct `GraphResourcesClientBeginDeleteGraphResourceOptions` +- New struct `GraphResourcesClientCreateUpdateGraphResponse` +- New struct `GraphResourcesClientDeleteGraphResourceResponse` +- New struct `GraphResourcesClientGetGraphOptions` +- New struct `GraphResourcesClientGetGraphResponse` +- New struct `GraphResourcesClientListGraphsOptions` +- New struct `GraphResourcesClientListGraphsResponse` +- New struct `GraphResourcesListResult` +- New struct `GremlinDatabaseRestoreResource` +- New struct `GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions` +- New struct `GremlinResourcesClientRetrieveContinuousBackupInformationResponse` +- New struct `KeyWrapMetadata` +- New struct `ListBackups` +- New struct `MaterializedViewsBuilderRegionalServiceResource` +- New struct `MaterializedViewsBuilderServiceResource` +- New struct `MaterializedViewsBuilderServiceResourceProperties` +- New struct `MergeParameters` +- New struct `MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions` +- New struct `MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions` +- New struct `MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions` +- New struct `MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions` +- New struct `MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions` +- New struct `MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions` +- New struct `MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions` +- New struct `MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse` +- New struct `MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse` +- New struct `MongoDBResourcesClientDeleteMongoRoleDefinitionResponse` +- New struct `MongoDBResourcesClientDeleteMongoUserDefinitionResponse` +- New struct `MongoDBResourcesClientGetMongoRoleDefinitionOptions` +- New struct `MongoDBResourcesClientGetMongoRoleDefinitionResponse` +- New struct `MongoDBResourcesClientGetMongoUserDefinitionOptions` +- New struct `MongoDBResourcesClientGetMongoUserDefinitionResponse` +- New struct `MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse` +- New struct `MongoDBResourcesClientListMongoRoleDefinitionsOptions` +- New struct `MongoDBResourcesClientListMongoRoleDefinitionsResponse` +- New struct `MongoDBResourcesClientListMongoUserDefinitionsOptions` +- New struct `MongoDBResourcesClientListMongoUserDefinitionsResponse` +- New struct `MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse` +- New struct `MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse` +- New struct `MongoRoleDefinitionCreateUpdateParameters` +- New struct `MongoRoleDefinitionGetResults` +- New struct `MongoRoleDefinitionListResult` +- New struct `MongoRoleDefinitionResource` +- New struct `MongoUserDefinitionCreateUpdateParameters` +- New struct `MongoUserDefinitionGetResults` +- New struct `MongoUserDefinitionListResult` +- New struct `MongoUserDefinitionResource` +- New struct `PhysicalPartitionID` +- New struct `PhysicalPartitionStorageInfo` +- New struct `PhysicalPartitionStorageInfoCollection` +- New struct `PhysicalPartitionThroughputInfoProperties` +- New struct `PhysicalPartitionThroughputInfoResource` +- New struct `PhysicalPartitionThroughputInfoResult` +- New struct `PhysicalPartitionThroughputInfoResultProperties` +- New struct `PhysicalPartitionThroughputInfoResultPropertiesResource` +- New struct `Privilege` +- New struct `PrivilegeResource` +- New struct `RedistributeThroughputParameters` +- New struct `RedistributeThroughputProperties` +- New struct `RedistributeThroughputPropertiesResource` +- New struct `RegionalServiceResource` +- New struct `RestorableGremlinDatabaseGetResult` +- New struct `RestorableGremlinDatabaseProperties` +- New struct `RestorableGremlinDatabasePropertiesResource` +- New struct `RestorableGremlinDatabasesClientListOptions` +- New struct `RestorableGremlinDatabasesClientListResponse` +- New struct `RestorableGremlinDatabasesListResult` +- New struct `RestorableGremlinGraphGetResult` +- New struct `RestorableGremlinGraphProperties` +- New struct `RestorableGremlinGraphPropertiesResource` +- New struct `RestorableGremlinGraphsClientListOptions` +- New struct `RestorableGremlinGraphsClientListResponse` +- New struct `RestorableGremlinGraphsListResult` +- New struct `RestorableGremlinResourcesClientListOptions` +- New struct `RestorableGremlinResourcesClientListResponse` +- New struct `RestorableGremlinResourcesListResult` +- New struct `RestorableTableGetResult` +- New struct `RestorableTableProperties` +- New struct `RestorableTablePropertiesResource` +- New struct `RestorableTableResourcesClientListOptions` +- New struct `RestorableTableResourcesClientListResponse` +- New struct `RestorableTableResourcesListResult` +- New struct `RestorableTablesClientListOptions` +- New struct `RestorableTablesClientListResponse` +- New struct `RestorableTablesListResult` +- New struct `RetrieveThroughputParameters` +- New struct `RetrieveThroughputProperties` +- New struct `RetrieveThroughputPropertiesResource` +- New struct `Role` +- New struct `SQLDataTransferDataSourceSink` +- New struct `SQLDedicatedGatewayRegionalServiceResource` +- New struct `SQLDedicatedGatewayServiceResource` +- New struct `SQLDedicatedGatewayServiceResourceProperties` +- New struct `SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions` +- New struct `SQLResourcesClientBeginListSQLContainerPartitionMergeOptions` +- New struct `SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions` +- New struct `SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions` +- New struct `SQLResourcesClientCreateUpdateClientEncryptionKeyResponse` +- New struct `SQLResourcesClientGetClientEncryptionKeyOptions` +- New struct `SQLResourcesClientGetClientEncryptionKeyResponse` +- New struct `SQLResourcesClientListClientEncryptionKeysOptions` +- New struct `SQLResourcesClientListClientEncryptionKeysResponse` +- New struct `SQLResourcesClientListSQLContainerPartitionMergeResponse` +- New struct `SQLResourcesClientSQLContainerRedistributeThroughputResponse` +- New struct `SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse` +- New struct `ServiceClientBeginCreateOptions` +- New struct `ServiceClientBeginDeleteOptions` +- New struct `ServiceClientCreateResponse` +- New struct `ServiceClientDeleteResponse` +- New struct `ServiceClientGetOptions` +- New struct `ServiceClientGetResponse` +- New struct `ServiceClientListOptions` +- New struct `ServiceClientListResponse` +- New struct `ServiceResource` +- New struct `ServiceResourceCreateUpdateParameters` +- New struct `ServiceResourceCreateUpdateProperties` +- New struct `ServiceResourceListResult` +- New struct `ServiceResourceProperties` +- New struct `TableResourcesClientBeginRetrieveContinuousBackupInformationOptions` +- New struct `TableResourcesClientRetrieveContinuousBackupInformationResponse` +- New field `Identity` in struct `GremlinDatabaseCreateUpdateParameters` +- New field `Identity` in struct `SQLTriggerCreateUpdateParameters` +- New field `DiagnosticLogSettings` in struct `DatabaseAccountGetProperties` +- New field `EnableMaterializedViews` in struct `DatabaseAccountGetProperties` +- New field `Identity` in struct `GremlinGraphGetResults` +- New field `Identity` in struct `CassandraTableGetResults` +- New field `Identity` in struct `SQLTriggerGetResults` +- New field `Identity` in struct `GremlinGraphCreateUpdateParameters` +- New field `GremlinDatabasesToRestore` in struct `RestoreParameters` +- New field `TablesToRestore` in struct `RestoreParameters` +- New field `ClientEncryptionPolicy` in struct `RestorableSQLContainerPropertiesResourceContainer` +- New field `DiagnosticLogSettings` in struct `DatabaseAccountUpdateProperties` +- New field `EnableMaterializedViews` in struct `DatabaseAccountUpdateProperties` +- New field `Identity` in struct `SQLStoredProcedureCreateUpdateParameters` +- New field `Identity` in struct `ARMResourceProperties` +- New field `ContinuousModeProperties` in struct `ContinuousModeBackupPolicy` +- New field `Identity` in struct `CassandraKeyspaceGetResults` +- New field `Identity` in struct `MongoDBDatabaseCreateUpdateParameters` +- New field `Identity` in struct `SQLStoredProcedureGetResults` +- New field `Identity` in struct `ThroughputSettingsUpdateParameters` +- New field `Identity` in struct `MongoDBCollectionGetResults` +- New field `StartTime` in struct `RestorableMongodbCollectionsClientListOptions` +- New field `EndTime` in struct `RestorableMongodbCollectionsClientListOptions` +- New field `Identity` in struct `TableGetResults` +- New field `OldestRestorableTime` in struct `RestorableDatabaseAccountProperties` +- New field `Identity` in struct `SQLDatabaseGetResults` +- New field `Identity` in struct `SQLContainerCreateUpdateParameters` +- New field `ClientEncryptionPolicy` in struct `SQLContainerResource` +- New field `Identity` in struct `MongoDBDatabaseGetResults` +- New field `Identity` in struct `GremlinDatabaseGetResults` +- New field `Identity` in struct `SQLUserDefinedFunctionGetResults` +- New field `Identity` in struct `TableCreateUpdateParameters` +- New field `Identity` in struct `CassandraKeyspaceCreateUpdateParameters` +- New field `ClientEncryptionPolicy` in struct `SQLContainerGetPropertiesResource` +- New field `AuthenticationMethodLdapProperties` in struct `DataCenterResourceProperties` +- New field `Identity` in struct `SQLDatabaseCreateUpdateParameters` +- New field `Identity` in struct `ThroughputSettingsGetResults` +- New field `Identity` in struct `SQLContainerGetResults` +- New field `Identity` in struct `SQLUserDefinedFunctionCreateUpdateParameters` +- New field `Identity` in struct `MongoDBCollectionCreateUpdateParameters` +- New field `DiagnosticLogSettings` in struct `DatabaseAccountCreateUpdateProperties` +- New field `EnableMaterializedViews` in struct `DatabaseAccountCreateUpdateProperties` +- New field `Status` in struct `LocationProperties` +- New field `Identity` in struct `CassandraTableCreateUpdateParameters` + + ## 1.0.0 (2022-05-17) ### Breaking Changes diff --git a/sdk/resourcemanager/cosmos/armcosmos/autorest.md b/sdk/resourcemanager/cosmos/armcosmos/autorest.md index d2d43d906bb0..174b05c3ccef 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/autorest.md +++ b/sdk/resourcemanager/cosmos/armcosmos/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-2021-10 require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cosmos-db/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/cosmos-db/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/cosmos-db/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/cosmos-db/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraclusters_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraclusters_client_test.go index 18b5bf9fc983..bc4730e86655 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraclusters_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraclusters_client_test.go @@ -17,14 +17,14 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json func ExampleCassandraClustersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -41,14 +41,14 @@ func ExampleCassandraClustersClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json func ExampleCassandraClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -66,14 +66,14 @@ func ExampleCassandraClustersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterGet.json func ExampleCassandraClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -88,14 +88,14 @@ func ExampleCassandraClustersClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterDelete.json func ExampleCassandraClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -112,7 +112,7 @@ func ExampleCassandraClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterCreate.json func ExampleCassandraClustersClient_BeginCreateUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -168,7 +168,7 @@ func ExampleCassandraClustersClient_BeginCreateUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterPatch.json func ExampleCassandraClustersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -217,14 +217,14 @@ func ExampleCassandraClustersClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraCommand.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraCommand.json func ExampleCassandraClustersClient_BeginInvokeCommand() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) + client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -232,7 +232,10 @@ func ExampleCassandraClustersClient_BeginInvokeCommand() { "cassandra-prod-rg", "cassandra-prod", armcosmos.CommandPostBody{ - Command: to.Ptr("nodetool status"), + Arguments: map[string]*string{ + "status": to.Ptr(""), + }, + Command: to.Ptr("nodetool"), Host: to.Ptr("10.0.1.12"), }, nil) @@ -245,7 +248,56 @@ func ExampleCassandraClustersClient_BeginInvokeCommand() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterDeallocate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraBackupsList.json +func ExampleCassandraClustersClient_NewListBackupsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListBackupsPager("cassandra-prod-rg", + "cassandra-prod", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraBackup.json +func ExampleCassandraClustersClient_GetBackup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetBackup(ctx, + "cassandra-prod-rg", + "cassandra-prod", + "1611250348", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json func ExampleCassandraClustersClient_BeginDeallocate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -269,14 +321,14 @@ func ExampleCassandraClustersClient_BeginDeallocate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraClusterStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraClusterStart.json func ExampleCassandraClustersClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraClustersClient("subid", cred, nil) + client, err := armcosmos.NewCassandraClustersClient("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -293,7 +345,7 @@ func ExampleCassandraClustersClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraStatus.json func ExampleCassandraClustersClient_Status() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandradatacenters_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandradatacenters_client_test.go index 63ea9af0ae98..10e8df995633 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandradatacenters_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandradatacenters_client_test.go @@ -17,14 +17,14 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraDataCenterList.json func ExampleCassandraDataCentersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -43,14 +43,14 @@ func ExampleCassandraDataCentersClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraDataCenterGet.json func ExampleCassandraDataCentersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -66,14 +66,14 @@ func ExampleCassandraDataCentersClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json func ExampleCassandraDataCentersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -91,14 +91,14 @@ func ExampleCassandraDataCentersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json func ExampleCassandraDataCentersClient_BeginCreateUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armcosmos.NewCassandraDataCentersClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewCassandraDataCentersClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -126,7 +126,7 @@ func ExampleCassandraDataCentersClient_BeginCreateUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBManagedCassandraDataCenterPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json func ExampleCassandraDataCentersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraresources_client_test.go index 2a06a97b1e3c..12fb76292256 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_cassandraresources_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceList.json func ExampleCassandraResourcesClient_NewListCassandraKeyspacesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleCassandraResourcesClient_NewListCassandraKeyspacesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceGet.json func ExampleCassandraResourcesClient_GetCassandraKeyspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleCassandraResourcesClient_GetCassandraKeyspace() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraKeyspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraKeyspace() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceDelete.json func ExampleCassandraResourcesClient_BeginDeleteCassandraKeyspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleCassandraResourcesClient_BeginDeleteCassandraKeyspace() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json func ExampleCassandraResourcesClient_GetCassandraKeyspaceThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +151,7 @@ func ExampleCassandraResourcesClient_GetCassandraKeyspaceThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json func ExampleCassandraResourcesClient_BeginUpdateCassandraKeyspaceThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleCassandraResourcesClient_BeginUpdateCassandraKeyspaceThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -214,7 +214,7 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToAutoscale() _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -241,7 +241,7 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraKeyspaceToManualThroug _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableList.json func ExampleCassandraResourcesClient_NewListCassandraTablesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -268,7 +268,7 @@ func ExampleCassandraResourcesClient_NewListCassandraTablesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableGet.json func ExampleCassandraResourcesClient_GetCassandraTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -292,7 +292,7 @@ func ExampleCassandraResourcesClient_GetCassandraTable() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableCreateUpdate.json func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -330,8 +330,9 @@ func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { Name: to.Ptr("columnA"), }}, }, - DefaultTTL: to.Ptr[int32](100), - ID: to.Ptr("tableName"), + AnalyticalStorageTTL: to.Ptr[int32](500), + DefaultTTL: to.Ptr[int32](100), + ID: to.Ptr("tableName"), }, }, }, @@ -347,7 +348,7 @@ func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraTable() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableDelete.json func ExampleCassandraResourcesClient_BeginDeleteCassandraTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -373,7 +374,7 @@ func ExampleCassandraResourcesClient_BeginDeleteCassandraTable() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableThroughputGet.json func ExampleCassandraResourcesClient_GetCassandraTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -397,7 +398,7 @@ func ExampleCassandraResourcesClient_GetCassandraTableThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableThroughputUpdate.json func ExampleCassandraResourcesClient_BeginUpdateCassandraTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -434,7 +435,7 @@ func ExampleCassandraResourcesClient_BeginUpdateCassandraTableThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -462,7 +463,7 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToAutoscale() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -489,3 +490,234 @@ func ExampleCassandraResourcesClient_BeginMigrateCassandraTableToManualThroughpu // TODO: use response item _ = res } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewList.json +func ExampleCassandraResourcesClient_NewListCassandraViewsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListCassandraViewsPager("rgName", + "ddb1", + "keyspacename", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewGet.json +func ExampleCassandraResourcesClient_GetCassandraView() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetCassandraView(ctx, + "rg1", + "ddb1", + "keyspacename", + "viewname", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewCreateUpdate.json +func ExampleCassandraResourcesClient_BeginCreateUpdateCassandraView() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateUpdateCassandraView(ctx, + "rg1", + "ddb1", + "keyspacename", + "viewname", + armcosmos.CassandraViewCreateUpdateParameters{ + Tags: map[string]*string{}, + Properties: &armcosmos.CassandraViewCreateUpdateProperties{ + Options: &armcosmos.CreateUpdateOptions{}, + Resource: &armcosmos.CassandraViewResource{ + ID: to.Ptr("viewname"), + ViewDefinition: to.Ptr("SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewDelete.json +func ExampleCassandraResourcesClient_BeginDeleteCassandraView() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDeleteCassandraView(ctx, + "rg1", + "ddb1", + "keyspacename", + "viewname", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewThroughputGet.json +func ExampleCassandraResourcesClient_GetCassandraViewThroughput() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetCassandraViewThroughput(ctx, + "rg1", + "ddb1", + "keyspacename", + "viewname", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewThroughputUpdate.json +func ExampleCassandraResourcesClient_BeginUpdateCassandraViewThroughput() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdateCassandraViewThroughput(ctx, + "rg1", + "ddb1", + "keyspacename", + "viewname", + armcosmos.ThroughputSettingsUpdateParameters{ + Tags: map[string]*string{}, + Properties: &armcosmos.ThroughputSettingsUpdateProperties{ + Resource: &armcosmos.ThroughputSettingsResource{ + Throughput: to.Ptr[int32](400), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json +func ExampleCassandraResourcesClient_BeginMigrateCassandraViewToAutoscale() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginMigrateCassandraViewToAutoscale(ctx, + "rg1", + "ddb1", + "keyspacename", + "viewname", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json +func ExampleCassandraResourcesClient_BeginMigrateCassandraViewToManualThroughput() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewCassandraResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginMigrateCassandraViewToManualThroughput(ctx, + "rg1", + "ddb1", + "keyspacename", + "viewname", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collection_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collection_client_test.go index 5c1631dbe854..98b2482265ef 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collection_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collection_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCollectionGetMetrics.json func ExampleCollectionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleCollectionClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCollectionGetUsages.json func ExampleCollectionClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -74,7 +74,7 @@ func ExampleCollectionClient_NewListUsagesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionGetMetricDefinitions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCollectionGetMetricDefinitions.json func ExampleCollectionClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartition_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartition_client_test.go index c1caa43a36dc..cf7bc2ace880 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartition_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartition_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionPartitionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCollectionPartitionGetMetrics.json func ExampleCollectionPartitionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleCollectionPartitionClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionPartitionGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCollectionPartitionGetUsages.json func ExampleCollectionPartitionClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartitionregion_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartitionregion_client_test.go index 07bee987988e..b2a690eac433 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartitionregion_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionpartitionregion_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json func ExampleCollectionPartitionRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionregion_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionregion_client_test.go index 02684786fe8e..fc38bf3fcec5 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionregion_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_collectionregion_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRegionCollectionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRegionCollectionGetMetrics.json func ExampleCollectionRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_database_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_database_client_test.go index 14095a173107..b25f85ab5130 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_database_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_database_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseGetMetrics.json func ExampleDatabaseClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleDatabaseClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseGetUsages.json func ExampleDatabaseClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +72,7 @@ func ExampleDatabaseClient_NewListUsagesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseGetMetricDefinitions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json func ExampleDatabaseClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccountregion_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccountregion_client_test.go index a88c5ea04f7c..efb615ea54ea 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccountregion_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccountregion_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json func ExampleDatabaseAccountRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccounts_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccounts_client_test.go index d1f58750b7e6..b3353c8bb66d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccounts_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_databaseaccounts_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountGet.json func ExampleDatabaseAccountsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleDatabaseAccountsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountPatch.json func ExampleDatabaseAccountsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -70,7 +70,7 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { PeriodicModeProperties: &armcosmos.PeriodicModeProperties{ BackupIntervalInMinutes: to.Ptr[int32](240), BackupRetentionIntervalInHours: to.Ptr[int32](720), - BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyLocal), + BackupStorageRedundancy: to.Ptr(armcosmos.BackupStorageRedundancyGeo), }, }, Capacity: &armcosmos.Capacity{ @@ -81,7 +81,10 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { MaxIntervalInSeconds: to.Ptr[int32](10), MaxStalenessPrefix: to.Ptr[int64](200), }, - DefaultIdentity: to.Ptr("FirstPartyIdentity"), + DefaultIdentity: to.Ptr("FirstPartyIdentity"), + DiagnosticLogSettings: &armcosmos.DiagnosticLogSettings{ + EnableFullTextQuery: to.Ptr(armcosmos.EnableFullTextQueryTrue), + }, EnableAnalyticalStorage: to.Ptr(true), EnableFreeTier: to.Ptr(false), IPRules: []*armcosmos.IPAddressOrRange{ @@ -117,7 +120,7 @@ func ExampleDatabaseAccountsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountCreateMax.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountCreateMax.json func ExampleDatabaseAccountsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -132,15 +135,15 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate() { "rg1", "ddb1", armcosmos.DatabaseAccountCreateUpdateParameters{ - Location: to.Ptr("westus"), - Tags: map[string]*string{}, Identity: &armcosmos.ManagedServiceIdentity{ Type: to.Ptr(armcosmos.ResourceIdentityTypeSystemAssignedUserAssigned), UserAssignedIdentities: map[string]*armcosmos.Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties{ "/subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/eu2cgroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1": {}, }, }, - Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB), + Location: to.Ptr("westus"), + Tags: map[string]*string{}, + Kind: to.Ptr(armcosmos.DatabaseAccountKindMongoDB), Properties: &armcosmos.DatabaseAccountCreateUpdateProperties{ AnalyticalStorageConfiguration: &armcosmos.AnalyticalStorageConfiguration{ SchemaType: to.Ptr(armcosmos.AnalyticalStorageSchemaTypeWellDefined), @@ -173,6 +176,7 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate() { DefaultIdentity: to.Ptr("FirstPartyIdentity"), EnableAnalyticalStorage: to.Ptr(true), EnableFreeTier: to.Ptr(false), + EnableMaterializedViews: to.Ptr(false), IPRules: []*armcosmos.IPAddressOrRange{ { IPAddressOrRange: to.Ptr("23.43.230.120"), @@ -216,7 +220,7 @@ func ExampleDatabaseAccountsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountDelete.json func ExampleDatabaseAccountsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -240,7 +244,7 @@ func ExampleDatabaseAccountsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json func ExampleDatabaseAccountsClient_BeginFailoverPriorityChange() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -275,7 +279,7 @@ func ExampleDatabaseAccountsClient_BeginFailoverPriorityChange() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountList.json func ExampleDatabaseAccountsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -299,7 +303,7 @@ func ExampleDatabaseAccountsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -324,7 +328,7 @@ func ExampleDatabaseAccountsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountListKeys.json func ExampleDatabaseAccountsClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -346,7 +350,7 @@ func ExampleDatabaseAccountsClient_ListKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json func ExampleDatabaseAccountsClient_ListConnectionStrings() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -368,7 +372,7 @@ func ExampleDatabaseAccountsClient_ListConnectionStrings() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountOfflineRegion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json func ExampleDatabaseAccountsClient_BeginOfflineRegion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -393,7 +397,7 @@ func ExampleDatabaseAccountsClient_BeginOfflineRegion() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountOnlineRegion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json func ExampleDatabaseAccountsClient_BeginOnlineRegion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -418,7 +422,7 @@ func ExampleDatabaseAccountsClient_BeginOnlineRegion() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json func ExampleDatabaseAccountsClient_GetReadOnlyKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -440,7 +444,7 @@ func ExampleDatabaseAccountsClient_GetReadOnlyKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json func ExampleDatabaseAccountsClient_ListReadOnlyKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -462,7 +466,7 @@ func ExampleDatabaseAccountsClient_ListReadOnlyKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json func ExampleDatabaseAccountsClient_BeginRegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -489,7 +493,7 @@ func ExampleDatabaseAccountsClient_BeginRegenerateKey() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountCheckNameExists.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json func ExampleDatabaseAccountsClient_CheckNameExists() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -508,7 +512,7 @@ func ExampleDatabaseAccountsClient_CheckNameExists() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountGetMetrics.json func ExampleDatabaseAccountsClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -535,7 +539,7 @@ func ExampleDatabaseAccountsClient_NewListMetricsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGetUsages.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountGetUsages.json func ExampleDatabaseAccountsClient_NewListUsagesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -561,7 +565,7 @@ func ExampleDatabaseAccountsClient_NewListUsagesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json func ExampleDatabaseAccountsClient_NewListMetricDefinitionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_datatransferjobs_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_datatransferjobs_client_test.go new file mode 100644 index 000000000000..6d0a09a09440 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_datatransferjobs_client_test.go @@ -0,0 +1,173 @@ +//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 armcosmos_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/cosmos/armcosmos" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json +func ExampleDataTransferJobsClient_Create() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Create(ctx, + "rg1", + "ddb1", + "j1", + armcosmos.CreateJobRequest{ + Properties: &armcosmos.DataTransferJobProperties{ + Destination: &armcosmos.AzureBlobDataTransferDataSourceSink{ + Component: to.Ptr(armcosmos.DataTransferComponentAzureBlobStorage), + ContainerName: to.Ptr("blob_container"), + EndpointURL: to.Ptr("https://blob.windows.net"), + }, + Source: &armcosmos.CassandraDataTransferDataSourceSink{ + Component: to.Ptr(armcosmos.DataTransferComponentCosmosDBCassandra), + KeyspaceName: to.Ptr("keyspace"), + TableName: to.Ptr("table"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json +func ExampleDataTransferJobsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "rg1", + "ddb1", + "j1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json +func ExampleDataTransferJobsClient_Pause() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Pause(ctx, + "rg1", + "ddb1", + "j1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json +func ExampleDataTransferJobsClient_Resume() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Resume(ctx, + "rg1", + "ddb1", + "j1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json +func ExampleDataTransferJobsClient_Cancel() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Cancel(ctx, + "rg1", + "ddb1", + "j1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json +func ExampleDataTransferJobsClient_NewListByDatabaseAccountPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewDataTransferJobsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByDatabaseAccountPager("rg1", + "ddb1", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_certificates_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_graphresources_client_test.go similarity index 55% rename from sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_certificates_client_test.go rename to sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_graphresources_client_test.go index 5cbed30af327..c01c02f18657 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_certificates_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_graphresources_client_test.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armappplatform_test +package armcosmos_test import ( "context" @@ -14,114 +14,116 @@ import ( "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/appplatform/armappplatform" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_Get.json -func ExampleCertificatesClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGraphResourceList.json +func ExampleGraphResourcesClient_NewListGraphsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "mycertificate", + pager := client.NewListGraphsPager("rgName", + "ddb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - // TODO: use response item - _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_CreateOrUpdate.json -func ExampleCertificatesClient_BeginCreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGraphResourceGet.json +func ExampleGraphResourcesClient_GetGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "mycertificate", - armappplatform.CertificateResource{ - Properties: &armappplatform.KeyVaultCertificateProperties{ - Type: to.Ptr("KeyVaultCertificate"), - CertVersion: to.Ptr("08a219d06d874795a96db47e06fbb01e"), - KeyVaultCertName: to.Ptr("mycert"), - VaultURI: to.Ptr("https://myvault.vault.azure.net"), - }, - }, + res, err := client.GetGraph(ctx, + "rg1", + "ddb1", + "graphName", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } // TODO: use response item _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_Delete.json -func ExampleCertificatesClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGraphResourceCreateUpdate.json +func ExampleGraphResourcesClient_BeginCreateUpdateGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "mycertificate", + poller, err := client.BeginCreateUpdateGraph(ctx, + "rg1", + "ddb1", + "graphName", + armcosmos.GraphResourceCreateUpdateParameters{ + Location: to.Ptr("West US"), + Tags: map[string]*string{}, + Properties: &armcosmos.GraphResourceCreateUpdateProperties{ + Options: &armcosmos.CreateUpdateOptions{}, + Resource: &armcosmos.GraphResource{ + ID: to.Ptr("graphName"), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // TODO: use response item + _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Certificates_List.json -func ExampleCertificatesClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGraphResourceDelete.json +func ExampleGraphResourcesClient_BeginDeleteGraphResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewCertificatesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewGraphResourcesClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", - "myService", + poller, err := client.BeginDeleteGraphResource(ctx, + "rg1", + "ddb1", + "graphName", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) } } diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_gremlinresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_gremlinresources_client_test.go index 743ed8fb50d0..b6878b2e9447 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_gremlinresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_gremlinresources_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseList.json func ExampleGremlinResourcesClient_NewListGremlinDatabasesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleGremlinResourcesClient_NewListGremlinDatabasesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseGet.json func ExampleGremlinResourcesClient_GetGremlinDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleGremlinResourcesClient_GetGremlinDatabase() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinDatabase() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseDelete.json func ExampleGremlinResourcesClient_BeginDeleteGremlinDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleGremlinResourcesClient_BeginDeleteGremlinDatabase() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json func ExampleGremlinResourcesClient_GetGremlinDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +151,7 @@ func ExampleGremlinResourcesClient_GetGremlinDatabaseThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json func ExampleGremlinResourcesClient_BeginUpdateGremlinDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleGremlinResourcesClient_BeginUpdateGremlinDatabaseThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -214,7 +214,7 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToAutoscale() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -241,7 +241,7 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinDatabaseToManualThroughput _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphList.json func ExampleGremlinResourcesClient_NewListGremlinGraphsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -268,7 +268,7 @@ func ExampleGremlinResourcesClient_NewListGremlinGraphsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphGet.json func ExampleGremlinResourcesClient_GetGremlinGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -292,7 +292,7 @@ func ExampleGremlinResourcesClient_GetGremlinGraph() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphCreateUpdate.json func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -367,7 +367,7 @@ func ExampleGremlinResourcesClient_BeginCreateUpdateGremlinGraph() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphDelete.json func ExampleGremlinResourcesClient_BeginDeleteGremlinGraph() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -393,7 +393,7 @@ func ExampleGremlinResourcesClient_BeginDeleteGremlinGraph() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphThroughputGet.json func ExampleGremlinResourcesClient_GetGremlinGraphThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -417,7 +417,7 @@ func ExampleGremlinResourcesClient_GetGremlinGraphThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json func ExampleGremlinResourcesClient_BeginUpdateGremlinGraphThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -454,7 +454,7 @@ func ExampleGremlinResourcesClient_BeginUpdateGremlinGraphThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -482,7 +482,7 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToAutoscale() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -509,3 +509,34 @@ func ExampleGremlinResourcesClient_BeginMigrateGremlinGraphToManualThroughput() // TODO: use response item _ = res } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBGremlinGraphBackupInformation.json +func ExampleGremlinResourcesClient_BeginRetrieveContinuousBackupInformation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewGremlinResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginRetrieveContinuousBackupInformation(ctx, + "rgName", + "ddb1", + "databaseName", + "graphName", + armcosmos.ContinuousBackupRestoreLocation{ + Location: to.Ptr("North Europe"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_locations_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_locations_client_test.go index 9169e100bd8d..5c800e642a95 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_locations_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_locations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBLocationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBLocationList.json func ExampleLocationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleLocationsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBLocationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBLocationGet.json func ExampleLocationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_mongodbresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_mongodbresources_client_test.go index 03074f83efa6..36fb620c1680 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_mongodbresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_mongodbresources_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseList.json func ExampleMongoDBResourcesClient_NewListMongoDBDatabasesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleMongoDBResourcesClient_NewListMongoDBDatabasesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseGet.json func ExampleMongoDBResourcesClient_GetMongoDBDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleMongoDBResourcesClient_GetMongoDBDatabase() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseCreateUpdate.json func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBDatabase() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseDelete.json func ExampleMongoDBResourcesClient_BeginDeleteMongoDBDatabase() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleMongoDBResourcesClient_BeginDeleteMongoDBDatabase() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json func ExampleMongoDBResourcesClient_GetMongoDBDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +151,7 @@ func ExampleMongoDBResourcesClient_GetMongoDBDatabaseThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json func ExampleMongoDBResourcesClient_BeginUpdateMongoDBDatabaseThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleMongoDBResourcesClient_BeginUpdateMongoDBDatabaseThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -214,7 +214,7 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToAutoscale() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -241,7 +241,100 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBDatabaseToManualThroughput _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json +func ExampleMongoDBResourcesClient_BeginMongoDBContainerRetrieveThroughputDistribution() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginMongoDBContainerRetrieveThroughputDistribution(ctx, + "rg1", + "ddb1", + "databaseName", + "collectionName", + armcosmos.RetrieveThroughputParameters{ + Properties: &armcosmos.RetrieveThroughputProperties{ + Resource: &armcosmos.RetrieveThroughputPropertiesResource{ + PhysicalPartitionIDs: []*armcosmos.PhysicalPartitionID{ + { + ID: to.Ptr("0"), + }, + { + ID: to.Ptr("1"), + }}, + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json +func ExampleMongoDBResourcesClient_BeginMongoDBContainerRedistributeThroughput() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginMongoDBContainerRedistributeThroughput(ctx, + "rg1", + "ddb1", + "databaseName", + "collectionName", + armcosmos.RedistributeThroughputParameters{ + Properties: &armcosmos.RedistributeThroughputProperties{ + Resource: &armcosmos.RedistributeThroughputPropertiesResource{ + SourcePhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ + { + ID: to.Ptr("2"), + Throughput: to.Ptr[float64](5000), + }, + { + ID: to.Ptr("3"), + }}, + TargetPhysicalPartitionThroughputInfo: []*armcosmos.PhysicalPartitionThroughputInfoResource{ + { + ID: to.Ptr("0"), + Throughput: to.Ptr[float64](5000), + }, + { + ID: to.Ptr("1"), + Throughput: to.Ptr[float64](5000), + }}, + ThroughputPolicy: to.Ptr(armcosmos.ThroughputPolicyTypeCustom), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionList.json func ExampleMongoDBResourcesClient_NewListMongoDBCollectionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -268,7 +361,7 @@ func ExampleMongoDBResourcesClient_NewListMongoDBCollectionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionGet.json func ExampleMongoDBResourcesClient_GetMongoDBCollection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -292,7 +385,7 @@ func ExampleMongoDBResourcesClient_GetMongoDBCollection() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionCreateUpdate.json func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -314,7 +407,8 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection() { Properties: &armcosmos.MongoDBCollectionCreateUpdateProperties{ Options: &armcosmos.CreateUpdateOptions{}, Resource: &armcosmos.MongoDBCollectionResource{ - ID: to.Ptr("collectionName"), + AnalyticalStorageTTL: to.Ptr[int32](500), + ID: to.Ptr("collectionName"), Indexes: []*armcosmos.MongoIndex{ { Key: &armcosmos.MongoIndexKeys{ @@ -350,7 +444,7 @@ func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoDBCollection() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionDelete.json func ExampleMongoDBResourcesClient_BeginDeleteMongoDBCollection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -376,7 +470,38 @@ func ExampleMongoDBResourcesClient_BeginDeleteMongoDBCollection() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json +func ExampleMongoDBResourcesClient_BeginListMongoDBCollectionPartitionMerge() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginListMongoDBCollectionPartitionMerge(ctx, + "rgName", + "ddb1", + "databaseName", + "collectionName", + armcosmos.MergeParameters{ + IsDryRun: to.Ptr(false), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json func ExampleMongoDBResourcesClient_GetMongoDBCollectionThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -400,7 +525,7 @@ func ExampleMongoDBResourcesClient_GetMongoDBCollectionThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json func ExampleMongoDBResourcesClient_BeginUpdateMongoDBCollectionThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -437,7 +562,7 @@ func ExampleMongoDBResourcesClient_BeginUpdateMongoDBCollectionThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -465,7 +590,7 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToAutoscale() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -493,7 +618,244 @@ func ExampleMongoDBResourcesClient_BeginMigrateMongoDBCollectionToManualThroughp _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBMongoDBCollectionBackupInformation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json +func ExampleMongoDBResourcesClient_GetMongoRoleDefinition() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetMongoRoleDefinition(ctx, + "myMongoRoleDefinitionId", + "myResourceGroupName", + "myAccountName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json +func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoRoleDefinition() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateUpdateMongoRoleDefinition(ctx, + "myMongoRoleDefinitionId", + "myResourceGroupName", + "myAccountName", + armcosmos.MongoRoleDefinitionCreateUpdateParameters{ + Properties: &armcosmos.MongoRoleDefinitionResource{ + DatabaseName: to.Ptr("sales"), + Privileges: []*armcosmos.Privilege{ + { + Actions: []*string{ + to.Ptr("insert"), + to.Ptr("find")}, + Resource: &armcosmos.PrivilegeResource{ + Collection: to.Ptr("sales"), + Db: to.Ptr("sales"), + }, + }}, + RoleName: to.Ptr("myRoleName"), + Roles: []*armcosmos.Role{ + { + Db: to.Ptr("sales"), + Role: to.Ptr("myInheritedRole"), + }}, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json +func ExampleMongoDBResourcesClient_BeginDeleteMongoRoleDefinition() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDeleteMongoRoleDefinition(ctx, + "myMongoRoleDefinitionId", + "myResourceGroupName", + "myAccountName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBRoleDefinitionList.json +func ExampleMongoDBResourcesClient_NewListMongoRoleDefinitionsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListMongoRoleDefinitionsPager("myResourceGroupName", + "myAccountName", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBUserDefinitionGet.json +func ExampleMongoDBResourcesClient_GetMongoUserDefinition() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetMongoUserDefinition(ctx, + "myMongoUserDefinitionId", + "myResourceGroupName", + "myAccountName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json +func ExampleMongoDBResourcesClient_BeginCreateUpdateMongoUserDefinition() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateUpdateMongoUserDefinition(ctx, + "myMongoUserDefinitionId", + "myResourceGroupName", + "myAccountName", + armcosmos.MongoUserDefinitionCreateUpdateParameters{ + Properties: &armcosmos.MongoUserDefinitionResource{ + CustomData: to.Ptr("My custom data"), + DatabaseName: to.Ptr("sales"), + Mechanisms: to.Ptr("SCRAM-SHA-256"), + Password: to.Ptr("myPassword"), + Roles: []*armcosmos.Role{ + { + Db: to.Ptr("sales"), + Role: to.Ptr("myReadRole"), + }}, + UserName: to.Ptr("myUserName"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json +func ExampleMongoDBResourcesClient_BeginDeleteMongoUserDefinition() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDeleteMongoUserDefinition(ctx, + "myMongoUserDefinitionId", + "myResourceGroupName", + "myAccountName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBUserDefinitionList.json +func ExampleMongoDBResourcesClient_NewListMongoUserDefinitionsPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewMongoDBResourcesClient("mySubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListMongoUserDefinitionsPager("myResourceGroupName", + "myAccountName", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json func ExampleMongoDBResourcesClient_BeginRetrieveContinuousBackupInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_notebookworkspaces_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_notebookworkspaces_client_test.go index ff932f126251..3a82a4cd7ec5 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_notebookworkspaces_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_notebookworkspaces_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBNotebookWorkspaceList.json func ExampleNotebookWorkspacesClient_NewListByDatabaseAccountPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleNotebookWorkspacesClient_NewListByDatabaseAccountPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBNotebookWorkspaceGet.json func ExampleNotebookWorkspacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleNotebookWorkspacesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBNotebookWorkspaceCreate.json func ExampleNotebookWorkspacesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -93,7 +93,7 @@ func ExampleNotebookWorkspacesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBNotebookWorkspaceDelete.json func ExampleNotebookWorkspacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,7 +118,7 @@ func ExampleNotebookWorkspacesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json func ExampleNotebookWorkspacesClient_ListConnectionInfo() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -141,7 +141,7 @@ func ExampleNotebookWorkspacesClient_ListConnectionInfo() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json func ExampleNotebookWorkspacesClient_BeginRegenerateAuthToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -166,7 +166,7 @@ func ExampleNotebookWorkspacesClient_BeginRegenerateAuthToken() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBNotebookWorkspaceStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBNotebookWorkspaceStart.json func ExampleNotebookWorkspacesClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_operations_client_test.go index 837aeea723c8..d579ead6cd91 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBOperationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBOperationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeid_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeid_client_test.go index 66f7f331f546..c16c7b46aa22 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeid_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeid_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPKeyRangeIdGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json func ExamplePartitionKeyRangeIDClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeidregion_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeidregion_client_test.go index 9eec2acfdee0..4add5657f0be 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeidregion_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_partitionkeyrangeidregion_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json func ExamplePartitionKeyRangeIDRegionClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentile_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentile_client_test.go index 2feabe04137c..78e012e5b447 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentile_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentile_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPercentileGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPercentileGetMetrics.json func ExamplePercentileClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentilesourcetarget_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentilesourcetarget_client_test.go index 6675c1e5b3ef..a886df67d43d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentilesourcetarget_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentilesourcetarget_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json func ExamplePercentileSourceTargetClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentiletarget_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentiletarget_client_test.go index 91c60b8c3cd4..5569b3012b77 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentiletarget_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_percentiletarget_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPercentileTargetGetMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPercentileTargetGetMetrics.json func ExamplePercentileTargetClient_NewListMetricsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privateendpointconnections_client_test.go index 4c70f51c5dff..2b69e279aaf3 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionListGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json func ExamplePrivateEndpointConnectionsClient_NewListByDatabaseAccountPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListByDatabaseAccountPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPrivateEndpointConnectionGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateEndpointConnectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privatelinkresources_client_test.go index 98b071087fd8..8d55f248352c 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_privatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateLinkResourceListGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPrivateLinkResourceListGet.json func ExamplePrivateLinkResourcesClient_NewListByDatabaseAccountPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExamplePrivateLinkResourcesClient_NewListByDatabaseAccountPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBPrivateLinkResourceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBPrivateLinkResourceGet.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabledatabaseaccounts_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabledatabaseaccounts_client_test.go index 3ce2fae246b4..0fdce10ef137 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabledatabaseaccounts_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabledatabaseaccounts_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableDatabaseAccountList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableDatabaseAccountList.json func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListByLocationPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json func ExampleRestorableDatabaseAccountsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleRestorableDatabaseAccountsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableDatabaseAccountGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableDatabaseAccountGet.json func ExampleRestorableDatabaseAccountsClient_GetByLocation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_skus_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlindatabases_client_test.go similarity index 63% rename from sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_skus_client_test.go rename to sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlindatabases_client_test.go index 59cf777f6676..be5b316f202e 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_skus_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlindatabases_client_test.go @@ -6,28 +6,30 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armappplatform_test +package armcosmos_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Skus_List.json -func ExampleSKUsClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableGremlinDatabaseList.json +func ExampleRestorableGremlinDatabasesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewSKUsClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewRestorableGremlinDatabasesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager(nil) + pager := client.NewListPager("WestUS", + "d9b26648-2f53-4541-b3d8-3044f4f9810d", + nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlingraphs_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlingraphs_client_test.go new file mode 100644 index 000000000000..5df99b1eb8f1 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlingraphs_client_test.go @@ -0,0 +1,47 @@ +//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 armcosmos_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/cosmos/armcosmos" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableGremlinGraphList.json +func ExampleRestorableGremlinGraphsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewRestorableGremlinGraphsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("WestUS", + "98a570f2-63db-4117-91f0-366327b7b353", + &armcosmos.RestorableGremlinGraphsClientListOptions{RestorableGremlinDatabaseRid: to.Ptr("PD5DALigDgw="), + StartTime: nil, + EndTime: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlinresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlinresources_client_test.go new file mode 100644 index 000000000000..c7fc55dde23c --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablegremlinresources_client_test.go @@ -0,0 +1,46 @@ +//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 armcosmos_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/cosmos/armcosmos" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableGremlinResourceList.json +func ExampleRestorableGremlinResourcesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewRestorableGremlinResourcesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("WestUS", + "d9b26648-2f53-4541-b3d8-3044f4f9810d", + &armcosmos.RestorableGremlinResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), + RestoreTimestampInUTC: to.Ptr("10/13/2020 4:56"), + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbcollections_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbcollections_client_test.go index 2c8bf3d6fa11..2314400c5c13 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbcollections_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbcollections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableMongodbCollectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableMongodbCollectionList.json func ExampleRestorableMongodbCollectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,7 +30,10 @@ func ExampleRestorableMongodbCollectionsClient_NewListPager() { } pager := client.NewListPager("WestUS", "98a570f2-63db-4117-91f0-366327b7b353", - &armcosmos.RestorableMongodbCollectionsClientListOptions{RestorableMongodbDatabaseRid: to.Ptr("PD5DALigDgw=")}) + &armcosmos.RestorableMongodbCollectionsClientListOptions{RestorableMongodbDatabaseRid: to.Ptr("PD5DALigDgw="), + StartTime: nil, + EndTime: nil, + }) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbdatabases_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbdatabases_client_test.go index 60d972e644c5..93ad1f0c95cc 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbdatabases_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbdatabases_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableMongodbDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableMongodbDatabaseList.json func ExampleRestorableMongodbDatabasesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbresources_client_test.go index ef4d6d08aeda..f6f646536bd9 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablemongodbresources_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableMongodbResourceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableMongodbResourceList.json func ExampleRestorableMongodbResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlcontainers_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlcontainers_client_test.go index 31833311433c..2133ff0fa2ae 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlcontainers_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlcontainers_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableSqlContainerList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableSqlContainerList.json func ExampleRestorableSQLContainersClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqldatabases_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqldatabases_client_test.go index 010daaed955a..8da7c3ea7d2f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqldatabases_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqldatabases_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableSqlDatabaseList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableSqlDatabaseList.json func ExampleRestorableSQLDatabasesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlresources_client_test.go index c198df60f640..71cf70f5b869 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorablesqlresources_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBRestorableSqlResourceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableSqlResourceList.json func ExampleRestorableSQLResourcesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabletableresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabletableresources_client_test.go new file mode 100644 index 000000000000..ec3a6d4b057b --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabletableresources_client_test.go @@ -0,0 +1,46 @@ +//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 armcosmos_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/cosmos/armcosmos" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableTableResourceList.json +func ExampleRestorableTableResourcesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewRestorableTableResourcesClient("2296c272-5d55-40d9-bc05-4d56dc2d7588", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("WestUS", + "d9b26648-2f53-4541-b3d8-3044f4f9810d", + &armcosmos.RestorableTableResourcesClientListOptions{RestoreLocation: to.Ptr("WestUS"), + RestoreTimestampInUTC: to.Ptr("10/13/2020 4:56"), + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabletables_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabletables_client_test.go new file mode 100644 index 000000000000..04a0951508e5 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_restorabletables_client_test.go @@ -0,0 +1,45 @@ +//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 armcosmos_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBRestorableTableList.json +func ExampleRestorableTablesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewRestorableTablesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("WestUS", + "98a570f2-63db-4117-91f0-366327b7b353", + &armcosmos.RestorableTablesClientListOptions{StartTime: nil, + EndTime: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_serviceregistries_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_service_client_test.go similarity index 58% rename from sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_serviceregistries_client_test.go rename to sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_service_client_test.go index 65ed421eafb7..d9496f9243ed 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_serviceregistries_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_service_client_test.go @@ -6,54 +6,65 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armappplatform_test +package armcosmos_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/appplatform/armappplatform" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_Get.json -func ExampleServiceRegistriesClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBServicesList.json +func ExampleServiceClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServiceRegistriesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewServiceClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "default", + pager := client.NewListPager("rg1", + "ddb1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - // TODO: use response item - _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_CreateOrUpdate.json -func ExampleServiceRegistriesClient_BeginCreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDataTransferServiceCreate.json +func ExampleServiceClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServiceRegistriesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewServiceClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "default", + poller, err := client.BeginCreate(ctx, + "rg1", + "ddb1", + "DataTransfer", + armcosmos.ServiceResourceCreateUpdateParameters{ + Properties: &armcosmos.ServiceResourceCreateUpdateProperties{ + InstanceCount: to.Ptr[int32](1), + InstanceSize: to.Ptr(armcosmos.ServiceSizeCosmosD4S), + ServiceType: to.Ptr(armcosmos.ServiceTypeDataTransfer), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -66,53 +77,50 @@ func ExampleServiceRegistriesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_Delete.json -func ExampleServiceRegistriesClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDataTransferServiceGet.json +func ExampleServiceClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServiceRegistriesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewServiceClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "default", + res, err := client.Get(ctx, + "rg1", + "ddb1", + "DataTransfer", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } + // TODO: use response item + _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/ServiceRegistries_List.json -func ExampleServiceRegistriesClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBDataTransferServiceDelete.json +func ExampleServiceClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewServiceRegistriesClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armcosmos.NewServiceClient("subid", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", - "myservice", + poller, err := client.BeginDelete(ctx, + "rg1", + "ddb1", + "DataTransfer", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) } } diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_sqlresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_sqlresources_client_test.go index 6ed428807e56..515cba55d0d6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_sqlresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_sqlresources_client_test.go @@ -17,7 +17,101 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBSqlContainerBackupInformation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBSqlClientEncryptionKeysList.json +func ExampleSQLResourcesClient_NewListClientEncryptionKeysPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewSQLResourcesClient("subId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListClientEncryptionKeysPager("rgName", + "accountName", + "databaseName", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json +func ExampleSQLResourcesClient_GetClientEncryptionKey() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewSQLResourcesClient("subId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetClientEncryptionKey(ctx, + "rgName", + "accountName", + "databaseName", + "cekName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json +func ExampleSQLResourcesClient_BeginCreateUpdateClientEncryptionKey() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewSQLResourcesClient("subId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateUpdateClientEncryptionKey(ctx, + "rgName", + "accountName", + "databaseName", + "cekName", + armcosmos.ClientEncryptionKeyCreateUpdateParameters{ + Properties: &armcosmos.ClientEncryptionKeyCreateUpdateProperties{ + Resource: &armcosmos.ClientEncryptionKeyResource{ + EncryptionAlgorithm: to.Ptr("AEAD_AES_256_CBC_HMAC_SHA256"), + ID: to.Ptr("cekName"), + KeyWrapMetadata: &armcosmos.KeyWrapMetadata{ + Name: to.Ptr("customerManagedKey"), + Type: to.Ptr("AzureKeyVault"), + Algorithm: to.Ptr("RSA-OAEP"), + Value: to.Ptr("AzureKeyVault Key URL"), + }, + WrappedDataEncryptionKey: []byte("This is actually an array of bytes. This request/response is being presented as a string for readability in the example"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBSqlContainerBackupInformation.json func ExampleSQLResourcesClient_BeginRetrieveContinuousBackupInformation() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_tableresources_client_test.go b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_tableresources_client_test.go index 2e5aaad1e675..cbea2a763144 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_tableresources_client_test.go +++ b/sdk/resourcemanager/cosmos/armcosmos/ze_generated_example_tableresources_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cosmos/armcosmos" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableList.json func ExampleTableResourcesClient_NewListTablesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleTableResourcesClient_NewListTablesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableGet.json func ExampleTableResourcesClient_GetTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleTableResourcesClient_GetTable() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableCreateUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableCreateUpdate.json func ExampleTableResourcesClient_BeginCreateUpdateTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleTableResourcesClient_BeginCreateUpdateTable() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableDelete.json func ExampleTableResourcesClient_BeginDeleteTable() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleTableResourcesClient_BeginDeleteTable() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableThroughputGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableThroughputGet.json func ExampleTableResourcesClient_GetTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -151,7 +151,7 @@ func ExampleTableResourcesClient_GetTableThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableThroughputUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableThroughputUpdate.json func ExampleTableResourcesClient_BeginUpdateTableThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -187,7 +187,7 @@ func ExampleTableResourcesClient_BeginUpdateTableThroughput() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableMigrateToAutoscale.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableMigrateToAutoscale.json func ExampleTableResourcesClient_BeginMigrateTableToAutoscale() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -214,7 +214,7 @@ func ExampleTableResourcesClient_BeginMigrateTableToAutoscale() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2021-10-15/examples/CosmosDBTableMigrateToManualThroughput.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableMigrateToManualThroughput.json func ExampleTableResourcesClient_BeginMigrateTableToManualThroughput() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -240,3 +240,33 @@ func ExampleTableResourcesClient_BeginMigrateTableToManualThroughput() { // TODO: use response item _ = res } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2022-02-15-preview/examples/CosmosDBTableBackupInformation.json +func ExampleTableResourcesClient_BeginRetrieveContinuousBackupInformation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armcosmos.NewTableResourcesClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginRetrieveContinuousBackupInformation(ctx, + "rgName", + "ddb1", + "tableName1", + armcosmos.ContinuousBackupRestoreLocation{ + Location: to.Ptr("North Europe"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraclusters_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraclusters_client.go index 95ffcfac76d2..b5dc8a5a2ca7 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraclusters_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraclusters_client.go @@ -57,7 +57,7 @@ func NewCassandraClustersClient(subscriptionID string, credential azcore.TokenCr // BeginCreateUpdate - Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. // To update only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // body - The properties specifying the desired state of the managed Cassandra cluster. @@ -78,7 +78,7 @@ func (client *CassandraClustersClient) BeginCreateUpdate(ctx context.Context, re // CreateUpdate - Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To // update only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraClustersClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource, options *CassandraClustersClientBeginCreateUpdateOptions) (*http.Response, error) { req, err := client.createUpdateCreateRequest(ctx, resourceGroupName, clusterName, body, options) if err != nil { @@ -114,7 +114,7 @@ func (client *CassandraClustersClient) createUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -124,7 +124,7 @@ func (client *CassandraClustersClient) createUpdateCreateRequest(ctx context.Con // host virtual machine of this cluster, and reserved the data disk. This won't do anything on an // already deallocated cluster. Use Start to restart the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientBeginDeallocateOptions contains the optional parameters for the CassandraClustersClient.BeginDeallocate @@ -145,7 +145,7 @@ func (client *CassandraClustersClient) BeginDeallocate(ctx context.Context, reso // virtual machine of this cluster, and reserved the data disk. This won't do anything on an // already deallocated cluster. Use Start to restart the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraClustersClient) deallocate(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginDeallocateOptions) (*http.Response, error) { req, err := client.deallocateCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -181,7 +181,7 @@ func (client *CassandraClustersClient) deallocateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *CassandraClustersClient) deallocateCreateRequest(ctx context.Conte // BeginDelete - Deletes a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientBeginDeleteOptions contains the optional parameters for the CassandraClustersClient.BeginDelete @@ -208,7 +208,7 @@ func (client *CassandraClustersClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -244,7 +244,7 @@ func (client *CassandraClustersClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,7 +252,7 @@ func (client *CassandraClustersClient) deleteCreateRequest(ctx context.Context, // Get - Get the properties of a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientGetOptions contains the optional parameters for the CassandraClustersClient.Get method. @@ -291,7 +291,7 @@ func (client *CassandraClustersClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,9 +306,71 @@ func (client *CassandraClustersClient) getHandleResponse(resp *http.Response) (C return result, nil } +// GetBackup - Get the properties of an individual backup of this cluster that is available to restore. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// clusterName - Managed Cassandra cluster name. +// backupID - Id of a restorable backup of a Cassandra cluster. +// options - CassandraClustersClientGetBackupOptions contains the optional parameters for the CassandraClustersClient.GetBackup +// method. +func (client *CassandraClustersClient) GetBackup(ctx context.Context, resourceGroupName string, clusterName string, backupID string, options *CassandraClustersClientGetBackupOptions) (CassandraClustersClientGetBackupResponse, error) { + req, err := client.getBackupCreateRequest(ctx, resourceGroupName, clusterName, backupID, options) + if err != nil { + return CassandraClustersClientGetBackupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CassandraClustersClientGetBackupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CassandraClustersClientGetBackupResponse{}, runtime.NewResponseError(resp) + } + return client.getBackupHandleResponse(resp) +} + +// getBackupCreateRequest creates the GetBackup request. +func (client *CassandraClustersClient) getBackupCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, backupID string, options *CassandraClustersClientGetBackupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}" + 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 clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + if backupID == "" { + return nil, errors.New("parameter backupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{backupId}", url.PathEscape(backupID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getBackupHandleResponse handles the GetBackup response. +func (client *CassandraClustersClient) getBackupHandleResponse(resp *http.Response) (CassandraClustersClientGetBackupResponse, error) { + result := CassandraClustersClientGetBackupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BackupResource); err != nil { + return CassandraClustersClientGetBackupResponse{}, err + } + return result, nil +} + // BeginInvokeCommand - Invoke a command like nodetool for cassandra maintenance // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // body - Specification which command to run where @@ -328,7 +390,7 @@ func (client *CassandraClustersClient) BeginInvokeCommand(ctx context.Context, r // InvokeCommand - Invoke a command like nodetool for cassandra maintenance // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraClustersClient) invokeCommand(ctx context.Context, resourceGroupName string, clusterName string, body CommandPostBody, options *CassandraClustersClientBeginInvokeCommandOptions) (*http.Response, error) { req, err := client.invokeCommandCreateRequest(ctx, resourceGroupName, clusterName, body, options) if err != nil { @@ -364,15 +426,79 @@ func (client *CassandraClustersClient) invokeCommandCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) } +// NewListBackupsPager - List the backups of this cluster that are available to restore. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// clusterName - Managed Cassandra cluster name. +// options - CassandraClustersClientListBackupsOptions contains the optional parameters for the CassandraClustersClient.ListBackups +// method. +func (client *CassandraClustersClient) NewListBackupsPager(resourceGroupName string, clusterName string, options *CassandraClustersClientListBackupsOptions) *runtime.Pager[CassandraClustersClientListBackupsResponse] { + return runtime.NewPager(runtime.PagingHandler[CassandraClustersClientListBackupsResponse]{ + More: func(page CassandraClustersClientListBackupsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *CassandraClustersClientListBackupsResponse) (CassandraClustersClientListBackupsResponse, error) { + req, err := client.listBackupsCreateRequest(ctx, resourceGroupName, clusterName, options) + if err != nil { + return CassandraClustersClientListBackupsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CassandraClustersClientListBackupsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CassandraClustersClientListBackupsResponse{}, runtime.NewResponseError(resp) + } + return client.listBackupsHandleResponse(resp) + }, + }) +} + +// listBackupsCreateRequest creates the ListBackups request. +func (client *CassandraClustersClient) listBackupsCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientListBackupsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups" + 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 clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBackupsHandleResponse handles the ListBackups response. +func (client *CassandraClustersClient) listBackupsHandleResponse(resp *http.Response) (CassandraClustersClientListBackupsResponse, error) { + result := CassandraClustersClientListBackupsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListBackups); err != nil { + return CassandraClustersClientListBackupsResponse{}, err + } + return result, nil +} + // NewListByResourceGroupPager - List all managed Cassandra clusters in this resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.ListByResourceGroup // method. @@ -414,7 +540,7 @@ func (client *CassandraClustersClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -431,7 +557,7 @@ func (client *CassandraClustersClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List all managed Cassandra clusters in this subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // options - CassandraClustersClientListBySubscriptionOptions contains the optional parameters for the CassandraClustersClient.ListBySubscription // method. func (client *CassandraClustersClient) NewListBySubscriptionPager(options *CassandraClustersClientListBySubscriptionOptions) *runtime.Pager[CassandraClustersClientListBySubscriptionResponse] { @@ -468,7 +594,7 @@ func (client *CassandraClustersClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -487,7 +613,7 @@ func (client *CassandraClustersClient) listBySubscriptionHandleResponse(resp *ht // of this cluster with reserved data disk. This won't do anything on an already running // cluster. Use Deallocate to deallocate the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientBeginStartOptions contains the optional parameters for the CassandraClustersClient.BeginStart @@ -508,7 +634,7 @@ func (client *CassandraClustersClient) BeginStart(ctx context.Context, resourceG // cluster with reserved data disk. This won't do anything on an already running // cluster. Use Deallocate to deallocate the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraClustersClient) start(ctx context.Context, resourceGroupName string, clusterName string, options *CassandraClustersClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -544,7 +670,7 @@ func (client *CassandraClustersClient) startCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -552,7 +678,7 @@ func (client *CassandraClustersClient) startCreateRequest(ctx context.Context, r // Status - Gets the CPU, memory, and disk usage statistics for each Cassandra node in a cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraClustersClientStatusOptions contains the optional parameters for the CassandraClustersClient.Status @@ -592,7 +718,7 @@ func (client *CassandraClustersClient) statusCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -609,7 +735,7 @@ func (client *CassandraClustersClient) statusHandleResponse(resp *http.Response) // BeginUpdate - Updates some of the properties of a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // body - Parameters to provide for specifying the managed Cassandra cluster. @@ -629,7 +755,7 @@ func (client *CassandraClustersClient) BeginUpdate(ctx context.Context, resource // Update - Updates some of the properties of a managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, body ClusterResource, options *CassandraClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, body, options) if err != nil { @@ -665,7 +791,7 @@ func (client *CassandraClustersClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandradatacenters_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandradatacenters_client.go index aa2e1e763947..fa003a9ac51f 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandradatacenters_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandradatacenters_client.go @@ -57,7 +57,7 @@ func NewCassandraDataCentersClient(subscriptionID string, credential azcore.Toke // BeginCreateUpdate - Create or update a managed Cassandra data center. When updating, overwrite all properties. To update // only some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -79,7 +79,7 @@ func (client *CassandraDataCentersClient) BeginCreateUpdate(ctx context.Context, // CreateUpdate - Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only // some properties, use PATCH. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraDataCentersClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource, options *CassandraDataCentersClientBeginCreateUpdateOptions) (*http.Response, error) { req, err := client.createUpdateCreateRequest(ctx, resourceGroupName, clusterName, dataCenterName, body, options) if err != nil { @@ -119,7 +119,7 @@ func (client *CassandraDataCentersClient) createUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) @@ -127,7 +127,7 @@ func (client *CassandraDataCentersClient) createUpdateCreateRequest(ctx context. // BeginDelete - Delete a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -147,7 +147,7 @@ func (client *CassandraDataCentersClient) BeginDelete(ctx context.Context, resou // Delete - Delete a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraDataCentersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, options *CassandraDataCentersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, dataCenterName, options) if err != nil { @@ -187,7 +187,7 @@ func (client *CassandraDataCentersClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +195,7 @@ func (client *CassandraDataCentersClient) deleteCreateRequest(ctx context.Contex // Get - Get the properties of a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -240,7 +240,7 @@ func (client *CassandraDataCentersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,7 +257,7 @@ func (client *CassandraDataCentersClient) getHandleResponse(resp *http.Response) // NewListPager - List all data centers in a particular managed Cassandra cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // options - CassandraDataCentersClientListOptions contains the optional parameters for the CassandraDataCentersClient.List @@ -304,7 +304,7 @@ func (client *CassandraDataCentersClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -321,7 +321,7 @@ func (client *CassandraDataCentersClient) listHandleResponse(resp *http.Response // BeginUpdate - Update some of the properties of a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // clusterName - Managed Cassandra cluster name. // dataCenterName - Data center name in a managed Cassandra cluster. @@ -342,7 +342,7 @@ func (client *CassandraDataCentersClient) BeginUpdate(ctx context.Context, resou // Update - Update some of the properties of a managed Cassandra data center. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraDataCentersClient) update(ctx context.Context, resourceGroupName string, clusterName string, dataCenterName string, body DataCenterResource, options *CassandraDataCentersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, dataCenterName, body, options) if err != nil { @@ -382,7 +382,7 @@ func (client *CassandraDataCentersClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, body) diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraresources_client.go index 27a6f24478f7..5df2f73862f9 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_cassandraresources_client.go @@ -56,7 +56,7 @@ func NewCassandraResourcesClient(subscriptionID string, credential azcore.TokenC // BeginCreateUpdateCassandraKeyspace - Create or update an Azure Cosmos DB Cassandra keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -77,7 +77,7 @@ func (client *CassandraResourcesClient) BeginCreateUpdateCassandraKeyspace(ctx c // CreateUpdateCassandraKeyspace - Create or update an Azure Cosmos DB Cassandra keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) createUpdateCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, createUpdateCassandraKeyspaceParameters CassandraKeyspaceCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraKeyspaceOptions) (*http.Response, error) { req, err := client.createUpdateCassandraKeyspaceCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, options) if err != nil { @@ -117,7 +117,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraKeyspaceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateCassandraKeyspaceParameters) @@ -125,7 +125,7 @@ func (client *CassandraResourcesClient) createUpdateCassandraKeyspaceCreateReque // BeginCreateUpdateCassandraTable - Create or update an Azure Cosmos DB Cassandra Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -147,7 +147,7 @@ func (client *CassandraResourcesClient) BeginCreateUpdateCassandraTable(ctx cont // CreateUpdateCassandraTable - Create or update an Azure Cosmos DB Cassandra Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) createUpdateCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, createUpdateCassandraTableParameters CassandraTableCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraTableOptions) (*http.Response, error) { req, err := client.createUpdateCassandraTableCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, options) if err != nil { @@ -191,15 +191,89 @@ func (client *CassandraResourcesClient) createUpdateCassandraTableCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateCassandraTableParameters) } +// BeginCreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// viewName - Cosmos DB view name. +// createUpdateCassandraViewParameters - The parameters to provide for the current Cassandra View. +// options - CassandraResourcesClientBeginCreateUpdateCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraView +// method. +func (client *CassandraResourcesClient) BeginCreateUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientCreateUpdateCassandraViewResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createUpdateCassandraView(ctx, resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CassandraResourcesClientCreateUpdateCassandraViewResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[CassandraResourcesClientCreateUpdateCassandraViewResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateUpdateCassandraView - Create or update an Azure Cosmos DB Cassandra View +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *CassandraResourcesClient) createUpdateCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*http.Response, error) { + req, err := client.createUpdateCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createUpdateCassandraViewCreateRequest creates the CreateUpdateCassandraView request. +func (client *CassandraResourcesClient) createUpdateCassandraViewCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, createUpdateCassandraViewParameters CassandraViewCreateUpdateParameters, options *CassandraResourcesClientBeginCreateUpdateCassandraViewOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + if viewName == "" { + return nil, errors.New("parameter viewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, createUpdateCassandraViewParameters) +} + // BeginDeleteCassandraKeyspace - Deletes an existing Azure Cosmos DB Cassandra keyspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -219,7 +293,7 @@ func (client *CassandraResourcesClient) BeginDeleteCassandraKeyspace(ctx context // DeleteCassandraKeyspace - Deletes an existing Azure Cosmos DB Cassandra keyspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) deleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions) (*http.Response, error) { req, err := client.deleteCassandraKeyspaceCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) if err != nil { @@ -259,14 +333,14 @@ func (client *CassandraResourcesClient) deleteCassandraKeyspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteCassandraTable - Deletes an existing Azure Cosmos DB Cassandra table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -287,7 +361,7 @@ func (client *CassandraResourcesClient) BeginDeleteCassandraTable(ctx context.Co // DeleteCassandraTable - Deletes an existing Azure Cosmos DB Cassandra table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) deleteCassandraTable(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginDeleteCassandraTableOptions) (*http.Response, error) { req, err := client.deleteCassandraTableCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, options) if err != nil { @@ -331,7 +405,79 @@ func (client *CassandraResourcesClient) deleteCassandraTableCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// BeginDeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// viewName - Cosmos DB view name. +// options - CassandraResourcesClientBeginDeleteCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraView +// method. +func (client *CassandraResourcesClient) BeginDeleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*runtime.Poller[CassandraResourcesClientDeleteCassandraViewResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteCassandraView(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CassandraResourcesClientDeleteCassandraViewResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[CassandraResourcesClientDeleteCassandraViewResponse](options.ResumeToken, client.pl, nil) + } +} + +// DeleteCassandraView - Deletes an existing Azure Cosmos DB Cassandra view. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *CassandraResourcesClient) deleteCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*http.Response, error) { + req, err := client.deleteCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCassandraViewCreateRequest creates the DeleteCassandraView request. +func (client *CassandraResourcesClient) deleteCassandraViewCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginDeleteCassandraViewOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + if viewName == "" { + return nil, errors.New("parameter viewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -339,7 +485,7 @@ func (client *CassandraResourcesClient) deleteCassandraTableCreateRequest(ctx co // GetCassandraKeyspace - Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided // name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -384,7 +530,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +548,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceHandleResponse(resp // GetCassandraKeyspaceThroughput - Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -447,7 +593,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +610,7 @@ func (client *CassandraResourcesClient) getCassandraKeyspaceThroughputHandleResp // GetCassandraTable - Gets the Cassandra table under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -514,7 +660,7 @@ func (client *CassandraResourcesClient) getCassandraTableCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -532,7 +678,7 @@ func (client *CassandraResourcesClient) getCassandraTableHandleResponse(resp *ht // GetCassandraTableThroughput - Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -582,7 +728,7 @@ func (client *CassandraResourcesClient) getCassandraTableThroughputCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -597,9 +743,144 @@ func (client *CassandraResourcesClient) getCassandraTableThroughputHandleRespons return result, nil } +// GetCassandraView - Gets the Cassandra view under an existing Azure Cosmos DB database account. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// viewName - Cosmos DB view name. +// options - CassandraResourcesClientGetCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraView +// method. +func (client *CassandraResourcesClient) GetCassandraView(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewOptions) (CassandraResourcesClientGetCassandraViewResponse, error) { + req, err := client.getCassandraViewCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return CassandraResourcesClientGetCassandraViewResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CassandraResourcesClientGetCassandraViewResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CassandraResourcesClientGetCassandraViewResponse{}, runtime.NewResponseError(resp) + } + return client.getCassandraViewHandleResponse(resp) +} + +// getCassandraViewCreateRequest creates the GetCassandraView request. +func (client *CassandraResourcesClient) getCassandraViewCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + if viewName == "" { + return nil, errors.New("parameter viewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getCassandraViewHandleResponse handles the GetCassandraView response. +func (client *CassandraResourcesClient) getCassandraViewHandleResponse(resp *http.Response) (CassandraResourcesClientGetCassandraViewResponse, error) { + result := CassandraResourcesClientGetCassandraViewResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CassandraViewGetResults); err != nil { + return CassandraResourcesClientGetCassandraViewResponse{}, err + } + return result, nil +} + +// GetCassandraViewThroughput - Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account +// with the provided name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// viewName - Cosmos DB view name. +// options - CassandraResourcesClientGetCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraViewThroughput +// method. +func (client *CassandraResourcesClient) GetCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewThroughputOptions) (CassandraResourcesClientGetCassandraViewThroughputResponse, error) { + req, err := client.getCassandraViewThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CassandraResourcesClientGetCassandraViewThroughputResponse{}, runtime.NewResponseError(resp) + } + return client.getCassandraViewThroughputHandleResponse(resp) +} + +// getCassandraViewThroughputCreateRequest creates the GetCassandraViewThroughput request. +func (client *CassandraResourcesClient) getCassandraViewThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientGetCassandraViewThroughputOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + if viewName == "" { + return nil, errors.New("parameter viewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getCassandraViewThroughputHandleResponse handles the GetCassandraViewThroughput response. +func (client *CassandraResourcesClient) getCassandraViewThroughputHandleResponse(resp *http.Response) (CassandraResourcesClientGetCassandraViewThroughputResponse, error) { + result := CassandraResourcesClientGetCassandraViewThroughputResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ThroughputSettingsGetResults); err != nil { + return CassandraResourcesClientGetCassandraViewThroughputResponse{}, err + } + return result, nil +} + // NewListCassandraKeyspacesPager - Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - CassandraResourcesClientListCassandraKeyspacesOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraKeyspaces @@ -646,7 +927,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -663,7 +944,7 @@ func (client *CassandraResourcesClient) listCassandraKeyspacesHandleResponse(res // NewListCassandraTablesPager - Lists the Cassandra table under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -715,7 +996,7 @@ func (client *CassandraResourcesClient) listCassandraTablesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -730,9 +1011,78 @@ func (client *CassandraResourcesClient) listCassandraTablesHandleResponse(resp * return result, nil } +// NewListCassandraViewsPager - Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// options - CassandraResourcesClientListCassandraViewsOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraViews +// method. +func (client *CassandraResourcesClient) NewListCassandraViewsPager(resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientListCassandraViewsOptions) *runtime.Pager[CassandraResourcesClientListCassandraViewsResponse] { + return runtime.NewPager(runtime.PagingHandler[CassandraResourcesClientListCassandraViewsResponse]{ + More: func(page CassandraResourcesClientListCassandraViewsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *CassandraResourcesClientListCassandraViewsResponse) (CassandraResourcesClientListCassandraViewsResponse, error) { + req, err := client.listCassandraViewsCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) + if err != nil { + return CassandraResourcesClientListCassandraViewsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return CassandraResourcesClientListCassandraViewsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return CassandraResourcesClientListCassandraViewsResponse{}, runtime.NewResponseError(resp) + } + return client.listCassandraViewsHandleResponse(resp) + }, + }) +} + +// listCassandraViewsCreateRequest creates the ListCassandraViews request. +func (client *CassandraResourcesClient) listCassandraViewsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientListCassandraViewsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listCassandraViewsHandleResponse handles the ListCassandraViews response. +func (client *CassandraResourcesClient) listCassandraViewsHandleResponse(resp *http.Response) (CassandraResourcesClientListCassandraViewsResponse, error) { + result := CassandraResourcesClientListCassandraViewsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CassandraViewListResult); err != nil { + return CassandraResourcesClientListCassandraViewsResponse{}, err + } + return result, nil +} + // BeginMigrateCassandraKeyspaceToAutoscale - Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -752,7 +1102,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraKeyspaceToAutoscale // MigrateCassandraKeyspaceToAutoscale - Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateCassandraKeyspaceToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) if err != nil { @@ -792,7 +1142,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -801,7 +1151,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToAutoscaleCreat // BeginMigrateCassandraKeyspaceToManualThroughput - Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual // throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -821,7 +1171,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraKeyspaceToManualThr // MigrateCassandraKeyspaceToManualThroughput - Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, options *CassandraResourcesClientBeginMigrateCassandraKeyspaceToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateCassandraKeyspaceToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, options) if err != nil { @@ -861,7 +1211,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughp return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -869,7 +1219,7 @@ func (client *CassandraResourcesClient) migrateCassandraKeyspaceToManualThroughp // BeginMigrateCassandraTableToAutoscale - Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -890,7 +1240,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraTableToAutoscale(ct // MigrateCassandraTableToAutoscale - Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) migrateCassandraTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginMigrateCassandraTableToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateCassandraTableToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, options) if err != nil { @@ -934,7 +1284,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToAutoscaleCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -942,7 +1292,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToAutoscaleCreateRe // BeginMigrateCassandraTableToManualThroughput - Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -963,7 +1313,7 @@ func (client *CassandraResourcesClient) BeginMigrateCassandraTableToManualThroug // MigrateCassandraTableToManualThroughput - Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, options *CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateCassandraTableToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, options) if err != nil { @@ -1007,7 +1357,153 @@ func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughputC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginMigrateCassandraViewToAutoscale - Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// viewName - Cosmos DB view name. +// options - CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions contains the optional parameters for the +// CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale method. +func (client *CassandraResourcesClient) BeginMigrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.migrateCassandraViewToAutoscale(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse](options.ResumeToken, client.pl, nil) + } +} + +// MigrateCassandraViewToAutoscale - Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *CassandraResourcesClient) migrateCassandraViewToAutoscale(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*http.Response, error) { + req, err := client.migrateCassandraViewToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// migrateCassandraViewToAutoscaleCreateRequest creates the MigrateCassandraViewToAutoscale request. +func (client *CassandraResourcesClient) migrateCassandraViewToAutoscaleCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + if viewName == "" { + return nil, errors.New("parameter viewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginMigrateCassandraViewToManualThroughput - Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// viewName - Cosmos DB view name. +// options - CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions contains the optional parameters for +// the CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput method. +func (client *CassandraResourcesClient) BeginMigrateCassandraViewToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*runtime.Poller[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.migrateCassandraViewToManualThroughput(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse](options.ResumeToken, client.pl, nil) + } +} + +// MigrateCassandraViewToManualThroughput - Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *CassandraResourcesClient) migrateCassandraViewToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*http.Response, error) { + req, err := client.migrateCassandraViewToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// migrateCassandraViewToManualThroughputCreateRequest creates the MigrateCassandraViewToManualThroughput request. +func (client *CassandraResourcesClient) migrateCassandraViewToManualThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, options *CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + if viewName == "" { + return nil, errors.New("parameter viewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) + 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-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1015,7 +1511,7 @@ func (client *CassandraResourcesClient) migrateCassandraTableToManualThroughputC // BeginUpdateCassandraKeyspaceThroughput - Update RUs per second of an Azure Cosmos DB Cassandra Keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1036,7 +1532,7 @@ func (client *CassandraResourcesClient) BeginUpdateCassandraKeyspaceThroughput(c // UpdateCassandraKeyspaceThroughput - Update RUs per second of an Azure Cosmos DB Cassandra Keyspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions) (*http.Response, error) { req, err := client.updateCassandraKeyspaceThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, updateThroughputParameters, options) if err != nil { @@ -1076,7 +1572,7 @@ func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughputCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -1084,7 +1580,7 @@ func (client *CassandraResourcesClient) updateCassandraKeyspaceThroughputCreateR // BeginUpdateCassandraTableThroughput - Update RUs per second of an Azure Cosmos DB Cassandra table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyspaceName - Cosmos DB keyspace name. @@ -1106,7 +1602,7 @@ func (client *CassandraResourcesClient) BeginUpdateCassandraTableThroughput(ctx // UpdateCassandraTableThroughput - Update RUs per second of an Azure Cosmos DB Cassandra table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *CassandraResourcesClient) updateCassandraTableThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions) (*http.Response, error) { req, err := client.updateCassandraTableThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, options) if err != nil { @@ -1150,7 +1646,81 @@ func (client *CassandraResourcesClient) updateCassandraTableThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, updateThroughputParameters) +} + +// BeginUpdateCassandraViewThroughput - Update RUs per second of an Azure Cosmos DB Cassandra view +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// keyspaceName - Cosmos DB keyspace name. +// viewName - Cosmos DB view name. +// updateThroughputParameters - The RUs per second of the parameters to provide for the current Cassandra view. +// options - CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraViewThroughput +// method. +func (client *CassandraResourcesClient) BeginUpdateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*runtime.Poller[CassandraResourcesClientUpdateCassandraViewThroughputResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateCassandraViewThroughput(ctx, resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[CassandraResourcesClientUpdateCassandraViewThroughputResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[CassandraResourcesClientUpdateCassandraViewThroughputResponse](options.ResumeToken, client.pl, nil) + } +} + +// UpdateCassandraViewThroughput - Update RUs per second of an Azure Cosmos DB Cassandra view +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *CassandraResourcesClient) updateCassandraViewThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*http.Response, error) { + req, err := client.updateCassandraViewThroughputCreateRequest(ctx, resourceGroupName, accountName, keyspaceName, viewName, updateThroughputParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCassandraViewThroughputCreateRequest creates the UpdateCassandraViewThroughput request. +func (client *CassandraResourcesClient) updateCassandraViewThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string, viewName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if keyspaceName == "" { + return nil, errors.New("parameter keyspaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{keyspaceName}", url.PathEscape(keyspaceName)) + if viewName == "" { + return nil, errors.New("parameter viewName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{viewName}", url.PathEscape(viewName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collection_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collection_client.go index 29354c7c1c52..6fb0f1189a41 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collection_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collection_client.go @@ -56,7 +56,7 @@ func NewCollectionClient(subscriptionID string, credential azcore.TokenCredentia // NewListMetricDefinitionsPager - Retrieves metric definitions for the given collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -113,7 +113,7 @@ func (client *CollectionClient) listMetricDefinitionsCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -130,7 +130,7 @@ func (client *CollectionClient) listMetricDefinitionsHandleResponse(resp *http.R // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -189,7 +189,7 @@ func (client *CollectionClient) listMetricsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -207,7 +207,7 @@ func (client *CollectionClient) listMetricsHandleResponse(resp *http.Response) ( // NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -263,7 +263,7 @@ func (client *CollectionClient) listUsagesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartition_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartition_client.go index 0c9e414ef676..0b85552ecdfa 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartition_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartition_client.go @@ -56,7 +56,7 @@ func NewCollectionPartitionClient(subscriptionID string, credential azcore.Token // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given collection, split by partition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -116,7 +116,7 @@ func (client *CollectionPartitionClient) listMetricsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -134,7 +134,7 @@ func (client *CollectionPartitionClient) listMetricsHandleResponse(resp *http.Re // NewListUsagesPager - Retrieves the usages (most recent storage data) for the given collection, split by partition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -191,7 +191,7 @@ func (client *CollectionPartitionClient) listUsagesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartitionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartitionregion_client.go index 63e3c7730d90..2f9f56ed6382 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartitionregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionpartitionregion_client.go @@ -57,7 +57,7 @@ func NewCollectionPartitionRegionClient(subscriptionID string, credential azcore // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given collection and region, split by // partition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -122,7 +122,7 @@ func (client *CollectionPartitionRegionClient) listMetricsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionregion_client.go index b1ac87cbab3f..d1240d96d78b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_collectionregion_client.go @@ -57,7 +57,7 @@ func NewCollectionRegionClient(subscriptionID string, credential azcore.TokenCre // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account, collection and // region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -122,7 +122,7 @@ func (client *CollectionRegionClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_constants.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_constants.go index cd28874274f3..9e65777c5d0b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_constants.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_constants.go @@ -10,7 +10,7 @@ package armcosmos const ( moduleName = "armcosmos" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) // APIType - Enum to indicate the API type of the restorable database account. @@ -55,11 +55,12 @@ func PossibleAnalyticalStorageSchemaTypeValues() []AnalyticalStorageSchemaType { // AuthenticationMethod - Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, // so should not be used except in emergencies. 'Cassandra' is the default password based -// authentication. The default is 'Cassandra'. +// authentication. The default is 'Cassandra'. 'Ldap' is in preview. type AuthenticationMethod string const ( AuthenticationMethodCassandra AuthenticationMethod = "Cassandra" + AuthenticationMethodLdap AuthenticationMethod = "Ldap" AuthenticationMethodNone AuthenticationMethod = "None" ) @@ -67,6 +68,7 @@ const ( func PossibleAuthenticationMethodValues() []AuthenticationMethod { return []AuthenticationMethod{ AuthenticationMethodCassandra, + AuthenticationMethodLdap, AuthenticationMethodNone, } } @@ -195,6 +197,22 @@ func PossibleConnectorOfferValues() []ConnectorOffer { } } +// ContinuousTier - Enum to indicate type of Continuous backup tier. +type ContinuousTier string + +const ( + ContinuousTierContinuous30Days ContinuousTier = "Continuous30Days" + ContinuousTierContinuous7Days ContinuousTier = "Continuous7Days" +) + +// PossibleContinuousTierValues returns the possible values for the ContinuousTier const type. +func PossibleContinuousTierValues() []ContinuousTier { + return []ContinuousTier{ + ContinuousTierContinuous30Days, + ContinuousTierContinuous7Days, + } +} + // CreateMode - Enum to indicate the mode of account creation. type CreateMode string @@ -231,6 +249,23 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +type DataTransferComponent string + +const ( + DataTransferComponentAzureBlobStorage DataTransferComponent = "AzureBlobStorage" + DataTransferComponentCosmosDBCassandra DataTransferComponent = "CosmosDBCassandra" + DataTransferComponentCosmosDBSQL DataTransferComponent = "CosmosDBSql" +) + +// PossibleDataTransferComponentValues returns the possible values for the DataTransferComponent const type. +func PossibleDataTransferComponentValues() []DataTransferComponent { + return []DataTransferComponent{ + DataTransferComponentAzureBlobStorage, + DataTransferComponentCosmosDBCassandra, + DataTransferComponentCosmosDBSQL, + } +} + // DataType - The datatype for which the indexing behavior is applied to. type DataType string @@ -295,6 +330,24 @@ func PossibleDefaultConsistencyLevelValues() []DefaultConsistencyLevel { } } +// EnableFullTextQuery - Describe the level of detail with which queries are to be logged. +type EnableFullTextQuery string + +const ( + EnableFullTextQueryNone EnableFullTextQuery = "None" + EnableFullTextQueryTrue EnableFullTextQuery = "True" + EnableFullTextQueryFalse EnableFullTextQuery = "False" +) + +// PossibleEnableFullTextQueryValues returns the possible values for the EnableFullTextQuery const type. +func PossibleEnableFullTextQueryValues() []EnableFullTextQuery { + return []EnableFullTextQuery{ + EnableFullTextQueryNone, + EnableFullTextQueryTrue, + EnableFullTextQueryFalse, + } +} + // IndexKind - Indicates the type of index. type IndexKind string @@ -391,6 +444,22 @@ func PossibleManagedCassandraResourceIdentityTypeValues() []ManagedCassandraReso } } +// MongoRoleDefinitionType - Indicates whether the Role Definition was built-in or user created. +type MongoRoleDefinitionType string + +const ( + MongoRoleDefinitionTypeBuiltInRole MongoRoleDefinitionType = "BuiltInRole" + MongoRoleDefinitionTypeCustomRole MongoRoleDefinitionType = "CustomRole" +) + +// PossibleMongoRoleDefinitionTypeValues returns the possible values for the MongoRoleDefinitionType const type. +func PossibleMongoRoleDefinitionTypeValues() []MongoRoleDefinitionType { + return []MongoRoleDefinitionType{ + MongoRoleDefinitionTypeBuiltInRole, + MongoRoleDefinitionTypeCustomRole, + } +} + // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. type NetworkACLBypass string @@ -609,6 +678,68 @@ func PossibleServerVersionValues() []ServerVersion { } } +// ServiceSize - Instance type for the service. +type ServiceSize string + +const ( + ServiceSizeCosmosD16S ServiceSize = "Cosmos.D16s" + ServiceSizeCosmosD4S ServiceSize = "Cosmos.D4s" + ServiceSizeCosmosD8S ServiceSize = "Cosmos.D8s" +) + +// PossibleServiceSizeValues returns the possible values for the ServiceSize const type. +func PossibleServiceSizeValues() []ServiceSize { + return []ServiceSize{ + ServiceSizeCosmosD16S, + ServiceSizeCosmosD4S, + ServiceSizeCosmosD8S, + } +} + +// ServiceStatus - Describes the status of a service. +type ServiceStatus string + +const ( + ServiceStatusCreating ServiceStatus = "Creating" + ServiceStatusDeleting ServiceStatus = "Deleting" + ServiceStatusError ServiceStatus = "Error" + ServiceStatusRunning ServiceStatus = "Running" + ServiceStatusStopped ServiceStatus = "Stopped" + ServiceStatusUpdating ServiceStatus = "Updating" +) + +// PossibleServiceStatusValues returns the possible values for the ServiceStatus const type. +func PossibleServiceStatusValues() []ServiceStatus { + return []ServiceStatus{ + ServiceStatusCreating, + ServiceStatusDeleting, + ServiceStatusError, + ServiceStatusRunning, + ServiceStatusStopped, + ServiceStatusUpdating, + } +} + +// ServiceType - ServiceType for the service. +type ServiceType string + +const ( + ServiceTypeDataTransfer ServiceType = "DataTransfer" + ServiceTypeGraphAPICompute ServiceType = "GraphAPICompute" + ServiceTypeMaterializedViewsBuilder ServiceType = "MaterializedViewsBuilder" + ServiceTypeSQLDedicatedGateway ServiceType = "SqlDedicatedGateway" +) + +// PossibleServiceTypeValues returns the possible values for the ServiceType const type. +func PossibleServiceTypeValues() []ServiceType { + return []ServiceType{ + ServiceTypeDataTransfer, + ServiceTypeGraphAPICompute, + ServiceTypeMaterializedViewsBuilder, + ServiceTypeSQLDedicatedGateway, + } +} + // SpatialType - Indicates the spatial type of index. type SpatialType string @@ -629,6 +760,24 @@ func PossibleSpatialTypeValues() []SpatialType { } } +// ThroughputPolicyType - ThroughputPolicy to apply for throughput redistribution +type ThroughputPolicyType string + +const ( + ThroughputPolicyTypeCustom ThroughputPolicyType = "custom" + ThroughputPolicyTypeEqual ThroughputPolicyType = "equal" + ThroughputPolicyTypeNone ThroughputPolicyType = "none" +) + +// PossibleThroughputPolicyTypeValues returns the possible values for the ThroughputPolicyType const type. +func PossibleThroughputPolicyTypeValues() []ThroughputPolicyType { + return []ThroughputPolicyType{ + ThroughputPolicyTypeCustom, + ThroughputPolicyTypeEqual, + ThroughputPolicyTypeNone, + } +} + // TriggerOperation - The operation the trigger is associated with type TriggerOperation string diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_database_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_database_client.go index b2534ba28c61..e1a1a0813906 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_database_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_database_client.go @@ -56,7 +56,7 @@ func NewDatabaseClient(subscriptionID string, credential azcore.TokenCredential, // NewListMetricDefinitionsPager - Retrieves metric definitions for the given database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -108,7 +108,7 @@ func (client *DatabaseClient) listMetricDefinitionsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,7 +125,7 @@ func (client *DatabaseClient) listMetricDefinitionsHandleResponse(resp *http.Res // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -179,7 +179,7 @@ func (client *DatabaseClient) listMetricsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -197,7 +197,7 @@ func (client *DatabaseClient) listMetricsHandleResponse(resp *http.Response) (Da // NewListUsagesPager - Retrieves the usages (most recent data) for the given database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -248,7 +248,7 @@ func (client *DatabaseClient) listUsagesCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccountregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccountregion_client.go index c303fb3f7854..80c305812174 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccountregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccountregion_client.go @@ -56,7 +56,7 @@ func NewDatabaseAccountRegionClient(subscriptionID string, credential azcore.Tok // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account and region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -111,7 +111,7 @@ func (client *DatabaseAccountRegionClient) listMetricsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccounts_client.go index 84d7a99a4f1c..8b248016cf02 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccounts_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_databaseaccounts_client.go @@ -56,7 +56,7 @@ func NewDatabaseAccountsClient(subscriptionID string, credential azcore.TokenCre // CheckNameExists - Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase // letters, numbers, and the '-' character, and must be between 3 and 50 characters. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientCheckNameExistsOptions contains the optional parameters for the DatabaseAccountsClient.CheckNameExists // method. @@ -87,7 +87,7 @@ func (client *DatabaseAccountsClient) checkNameExistsCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -95,7 +95,7 @@ func (client *DatabaseAccountsClient) checkNameExistsCreateRequest(ctx context.C // BeginCreateOrUpdate - Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // createUpdateParameters - The parameters to provide for the current database account. @@ -116,7 +116,7 @@ func (client *DatabaseAccountsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing // updates on an account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *DatabaseAccountsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters, options *DatabaseAccountsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, createUpdateParameters, options) if err != nil { @@ -152,7 +152,7 @@ func (client *DatabaseAccountsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateParameters) @@ -160,7 +160,7 @@ func (client *DatabaseAccountsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientBeginDeleteOptions contains the optional parameters for the DatabaseAccountsClient.BeginDelete @@ -179,7 +179,7 @@ func (client *DatabaseAccountsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *DatabaseAccountsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, options *DatabaseAccountsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, options) if err != nil { @@ -215,7 +215,7 @@ func (client *DatabaseAccountsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -224,7 +224,7 @@ func (client *DatabaseAccountsClient) deleteCreateRequest(ctx context.Context, r // of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). // Failover priority values must be unique for each of the regions in which the database account exists. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // failoverParameters - The new failover policies for the database account. @@ -246,7 +246,7 @@ func (client *DatabaseAccountsClient) BeginFailoverPriorityChange(ctx context.Co // 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). // Failover priority values must be unique for each of the regions in which the database account exists. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *DatabaseAccountsClient) failoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies, options *DatabaseAccountsClientBeginFailoverPriorityChangeOptions) (*http.Response, error) { req, err := client.failoverPriorityChangeCreateRequest(ctx, resourceGroupName, accountName, failoverParameters, options) if err != nil { @@ -282,14 +282,14 @@ func (client *DatabaseAccountsClient) failoverPriorityChangeCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, failoverParameters) } // Get - Retrieves the properties of an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientGetOptions contains the optional parameters for the DatabaseAccountsClient.Get method. @@ -328,7 +328,7 @@ func (client *DatabaseAccountsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *DatabaseAccountsClient) getHandleResponse(resp *http.Response) (Da // GetReadOnlyKeys - Lists the read-only access keys for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientGetReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.GetReadOnlyKeys @@ -385,7 +385,7 @@ func (client *DatabaseAccountsClient) getReadOnlyKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +402,7 @@ func (client *DatabaseAccountsClient) getReadOnlyKeysHandleResponse(resp *http.R // NewListPager - Lists all the Azure Cosmos DB database accounts available under the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // options - DatabaseAccountsClientListOptions contains the optional parameters for the DatabaseAccountsClient.List method. func (client *DatabaseAccountsClient) NewListPager(options *DatabaseAccountsClientListOptions) *runtime.Pager[DatabaseAccountsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseAccountsClientListResponse]{ @@ -438,7 +438,7 @@ func (client *DatabaseAccountsClient) listCreateRequest(ctx context.Context, opt return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -455,7 +455,7 @@ func (client *DatabaseAccountsClient) listHandleResponse(resp *http.Response) (D // NewListByResourceGroupPager - Lists all the Azure Cosmos DB database accounts available under the given resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - DatabaseAccountsClientListByResourceGroupOptions contains the optional parameters for the DatabaseAccountsClient.ListByResourceGroup // method. @@ -497,7 +497,7 @@ func (client *DatabaseAccountsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -514,7 +514,7 @@ func (client *DatabaseAccountsClient) listByResourceGroupHandleResponse(resp *ht // ListConnectionStrings - Lists the connection strings for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListConnectionStringsOptions contains the optional parameters for the DatabaseAccountsClient.ListConnectionStrings @@ -554,7 +554,7 @@ func (client *DatabaseAccountsClient) listConnectionStringsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -571,7 +571,7 @@ func (client *DatabaseAccountsClient) listConnectionStringsHandleResponse(resp * // ListKeys - Lists the access keys for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListKeys @@ -611,7 +611,7 @@ func (client *DatabaseAccountsClient) listKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -628,7 +628,7 @@ func (client *DatabaseAccountsClient) listKeysHandleResponse(resp *http.Response // NewListMetricDefinitionsPager - Retrieves metric definitions for the given database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListMetricDefinitionsOptions contains the optional parameters for the DatabaseAccountsClient.ListMetricDefinitions @@ -675,7 +675,7 @@ func (client *DatabaseAccountsClient) listMetricDefinitionsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -692,7 +692,7 @@ func (client *DatabaseAccountsClient) listMetricDefinitionsHandleResponse(resp * // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are @@ -742,7 +742,7 @@ func (client *DatabaseAccountsClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} @@ -760,7 +760,7 @@ func (client *DatabaseAccountsClient) listMetricsHandleResponse(resp *http.Respo // ListReadOnlyKeys - Lists the read-only access keys for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListReadOnlyKeysOptions contains the optional parameters for the DatabaseAccountsClient.ListReadOnlyKeys @@ -800,7 +800,7 @@ func (client *DatabaseAccountsClient) listReadOnlyKeysCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -817,7 +817,7 @@ func (client *DatabaseAccountsClient) listReadOnlyKeysHandleResponse(resp *http. // NewListUsagesPager - Retrieves the usages (most recent data) for the given database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - DatabaseAccountsClientListUsagesOptions contains the optional parameters for the DatabaseAccountsClient.ListUsages @@ -864,7 +864,7 @@ func (client *DatabaseAccountsClient) listUsagesCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -884,7 +884,7 @@ func (client *DatabaseAccountsClient) listUsagesHandleResponse(resp *http.Respon // BeginOfflineRegion - Offline the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // regionParameterForOffline - Cosmos DB region to offline for the database account. @@ -904,7 +904,7 @@ func (client *DatabaseAccountsClient) BeginOfflineRegion(ctx context.Context, re // OfflineRegion - Offline the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *DatabaseAccountsClient) offlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOfflineRegionOptions) (*http.Response, error) { req, err := client.offlineRegionCreateRequest(ctx, resourceGroupName, accountName, regionParameterForOffline, options) if err != nil { @@ -940,7 +940,7 @@ func (client *DatabaseAccountsClient) offlineRegionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regionParameterForOffline) @@ -948,7 +948,7 @@ func (client *DatabaseAccountsClient) offlineRegionCreateRequest(ctx context.Con // BeginOnlineRegion - Online the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // regionParameterForOnline - Cosmos DB region to online for the database account. @@ -968,7 +968,7 @@ func (client *DatabaseAccountsClient) BeginOnlineRegion(ctx context.Context, res // OnlineRegion - Online the specified region for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *DatabaseAccountsClient) onlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline, options *DatabaseAccountsClientBeginOnlineRegionOptions) (*http.Response, error) { req, err := client.onlineRegionCreateRequest(ctx, resourceGroupName, accountName, regionParameterForOnline, options) if err != nil { @@ -1004,7 +1004,7 @@ func (client *DatabaseAccountsClient) onlineRegionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regionParameterForOnline) @@ -1012,7 +1012,7 @@ func (client *DatabaseAccountsClient) onlineRegionCreateRequest(ctx context.Cont // BeginRegenerateKey - Regenerates an access key for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // keyToRegenerate - The name of the key to regenerate. @@ -1032,7 +1032,7 @@ func (client *DatabaseAccountsClient) BeginRegenerateKey(ctx context.Context, re // RegenerateKey - Regenerates an access key for the specified Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *DatabaseAccountsClient) regenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters, options *DatabaseAccountsClientBeginRegenerateKeyOptions) (*http.Response, error) { req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, accountName, keyToRegenerate, options) if err != nil { @@ -1068,14 +1068,14 @@ func (client *DatabaseAccountsClient) regenerateKeyCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, keyToRegenerate) } // BeginUpdate - Updates the properties of an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // updateParameters - The parameters to provide for the current database account. @@ -1095,7 +1095,7 @@ func (client *DatabaseAccountsClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates the properties of an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *DatabaseAccountsClient) update(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters, options *DatabaseAccountsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, accountName, updateParameters, options) if err != nil { @@ -1131,7 +1131,7 @@ func (client *DatabaseAccountsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_datatransferjobs_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_datatransferjobs_client.go new file mode 100644 index 000000000000..2aabb7787d47 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_datatransferjobs_client.go @@ -0,0 +1,430 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// DataTransferJobsClient contains the methods for the DataTransferJobs group. +// Don't use this type directly, use NewDataTransferJobsClient() instead. +type DataTransferJobsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDataTransferJobsClient creates a new instance of DataTransferJobsClient with the specified values. +// 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 NewDataTransferJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataTransferJobsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &DataTransferJobsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Cancel - Cancels a Data Transfer Job. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// jobName - Name of the Data Transfer Job +// options - DataTransferJobsClientCancelOptions contains the optional parameters for the DataTransferJobsClient.Cancel method. +func (client *DataTransferJobsClient) Cancel(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientCancelOptions) (DataTransferJobsClientCancelResponse, error) { + req, err := client.cancelCreateRequest(ctx, resourceGroupName, accountName, jobName, options) + if err != nil { + return DataTransferJobsClientCancelResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataTransferJobsClientCancelResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataTransferJobsClientCancelResponse{}, runtime.NewResponseError(resp) + } + return client.cancelHandleResponse(resp) +} + +// cancelCreateRequest creates the Cancel request. +func (client *DataTransferJobsClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if jobName == "" { + return nil, errors.New("parameter jobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// cancelHandleResponse handles the Cancel response. +func (client *DataTransferJobsClient) cancelHandleResponse(resp *http.Response) (DataTransferJobsClientCancelResponse, error) { + result := DataTransferJobsClientCancelResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { + return DataTransferJobsClientCancelResponse{}, err + } + return result, nil +} + +// Create - Creates a Data Transfer Job. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// jobName - Name of the Data Transfer Job +// options - DataTransferJobsClientCreateOptions contains the optional parameters for the DataTransferJobsClient.Create method. +func (client *DataTransferJobsClient) Create(ctx context.Context, resourceGroupName string, accountName string, jobName string, jobCreateParameters CreateJobRequest, options *DataTransferJobsClientCreateOptions) (DataTransferJobsClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, jobName, jobCreateParameters, options) + if err != nil { + return DataTransferJobsClientCreateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataTransferJobsClientCreateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataTransferJobsClientCreateResponse{}, runtime.NewResponseError(resp) + } + return client.createHandleResponse(resp) +} + +// createCreateRequest creates the Create request. +func (client *DataTransferJobsClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, jobCreateParameters CreateJobRequest, options *DataTransferJobsClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if jobName == "" { + return nil, errors.New("parameter jobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, jobCreateParameters) +} + +// createHandleResponse handles the Create response. +func (client *DataTransferJobsClient) createHandleResponse(resp *http.Response) (DataTransferJobsClientCreateResponse, error) { + result := DataTransferJobsClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { + return DataTransferJobsClientCreateResponse{}, err + } + return result, nil +} + +// Get - Get a Data Transfer Job. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// jobName - Name of the Data Transfer Job +// options - DataTransferJobsClientGetOptions contains the optional parameters for the DataTransferJobsClient.Get method. +func (client *DataTransferJobsClient) Get(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientGetOptions) (DataTransferJobsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, jobName, options) + if err != nil { + return DataTransferJobsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataTransferJobsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataTransferJobsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DataTransferJobsClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if jobName == "" { + return nil, errors.New("parameter jobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DataTransferJobsClient) getHandleResponse(resp *http.Response) (DataTransferJobsClientGetResponse, error) { + result := DataTransferJobsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { + return DataTransferJobsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDatabaseAccountPager - Get a list of Data Transfer jobs. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.ListByDatabaseAccount +// method. +func (client *DataTransferJobsClient) NewListByDatabaseAccountPager(resourceGroupName string, accountName string, options *DataTransferJobsClientListByDatabaseAccountOptions) *runtime.Pager[DataTransferJobsClientListByDatabaseAccountResponse] { + return runtime.NewPager(runtime.PagingHandler[DataTransferJobsClientListByDatabaseAccountResponse]{ + More: func(page DataTransferJobsClientListByDatabaseAccountResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DataTransferJobsClientListByDatabaseAccountResponse) (DataTransferJobsClientListByDatabaseAccountResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseAccountCreateRequest(ctx, resourceGroupName, accountName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DataTransferJobsClientListByDatabaseAccountResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataTransferJobsClientListByDatabaseAccountResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataTransferJobsClientListByDatabaseAccountResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseAccountHandleResponse(resp) + }, + }) +} + +// listByDatabaseAccountCreateRequest creates the ListByDatabaseAccount request. +func (client *DataTransferJobsClient) listByDatabaseAccountCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *DataTransferJobsClientListByDatabaseAccountOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseAccountHandleResponse handles the ListByDatabaseAccount response. +func (client *DataTransferJobsClient) listByDatabaseAccountHandleResponse(resp *http.Response) (DataTransferJobsClientListByDatabaseAccountResponse, error) { + result := DataTransferJobsClientListByDatabaseAccountResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobFeedResults); err != nil { + return DataTransferJobsClientListByDatabaseAccountResponse{}, err + } + return result, nil +} + +// Pause - Pause a Data Transfer Job. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// jobName - Name of the Data Transfer Job +// options - DataTransferJobsClientPauseOptions contains the optional parameters for the DataTransferJobsClient.Pause method. +func (client *DataTransferJobsClient) Pause(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientPauseOptions) (DataTransferJobsClientPauseResponse, error) { + req, err := client.pauseCreateRequest(ctx, resourceGroupName, accountName, jobName, options) + if err != nil { + return DataTransferJobsClientPauseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataTransferJobsClientPauseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataTransferJobsClientPauseResponse{}, runtime.NewResponseError(resp) + } + return client.pauseHandleResponse(resp) +} + +// pauseCreateRequest creates the Pause request. +func (client *DataTransferJobsClient) pauseCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientPauseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if jobName == "" { + return nil, errors.New("parameter jobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// pauseHandleResponse handles the Pause response. +func (client *DataTransferJobsClient) pauseHandleResponse(resp *http.Response) (DataTransferJobsClientPauseResponse, error) { + result := DataTransferJobsClientPauseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { + return DataTransferJobsClientPauseResponse{}, err + } + return result, nil +} + +// Resume - Resumes a Data Transfer Job. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// jobName - Name of the Data Transfer Job +// options - DataTransferJobsClientResumeOptions contains the optional parameters for the DataTransferJobsClient.Resume method. +func (client *DataTransferJobsClient) Resume(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientResumeOptions) (DataTransferJobsClientResumeResponse, error) { + req, err := client.resumeCreateRequest(ctx, resourceGroupName, accountName, jobName, options) + if err != nil { + return DataTransferJobsClientResumeResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataTransferJobsClientResumeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataTransferJobsClientResumeResponse{}, runtime.NewResponseError(resp) + } + return client.resumeHandleResponse(resp) +} + +// resumeCreateRequest creates the Resume request. +func (client *DataTransferJobsClient) resumeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, jobName string, options *DataTransferJobsClientResumeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if jobName == "" { + return nil, errors.New("parameter jobName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{jobName}", url.PathEscape(jobName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// resumeHandleResponse handles the Resume response. +func (client *DataTransferJobsClient) resumeHandleResponse(resp *http.Response) (DataTransferJobsClientResumeResponse, error) { + result := DataTransferJobsClientResumeResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataTransferJobGetResults); err != nil { + return DataTransferJobsClientResumeResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_graphresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_graphresources_client.go new file mode 100644 index 000000000000..d902727054c0 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_graphresources_client.go @@ -0,0 +1,316 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// GraphResourcesClient contains the methods for the GraphResources group. +// Don't use this type directly, use NewGraphResourcesClient() instead. +type GraphResourcesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewGraphResourcesClient creates a new instance of GraphResourcesClient with the specified values. +// 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 NewGraphResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GraphResourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &GraphResourcesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateUpdateGraph - Create or update an Azure Cosmos DB Graph. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// graphName - Cosmos DB graph resource name. +// createUpdateGraphParameters - The parameters to provide for the current graph. +// options - GraphResourcesClientBeginCreateUpdateGraphOptions contains the optional parameters for the GraphResourcesClient.BeginCreateUpdateGraph +// method. +func (client *GraphResourcesClient) BeginCreateUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*runtime.Poller[GraphResourcesClientCreateUpdateGraphResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createUpdateGraph(ctx, resourceGroupName, accountName, graphName, createUpdateGraphParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GraphResourcesClientCreateUpdateGraphResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GraphResourcesClientCreateUpdateGraphResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateUpdateGraph - Create or update an Azure Cosmos DB Graph. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *GraphResourcesClient) createUpdateGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*http.Response, error) { + req, err := client.createUpdateGraphCreateRequest(ctx, resourceGroupName, accountName, graphName, createUpdateGraphParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createUpdateGraphCreateRequest creates the CreateUpdateGraph request. +func (client *GraphResourcesClient) createUpdateGraphCreateRequest(ctx context.Context, resourceGroupName string, accountName string, graphName string, createUpdateGraphParameters GraphResourceCreateUpdateParameters, options *GraphResourcesClientBeginCreateUpdateGraphOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if graphName == "" { + return nil, errors.New("parameter graphName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, createUpdateGraphParameters) +} + +// BeginDeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// graphName - Cosmos DB graph resource name. +// options - GraphResourcesClientBeginDeleteGraphResourceOptions contains the optional parameters for the GraphResourcesClient.BeginDeleteGraphResource +// method. +func (client *GraphResourcesClient) BeginDeleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*runtime.Poller[GraphResourcesClientDeleteGraphResourceResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteGraphResource(ctx, resourceGroupName, accountName, graphName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[GraphResourcesClientDeleteGraphResourceResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[GraphResourcesClientDeleteGraphResourceResponse](options.ResumeToken, client.pl, nil) + } +} + +// DeleteGraphResource - Deletes an existing Azure Cosmos DB Graph Resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *GraphResourcesClient) deleteGraphResource(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*http.Response, error) { + req, err := client.deleteGraphResourceCreateRequest(ctx, resourceGroupName, accountName, graphName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteGraphResourceCreateRequest creates the DeleteGraphResource request. +func (client *GraphResourcesClient) deleteGraphResourceCreateRequest(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientBeginDeleteGraphResourceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if graphName == "" { + return nil, errors.New("parameter graphName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// GetGraph - Gets the Graph resource under an existing Azure Cosmos DB database account with the provided name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// graphName - Cosmos DB graph resource name. +// options - GraphResourcesClientGetGraphOptions contains the optional parameters for the GraphResourcesClient.GetGraph method. +func (client *GraphResourcesClient) GetGraph(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientGetGraphOptions) (GraphResourcesClientGetGraphResponse, error) { + req, err := client.getGraphCreateRequest(ctx, resourceGroupName, accountName, graphName, options) + if err != nil { + return GraphResourcesClientGetGraphResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphResourcesClientGetGraphResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphResourcesClientGetGraphResponse{}, runtime.NewResponseError(resp) + } + return client.getGraphHandleResponse(resp) +} + +// getGraphCreateRequest creates the GetGraph request. +func (client *GraphResourcesClient) getGraphCreateRequest(ctx context.Context, resourceGroupName string, accountName string, graphName string, options *GraphResourcesClientGetGraphOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if graphName == "" { + return nil, errors.New("parameter graphName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getGraphHandleResponse handles the GetGraph response. +func (client *GraphResourcesClient) getGraphHandleResponse(resp *http.Response) (GraphResourcesClientGetGraphResponse, error) { + result := GraphResourcesClientGetGraphResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GraphResourceGetResults); err != nil { + return GraphResourcesClientGetGraphResponse{}, err + } + return result, nil +} + +// NewListGraphsPager - Lists the graphs under an existing Azure Cosmos DB database account. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - GraphResourcesClientListGraphsOptions contains the optional parameters for the GraphResourcesClient.ListGraphs +// method. +func (client *GraphResourcesClient) NewListGraphsPager(resourceGroupName string, accountName string, options *GraphResourcesClientListGraphsOptions) *runtime.Pager[GraphResourcesClientListGraphsResponse] { + return runtime.NewPager(runtime.PagingHandler[GraphResourcesClientListGraphsResponse]{ + More: func(page GraphResourcesClientListGraphsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *GraphResourcesClientListGraphsResponse) (GraphResourcesClientListGraphsResponse, error) { + req, err := client.listGraphsCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return GraphResourcesClientListGraphsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphResourcesClientListGraphsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphResourcesClientListGraphsResponse{}, runtime.NewResponseError(resp) + } + return client.listGraphsHandleResponse(resp) + }, + }) +} + +// listGraphsCreateRequest creates the ListGraphs request. +func (client *GraphResourcesClient) listGraphsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *GraphResourcesClientListGraphsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listGraphsHandleResponse handles the ListGraphs response. +func (client *GraphResourcesClient) listGraphsHandleResponse(resp *http.Response) (GraphResourcesClientListGraphsResponse, error) { + result := GraphResourcesClientListGraphsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GraphResourcesListResult); err != nil { + return GraphResourcesClientListGraphsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_gremlinresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_gremlinresources_client.go index 0d32f9a44551..3f888549624d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_gremlinresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_gremlinresources_client.go @@ -56,7 +56,7 @@ func NewGremlinResourcesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateUpdateGremlinDatabase - Create or update an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -77,7 +77,7 @@ func (client *GremlinResourcesClient) BeginCreateUpdateGremlinDatabase(ctx conte // CreateUpdateGremlinDatabase - Create or update an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) createUpdateGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateGremlinDatabaseParameters GremlinDatabaseCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinDatabaseOptions) (*http.Response, error) { req, err := client.createUpdateGremlinDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, createUpdateGremlinDatabaseParameters, options) if err != nil { @@ -117,7 +117,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateGremlinDatabaseParameters) @@ -125,7 +125,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinDatabaseCreateRequest(c // BeginCreateUpdateGremlinGraph - Create or update an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -147,7 +147,7 @@ func (client *GremlinResourcesClient) BeginCreateUpdateGremlinGraph(ctx context. // CreateUpdateGremlinGraph - Create or update an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) createUpdateGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, createUpdateGremlinGraphParameters GremlinGraphCreateUpdateParameters, options *GremlinResourcesClientBeginCreateUpdateGremlinGraphOptions) (*http.Response, error) { req, err := client.createUpdateGremlinGraphCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, createUpdateGremlinGraphParameters, options) if err != nil { @@ -191,7 +191,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinGraphCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateGremlinGraphParameters) @@ -199,7 +199,7 @@ func (client *GremlinResourcesClient) createUpdateGremlinGraphCreateRequest(ctx // BeginDeleteGremlinDatabase - Deletes an existing Azure Cosmos DB Gremlin database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -219,7 +219,7 @@ func (client *GremlinResourcesClient) BeginDeleteGremlinDatabase(ctx context.Con // DeleteGremlinDatabase - Deletes an existing Azure Cosmos DB Gremlin database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) deleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginDeleteGremlinDatabaseOptions) (*http.Response, error) { req, err := client.deleteGremlinDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -259,14 +259,14 @@ func (client *GremlinResourcesClient) deleteGremlinDatabaseCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteGremlinGraph - Deletes an existing Azure Cosmos DB Gremlin graph. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -287,7 +287,7 @@ func (client *GremlinResourcesClient) BeginDeleteGremlinGraph(ctx context.Contex // DeleteGremlinGraph - Deletes an existing Azure Cosmos DB Gremlin graph. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) deleteGremlinGraph(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginDeleteGremlinGraphOptions) (*http.Response, error) { req, err := client.deleteGremlinGraphCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, options) if err != nil { @@ -331,14 +331,14 @@ func (client *GremlinResourcesClient) deleteGremlinGraphCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // GetGremlinDatabase - Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -383,7 +383,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,7 +401,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseHandleResponse(resp *htt // GetGremlinDatabaseThroughput - Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -446,7 +446,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -463,7 +463,7 @@ func (client *GremlinResourcesClient) getGremlinDatabaseThroughputHandleResponse // GetGremlinGraph - Gets the Gremlin graph under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -513,7 +513,7 @@ func (client *GremlinResourcesClient) getGremlinGraphCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -531,7 +531,7 @@ func (client *GremlinResourcesClient) getGremlinGraphHandleResponse(resp *http.R // GetGremlinGraphThroughput - Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the // provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -581,7 +581,7 @@ func (client *GremlinResourcesClient) getGremlinGraphThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -598,7 +598,7 @@ func (client *GremlinResourcesClient) getGremlinGraphThroughputHandleResponse(re // NewListGremlinDatabasesPager - Lists the Gremlin databases under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - GremlinResourcesClientListGremlinDatabasesOptions contains the optional parameters for the GremlinResourcesClient.ListGremlinDatabases @@ -645,7 +645,7 @@ func (client *GremlinResourcesClient) listGremlinDatabasesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -662,7 +662,7 @@ func (client *GremlinResourcesClient) listGremlinDatabasesHandleResponse(resp *h // NewListGremlinGraphsPager - Lists the Gremlin graph under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -714,7 +714,7 @@ func (client *GremlinResourcesClient) listGremlinGraphsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -731,7 +731,7 @@ func (client *GremlinResourcesClient) listGremlinGraphsHandleResponse(resp *http // BeginMigrateGremlinDatabaseToAutoscale - Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -751,7 +751,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinDatabaseToAutoscale(ctx // MigrateGremlinDatabaseToAutoscale - Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginMigrateGremlinDatabaseToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateGremlinDatabaseToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -791,7 +791,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -799,7 +799,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToAutoscaleCreateReq // BeginMigrateGremlinDatabaseToManualThroughput - Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -819,7 +819,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinDatabaseToManualThrough // MigrateGremlinDatabaseToManualThroughput - Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *GremlinResourcesClientBeginMigrateGremlinDatabaseToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateGremlinDatabaseToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -859,7 +859,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -867,7 +867,7 @@ func (client *GremlinResourcesClient) migrateGremlinDatabaseToManualThroughputCr // BeginMigrateGremlinGraphToAutoscale - Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -888,7 +888,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinGraphToAutoscale(ctx co // MigrateGremlinGraphToAutoscale - Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateGremlinGraphToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, options) if err != nil { @@ -932,7 +932,7 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscaleCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -940,7 +940,7 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToAutoscaleCreateReques // BeginMigrateGremlinGraphToManualThroughput - Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -961,7 +961,7 @@ func (client *GremlinResourcesClient) BeginMigrateGremlinGraphToManualThroughput // MigrateGremlinGraphToManualThroughput - Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) migrateGremlinGraphToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, options *GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateGremlinGraphToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, options) if err != nil { @@ -1005,15 +1005,91 @@ func (client *GremlinResourcesClient) migrateGremlinGraphToManualThroughputCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a gremlin graph. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// graphName - Cosmos DB graph name. +// location - The name of the continuous backup restore location. +// options - GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the +// GremlinResourcesClient.BeginRetrieveContinuousBackupInformation method. +func (client *GremlinResourcesClient) BeginRetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[GremlinResourcesClientRetrieveContinuousBackupInformationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.retrieveContinuousBackupInformation(ctx, resourceGroupName, accountName, databaseName, graphName, location, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[GremlinResourcesClientRetrieveContinuousBackupInformationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GremlinResourcesClientRetrieveContinuousBackupInformationResponse](options.ResumeToken, client.pl, nil) + } +} + +// RetrieveContinuousBackupInformation - Retrieves continuous backup information for a gremlin graph. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *GremlinResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { + req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, location, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// retrieveContinuousBackupInformationCreateRequest creates the RetrieveContinuousBackupInformation request. +func (client *GremlinResourcesClient) retrieveContinuousBackupInformationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, location ContinuousBackupRestoreLocation, options *GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if graphName == "" { + return nil, errors.New("parameter graphName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{graphName}", url.PathEscape(graphName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, location) +} + // BeginUpdateGremlinDatabaseThroughput - Update RUs per second of an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1034,7 +1110,7 @@ func (client *GremlinResourcesClient) BeginUpdateGremlinDatabaseThroughput(ctx c // UpdateGremlinDatabaseThroughput - Update RUs per second of an Azure Cosmos DB Gremlin database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) updateGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions) (*http.Response, error) { req, err := client.updateGremlinDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters, options) if err != nil { @@ -1074,7 +1150,7 @@ func (client *GremlinResourcesClient) updateGremlinDatabaseThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -1082,7 +1158,7 @@ func (client *GremlinResourcesClient) updateGremlinDatabaseThroughputCreateReque // BeginUpdateGremlinGraphThroughput - Update RUs per second of an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1104,7 +1180,7 @@ func (client *GremlinResourcesClient) BeginUpdateGremlinGraphThroughput(ctx cont // UpdateGremlinGraphThroughput - Update RUs per second of an Azure Cosmos DB Gremlin graph // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *GremlinResourcesClient) updateGremlinGraphThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, graphName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *GremlinResourcesClientBeginUpdateGremlinGraphThroughputOptions) (*http.Response, error) { req, err := client.updateGremlinGraphThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, options) if err != nil { @@ -1148,7 +1224,7 @@ func (client *GremlinResourcesClient) updateGremlinGraphThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_locations_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_locations_client.go index e41766fdc33e..eeccdb292020 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_locations_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_locations_client.go @@ -56,7 +56,7 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // Get - Get the properties of an existing Cosmos DB location // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // options - LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method. func (client *LocationsClient) Get(ctx context.Context, location string, options *LocationsClientGetOptions) (LocationsClientGetResponse, error) { @@ -90,7 +90,7 @@ func (client *LocationsClient) getCreateRequest(ctx context.Context, location st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -107,7 +107,7 @@ func (client *LocationsClient) getHandleResponse(resp *http.Response) (Locations // NewListPager - List Cosmos DB locations and their properties // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // options - LocationsClientListOptions contains the optional parameters for the LocationsClient.List method. func (client *LocationsClient) NewListPager(options *LocationsClientListOptions) *runtime.Pager[LocationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LocationsClientListResponse]{ @@ -143,7 +143,7 @@ func (client *LocationsClient) listCreateRequest(ctx context.Context, options *L return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models.go index 2203cc772863..3dc8cec0d560 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models.go @@ -30,6 +30,9 @@ type ARMProxyResource struct { // ARMResourceProperties - The core properties of ARM resources. type ARMResourceProperties struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -56,6 +59,28 @@ type AnalyticalStorageConfiguration struct { SchemaType *AnalyticalStorageSchemaType `json:"schemaType,omitempty"` } +// AuthenticationMethodLdapProperties - Ldap authentication method properties. This feature is in preview. +type AuthenticationMethodLdapProperties struct { + // Distinguished name of the object to start the recursive search of users from. + SearchBaseDistinguishedName *string `json:"searchBaseDistinguishedName,omitempty"` + + // Template to use for searching. Defaults to (cn=%s) where %s will be replaced by the username used to login. + SearchFilterTemplate *string `json:"searchFilterTemplate,omitempty"` + ServerCertificates []*Certificate `json:"serverCertificates,omitempty"` + + // Hostname of the LDAP server. + ServerHostname *string `json:"serverHostname,omitempty"` + + // Port of the LDAP server. + ServerPort *int32 `json:"serverPort,omitempty"` + + // Distinguished name of the look up user account, who can look up user details on authentication. + ServiceUserDistinguishedName *string `json:"serviceUserDistinguishedName,omitempty"` + + // Password of the look up user. + ServiceUserPassword *string `json:"serviceUserPassword,omitempty"` +} + // AutoUpgradePolicyResource - Cosmos DB resource auto-upgrade policy type AutoUpgradePolicyResource struct { // Represents throughput policy which service must adhere to for auto-upgrade @@ -79,6 +104,23 @@ type AutoscaleSettingsResource struct { TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty" azure:"ro"` } +// AzureBlobDataTransferDataSourceSink - An Azure Blob Storage data source/sink +type AzureBlobDataTransferDataSourceSink struct { + // REQUIRED + Component *DataTransferComponent `json:"component,omitempty"` + + // REQUIRED + ContainerName *string `json:"containerName,omitempty"` + EndpointURL *string `json:"endpointUrl,omitempty"` +} + +// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type AzureBlobDataTransferDataSourceSink. +func (a *AzureBlobDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { + return &DataTransferDataSourceSink{ + Component: a.Component, + } +} + // BackupInformation - Backup information of a resource. type BackupInformation struct { // READ-ONLY; Information about the status of continuous backups. @@ -118,6 +160,25 @@ type BackupPolicyMigrationState struct { TargetType *BackupPolicyType `json:"targetType,omitempty"` } +// BackupResource - A restorable backup of a Cassandra cluster. +type BackupResource struct { + Properties *BackupResourceProperties `json:"properties,omitempty"` + + // READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +type BackupResourceProperties struct { + // The time this backup was taken, formatted like 2021-01-21T17:35:21 + Timestamp *time.Time `json:"timestamp,omitempty"` +} + // Capability - Cosmos DB capability object type Capability struct { // Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and @@ -194,11 +255,22 @@ type CassandraClustersClientBeginUpdateOptions struct { ResumeToken string } +// CassandraClustersClientGetBackupOptions contains the optional parameters for the CassandraClustersClient.GetBackup method. +type CassandraClustersClientGetBackupOptions struct { + // placeholder for future optional parameters +} + // CassandraClustersClientGetOptions contains the optional parameters for the CassandraClustersClient.Get method. type CassandraClustersClientGetOptions struct { // placeholder for future optional parameters } +// CassandraClustersClientListBackupsOptions contains the optional parameters for the CassandraClustersClient.ListBackups +// method. +type CassandraClustersClientListBackupsOptions struct { + // placeholder for future optional parameters +} + // CassandraClustersClientListByResourceGroupOptions contains the optional parameters for the CassandraClustersClient.ListByResourceGroup // method. type CassandraClustersClientListByResourceGroupOptions struct { @@ -247,11 +319,33 @@ type CassandraDataCentersClientListOptions struct { // placeholder for future optional parameters } +// CassandraDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink +type CassandraDataTransferDataSourceSink struct { + // REQUIRED + Component *DataTransferComponent `json:"component,omitempty"` + + // REQUIRED + KeyspaceName *string `json:"keyspaceName,omitempty"` + + // REQUIRED + TableName *string `json:"tableName,omitempty"` +} + +// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type CassandraDataTransferDataSourceSink. +func (c *CassandraDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { + return &DataTransferDataSourceSink{ + Component: c.Component, + } +} + // CassandraKeyspaceCreateUpdateParameters - Parameters to create and update Cosmos DB Cassandra keyspace. type CassandraKeyspaceCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra keyspace. Properties *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -312,6 +406,9 @@ type CassandraKeyspaceGetPropertiesResource struct { // CassandraKeyspaceGetResults - An Azure Cosmos DB Cassandra keyspace. type CassandraKeyspaceGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -367,6 +464,13 @@ type CassandraResourcesClientBeginCreateUpdateCassandraTableOptions struct { ResumeToken string } +// CassandraResourcesClientBeginCreateUpdateCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginCreateUpdateCassandraView +// method. +type CassandraResourcesClientBeginCreateUpdateCassandraViewOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraKeyspace // method. type CassandraResourcesClientBeginDeleteCassandraKeyspaceOptions struct { @@ -381,6 +485,13 @@ type CassandraResourcesClientBeginDeleteCassandraTableOptions struct { ResumeToken string } +// CassandraResourcesClientBeginDeleteCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.BeginDeleteCassandraView +// method. +type CassandraResourcesClientBeginDeleteCassandraViewOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraKeyspaceToAutoscale // method. type CassandraResourcesClientBeginMigrateCassandraKeyspaceToAutoscaleOptions struct { @@ -409,6 +520,20 @@ type CassandraResourcesClientBeginMigrateCassandraTableToManualThroughputOptions ResumeToken string } +// CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToAutoscale +// method. +type CassandraResourcesClientBeginMigrateCassandraViewToAutoscaleOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginMigrateCassandraViewToManualThroughput +// method. +type CassandraResourcesClientBeginMigrateCassandraViewToManualThroughputOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraKeyspaceThroughput // method. type CassandraResourcesClientBeginUpdateCassandraKeyspaceThroughputOptions struct { @@ -423,6 +548,13 @@ type CassandraResourcesClientBeginUpdateCassandraTableThroughputOptions struct { ResumeToken string } +// CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.BeginUpdateCassandraViewThroughput +// method. +type CassandraResourcesClientBeginUpdateCassandraViewThroughputOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // CassandraResourcesClientGetCassandraKeyspaceOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraKeyspace // method. type CassandraResourcesClientGetCassandraKeyspaceOptions struct { @@ -447,6 +579,18 @@ type CassandraResourcesClientGetCassandraTableThroughputOptions struct { // placeholder for future optional parameters } +// CassandraResourcesClientGetCassandraViewOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraView +// method. +type CassandraResourcesClientGetCassandraViewOptions struct { + // placeholder for future optional parameters +} + +// CassandraResourcesClientGetCassandraViewThroughputOptions contains the optional parameters for the CassandraResourcesClient.GetCassandraViewThroughput +// method. +type CassandraResourcesClientGetCassandraViewThroughputOptions struct { + // placeholder for future optional parameters +} + // CassandraResourcesClientListCassandraKeyspacesOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraKeyspaces // method. type CassandraResourcesClientListCassandraKeyspacesOptions struct { @@ -459,6 +603,12 @@ type CassandraResourcesClientListCassandraTablesOptions struct { // placeholder for future optional parameters } +// CassandraResourcesClientListCassandraViewsOptions contains the optional parameters for the CassandraResourcesClient.ListCassandraViews +// method. +type CassandraResourcesClientListCassandraViewsOptions struct { + // placeholder for future optional parameters +} + // CassandraSchema - Cosmos DB Cassandra table schema type CassandraSchema struct { // List of cluster key. @@ -476,6 +626,9 @@ type CassandraTableCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra table. Properties *CassandraTableCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -545,6 +698,9 @@ type CassandraTableGetPropertiesResource struct { // CassandraTableGetResults - An Azure Cosmos DB Cassandra table. type CassandraTableGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -589,11 +745,224 @@ type CassandraTableResource struct { Schema *CassandraSchema `json:"schema,omitempty"` } +// CassandraViewCreateUpdateParameters - Parameters to create and update Cosmos DB Cassandra view. +type CassandraViewCreateUpdateParameters struct { + // REQUIRED; Properties to create and update Azure Cosmos DB Cassandra view. + Properties *CassandraViewCreateUpdateProperties `json:"properties,omitempty"` + + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + + // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource + // (across resource groups). A maximum of 15 tags can be provided for a + // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + // the default experience for a template type is set with "defaultExperience": + // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// CassandraViewCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra view. +type CassandraViewCreateUpdateProperties struct { + // REQUIRED; The standard JSON format of a Cassandra view + Resource *CassandraViewResource `json:"resource,omitempty"` + + // A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// CassandraViewGetProperties - The properties of an Azure Cosmos DB Cassandra view +type CassandraViewGetProperties struct { + Options *CassandraViewGetPropertiesOptions `json:"options,omitempty"` + Resource *CassandraViewGetPropertiesResource `json:"resource,omitempty"` +} + +type CassandraViewGetPropertiesOptions struct { + // Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` + + // Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer + // details. + Throughput *int32 `json:"throughput,omitempty"` +} + +type CassandraViewGetPropertiesResource struct { + // REQUIRED; Name of the Cosmos DB Cassandra view + ID *string `json:"id,omitempty"` + + // REQUIRED; View Definition of the Cosmos DB Cassandra view + ViewDefinition *string `json:"viewDefinition,omitempty"` + + // READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty" azure:"ro"` + + // READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty" azure:"ro"` + + // READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float32 `json:"_ts,omitempty" azure:"ro"` +} + +// CassandraViewGetResults - An Azure Cosmos DB Cassandra view. +type CassandraViewGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + + // The properties of an Azure Cosmos DB Cassandra view + Properties *CassandraViewGetProperties `json:"properties,omitempty"` + + // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource + // (across resource groups). A maximum of 15 tags can be provided for a + // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + // the default experience for a template type is set with "defaultExperience": + // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// CassandraViewListResult - The List operation response, that contains the Cassandra views and their properties. +type CassandraViewListResult struct { + // READ-ONLY; List of Cassandra views and their properties. + Value []*CassandraViewGetResults `json:"value,omitempty" azure:"ro"` +} + +// CassandraViewResource - Cosmos DB Cassandra view resource object +type CassandraViewResource struct { + // REQUIRED; Name of the Cosmos DB Cassandra view + ID *string `json:"id,omitempty"` + + // REQUIRED; View Definition of the Cosmos DB Cassandra view + ViewDefinition *string `json:"viewDefinition,omitempty"` +} + type Certificate struct { // PEM formatted public key. Pem *string `json:"pem,omitempty"` } +// ClientEncryptionIncludedPath - . +type ClientEncryptionIncludedPath struct { + // REQUIRED; The identifier of the Client Encryption Key to be used to encrypt the path. + ClientEncryptionKeyID *string `json:"clientEncryptionKeyId,omitempty"` + + // REQUIRED; The encryption algorithm which will be used. Eg - AEADAES256CBCHMAC_SHA256. + EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` + + // REQUIRED; The type of encryption to be performed. Eg - Deterministic, Randomized. + EncryptionType *string `json:"encryptionType,omitempty"` + + // REQUIRED; Path that needs to be encrypted. + Path *string `json:"path,omitempty"` +} + +// ClientEncryptionKeyCreateUpdateParameters - Parameters to create and update ClientEncryptionKey. +type ClientEncryptionKeyCreateUpdateParameters struct { + // REQUIRED; Properties to create and update ClientEncryptionKey. + Properties *ClientEncryptionKeyCreateUpdateProperties `json:"properties,omitempty"` +} + +// ClientEncryptionKeyCreateUpdateProperties - Properties to create and update ClientEncryptionKey. +type ClientEncryptionKeyCreateUpdateProperties struct { + // REQUIRED; The standard JSON format of a ClientEncryptionKey + Resource *ClientEncryptionKeyResource `json:"resource,omitempty"` +} + +// ClientEncryptionKeyGetProperties - The properties of a ClientEncryptionKey resource +type ClientEncryptionKeyGetProperties struct { + Resource *ClientEncryptionKeyGetPropertiesResource `json:"resource,omitempty"` +} + +type ClientEncryptionKeyGetPropertiesResource struct { + // Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. + EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` + + // Name of the ClientEncryptionKey + ID *string `json:"id,omitempty"` + + // Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. + KeyWrapMetadata *KeyWrapMetadata `json:"keyWrapMetadata,omitempty"` + + // Wrapped (encrypted) form of the key represented as a byte array. + WrappedDataEncryptionKey []byte `json:"wrappedDataEncryptionKey,omitempty"` + + // READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. + Etag *string `json:"_etag,omitempty" azure:"ro"` + + // READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty" azure:"ro"` + + // READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. + Ts *float32 `json:"_ts,omitempty" azure:"ro"` +} + +// ClientEncryptionKeyGetResults - Client Encryption Key. +type ClientEncryptionKeyGetResults struct { + // The properties of a ClientEncryptionKey + Properties *ClientEncryptionKeyGetProperties `json:"properties,omitempty"` + + // READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ClientEncryptionKeyResource - Cosmos DB client encryption key resource object. +type ClientEncryptionKeyResource struct { + // Encryption algorithm that will be used along with this client encryption key to encrypt/decrypt data. + EncryptionAlgorithm *string `json:"encryptionAlgorithm,omitempty"` + + // Name of the ClientEncryptionKey + ID *string `json:"id,omitempty"` + + // Metadata for the wrapping provider that can be used to unwrap the wrapped client encryption key. + KeyWrapMetadata *KeyWrapMetadata `json:"keyWrapMetadata,omitempty"` + + // Wrapped (encrypted) form of the key represented as a byte array. + WrappedDataEncryptionKey []byte `json:"wrappedDataEncryptionKey,omitempty"` +} + +// ClientEncryptionKeysListResult - The List operation response, that contains the client encryption keys and their properties. +type ClientEncryptionKeysListResult struct { + // READ-ONLY; List of client encryption keys and their properties. + Value []*ClientEncryptionKeyGetResults `json:"value,omitempty" azure:"ro"` +} + +// ClientEncryptionPolicy - Cosmos DB client encryption policy. +type ClientEncryptionPolicy struct { + // REQUIRED; Paths of the item that need encryption along with path-specific settings. + IncludedPaths []*ClientEncryptionIncludedPath `json:"includedPaths,omitempty"` + + // Version of the client encryption policy definition. Please note, user passed value is ignored. Default policy version is + // 1. + PolicyFormatVersion *int32 `json:"policyFormatVersion,omitempty"` +} + // CloudError - An error response from the service. type CloudError struct { // Error Response. @@ -641,7 +1010,7 @@ type ClusterResource struct { type ClusterResourceProperties struct { // Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not // be used except in emergencies. 'Cassandra' is the default password based - // authentication. The default is 'Cassandra'. + // authentication. The default is 'Cassandra'. 'Ldap' is in preview. AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` // Whether Cassandra audit logging is enabled @@ -678,7 +1047,7 @@ type ClusterResourceProperties struct { // nodes. ExternalSeedNodes []*SeedNode `json:"externalSeedNodes,omitempty"` - // Number of hours to wait between taking a backup of the cluster. To disable backups, set this property to 0. + // Number of hours to wait between taking a backup of the cluster. HoursBetweenBackups *int32 `json:"hoursBetweenBackups,omitempty"` // Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null @@ -836,7 +1205,7 @@ type ComponentsM9L909SchemasCassandraclusterpublicstatusPropertiesDatacentersIte State *NodeState `json:"state,omitempty"` Status *string `json:"status,omitempty"` - // The timestamp when these statistics were captured. + // The timestamp at which that snapshot of these usage statistics were taken. Timestamp *string `json:"timestamp,omitempty"` // List of tokens this node covers. @@ -929,6 +1298,9 @@ type ContinuousModeBackupPolicy struct { // REQUIRED; Describes the mode of backups. Type *BackupPolicyType `json:"type,omitempty"` + // Configuration values for continuous mode backup + ContinuousModeProperties *ContinuousModeProperties `json:"continuousModeProperties,omitempty"` + // The object representing the state of the migration between the backup policies. MigrationState *BackupPolicyMigrationState `json:"migrationState,omitempty"` } @@ -941,6 +1313,12 @@ func (c *ContinuousModeBackupPolicy) GetBackupPolicy() *BackupPolicy { } } +// ContinuousModeProperties - Configuration values for periodic mode backup +type ContinuousModeProperties struct { + // Enum to indicate type of Continuos backup mode + Tier *ContinuousTier `json:"tier,omitempty"` +} + // CorsPolicy - The CORS policy for the Cosmos DB database account. type CorsPolicy struct { // REQUIRED; The origin domains that are permitted to make a request against the service via CORS. @@ -959,6 +1337,21 @@ type CorsPolicy struct { MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"` } +// CreateJobRequest - Parameters to create Data Transfer Job +type CreateJobRequest struct { + // REQUIRED; Data Transfer Create Job Properties + Properties *DataTransferJobProperties `json:"properties,omitempty"` + + // READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + // CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", // "Session-Token" and "Throughput" type CreateUpdateOptions struct { @@ -986,8 +1379,11 @@ type DataCenterResource struct { // DataCenterResourceProperties - Properties of a managed Cassandra data center. type DataCenterResourceProperties struct { - // If the azure data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the cassandra - // data center virtual machines. + // Ldap authentication method properties. This feature is in preview. + AuthenticationMethodLdapProperties *AuthenticationMethodLdapProperties `json:"authenticationMethodLdapProperties,omitempty"` + + // If the data center has Availability Zone feature, apply it to the Virtual Machine ScaleSet that host the cassandra data + // center virtual machines. AvailabilityZone *bool `json:"availabilityZone,omitempty"` // Indicates the Key Uri of the customer key to use for encryption of the backup storage account. @@ -1034,25 +1430,184 @@ type DataCenterResourceProperties struct { SeedNodes []*SeedNode `json:"seedNodes,omitempty" azure:"ro"` } -// DatabaseAccountConnectionString - Connection string for the Cosmos DB account -type DatabaseAccountConnectionString struct { - // READ-ONLY; Value of the connection string - ConnectionString *string `json:"connectionString,omitempty" azure:"ro"` +// DataTransferDataSourceSinkClassification provides polymorphic access to related types. +// Call the interface's GetDataTransferDataSourceSink() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureBlobDataTransferDataSourceSink, *CassandraDataTransferDataSourceSink, *DataTransferDataSourceSink, *SQLDataTransferDataSourceSink +type DataTransferDataSourceSinkClassification interface { + // GetDataTransferDataSourceSink returns the DataTransferDataSourceSink content of the underlying type. + GetDataTransferDataSourceSink() *DataTransferDataSourceSink +} - // READ-ONLY; Description of the connection string - Description *string `json:"description,omitempty" azure:"ro"` +// DataTransferDataSourceSink - Base class for all DataTransfer source/sink +type DataTransferDataSourceSink struct { + // REQUIRED + Component *DataTransferComponent `json:"component,omitempty"` } -// DatabaseAccountCreateUpdateParameters - Parameters to create and update Cosmos DB database accounts. -type DatabaseAccountCreateUpdateParameters struct { - // REQUIRED; Properties to create and update Azure Cosmos DB database accounts. - Properties *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` +// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type DataTransferDataSourceSink. +func (d *DataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { + return d +} - // Identity for the resource. - Identity *ManagedServiceIdentity `json:"identity,omitempty"` +// DataTransferJobFeedResults - The List operation response, that contains the Data Transfer jobs and their properties. +type DataTransferJobFeedResults struct { + // READ-ONLY; URL to get the next set of Data Transfer job list results if there are any. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // Indicates the type of database account. This can only be set at database account creation. - Kind *DatabaseAccountKind `json:"kind,omitempty"` + // READ-ONLY; List of Data Transfer jobs and their properties. + Value []*DataTransferJobGetResults `json:"value,omitempty" azure:"ro"` +} + +// DataTransferJobGetResults - A Cosmos DB Data Transfer Job +type DataTransferJobGetResults struct { + // The properties of a DataTransfer Job + Properties *DataTransferJobProperties `json:"properties,omitempty"` + + // READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DataTransferJobProperties - The properties of a DataTransfer Job +type DataTransferJobProperties struct { + // REQUIRED; Destination DataStore details + Destination DataTransferDataSourceSinkClassification `json:"destination,omitempty"` + + // REQUIRED; Source DataStore details + Source DataTransferDataSourceSinkClassification `json:"source,omitempty"` + + // Worker count + WorkerCount *int32 `json:"workerCount,omitempty"` + + // READ-ONLY; Error response for Faulted job + Error *ErrorResponse `json:"error,omitempty" azure:"ro"` + + // READ-ONLY; Job Name + JobName *string `json:"jobName,omitempty" azure:"ro"` + + // READ-ONLY; Last Updated Time (ISO-8601 format). + LastUpdatedUTCTime *time.Time `json:"lastUpdatedUtcTime,omitempty" azure:"ro"` + + // READ-ONLY; Processed Count. + ProcessedCount *int64 `json:"processedCount,omitempty" azure:"ro"` + + // READ-ONLY; Job Status + Status *string `json:"status,omitempty" azure:"ro"` + + // READ-ONLY; Total Count. + TotalCount *int64 `json:"totalCount,omitempty" azure:"ro"` +} + +// DataTransferJobsClientCancelOptions contains the optional parameters for the DataTransferJobsClient.Cancel method. +type DataTransferJobsClientCancelOptions struct { + // placeholder for future optional parameters +} + +// DataTransferJobsClientCreateOptions contains the optional parameters for the DataTransferJobsClient.Create method. +type DataTransferJobsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// DataTransferJobsClientGetOptions contains the optional parameters for the DataTransferJobsClient.Get method. +type DataTransferJobsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DataTransferJobsClientListByDatabaseAccountOptions contains the optional parameters for the DataTransferJobsClient.ListByDatabaseAccount +// method. +type DataTransferJobsClientListByDatabaseAccountOptions struct { + // placeholder for future optional parameters +} + +// DataTransferJobsClientPauseOptions contains the optional parameters for the DataTransferJobsClient.Pause method. +type DataTransferJobsClientPauseOptions struct { + // placeholder for future optional parameters +} + +// DataTransferJobsClientResumeOptions contains the optional parameters for the DataTransferJobsClient.Resume method. +type DataTransferJobsClientResumeOptions struct { + // placeholder for future optional parameters +} + +// DataTransferRegionalServiceResource - Resource for a regional service location. +type DataTransferRegionalServiceResource struct { + // READ-ONLY; The location name. + Location *string `json:"location,omitempty" azure:"ro"` + + // READ-ONLY; The regional service name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// DataTransferServiceResource - Describes the service response property. +type DataTransferServiceResource struct { + // Properties for DataTransferServiceResource. + Properties *DataTransferServiceResourceProperties `json:"properties,omitempty"` +} + +// DataTransferServiceResourceProperties - Properties for DataTransferServiceResource. +type DataTransferServiceResourceProperties struct { + // REQUIRED; ServiceType for the service. + ServiceType *ServiceType `json:"serviceType,omitempty"` + + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]interface{} + + // Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + + // Instance type for the service. + InstanceSize *ServiceSize `json:"instanceSize,omitempty"` + + // READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + + // READ-ONLY; An array that contains all of the locations for the service. + Locations []*DataTransferRegionalServiceResource `json:"locations,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type DataTransferServiceResourceProperties. +func (d *DataTransferServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties { + return &ServiceResourceProperties{ + CreationTime: d.CreationTime, + InstanceSize: d.InstanceSize, + InstanceCount: d.InstanceCount, + ServiceType: d.ServiceType, + Status: d.Status, + AdditionalProperties: d.AdditionalProperties, + } +} + +// DatabaseAccountConnectionString - Connection string for the Cosmos DB account +type DatabaseAccountConnectionString struct { + // READ-ONLY; Value of the connection string + ConnectionString *string `json:"connectionString,omitempty" azure:"ro"` + + // READ-ONLY; Description of the connection string + Description *string `json:"description,omitempty" azure:"ro"` +} + +// DatabaseAccountCreateUpdateParameters - Parameters to create and update Cosmos DB database accounts. +type DatabaseAccountCreateUpdateParameters struct { + // REQUIRED; Properties to create and update Azure Cosmos DB database accounts. + Properties *DatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` + + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // Indicates the type of database account. This can only be set at database account creation. + Kind *DatabaseAccountKind `json:"kind,omitempty"` // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -1114,6 +1669,9 @@ type DatabaseAccountCreateUpdateProperties struct { // "SystemAssignedIdentity" and more. DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // The Object representing the different Diagnostic log settings for the Cosmos DB Account. + DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` + // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` @@ -1134,6 +1692,9 @@ type DatabaseAccountCreateUpdateProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account + EnableMaterializedViews *bool `json:"enableMaterializedViews,omitempty"` + // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` @@ -1196,6 +1757,9 @@ type DatabaseAccountGetProperties struct { // "SystemAssignedIdentity" and more. DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // The Object representing the different Diagnostic log settings for the Cosmos DB Account. + DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` + // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` @@ -1216,6 +1780,9 @@ type DatabaseAccountGetProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account + EnableMaterializedViews *bool `json:"enableMaterializedViews,omitempty"` + // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` @@ -1402,6 +1969,9 @@ type DatabaseAccountUpdateProperties struct { // "SystemAssignedIdentity" and more. DefaultIdentity *string `json:"defaultIdentity,omitempty"` + // The Object representing the different Diagnostic log settings for the Cosmos DB Account. + DiagnosticLogSettings *DiagnosticLogSettings `json:"diagnosticLogSettings,omitempty"` + // Disable write operations on metadata resources (databases, containers, throughput) via account keys DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` @@ -1422,6 +1992,9 @@ type DatabaseAccountUpdateProperties struct { // Flag to indicate whether Free Tier is enabled. EnableFreeTier *bool `json:"enableFreeTier,omitempty"` + // Flag to indicate whether to enable MaterializedViews on the Cosmos DB account + EnableMaterializedViews *bool `json:"enableMaterializedViews,omitempty"` + // Enables the account to write in multiple locations EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` @@ -1593,6 +2166,12 @@ type DatabaseRestoreResource struct { DatabaseName *string `json:"databaseName,omitempty"` } +// DiagnosticLogSettings - Indicates what diagnostic log settings are to be enabled. +type DiagnosticLogSettings struct { + // Describe the level of detail with which queries are to be logged. + EnableFullTextQuery *EnableFullTextQuery `json:"enableFullTextQuery,omitempty"` +} + // ErrorResponse - Error Response. type ErrorResponse struct { // Error code. @@ -1640,11 +2219,195 @@ type FailoverPolicy struct { ID *string `json:"id,omitempty" azure:"ro"` } +// GraphAPIComputeRegionalServiceResource - Resource for a regional service location. +type GraphAPIComputeRegionalServiceResource struct { + // READ-ONLY; The regional endpoint for GraphAPICompute. + GraphAPIComputeEndpoint *string `json:"graphApiComputeEndpoint,omitempty" azure:"ro"` + + // READ-ONLY; The location name. + Location *string `json:"location,omitempty" azure:"ro"` + + // READ-ONLY; The regional service name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// GraphAPIComputeServiceResource - Describes the service response property for GraphAPICompute. +type GraphAPIComputeServiceResource struct { + // Properties for GraphAPIComputeServiceResource. + Properties *GraphAPIComputeServiceResourceProperties `json:"properties,omitempty"` +} + +// GraphAPIComputeServiceResourceProperties - Properties for GraphAPIComputeServiceResource. +type GraphAPIComputeServiceResourceProperties struct { + // REQUIRED; ServiceType for the service. + ServiceType *ServiceType `json:"serviceType,omitempty"` + + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]interface{} + + // GraphAPICompute endpoint for the service. + GraphAPIComputeEndpoint *string `json:"graphApiComputeEndpoint,omitempty"` + + // Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + + // Instance type for the service. + InstanceSize *ServiceSize `json:"instanceSize,omitempty"` + + // READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + + // READ-ONLY; An array that contains all of the locations for the service. + Locations []*GraphAPIComputeRegionalServiceResource `json:"locations,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type GraphAPIComputeServiceResourceProperties. +func (g *GraphAPIComputeServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties { + return &ServiceResourceProperties{ + CreationTime: g.CreationTime, + InstanceSize: g.InstanceSize, + InstanceCount: g.InstanceCount, + ServiceType: g.ServiceType, + Status: g.Status, + AdditionalProperties: g.AdditionalProperties, + } +} + +// GraphResource - Cosmos DB Graph resource object +type GraphResource struct { + // REQUIRED; Name of the Cosmos DB Graph + ID *string `json:"id,omitempty"` +} + +// GraphResourceCreateUpdateParameters - Parameters to create and update Cosmos DB Graph resource. +type GraphResourceCreateUpdateParameters struct { + // REQUIRED; Properties to create and update Azure Cosmos DB Graph resource. + Properties *GraphResourceCreateUpdateProperties `json:"properties,omitempty"` + + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + + // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource + // (across resource groups). A maximum of 15 tags can be provided for a + // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + // the default experience for a template type is set with "defaultExperience": + // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// GraphResourceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Graph resource. +type GraphResourceCreateUpdateProperties struct { + // REQUIRED; The standard JSON format of a Graph resource + Resource *GraphResource `json:"resource,omitempty"` + + // A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + Options *CreateUpdateOptions `json:"options,omitempty"` +} + +// GraphResourceGetProperties - The properties of an Azure Cosmos DB SQL database +type GraphResourceGetProperties struct { + Options *GraphResourceGetPropertiesOptions `json:"options,omitempty"` + Resource *GraphResourceGetPropertiesResource `json:"resource,omitempty"` +} + +type GraphResourceGetPropertiesOptions struct { + // Specifies the Autoscale settings. + AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` + + // Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer + // details. + Throughput *int32 `json:"throughput,omitempty"` +} + +type GraphResourceGetPropertiesResource struct { + // REQUIRED; Name of the Cosmos DB Graph + ID *string `json:"id,omitempty"` +} + +// GraphResourceGetResults - An Azure Cosmos DB Graph resource. +type GraphResourceGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + + // The properties of an Azure Cosmos DB Graph resource. + Properties *GraphResourceGetProperties `json:"properties,omitempty"` + + // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource + // (across resource groups). A maximum of 15 tags can be provided for a + // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + // the default experience for a template type is set with "defaultExperience": + // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// GraphResourcesClientBeginCreateUpdateGraphOptions contains the optional parameters for the GraphResourcesClient.BeginCreateUpdateGraph +// method. +type GraphResourcesClientBeginCreateUpdateGraphOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GraphResourcesClientBeginDeleteGraphResourceOptions contains the optional parameters for the GraphResourcesClient.BeginDeleteGraphResource +// method. +type GraphResourcesClientBeginDeleteGraphResourceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GraphResourcesClientGetGraphOptions contains the optional parameters for the GraphResourcesClient.GetGraph method. +type GraphResourcesClientGetGraphOptions struct { + // placeholder for future optional parameters +} + +// GraphResourcesClientListGraphsOptions contains the optional parameters for the GraphResourcesClient.ListGraphs method. +type GraphResourcesClientListGraphsOptions struct { + // placeholder for future optional parameters +} + +// GraphResourcesListResult - The List operation response, that contains the Graph resource and their properties. +type GraphResourcesListResult struct { + // READ-ONLY; List of Graph resource and their properties. + Value []*GraphResourceGetResults `json:"value,omitempty" azure:"ro"` +} + // GremlinDatabaseCreateUpdateParameters - Parameters to create and update Cosmos DB Gremlin database. type GremlinDatabaseCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Gremlin database. Properties *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -1705,6 +2468,9 @@ type GremlinDatabaseGetPropertiesResource struct { // GremlinDatabaseGetResults - An Azure Cosmos DB Gremlin database. type GremlinDatabaseGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -1740,11 +2506,23 @@ type GremlinDatabaseResource struct { ID *string `json:"id,omitempty"` } +// GremlinDatabaseRestoreResource - Specific Gremlin Databases to restore. +type GremlinDatabaseRestoreResource struct { + // The name of the gremlin database available for restore. + DatabaseName *string `json:"databaseName,omitempty"` + + // The names of the graphs available for restore. + GraphNames []*string `json:"graphNames,omitempty"` +} + // GremlinGraphCreateUpdateParameters - Parameters to create and update Cosmos DB Gremlin graph. type GremlinGraphCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Gremlin graph. Properties *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -1821,6 +2599,9 @@ type GremlinGraphGetPropertiesResource struct { // GremlinGraphGetResults - An Azure Cosmos DB Gremlin graph. type GremlinGraphGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -1928,6 +2709,13 @@ type GremlinResourcesClientBeginMigrateGremlinGraphToManualThroughputOptions str ResumeToken string } +// GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the GremlinResourcesClient.BeginRetrieveContinuousBackupInformation +// method. +type GremlinResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions contains the optional parameters for the GremlinResourcesClient.BeginUpdateGremlinDatabaseThroughput // method. type GremlinResourcesClientBeginUpdateGremlinDatabaseThroughputOptions struct { @@ -2029,6 +2817,28 @@ type IndexingPolicy struct { SpatialIndexes []*SpatialSpec `json:"spatialIndexes,omitempty"` } +// KeyWrapMetadata - Represents key wrap metadata that a key wrapping provider can use to wrap/unwrap a client encryption +// key. +type KeyWrapMetadata struct { + // Algorithm used in wrapping and unwrapping of the data encryption key. + Algorithm *string `json:"algorithm,omitempty"` + + // The name of associated KeyEncryptionKey (aka CustomerManagedKey). + Name *string `json:"name,omitempty"` + + // ProviderName of KeyStoreProvider. + Type *string `json:"type,omitempty"` + + // Reference / link to the KeyEncryptionKey. + Value *string `json:"value,omitempty"` +} + +// ListBackups - List of restorable backups for a Cassandra cluster. +type ListBackups struct { + // READ-ONLY; Container for array of backups. + Value []*BackupResource `json:"value,omitempty" azure:"ro"` +} + // ListClusters - List of managed Cassandra clusters. type ListClusters struct { // Container for the array of clusters. @@ -2098,6 +2908,9 @@ type LocationProperties struct { // READ-ONLY; Flag indicating whether the location is residency sensitive. IsResidencyRestricted *bool `json:"isResidencyRestricted,omitempty" azure:"ro"` + // READ-ONLY; The current status of location in Azure. + Status *string `json:"status,omitempty" azure:"ro"` + // READ-ONLY; Flag indicating whether the location supports availability zones or not. SupportsAvailabilityZone *bool `json:"supportsAvailabilityZone,omitempty" azure:"ro"` } @@ -2179,6 +2992,66 @@ type ManagedServiceIdentity struct { TenantID *string `json:"tenantId,omitempty" azure:"ro"` } +// MaterializedViewsBuilderRegionalServiceResource - Resource for a regional service location. +type MaterializedViewsBuilderRegionalServiceResource struct { + // READ-ONLY; The location name. + Location *string `json:"location,omitempty" azure:"ro"` + + // READ-ONLY; The regional service name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// MaterializedViewsBuilderServiceResource - Describes the service response property for MaterializedViewsBuilder. +type MaterializedViewsBuilderServiceResource struct { + // Properties for MaterializedViewsBuilderServiceResource. + Properties *MaterializedViewsBuilderServiceResourceProperties `json:"properties,omitempty"` +} + +// MaterializedViewsBuilderServiceResourceProperties - Properties for MaterializedViewsBuilderServiceResource. +type MaterializedViewsBuilderServiceResourceProperties struct { + // REQUIRED; ServiceType for the service. + ServiceType *ServiceType `json:"serviceType,omitempty"` + + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]interface{} + + // Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + + // Instance type for the service. + InstanceSize *ServiceSize `json:"instanceSize,omitempty"` + + // READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + + // READ-ONLY; An array that contains all of the locations for the service. + Locations []*MaterializedViewsBuilderRegionalServiceResource `json:"locations,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type MaterializedViewsBuilderServiceResourceProperties. +func (m *MaterializedViewsBuilderServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties { + return &ServiceResourceProperties{ + CreationTime: m.CreationTime, + InstanceSize: m.InstanceSize, + InstanceCount: m.InstanceCount, + ServiceType: m.ServiceType, + Status: m.Status, + AdditionalProperties: m.AdditionalProperties, + } +} + +// MergeParameters - The properties of an Azure Cosmos DB merge operations +type MergeParameters struct { + // Specifies whether the operation is a real merge operation or a simulation. + IsDryRun *bool `json:"isDryRun,omitempty"` +} + // Metric data type Metric struct { // READ-ONLY; The end time for the metric (ISO-8601 format). @@ -2274,6 +3147,9 @@ type MongoDBCollectionCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB MongoDB collection. Properties *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2343,6 +3219,9 @@ type MongoDBCollectionGetPropertiesResource struct { // MongoDBCollectionGetResults - An Azure Cosmos DB MongoDB collection. type MongoDBCollectionGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2392,7 +3271,10 @@ type MongoDBDatabaseCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB MongoDB database. Properties *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"` - // The location of the resource group to which the resource belongs. + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource @@ -2452,6 +3334,9 @@ type MongoDBDatabaseGetPropertiesResource struct { // MongoDBDatabaseGetResults - An Azure Cosmos DB MongoDB database. type MongoDBDatabaseGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -2501,6 +3386,20 @@ type MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions struct { ResumeToken string } +// MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition +// method. +type MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition +// method. +type MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoDBCollection // method. type MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions struct { @@ -2515,6 +3414,27 @@ type MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions struct { ResumeToken string } +// MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoRoleDefinition +// method. +type MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoUserDefinition +// method. +type MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions contains the optional parameters for the MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge +// method. +type MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions contains the optional parameters for the MongoDBResourcesClient.BeginMigrateMongoDBCollectionToAutoscale // method. type MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions struct { @@ -2543,6 +3463,20 @@ type MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions ResumeToken string } +// MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions contains the optional parameters for the MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput +// method. +type MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions contains the optional parameters for the +// MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution method. +type MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the MongoDBResourcesClient.BeginRetrieveContinuousBackupInformation // method. type MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { @@ -2588,6 +3522,18 @@ type MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions struct { // placeholder for future optional parameters } +// MongoDBResourcesClientGetMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoRoleDefinition +// method. +type MongoDBResourcesClientGetMongoRoleDefinitionOptions struct { + // placeholder for future optional parameters +} + +// MongoDBResourcesClientGetMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoUserDefinition +// method. +type MongoDBResourcesClientGetMongoUserDefinitionOptions struct { + // placeholder for future optional parameters +} + // MongoDBResourcesClientListMongoDBCollectionsOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoDBCollections // method. type MongoDBResourcesClientListMongoDBCollectionsOptions struct { @@ -2600,6 +3546,18 @@ type MongoDBResourcesClientListMongoDBDatabasesOptions struct { // placeholder for future optional parameters } +// MongoDBResourcesClientListMongoRoleDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoRoleDefinitions +// method. +type MongoDBResourcesClientListMongoRoleDefinitionsOptions struct { + // placeholder for future optional parameters +} + +// MongoDBResourcesClientListMongoUserDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoUserDefinitions +// method. +type MongoDBResourcesClientListMongoUserDefinitionsOptions struct { + // placeholder for future optional parameters +} + // MongoIndex - Cosmos DB MongoDB collection index key type MongoIndex struct { // Cosmos DB MongoDB collection index keys @@ -2624,6 +3582,101 @@ type MongoIndexOptions struct { Unique *bool `json:"unique,omitempty"` } +// MongoRoleDefinitionCreateUpdateParameters - Parameters to create and update an Azure Cosmos DB Mongo Role Definition. +type MongoRoleDefinitionCreateUpdateParameters struct { + // Properties to create and update an Azure Cosmos DB Mongo Role Definition. + Properties *MongoRoleDefinitionResource `json:"properties,omitempty"` +} + +// MongoRoleDefinitionGetResults - An Azure Cosmos DB Mongo Role Definition. +type MongoRoleDefinitionGetResults struct { + // Properties related to the Mongo Role Definition. + Properties *MongoRoleDefinitionResource `json:"properties,omitempty"` + + // READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// MongoRoleDefinitionListResult - The relevant Mongo Role Definitions. +type MongoRoleDefinitionListResult struct { + // READ-ONLY; List of Mongo Role Definitions and their properties. + Value []*MongoRoleDefinitionGetResults `json:"value,omitempty" azure:"ro"` +} + +// MongoRoleDefinitionResource - Azure Cosmos DB Mongo Role Definition resource object. +type MongoRoleDefinitionResource struct { + // The database name for which access is being granted for this Role Definition. + DatabaseName *string `json:"databaseName,omitempty"` + + // A set of privileges contained by the Role Definition. This will allow application of this Role Definition on the entire + // database account or any underlying Database / Collection. Scopes higher than + // Database are not enforceable as privilege. + Privileges []*Privilege `json:"privileges,omitempty"` + + // A user-friendly name for the Role Definition. Must be unique for the database account. + RoleName *string `json:"roleName,omitempty"` + + // The set of roles inherited by this Role Definition. + Roles []*Role `json:"roles,omitempty"` + + // Indicates whether the Role Definition was built-in or user created. + Type *MongoRoleDefinitionType `json:"type,omitempty"` +} + +// MongoUserDefinitionCreateUpdateParameters - Parameters to create and update an Azure Cosmos DB Mongo User Definition. +type MongoUserDefinitionCreateUpdateParameters struct { + // Properties to create and update an Azure Cosmos DB Mongo User Definition. + Properties *MongoUserDefinitionResource `json:"properties,omitempty"` +} + +// MongoUserDefinitionGetResults - An Azure Cosmos DB User Definition +type MongoUserDefinitionGetResults struct { + // Properties related to the User Definition. + Properties *MongoUserDefinitionResource `json:"properties,omitempty"` + + // READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// MongoUserDefinitionListResult - The relevant User Definition. +type MongoUserDefinitionListResult struct { + // READ-ONLY; List of User Definition and their properties + Value []*MongoUserDefinitionGetResults `json:"value,omitempty" azure:"ro"` +} + +// MongoUserDefinitionResource - Azure Cosmos DB Mongo User Definition resource object. +type MongoUserDefinitionResource struct { + // A custom definition for the USer Definition. + CustomData *string `json:"customData,omitempty"` + + // The database name for which access is being granted for this User Definition. + DatabaseName *string `json:"databaseName,omitempty"` + + // The Mongo Auth mechanism. For now, we only support auth mechanism SCRAM-SHA-256. + Mechanisms *string `json:"mechanisms,omitempty"` + + // The password for User Definition. Response does not contain user password. + Password *string `json:"password,omitempty"` + + // The set of roles inherited by the User Definition. + Roles []*Role `json:"roles,omitempty"` + + // The user name for User Definition. + UserName *string `json:"userName,omitempty"` +} + // NotebookWorkspace - A notebook workspace resource type NotebookWorkspace struct { // Resource properties. @@ -2970,6 +4023,84 @@ type Permission struct { NotDataActions []*string `json:"notDataActions,omitempty"` } +// PhysicalPartitionID - PhysicalPartitionId object +type PhysicalPartitionID struct { + // REQUIRED; Id of a physical partition + ID *string `json:"id,omitempty"` +} + +// PhysicalPartitionStorageInfo - The storage of a physical partition +type PhysicalPartitionStorageInfo struct { + // READ-ONLY; The unique identifier of the partition. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The storage in KB for the physical partition. + StorageInKB *float64 `json:"storageInKB,omitempty" azure:"ro"` +} + +// PhysicalPartitionStorageInfoCollection - List of physical partitions and their properties returned by a merge operation. +type PhysicalPartitionStorageInfoCollection struct { + // READ-ONLY; List of physical partitions and their properties. + PhysicalPartitionStorageInfoCollection []*PhysicalPartitionStorageInfo `json:"physicalPartitionStorageInfoCollection,omitempty" azure:"ro"` +} + +// PhysicalPartitionThroughputInfoProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties +// object +type PhysicalPartitionThroughputInfoProperties struct { + // Array of physical partition throughput info objects + PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"physicalPartitionThroughputInfo,omitempty"` +} + +// PhysicalPartitionThroughputInfoResource - PhysicalPartitionThroughputInfo object +type PhysicalPartitionThroughputInfoResource struct { + // REQUIRED; Id of a physical partition + ID *string `json:"id,omitempty"` + + // Throughput of a physical partition + Throughput *float64 `json:"throughput,omitempty"` +} + +// PhysicalPartitionThroughputInfoResult - An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. +type PhysicalPartitionThroughputInfoResult struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + + // The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object + Properties *PhysicalPartitionThroughputInfoResultProperties `json:"properties,omitempty"` + + // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource + // (across resource groups). A maximum of 15 tags can be provided for a + // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + // the default experience for a template type is set with "defaultExperience": + // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PhysicalPartitionThroughputInfoResultProperties - The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult +// object +type PhysicalPartitionThroughputInfoResultProperties struct { + // properties of physical partition throughput info + Resource *PhysicalPartitionThroughputInfoResultPropertiesResource `json:"resource,omitempty"` +} + +// PhysicalPartitionThroughputInfoResultPropertiesResource - properties of physical partition throughput info +type PhysicalPartitionThroughputInfoResultPropertiesResource struct { + // Array of physical partition throughput info objects + PhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"physicalPartitionThroughputInfo,omitempty"` +} + // PrivateEndpointConnection - A private endpoint connection type PrivateEndpointConnection struct { // Resource properties. @@ -3094,6 +4225,24 @@ type PrivateLinkServiceConnectionStateProperty struct { ActionsRequired *string `json:"actionsRequired,omitempty" azure:"ro"` } +// Privilege - The set of data plane operations permitted through this Role Definition. +type Privilege struct { + // An array of actions that are allowed. + Actions []*string `json:"actions,omitempty"` + + // An Azure Cosmos DB Mongo DB Resource. + Resource *PrivilegeResource `json:"resource,omitempty"` +} + +// PrivilegeResource - An Azure Cosmos DB Mongo DB Resource. +type PrivilegeResource struct { + // The collection name the role is applied. + Collection *string `json:"collection,omitempty"` + + // The database name the role is applied. + Db *string `json:"db,omitempty"` +} + // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -3107,12 +4256,70 @@ type ProxyResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// RedistributeThroughputParameters - Cosmos DB redistribute throughput parameters object +type RedistributeThroughputParameters struct { + // REQUIRED; Properties to redistribute throughput parameters object + Properties *RedistributeThroughputProperties `json:"properties,omitempty"` + + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + + // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource + // (across resource groups). A maximum of 15 tags can be provided for a + // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + // the default experience for a template type is set with "defaultExperience": + // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// RedistributeThroughputProperties - Properties to redistribute throughput for Azure Cosmos DB resource. +type RedistributeThroughputProperties struct { + // REQUIRED; The standard JSON format of a resource throughput + Resource *RedistributeThroughputPropertiesResource `json:"resource,omitempty"` +} + +// RedistributeThroughputPropertiesResource - Resource to redistribute throughput for Azure Cosmos DB resource +type RedistributeThroughputPropertiesResource struct { + // REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects. + SourcePhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"sourcePhysicalPartitionThroughputInfo,omitempty"` + + // REQUIRED; Array of PhysicalPartitionThroughputInfoResource objects. + TargetPhysicalPartitionThroughputInfo []*PhysicalPartitionThroughputInfoResource `json:"targetPhysicalPartitionThroughputInfo,omitempty"` + + // REQUIRED; ThroughputPolicy to apply for throughput redistribution + ThroughputPolicy *ThroughputPolicyType `json:"throughputPolicy,omitempty"` +} + // RegionForOnlineOffline - Cosmos DB region to online or offline. type RegionForOnlineOffline struct { // REQUIRED; Cosmos DB region, with spaces between words and each word capitalized. Region *string `json:"region,omitempty"` } +// RegionalServiceResource - Resource for a regional service location. +type RegionalServiceResource struct { + // READ-ONLY; The location name. + Location *string `json:"location,omitempty" azure:"ro"` + + // READ-ONLY; The regional service name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -3154,36 +4361,161 @@ type RestorableDatabaseAccountProperties struct { // The time at which the restorable database account has been deleted (ISO-8601 format). DeletionTime *time.Time `json:"deletionTime,omitempty"` + // The least recent time at which the database account can be restored to (ISO-8601 format). + OldestRestorableTime *time.Time `json:"oldestRestorableTime,omitempty"` + // READ-ONLY; The API type of the restorable database account. APIType *APIType `json:"apiType,omitempty" azure:"ro"` - // READ-ONLY; List of regions where the of the database account can be restored from. - RestorableLocations []*RestorableLocationResource `json:"restorableLocations,omitempty" azure:"ro"` + // READ-ONLY; List of regions where the of the database account can be restored from. + RestorableLocations []*RestorableLocationResource `json:"restorableLocations,omitempty" azure:"ro"` +} + +// RestorableDatabaseAccountsClientGetByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.GetByLocation +// method. +type RestorableDatabaseAccountsClientGetByLocationOptions struct { + // placeholder for future optional parameters +} + +// RestorableDatabaseAccountsClientListByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.ListByLocation +// method. +type RestorableDatabaseAccountsClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// RestorableDatabaseAccountsClientListOptions contains the optional parameters for the RestorableDatabaseAccountsClient.List +// method. +type RestorableDatabaseAccountsClientListOptions struct { + // placeholder for future optional parameters +} + +// RestorableDatabaseAccountsListResult - The List operation response, that contains the restorable database accounts and +// their properties. +type RestorableDatabaseAccountsListResult struct { + // READ-ONLY; List of restorable database accounts and their properties. + Value []*RestorableDatabaseAccountGetResult `json:"value,omitempty" azure:"ro"` +} + +// RestorableGremlinDatabaseGetResult - An Azure Cosmos DB Gremlin database event +type RestorableGremlinDatabaseGetResult struct { + // The properties of a Gremlin database event. + Properties *RestorableGremlinDatabaseProperties `json:"properties,omitempty"` + + // READ-ONLY; The unique resource Identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// RestorableGremlinDatabaseProperties - The properties of an Azure Cosmos DB Gremlin database event +type RestorableGremlinDatabaseProperties struct { + // The resource of an Azure Cosmos DB Gremlin database event + Resource *RestorableGremlinDatabasePropertiesResource `json:"resource,omitempty"` +} + +// RestorableGremlinDatabasePropertiesResource - The resource of an Azure Cosmos DB Gremlin database event +type RestorableGremlinDatabasePropertiesResource struct { + // READ-ONLY; The time when this database event happened. + EventTimestamp *string `json:"eventTimestamp,omitempty" azure:"ro"` + + // READ-ONLY; The operation type of this database event. + OperationType *OperationType `json:"operationType,omitempty" azure:"ro"` + + // READ-ONLY; The name of this Gremlin database. + OwnerID *string `json:"ownerId,omitempty" azure:"ro"` + + // READ-ONLY; The resource ID of this Gremlin database. + OwnerResourceID *string `json:"ownerResourceId,omitempty" azure:"ro"` + + // READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty" azure:"ro"` +} + +// RestorableGremlinDatabasesClientListOptions contains the optional parameters for the RestorableGremlinDatabasesClient.List +// method. +type RestorableGremlinDatabasesClientListOptions struct { + // placeholder for future optional parameters +} + +// RestorableGremlinDatabasesListResult - The List operation response, that contains the Gremlin database events and their +// properties. +type RestorableGremlinDatabasesListResult struct { + // READ-ONLY; List of Gremlin database events and their properties. + Value []*RestorableGremlinDatabaseGetResult `json:"value,omitempty" azure:"ro"` +} + +// RestorableGremlinGraphGetResult - An Azure Cosmos DB Gremlin graph event +type RestorableGremlinGraphGetResult struct { + // The properties of a Gremlin graph event. + Properties *RestorableGremlinGraphProperties `json:"properties,omitempty"` + + // READ-ONLY; The unique resource Identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// RestorableGremlinGraphProperties - The properties of an Azure Cosmos DB Gremlin graph event +type RestorableGremlinGraphProperties struct { + // The resource of an Azure Cosmos DB Gremlin graph event + Resource *RestorableGremlinGraphPropertiesResource `json:"resource,omitempty"` +} + +// RestorableGremlinGraphPropertiesResource - The resource of an Azure Cosmos DB Gremlin graph event +type RestorableGremlinGraphPropertiesResource struct { + // READ-ONLY; The time when this graph event happened. + EventTimestamp *string `json:"eventTimestamp,omitempty" azure:"ro"` + + // READ-ONLY; The operation type of this graph event. + OperationType *OperationType `json:"operationType,omitempty" azure:"ro"` + + // READ-ONLY; The name of this Gremlin graph. + OwnerID *string `json:"ownerId,omitempty" azure:"ro"` + + // READ-ONLY; The resource ID of this Gremlin graph. + OwnerResourceID *string `json:"ownerResourceId,omitempty" azure:"ro"` + + // READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty" azure:"ro"` } -// RestorableDatabaseAccountsClientGetByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.GetByLocation -// method. -type RestorableDatabaseAccountsClientGetByLocationOptions struct { - // placeholder for future optional parameters +// RestorableGremlinGraphsClientListOptions contains the optional parameters for the RestorableGremlinGraphsClient.List method. +type RestorableGremlinGraphsClientListOptions struct { + // Restorable Gremlin graphs event feed end time. + EndTime *string + // The resource ID of the Gremlin database. + RestorableGremlinDatabaseRid *string + // Restorable Gremlin graphs event feed start time. + StartTime *string } -// RestorableDatabaseAccountsClientListByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.ListByLocation -// method. -type RestorableDatabaseAccountsClientListByLocationOptions struct { - // placeholder for future optional parameters +// RestorableGremlinGraphsListResult - The List operation response, that contains the Gremlin graph events and their properties. +type RestorableGremlinGraphsListResult struct { + // READ-ONLY; List of Gremlin graph events and their properties. + Value []*RestorableGremlinGraphGetResult `json:"value,omitempty" azure:"ro"` } -// RestorableDatabaseAccountsClientListOptions contains the optional parameters for the RestorableDatabaseAccountsClient.List +// RestorableGremlinResourcesClientListOptions contains the optional parameters for the RestorableGremlinResourcesClient.List // method. -type RestorableDatabaseAccountsClientListOptions struct { - // placeholder for future optional parameters +type RestorableGremlinResourcesClientListOptions struct { + // The location where the restorable resources are located. + RestoreLocation *string + // The timestamp when the restorable resources existed. + RestoreTimestampInUTC *string } -// RestorableDatabaseAccountsListResult - The List operation response, that contains the restorable database accounts and -// their properties. -type RestorableDatabaseAccountsListResult struct { - // READ-ONLY; List of restorable database accounts and their properties. - Value []*RestorableDatabaseAccountGetResult `json:"value,omitempty" azure:"ro"` +// RestorableGremlinResourcesListResult - The List operation response, that contains the restorable Gremlin resources. +type RestorableGremlinResourcesListResult struct { + // READ-ONLY; List of restorable Gremlin resources, including the gremlin database and graph names. + Value []*GremlinDatabaseRestoreResource `json:"value,omitempty" azure:"ro"` } // RestorableLocationResource - Properties of the regional restorable account. @@ -3243,8 +4575,12 @@ type RestorableMongodbCollectionPropertiesResource struct { // RestorableMongodbCollectionsClientListOptions contains the optional parameters for the RestorableMongodbCollectionsClient.List // method. type RestorableMongodbCollectionsClientListOptions struct { + // Restorable MongoDB collections event feed end time. + EndTime *string // The resource ID of the MongoDB database. RestorableMongodbDatabaseRid *string + // Restorable MongoDB collections event feed start time. + StartTime *string } // RestorableMongodbCollectionsListResult - The List operation response, that contains the MongoDB collection events and their @@ -3371,6 +4707,9 @@ type RestorableSQLContainerPropertiesResourceContainer struct { // Analytical TTL. AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` + // The client encryption policy for the container. + ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"` + // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` @@ -3402,11 +4741,11 @@ type RestorableSQLContainerPropertiesResourceContainer struct { // RestorableSQLContainersClientListOptions contains the optional parameters for the RestorableSQLContainersClient.List method. type RestorableSQLContainersClientListOptions struct { - // The snapshot create timestamp before which snapshots need to be listed. + // Restorable Sql containers event feed end time. EndTime *string // The resource ID of the SQL database. RestorableSQLDatabaseRid *string - // The snapshot create timestamp after which snapshots need to be listed. + // Restorable Sql containers event feed start time. StartTime *string } @@ -3507,11 +4846,82 @@ type RestorableSQLResourcesListResult struct { Value []*DatabaseRestoreResource `json:"value,omitempty" azure:"ro"` } +// RestorableTableGetResult - An Azure Cosmos DB Table event +type RestorableTableGetResult struct { + // The properties of a Table event. + Properties *RestorableTableProperties `json:"properties,omitempty"` + + // READ-ONLY; The unique resource Identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// RestorableTableProperties - The properties of an Azure Cosmos DB Table event +type RestorableTableProperties struct { + // The resource of an Azure Cosmos DB Table event + Resource *RestorableTablePropertiesResource `json:"resource,omitempty"` +} + +// RestorableTablePropertiesResource - The resource of an Azure Cosmos DB Table event +type RestorableTablePropertiesResource struct { + // READ-ONLY; The time when this table event happened. + EventTimestamp *string `json:"eventTimestamp,omitempty" azure:"ro"` + + // READ-ONLY; The operation type of this table event. + OperationType *OperationType `json:"operationType,omitempty" azure:"ro"` + + // READ-ONLY; The name of this Table. + OwnerID *string `json:"ownerId,omitempty" azure:"ro"` + + // READ-ONLY; The resource ID of this Table. + OwnerResourceID *string `json:"ownerResourceId,omitempty" azure:"ro"` + + // READ-ONLY; A system generated property. A unique identifier. + Rid *string `json:"_rid,omitempty" azure:"ro"` +} + +// RestorableTableResourcesClientListOptions contains the optional parameters for the RestorableTableResourcesClient.List +// method. +type RestorableTableResourcesClientListOptions struct { + // The location where the restorable resources are located. + RestoreLocation *string + // The timestamp when the restorable resources existed. + RestoreTimestampInUTC *string +} + +// RestorableTableResourcesListResult - List of restorable table names. +type RestorableTableResourcesListResult struct { + // READ-ONLY; List of restorable table names. + Value []*string `json:"value,omitempty" azure:"ro"` +} + +// RestorableTablesClientListOptions contains the optional parameters for the RestorableTablesClient.List method. +type RestorableTablesClientListOptions struct { + // Restorable Tables event feed end time. + EndTime *string + // Restorable Tables event feed start time. + StartTime *string +} + +// RestorableTablesListResult - The List operation response, that contains the Table events and their properties. +type RestorableTablesListResult struct { + // READ-ONLY; List of Table events and their properties. + Value []*RestorableTableGetResult `json:"value,omitempty" azure:"ro"` +} + // RestoreParameters - Parameters to indicate the information about the restore. type RestoreParameters struct { // List of specific databases available for restore. DatabasesToRestore []*DatabaseRestoreResource `json:"databasesToRestore,omitempty"` + // List of specific gremlin databases available for restore. + GremlinDatabasesToRestore []*GremlinDatabaseRestoreResource `json:"gremlinDatabasesToRestore,omitempty"` + // Describes the mode of the restore. RestoreMode *RestoreMode `json:"restoreMode,omitempty"` @@ -3521,6 +4931,58 @@ type RestoreParameters struct { // Time to which the account has to be restored (ISO-8601 format). RestoreTimestampInUTC *time.Time `json:"restoreTimestampInUtc,omitempty"` + + // List of specific tables available for restore. + TablesToRestore []*string `json:"tablesToRestore,omitempty"` +} + +// RetrieveThroughputParameters - Cosmos DB retrieve throughput parameters object +type RetrieveThroughputParameters struct { + // REQUIRED; Properties to retrieve throughput parameters object + Properties *RetrieveThroughputProperties `json:"properties,omitempty"` + + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + + // The location of the resource group to which the resource belongs. + Location *string `json:"location,omitempty"` + + // Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource + // (across resource groups). A maximum of 15 tags can be provided for a + // resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + // the default experience for a template type is set with "defaultExperience": + // "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; The unique resource identifier of the ARM resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the ARM resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// RetrieveThroughputProperties - Properties to retrieve throughput for Azure Cosmos DB resource. +type RetrieveThroughputProperties struct { + // REQUIRED; The standard JSON format of a resource throughput + Resource *RetrieveThroughputPropertiesResource `json:"resource,omitempty"` +} + +// RetrieveThroughputPropertiesResource - Resource to retrieve throughput information for Cosmos DB resource +type RetrieveThroughputPropertiesResource struct { + // REQUIRED; Array of PhysicalPartitionId objects. + PhysicalPartitionIDs []*PhysicalPartitionID `json:"physicalPartitionIds,omitempty"` +} + +// Role - The set of roles permitted through this Role Definition. +type Role struct { + // The database name the role is applied. + Db *string `json:"db,omitempty"` + + // The role name. + Role *string `json:"role,omitempty"` } // SQLContainerCreateUpdateParameters - Parameters to create and update Cosmos DB container. @@ -3528,6 +4990,9 @@ type SQLContainerCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB container. Properties *SQLContainerCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3579,6 +5044,9 @@ type SQLContainerGetPropertiesResource struct { // Analytical TTL. AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` + // The client encryption policy for the container. + ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"` + // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` @@ -3607,6 +5075,9 @@ type SQLContainerGetPropertiesResource struct { // SQLContainerGetResults - An Azure Cosmos DB container. type SQLContainerGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3644,6 +5115,9 @@ type SQLContainerResource struct { // Analytical TTL. AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` + // The client encryption policy for the container. + ClientEncryptionPolicy *ClientEncryptionPolicy `json:"clientEncryptionPolicy,omitempty"` + // The conflict resolution policy for the container. ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` @@ -3661,11 +5135,33 @@ type SQLContainerResource struct { UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` } +// SQLDataTransferDataSourceSink - A CosmosDB Cassandra API data source/sink +type SQLDataTransferDataSourceSink struct { + // REQUIRED + Component *DataTransferComponent `json:"component,omitempty"` + + // REQUIRED + ContainerName *string `json:"containerName,omitempty"` + + // REQUIRED + DatabaseName *string `json:"databaseName,omitempty"` +} + +// GetDataTransferDataSourceSink implements the DataTransferDataSourceSinkClassification interface for type SQLDataTransferDataSourceSink. +func (s *SQLDataTransferDataSourceSink) GetDataTransferDataSourceSink() *DataTransferDataSourceSink { + return &DataTransferDataSourceSink{ + Component: s.Component, + } +} + // SQLDatabaseCreateUpdateParameters - Parameters to create and update Cosmos DB SQL database. type SQLDatabaseCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB SQL database. Properties *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3732,6 +5228,9 @@ type SQLDatabaseGetPropertiesResource struct { // SQLDatabaseGetResults - An Azure Cosmos DB SQL database. type SQLDatabaseGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -3767,6 +5266,73 @@ type SQLDatabaseResource struct { ID *string `json:"id,omitempty"` } +// SQLDedicatedGatewayRegionalServiceResource - Resource for a regional service location. +type SQLDedicatedGatewayRegionalServiceResource struct { + // READ-ONLY; The location name. + Location *string `json:"location,omitempty" azure:"ro"` + + // READ-ONLY; The regional service name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The regional endpoint for SqlDedicatedGateway. + SQLDedicatedGatewayEndpoint *string `json:"sqlDedicatedGatewayEndpoint,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// SQLDedicatedGatewayServiceResource - Describes the service response property for SqlDedicatedGateway. +type SQLDedicatedGatewayServiceResource struct { + // Properties for SqlDedicatedGatewayServiceResource. + Properties *SQLDedicatedGatewayServiceResourceProperties `json:"properties,omitempty"` +} + +// SQLDedicatedGatewayServiceResourceProperties - Properties for SqlDedicatedGatewayServiceResource. +type SQLDedicatedGatewayServiceResourceProperties struct { + // REQUIRED; ServiceType for the service. + ServiceType *ServiceType `json:"serviceType,omitempty"` + + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]interface{} + + // Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + + // Instance type for the service. + InstanceSize *ServiceSize `json:"instanceSize,omitempty"` + + // SqlDedicatedGateway endpoint for the service. + SQLDedicatedGatewayEndpoint *string `json:"sqlDedicatedGatewayEndpoint,omitempty"` + + // READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + + // READ-ONLY; An array that contains all of the locations for the service. + Locations []*SQLDedicatedGatewayRegionalServiceResource `json:"locations,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type SQLDedicatedGatewayServiceResourceProperties. +func (s *SQLDedicatedGatewayServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties { + return &ServiceResourceProperties{ + CreationTime: s.CreationTime, + InstanceSize: s.InstanceSize, + InstanceCount: s.InstanceCount, + ServiceType: s.ServiceType, + Status: s.Status, + AdditionalProperties: s.AdditionalProperties, + } +} + +// SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateClientEncryptionKey +// method. +type SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // SQLResourcesClientBeginCreateUpdateSQLContainerOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateSQLContainer // method. type SQLResourcesClientBeginCreateUpdateSQLContainerOptions struct { @@ -3865,6 +5431,13 @@ type SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions struct { ResumeToken string } +// SQLResourcesClientBeginListSQLContainerPartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginListSQLContainerPartitionMerge +// method. +type SQLResourcesClientBeginListSQLContainerPartitionMergeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions contains the optional parameters for the SQLResourcesClient.BeginMigrateSQLContainerToAutoscale // method. type SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions struct { @@ -3900,6 +5473,20 @@ type SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { ResumeToken string } +// SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRedistributeThroughput +// method. +type SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution +// method. +type SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // SQLResourcesClientBeginUpdateSQLContainerThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginUpdateSQLContainerThroughput // method. type SQLResourcesClientBeginUpdateSQLContainerThroughputOptions struct { @@ -3914,6 +5501,12 @@ type SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions struct { ResumeToken string } +// SQLResourcesClientGetClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.GetClientEncryptionKey +// method. +type SQLResourcesClientGetClientEncryptionKeyOptions struct { + // placeholder for future optional parameters +} + // SQLResourcesClientGetSQLContainerOptions contains the optional parameters for the SQLResourcesClient.GetSQLContainer method. type SQLResourcesClientGetSQLContainerOptions struct { // placeholder for future optional parameters @@ -3965,6 +5558,12 @@ type SQLResourcesClientGetSQLUserDefinedFunctionOptions struct { // placeholder for future optional parameters } +// SQLResourcesClientListClientEncryptionKeysOptions contains the optional parameters for the SQLResourcesClient.ListClientEncryptionKeys +// method. +type SQLResourcesClientListClientEncryptionKeysOptions struct { + // placeholder for future optional parameters +} + // SQLResourcesClientListSQLContainersOptions contains the optional parameters for the SQLResourcesClient.ListSQLContainers // method. type SQLResourcesClientListSQLContainersOptions struct { @@ -4098,6 +5697,9 @@ type SQLStoredProcedureCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB storedProcedure. Properties *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4151,6 +5753,9 @@ type SQLStoredProcedureGetPropertiesResource struct { // SQLStoredProcedureGetResults - An Azure Cosmos DB storedProcedure. type SQLStoredProcedureGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4194,6 +5799,9 @@ type SQLTriggerCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB trigger. Properties *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4253,6 +5861,9 @@ type SQLTriggerGetPropertiesResource struct { // SQLTriggerGetResults - An Azure Cosmos DB trigger. type SQLTriggerGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4302,6 +5913,9 @@ type SQLUserDefinedFunctionCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB userDefinedFunction. Properties *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4355,6 +5969,9 @@ type SQLUserDefinedFunctionGetPropertiesResource struct { // SQLUserDefinedFunctionGetResults - An Azure Cosmos DB userDefinedFunction. type SQLUserDefinedFunctionGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4398,6 +6015,103 @@ type SeedNode struct { IPAddress *string `json:"ipAddress,omitempty"` } +// ServiceClientBeginCreateOptions contains the optional parameters for the ServiceClient.BeginCreate method. +type ServiceClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method. +type ServiceClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. +type ServiceClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServiceClientListOptions contains the optional parameters for the ServiceClient.List method. +type ServiceClientListOptions struct { + // placeholder for future optional parameters +} + +// ServiceResource - Properties for the database account. +type ServiceResource struct { + // Services response resource. + Properties ServiceResourcePropertiesClassification `json:"properties,omitempty"` + + // READ-ONLY; The unique resource identifier of the database account. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the database account. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of Azure resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ServiceResourceCreateUpdateParameters - Parameters for Create or Update Request for ServiceResource +type ServiceResourceCreateUpdateParameters struct { + // Properties in ServiceResourceCreateUpdateParameters. + Properties *ServiceResourceCreateUpdateProperties `json:"properties,omitempty"` +} + +// ServiceResourceCreateUpdateProperties - Properties in ServiceResourceCreateUpdateParameters. +type ServiceResourceCreateUpdateProperties struct { + // Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + + // Instance type for the service. + InstanceSize *ServiceSize `json:"instanceSize,omitempty"` + + // ServiceType for the service. + ServiceType *ServiceType `json:"serviceType,omitempty"` +} + +// ServiceResourceListResult - The List operation response, that contains the Service Resource and their properties. +type ServiceResourceListResult struct { + // READ-ONLY; List of Service Resource and their properties. + Value []*ServiceResource `json:"value,omitempty" azure:"ro"` +} + +// ServiceResourcePropertiesClassification provides polymorphic access to related types. +// Call the interface's GetServiceResourceProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *DataTransferServiceResourceProperties, *GraphAPIComputeServiceResourceProperties, *MaterializedViewsBuilderServiceResourceProperties, +// - *SQLDedicatedGatewayServiceResourceProperties, *ServiceResourceProperties +type ServiceResourcePropertiesClassification interface { + // GetServiceResourceProperties returns the ServiceResourceProperties content of the underlying type. + GetServiceResourceProperties() *ServiceResourceProperties +} + +// ServiceResourceProperties - Services response resource. +type ServiceResourceProperties struct { + // REQUIRED; ServiceType for the service. + ServiceType *ServiceType `json:"serviceType,omitempty"` + + // OPTIONAL; Contains additional key/value pairs not defined in the schema. + AdditionalProperties map[string]interface{} + + // Instance count for the service. + InstanceCount *int32 `json:"instanceCount,omitempty"` + + // Instance type for the service. + InstanceSize *ServiceSize `json:"instanceSize,omitempty"` + + // READ-ONLY; Time of the last state change (ISO-8601 format). + CreationTime *time.Time `json:"creationTime,omitempty" azure:"ro"` + + // READ-ONLY; Describes the status of a service. + Status *ServiceStatus `json:"status,omitempty" azure:"ro"` +} + +// GetServiceResourceProperties implements the ServiceResourcePropertiesClassification interface for type ServiceResourceProperties. +func (s *ServiceResourceProperties) GetServiceResourceProperties() *ServiceResourceProperties { + return s +} + type SpatialSpec struct { // The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) Path *string `json:"path,omitempty"` @@ -4432,6 +6146,9 @@ type TableCreateUpdateParameters struct { // REQUIRED; Properties to create and update Azure Cosmos DB Table. Properties *TableCreateUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4492,6 +6209,9 @@ type TableGetPropertiesResource struct { // TableGetResults - An Azure Cosmos DB Table. type TableGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4555,6 +6275,13 @@ type TableResourcesClientBeginMigrateTableToManualThroughputOptions struct { ResumeToken string } +// TableResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the TableResourcesClient.BeginRetrieveContinuousBackupInformation +// method. +type TableResourcesClientBeginRetrieveContinuousBackupInformationOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // TableResourcesClientBeginUpdateTableThroughputOptions contains the optional parameters for the TableResourcesClient.BeginUpdateTableThroughput // method. type TableResourcesClientBeginUpdateTableThroughputOptions struct { @@ -4617,6 +6344,9 @@ type ThroughputSettingsGetPropertiesResource struct { // ThroughputSettingsGetResults - An Azure Cosmos DB resource throughput. type ThroughputSettingsGetResults struct { + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` @@ -4661,6 +6391,9 @@ type ThroughputSettingsUpdateParameters struct { // REQUIRED; Properties to update Azure Cosmos DB resource throughput. Properties *ThroughputSettingsUpdateProperties `json:"properties,omitempty"` + // Identity for the resource. + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // The location of the resource group to which the resource belongs. Location *string `json:"location,omitempty"` diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models_serde.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models_serde.go index 91f109493dd7..81da4b81ac0b 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models_serde.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_models_serde.go @@ -12,6 +12,7 @@ import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "reflect" ) @@ -19,6 +20,7 @@ import ( func (a ARMResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", a.ID) + populate(objectMap, "identity", a.Identity) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) populate(objectMap, "tags", a.Tags) @@ -26,6 +28,54 @@ func (a ARMResourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type AuthenticationMethodLdapProperties. +func (a AuthenticationMethodLdapProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "searchBaseDistinguishedName", a.SearchBaseDistinguishedName) + populate(objectMap, "searchFilterTemplate", a.SearchFilterTemplate) + populate(objectMap, "serverCertificates", a.ServerCertificates) + populate(objectMap, "serverHostname", a.ServerHostname) + populate(objectMap, "serverPort", a.ServerPort) + populate(objectMap, "serviceUserDistinguishedName", a.ServiceUserDistinguishedName) + populate(objectMap, "serviceUserPassword", a.ServiceUserPassword) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AzureBlobDataTransferDataSourceSink. +func (a AzureBlobDataTransferDataSourceSink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["component"] = DataTransferComponentAzureBlobStorage + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "endpointUrl", a.EndpointURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureBlobDataTransferDataSourceSink. +func (a *AzureBlobDataTransferDataSourceSink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "component": + err = unpopulate(val, "Component", &a.Component) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "endpointUrl": + err = unpopulate(val, "EndpointURL", &a.EndpointURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BackupPolicyMigrationState. func (b BackupPolicyMigrationState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -61,10 +111,73 @@ func (b *BackupPolicyMigrationState) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BackupResourceProperties. +func (b BackupResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "timestamp", b.Timestamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceProperties. +func (b *BackupResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &b.Timestamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CassandraDataTransferDataSourceSink. +func (c CassandraDataTransferDataSourceSink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["component"] = DataTransferComponentCosmosDBCassandra + populate(objectMap, "keyspaceName", c.KeyspaceName) + populate(objectMap, "tableName", c.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CassandraDataTransferDataSourceSink. +func (c *CassandraDataTransferDataSourceSink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "component": + err = unpopulate(val, "Component", &c.Component) + delete(rawMsg, key) + case "keyspaceName": + err = unpopulate(val, "KeyspaceName", &c.KeyspaceName) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &c.TableName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CassandraKeyspaceCreateUpdateParameters. func (c CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -77,6 +190,7 @@ func (c CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (c CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -98,6 +212,7 @@ func (c CassandraSchema) MarshalJSON() ([]byte, error) { func (c CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -110,6 +225,33 @@ func (c CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (c CassandraTableGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CassandraViewCreateUpdateParameters. +func (c CassandraViewCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CassandraViewGetResults. +func (c CassandraViewGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", c.ID) + populate(objectMap, "identity", c.Identity) populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -118,6 +260,104 @@ func (c CassandraTableGetResults) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyGetPropertiesResource. +func (c ClientEncryptionKeyGetPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) + populate(objectMap, "_etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "keyWrapMetadata", c.KeyWrapMetadata) + populate(objectMap, "_rid", c.Rid) + populate(objectMap, "_ts", c.Ts) + populateByteArray(objectMap, "wrappedDataEncryptionKey", c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyGetPropertiesResource. +func (c *ClientEncryptionKeyGetPropertiesResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptionAlgorithm": + err = unpopulate(val, "EncryptionAlgorithm", &c.EncryptionAlgorithm) + delete(rawMsg, key) + case "_etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "keyWrapMetadata": + err = unpopulate(val, "KeyWrapMetadata", &c.KeyWrapMetadata) + delete(rawMsg, key) + case "_rid": + err = unpopulate(val, "Rid", &c.Rid) + delete(rawMsg, key) + case "_ts": + err = unpopulate(val, "Ts", &c.Ts) + delete(rawMsg, key) + case "wrappedDataEncryptionKey": + err = runtime.DecodeByteArray(string(val), &c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionKeyResource. +func (c ClientEncryptionKeyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "encryptionAlgorithm", c.EncryptionAlgorithm) + populate(objectMap, "id", c.ID) + populate(objectMap, "keyWrapMetadata", c.KeyWrapMetadata) + populateByteArray(objectMap, "wrappedDataEncryptionKey", c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientEncryptionKeyResource. +func (c *ClientEncryptionKeyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "encryptionAlgorithm": + err = unpopulate(val, "EncryptionAlgorithm", &c.EncryptionAlgorithm) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "keyWrapMetadata": + err = unpopulate(val, "KeyWrapMetadata", &c.KeyWrapMetadata) + delete(rawMsg, key) + case "wrappedDataEncryptionKey": + err = runtime.DecodeByteArray(string(val), &c.WrappedDataEncryptionKey, runtime.Base64StdFormat) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientEncryptionPolicy. +func (c ClientEncryptionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "includedPaths", c.IncludedPaths) + populate(objectMap, "policyFormatVersion", c.PolicyFormatVersion) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type ClusterResource. func (c ClusterResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -178,6 +418,7 @@ func (c ContainerPartitionKey) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type ContinuousModeBackupPolicy. func (c ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "continuousModeProperties", c.ContinuousModeProperties) populate(objectMap, "migrationState", c.MigrationState) objectMap["type"] = BackupPolicyTypeContinuous return json.Marshal(objectMap) @@ -192,6 +433,9 @@ func (c *ContinuousModeBackupPolicy) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "continuousModeProperties": + err = unpopulate(val, "ContinuousModeProperties", &c.ContinuousModeProperties) + delete(rawMsg, key) case "migrationState": err = unpopulate(val, "MigrationState", &c.MigrationState) delete(rawMsg, key) @@ -219,6 +463,7 @@ func (d DataCenterResource) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type DataCenterResourceProperties. func (d DataCenterResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "authenticationMethodLdapProperties", d.AuthenticationMethodLdapProperties) populate(objectMap, "availabilityZone", d.AvailabilityZone) populate(objectMap, "backupStorageCustomerKeyUri", d.BackupStorageCustomerKeyURI) populate(objectMap, "base64EncodedCassandraYamlFragment", d.Base64EncodedCassandraYamlFragment) @@ -234,6 +479,127 @@ func (d DataCenterResourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type DataTransferJobProperties. +func (d DataTransferJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destination", d.Destination) + populate(objectMap, "error", d.Error) + populate(objectMap, "jobName", d.JobName) + populateTimeRFC3339(objectMap, "lastUpdatedUtcTime", d.LastUpdatedUTCTime) + populate(objectMap, "processedCount", d.ProcessedCount) + populate(objectMap, "source", d.Source) + populate(objectMap, "status", d.Status) + populate(objectMap, "totalCount", d.TotalCount) + populate(objectMap, "workerCount", d.WorkerCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferJobProperties. +func (d *DataTransferJobProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destination": + d.Destination, err = unmarshalDataTransferDataSourceSinkClassification(val) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &d.Error) + delete(rawMsg, key) + case "jobName": + err = unpopulate(val, "JobName", &d.JobName) + delete(rawMsg, key) + case "lastUpdatedUtcTime": + err = unpopulateTimeRFC3339(val, "LastUpdatedUTCTime", &d.LastUpdatedUTCTime) + delete(rawMsg, key) + case "processedCount": + err = unpopulate(val, "ProcessedCount", &d.ProcessedCount) + delete(rawMsg, key) + case "source": + d.Source, err = unmarshalDataTransferDataSourceSinkClassification(val) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "totalCount": + err = unpopulate(val, "TotalCount", &d.TotalCount) + delete(rawMsg, key) + case "workerCount": + err = unpopulate(val, "WorkerCount", &d.WorkerCount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataTransferServiceResourceProperties. +func (d DataTransferServiceResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", d.CreationTime) + populate(objectMap, "instanceCount", d.InstanceCount) + populate(objectMap, "instanceSize", d.InstanceSize) + populate(objectMap, "locations", d.Locations) + objectMap["serviceType"] = ServiceTypeDataTransfer + populate(objectMap, "status", d.Status) + if d.AdditionalProperties != nil { + for key, val := range d.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataTransferServiceResourceProperties. +func (d *DataTransferServiceResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &d.CreationTime) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &d.InstanceCount) + delete(rawMsg, key) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &d.InstanceSize) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &d.Locations) + delete(rawMsg, key) + case "serviceType": + err = unpopulate(val, "ServiceType", &d.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + default: + if d.AdditionalProperties == nil { + d.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + d.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DatabaseAccountCreateUpdateParameters. func (d DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -262,12 +628,14 @@ func (d DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "createMode", d.CreateMode) populate(objectMap, "databaseAccountOfferType", d.DatabaseAccountOfferType) populate(objectMap, "defaultIdentity", d.DefaultIdentity) + populate(objectMap, "diagnosticLogSettings", d.DiagnosticLogSettings) populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) populate(objectMap, "enableFreeTier", d.EnableFreeTier) + populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) populate(objectMap, "ipRules", d.IPRules) populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) @@ -323,6 +691,9 @@ func (d *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(data []byte) error case "defaultIdentity": err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) delete(rawMsg, key) + case "diagnosticLogSettings": + err = unpopulate(val, "DiagnosticLogSettings", &d.DiagnosticLogSettings) + delete(rawMsg, key) case "disableKeyBasedMetadataWriteAccess": err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) delete(rawMsg, key) @@ -341,6 +712,9 @@ func (d *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(data []byte) error case "enableFreeTier": err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) delete(rawMsg, key) + case "enableMaterializedViews": + err = unpopulate(val, "EnableMaterializedViews", &d.EnableMaterializedViews) + delete(rawMsg, key) case "enableMultipleWriteLocations": err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) delete(rawMsg, key) @@ -393,6 +767,7 @@ func (d DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "createMode", d.CreateMode) populate(objectMap, "databaseAccountOfferType", d.DatabaseAccountOfferType) populate(objectMap, "defaultIdentity", d.DefaultIdentity) + populate(objectMap, "diagnosticLogSettings", d.DiagnosticLogSettings) populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) populate(objectMap, "documentEndpoint", d.DocumentEndpoint) @@ -400,6 +775,7 @@ func (d DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) populate(objectMap, "enableFreeTier", d.EnableFreeTier) + populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) populate(objectMap, "failoverPolicies", d.FailoverPolicies) populate(objectMap, "ipRules", d.IPRules) @@ -461,6 +837,9 @@ func (d *DatabaseAccountGetProperties) UnmarshalJSON(data []byte) error { case "defaultIdentity": err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) delete(rawMsg, key) + case "diagnosticLogSettings": + err = unpopulate(val, "DiagnosticLogSettings", &d.DiagnosticLogSettings) + delete(rawMsg, key) case "disableKeyBasedMetadataWriteAccess": err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) delete(rawMsg, key) @@ -482,6 +861,9 @@ func (d *DatabaseAccountGetProperties) UnmarshalJSON(data []byte) error { case "enableFreeTier": err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) delete(rawMsg, key) + case "enableMaterializedViews": + err = unpopulate(val, "EnableMaterializedViews", &d.EnableMaterializedViews) + delete(rawMsg, key) case "enableMultipleWriteLocations": err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) delete(rawMsg, key) @@ -575,12 +957,14 @@ func (d DatabaseAccountUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "consistencyPolicy", d.ConsistencyPolicy) populate(objectMap, "cors", d.Cors) populate(objectMap, "defaultIdentity", d.DefaultIdentity) + populate(objectMap, "diagnosticLogSettings", d.DiagnosticLogSettings) populate(objectMap, "disableKeyBasedMetadataWriteAccess", d.DisableKeyBasedMetadataWriteAccess) populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) populate(objectMap, "enableAnalyticalStorage", d.EnableAnalyticalStorage) populate(objectMap, "enableAutomaticFailover", d.EnableAutomaticFailover) populate(objectMap, "enableCassandraConnector", d.EnableCassandraConnector) populate(objectMap, "enableFreeTier", d.EnableFreeTier) + populate(objectMap, "enableMaterializedViews", d.EnableMaterializedViews) populate(objectMap, "enableMultipleWriteLocations", d.EnableMultipleWriteLocations) populate(objectMap, "ipRules", d.IPRules) populate(objectMap, "isVirtualNetworkFilterEnabled", d.IsVirtualNetworkFilterEnabled) @@ -629,6 +1013,9 @@ func (d *DatabaseAccountUpdateProperties) UnmarshalJSON(data []byte) error { case "defaultIdentity": err = unpopulate(val, "DefaultIdentity", &d.DefaultIdentity) delete(rawMsg, key) + case "diagnosticLogSettings": + err = unpopulate(val, "DiagnosticLogSettings", &d.DiagnosticLogSettings) + delete(rawMsg, key) case "disableKeyBasedMetadataWriteAccess": err = unpopulate(val, "DisableKeyBasedMetadataWriteAccess", &d.DisableKeyBasedMetadataWriteAccess) delete(rawMsg, key) @@ -647,6 +1034,9 @@ func (d *DatabaseAccountUpdateProperties) UnmarshalJSON(data []byte) error { case "enableFreeTier": err = unpopulate(val, "EnableFreeTier", &d.EnableFreeTier) delete(rawMsg, key) + case "enableMaterializedViews": + err = unpopulate(val, "EnableMaterializedViews", &d.EnableMaterializedViews) + delete(rawMsg, key) case "enableMultipleWriteLocations": err = unpopulate(val, "EnableMultipleWriteLocations", &d.EnableMultipleWriteLocations) delete(rawMsg, key) @@ -697,10 +1087,103 @@ func (f FailoverPolicies) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type GraphAPIComputeServiceResourceProperties. +func (g GraphAPIComputeServiceResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", g.CreationTime) + populate(objectMap, "graphApiComputeEndpoint", g.GraphAPIComputeEndpoint) + populate(objectMap, "instanceCount", g.InstanceCount) + populate(objectMap, "instanceSize", g.InstanceSize) + populate(objectMap, "locations", g.Locations) + objectMap["serviceType"] = ServiceTypeGraphAPICompute + populate(objectMap, "status", g.Status) + if g.AdditionalProperties != nil { + for key, val := range g.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GraphAPIComputeServiceResourceProperties. +func (g *GraphAPIComputeServiceResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &g.CreationTime) + delete(rawMsg, key) + case "graphApiComputeEndpoint": + err = unpopulate(val, "GraphAPIComputeEndpoint", &g.GraphAPIComputeEndpoint) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &g.InstanceCount) + delete(rawMsg, key) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &g.InstanceSize) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &g.Locations) + delete(rawMsg, key) + case "serviceType": + err = unpopulate(val, "ServiceType", &g.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &g.Status) + delete(rawMsg, key) + default: + if g.AdditionalProperties == nil { + g.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + g.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GraphResourceCreateUpdateParameters. +func (g GraphResourceCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", g.ID) + populate(objectMap, "identity", g.Identity) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GraphResourceGetResults. +func (g GraphResourceGetResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", g.ID) + populate(objectMap, "identity", g.Identity) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "tags", g.Tags) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseCreateUpdateParameters. func (g GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", g.ID) + populate(objectMap, "identity", g.Identity) populate(objectMap, "location", g.Location) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) @@ -713,6 +1196,7 @@ func (g GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (g GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", g.ID) + populate(objectMap, "identity", g.Identity) populate(objectMap, "location", g.Location) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) @@ -721,10 +1205,19 @@ func (g GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type GremlinDatabaseRestoreResource. +func (g GremlinDatabaseRestoreResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", g.DatabaseName) + populate(objectMap, "graphNames", g.GraphNames) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type GremlinGraphCreateUpdateParameters. func (g GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", g.ID) + populate(objectMap, "identity", g.Identity) populate(objectMap, "location", g.Location) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) @@ -737,6 +1230,7 @@ func (g GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (g GremlinGraphGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", g.ID) + populate(objectMap, "identity", g.Identity) populate(objectMap, "location", g.Location) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) @@ -770,6 +1264,7 @@ func (l LocationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "backupStorageRedundancies", l.BackupStorageRedundancies) populate(objectMap, "isResidencyRestricted", l.IsResidencyRestricted) + populate(objectMap, "status", l.Status) populate(objectMap, "supportsAvailabilityZone", l.SupportsAvailabilityZone) return json.Marshal(objectMap) } @@ -796,6 +1291,68 @@ func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type MaterializedViewsBuilderServiceResourceProperties. +func (m MaterializedViewsBuilderServiceResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", m.CreationTime) + populate(objectMap, "instanceCount", m.InstanceCount) + populate(objectMap, "instanceSize", m.InstanceSize) + populate(objectMap, "locations", m.Locations) + objectMap["serviceType"] = ServiceTypeMaterializedViewsBuilder + populate(objectMap, "status", m.Status) + if m.AdditionalProperties != nil { + for key, val := range m.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaterializedViewsBuilderServiceResourceProperties. +func (m *MaterializedViewsBuilderServiceResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &m.CreationTime) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &m.InstanceCount) + delete(rawMsg, key) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &m.InstanceSize) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &m.Locations) + delete(rawMsg, key) + case "serviceType": + err = unpopulate(val, "ServiceType", &m.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + default: + if m.AdditionalProperties == nil { + m.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + m.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // UnmarshalJSON implements the json.Unmarshaller interface for type Metric. func (m *Metric) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage @@ -870,6 +1427,7 @@ func (m *MetricValue) UnmarshalJSON(data []byte) error { func (m MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -895,6 +1453,7 @@ func (m MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { func (m MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -917,6 +1476,7 @@ func (m MongoDBCollectionResource) MarshalJSON() ([]byte, error) { func (m MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -929,6 +1489,7 @@ func (m MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (m MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) populate(objectMap, "location", m.Location) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -944,6 +1505,29 @@ func (m MongoIndexKeys) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type MongoRoleDefinitionResource. +func (m MongoRoleDefinitionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "privileges", m.Privileges) + populate(objectMap, "roleName", m.RoleName) + populate(objectMap, "roles", m.Roles) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MongoUserDefinitionResource. +func (m MongoUserDefinitionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customData", m.CustomData) + populate(objectMap, "databaseName", m.DatabaseName) + populate(objectMap, "mechanisms", m.Mechanisms) + populate(objectMap, "password", m.Password) + populate(objectMap, "roles", m.Roles) + populate(objectMap, "userName", m.UserName) + return json.Marshal(objectMap) +} + // UnmarshalJSON implements the json.Unmarshaller interface for type PartitionMetric. func (p *PartitionMetric) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage @@ -1119,6 +1703,33 @@ func (p Permission) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoProperties. +func (p PhysicalPartitionThroughputInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "physicalPartitionThroughputInfo", p.PhysicalPartitionThroughputInfo) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResult. +func (p PhysicalPartitionThroughputInfoResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PhysicalPartitionThroughputInfoResultPropertiesResource. +func (p PhysicalPartitionThroughputInfoResultPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "physicalPartitionThroughputInfo", p.PhysicalPartitionThroughputInfo) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1128,6 +1739,36 @@ func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type Privilege. +func (p Privilege) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "actions", p.Actions) + populate(objectMap, "resource", p.Resource) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputParameters. +func (r RedistributeThroughputParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RedistributeThroughputPropertiesResource. +func (r RedistributeThroughputPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "sourcePhysicalPartitionThroughputInfo", r.SourcePhysicalPartitionThroughputInfo) + populate(objectMap, "targetPhysicalPartitionThroughputInfo", r.TargetPhysicalPartitionThroughputInfo) + populate(objectMap, "throughputPolicy", r.ThroughputPolicy) + return json.Marshal(objectMap) +} + // UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDatabaseAccountProperties. func (r *RestorableDatabaseAccountProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage @@ -1149,6 +1790,9 @@ func (r *RestorableDatabaseAccountProperties) UnmarshalJSON(data []byte) error { case "deletionTime": err = unpopulateTimeRFC3339(val, "DeletionTime", &r.DeletionTime) delete(rawMsg, key) + case "oldestRestorableTime": + err = unpopulateTimeRFC3339(val, "OldestRestorableTime", &r.OldestRestorableTime) + delete(rawMsg, key) case "restorableLocations": err = unpopulate(val, "RestorableLocations", &r.RestorableLocations) delete(rawMsg, key) @@ -1193,9 +1837,11 @@ func (r *RestorableLocationResource) UnmarshalJSON(data []byte) error { func (r RestoreParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "databasesToRestore", r.DatabasesToRestore) + populate(objectMap, "gremlinDatabasesToRestore", r.GremlinDatabasesToRestore) populate(objectMap, "restoreMode", r.RestoreMode) populate(objectMap, "restoreSource", r.RestoreSource) populateTimeRFC3339(objectMap, "restoreTimestampInUtc", r.RestoreTimestampInUTC) + populate(objectMap, "tablesToRestore", r.TablesToRestore) return json.Marshal(objectMap) } @@ -1211,6 +1857,9 @@ func (r *RestoreParameters) UnmarshalJSON(data []byte) error { case "databasesToRestore": err = unpopulate(val, "DatabasesToRestore", &r.DatabasesToRestore) delete(rawMsg, key) + case "gremlinDatabasesToRestore": + err = unpopulate(val, "GremlinDatabasesToRestore", &r.GremlinDatabasesToRestore) + delete(rawMsg, key) case "restoreMode": err = unpopulate(val, "RestoreMode", &r.RestoreMode) delete(rawMsg, key) @@ -1220,6 +1869,9 @@ func (r *RestoreParameters) UnmarshalJSON(data []byte) error { case "restoreTimestampInUtc": err = unpopulateTimeRFC3339(val, "RestoreTimestampInUTC", &r.RestoreTimestampInUTC) delete(rawMsg, key) + case "tablesToRestore": + err = unpopulate(val, "TablesToRestore", &r.TablesToRestore) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", r, err) @@ -1228,10 +1880,31 @@ func (r *RestoreParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputParameters. +func (r RetrieveThroughputParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RetrieveThroughputPropertiesResource. +func (r RetrieveThroughputPropertiesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "physicalPartitionIds", r.PhysicalPartitionIDs) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type SQLContainerCreateUpdateParameters. func (s SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1244,6 +1917,7 @@ func (s SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (s SQLContainerGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1252,10 +1926,46 @@ func (s SQLContainerGetResults) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type SQLDataTransferDataSourceSink. +func (s SQLDataTransferDataSourceSink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["component"] = DataTransferComponentCosmosDBSQL + populate(objectMap, "containerName", s.ContainerName) + populate(objectMap, "databaseName", s.DatabaseName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDataTransferDataSourceSink. +func (s *SQLDataTransferDataSourceSink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "component": + err = unpopulate(val, "Component", &s.Component) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &s.ContainerName) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &s.DatabaseName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SQLDatabaseCreateUpdateParameters. func (s SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1268,6 +1978,7 @@ func (s SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (s SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1276,6 +1987,72 @@ func (s SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type SQLDedicatedGatewayServiceResourceProperties. +func (s SQLDedicatedGatewayServiceResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "instanceCount", s.InstanceCount) + populate(objectMap, "instanceSize", s.InstanceSize) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "sqlDedicatedGatewayEndpoint", s.SQLDedicatedGatewayEndpoint) + objectMap["serviceType"] = ServiceTypeSQLDedicatedGateway + populate(objectMap, "status", s.Status) + if s.AdditionalProperties != nil { + for key, val := range s.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDedicatedGatewayServiceResourceProperties. +func (s *SQLDedicatedGatewayServiceResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &s.InstanceCount) + delete(rawMsg, key) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &s.InstanceSize) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "sqlDedicatedGatewayEndpoint": + err = unpopulate(val, "SQLDedicatedGatewayEndpoint", &s.SQLDedicatedGatewayEndpoint) + delete(rawMsg, key) + case "serviceType": + err = unpopulate(val, "ServiceType", &s.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + default: + if s.AdditionalProperties == nil { + s.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + s.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SQLRoleDefinitionResource. func (s SQLRoleDefinitionResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1290,6 +2067,7 @@ func (s SQLRoleDefinitionResource) MarshalJSON() ([]byte, error) { func (s SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1302,6 +2080,7 @@ func (s SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) func (s SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1314,6 +2093,7 @@ func (s SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { func (s SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1326,6 +2106,7 @@ func (s SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (s SQLTriggerGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1338,6 +2119,7 @@ func (s SQLTriggerGetResults) MarshalJSON() ([]byte, error) { func (s SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1350,6 +2132,7 @@ func (s SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, err func (s SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -1358,6 +2141,103 @@ func (s SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type ServiceResource. +func (s ServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResource. +func (s *ServiceResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + s.Properties, err = unmarshalServiceResourcePropertiesClassification(val) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceResourceProperties. +func (s ServiceResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "instanceCount", s.InstanceCount) + populate(objectMap, "instanceSize", s.InstanceSize) + objectMap["serviceType"] = s.ServiceType + populate(objectMap, "status", s.Status) + if s.AdditionalProperties != nil { + for key, val := range s.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResourceProperties. +func (s *ServiceResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) + delete(rawMsg, key) + case "instanceCount": + err = unpopulate(val, "InstanceCount", &s.InstanceCount) + delete(rawMsg, key) + case "instanceSize": + err = unpopulate(val, "InstanceSize", &s.InstanceSize) + delete(rawMsg, key) + case "serviceType": + err = unpopulate(val, "ServiceType", &s.ServiceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + default: + if s.AdditionalProperties == nil { + s.AdditionalProperties = map[string]interface{}{} + } + if val != nil { + var aux interface{} + err = json.Unmarshal(val, &aux) + s.AdditionalProperties[key] = aux + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SpatialSpec. func (s SpatialSpec) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1417,6 +2297,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { func (t TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) + populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -1429,6 +2310,7 @@ func (t TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { func (t TableGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) + populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -1441,6 +2323,7 @@ func (t TableGetResults) MarshalJSON() ([]byte, error) { func (t ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) + populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -1453,6 +2336,7 @@ func (t ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { func (t ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) + populate(objectMap, "identity", t.Identity) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -1485,6 +2369,16 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } +func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_mongodbresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_mongodbresources_client.go index ed6c825de606..0ab9f2ea6bb2 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_mongodbresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_mongodbresources_client.go @@ -56,7 +56,7 @@ func NewMongoDBResourcesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateUpdateMongoDBCollection - Create or update an Azure Cosmos DB MongoDB Collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -78,7 +78,7 @@ func (client *MongoDBResourcesClient) BeginCreateUpdateMongoDBCollection(ctx con // CreateUpdateMongoDBCollection - Create or update an Azure Cosmos DB MongoDB Collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) createUpdateMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, createUpdateMongoDBCollectionParameters MongoDBCollectionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBCollectionOptions) (*http.Response, error) { req, err := client.createUpdateMongoDBCollectionCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, options) if err != nil { @@ -122,7 +122,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBCollectionCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateMongoDBCollectionParameters) @@ -130,7 +130,7 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBCollectionCreateRequest // BeginCreateUpdateMongoDBDatabase - Create or updates Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -151,7 +151,7 @@ func (client *MongoDBResourcesClient) BeginCreateUpdateMongoDBDatabase(ctx conte // CreateUpdateMongoDBDatabase - Create or updates Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) createUpdateMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateMongoDBDatabaseParameters MongoDBDatabaseCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoDBDatabaseOptions) (*http.Response, error) { req, err := client.createUpdateMongoDBDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, createUpdateMongoDBDatabaseParameters, options) if err != nil { @@ -191,15 +191,153 @@ func (client *MongoDBResourcesClient) createUpdateMongoDBDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateMongoDBDatabaseParameters) } +// BeginCreateUpdateMongoRoleDefinition - Creates or updates an Azure Cosmos DB Mongo Role Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// createUpdateMongoRoleDefinitionParameters - The properties required to create or update a Role Definition. +// options - MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoRoleDefinition +// method. +func (client *MongoDBResourcesClient) BeginCreateUpdateMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoRoleDefinitionParameters MongoRoleDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createUpdateMongoRoleDefinition(ctx, mongoRoleDefinitionID, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateUpdateMongoRoleDefinition - Creates or updates an Azure Cosmos DB Mongo Role Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *MongoDBResourcesClient) createUpdateMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoRoleDefinitionParameters MongoRoleDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*http.Response, error) { + req, err := client.createUpdateMongoRoleDefinitionCreateRequest(ctx, mongoRoleDefinitionID, resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createUpdateMongoRoleDefinitionCreateRequest creates the CreateUpdateMongoRoleDefinition request. +func (client *MongoDBResourcesClient) createUpdateMongoRoleDefinitionCreateRequest(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoRoleDefinitionParameters MongoRoleDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoRoleDefinitionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + if mongoRoleDefinitionID == "" { + return nil, errors.New("parameter mongoRoleDefinitionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mongoRoleDefinitionId}", url.PathEscape(mongoRoleDefinitionID)) + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, createUpdateMongoRoleDefinitionParameters) +} + +// BeginCreateUpdateMongoUserDefinition - Creates or updates an Azure Cosmos DB Mongo User Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// mongoUserDefinitionID - The ID for the User Definition {dbName.userName}. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// createUpdateMongoUserDefinitionParameters - The properties required to create or update a User Definition. +// options - MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginCreateUpdateMongoUserDefinition +// method. +func (client *MongoDBResourcesClient) BeginCreateUpdateMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoUserDefinitionParameters MongoUserDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createUpdateMongoUserDefinition(ctx, mongoUserDefinitionID, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateUpdateMongoUserDefinition - Creates or updates an Azure Cosmos DB Mongo User Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *MongoDBResourcesClient) createUpdateMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoUserDefinitionParameters MongoUserDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*http.Response, error) { + req, err := client.createUpdateMongoUserDefinitionCreateRequest(ctx, mongoUserDefinitionID, resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createUpdateMongoUserDefinitionCreateRequest creates the CreateUpdateMongoUserDefinition request. +func (client *MongoDBResourcesClient) createUpdateMongoUserDefinitionCreateRequest(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, createUpdateMongoUserDefinitionParameters MongoUserDefinitionCreateUpdateParameters, options *MongoDBResourcesClientBeginCreateUpdateMongoUserDefinitionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + if mongoUserDefinitionID == "" { + return nil, errors.New("parameter mongoUserDefinitionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mongoUserDefinitionId}", url.PathEscape(mongoUserDefinitionID)) + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, createUpdateMongoUserDefinitionParameters) +} + // BeginDeleteMongoDBCollection - Deletes an existing Azure Cosmos DB MongoDB Collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -220,7 +358,7 @@ func (client *MongoDBResourcesClient) BeginDeleteMongoDBCollection(ctx context.C // DeleteMongoDBCollection - Deletes an existing Azure Cosmos DB MongoDB Collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) deleteMongoDBCollection(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginDeleteMongoDBCollectionOptions) (*http.Response, error) { req, err := client.deleteMongoDBCollectionCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, options) if err != nil { @@ -264,14 +402,14 @@ func (client *MongoDBResourcesClient) deleteMongoDBCollectionCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteMongoDBDatabase - Deletes an existing Azure Cosmos DB MongoDB database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -291,7 +429,7 @@ func (client *MongoDBResourcesClient) BeginDeleteMongoDBDatabase(ctx context.Con // DeleteMongoDBDatabase - Deletes an existing Azure Cosmos DB MongoDB database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) deleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginDeleteMongoDBDatabaseOptions) (*http.Response, error) { req, err := client.deleteMongoDBDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -331,14 +469,150 @@ func (client *MongoDBResourcesClient) deleteMongoDBDatabaseCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// BeginDeleteMongoRoleDefinition - Deletes an existing Azure Cosmos DB Mongo Role Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoRoleDefinition +// method. +func (client *MongoDBResourcesClient) BeginDeleteMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoRoleDefinitionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteMongoRoleDefinition(ctx, mongoRoleDefinitionID, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[MongoDBResourcesClientDeleteMongoRoleDefinitionResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[MongoDBResourcesClientDeleteMongoRoleDefinitionResponse](options.ResumeToken, client.pl, nil) + } +} + +// DeleteMongoRoleDefinition - Deletes an existing Azure Cosmos DB Mongo Role Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *MongoDBResourcesClient) deleteMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*http.Response, error) { + req, err := client.deleteMongoRoleDefinitionCreateRequest(ctx, mongoRoleDefinitionID, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteMongoRoleDefinitionCreateRequest creates the DeleteMongoRoleDefinition request. +func (client *MongoDBResourcesClient) deleteMongoRoleDefinitionCreateRequest(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoRoleDefinitionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + if mongoRoleDefinitionID == "" { + return nil, errors.New("parameter mongoRoleDefinitionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mongoRoleDefinitionId}", url.PathEscape(mongoRoleDefinitionID)) + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginDeleteMongoUserDefinition - Deletes an existing Azure Cosmos DB Mongo User Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// mongoUserDefinitionID - The ID for the User Definition {dbName.userName}. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.BeginDeleteMongoUserDefinition +// method. +func (client *MongoDBResourcesClient) BeginDeleteMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*runtime.Poller[MongoDBResourcesClientDeleteMongoUserDefinitionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteMongoUserDefinition(ctx, mongoUserDefinitionID, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[MongoDBResourcesClientDeleteMongoUserDefinitionResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[MongoDBResourcesClientDeleteMongoUserDefinitionResponse](options.ResumeToken, client.pl, nil) + } +} + +// DeleteMongoUserDefinition - Deletes an existing Azure Cosmos DB Mongo User Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *MongoDBResourcesClient) deleteMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*http.Response, error) { + req, err := client.deleteMongoUserDefinitionCreateRequest(ctx, mongoUserDefinitionID, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteMongoUserDefinitionCreateRequest creates the DeleteMongoUserDefinition request. +func (client *MongoDBResourcesClient) deleteMongoUserDefinitionCreateRequest(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientBeginDeleteMongoUserDefinitionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + if mongoUserDefinitionID == "" { + return nil, errors.New("parameter mongoUserDefinitionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mongoUserDefinitionId}", url.PathEscape(mongoUserDefinitionID)) + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // GetMongoDBCollection - Gets the MongoDB collection under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -388,7 +662,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -406,7 +680,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionHandleResponse(resp *h // GetMongoDBCollectionThroughput - Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database // account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -456,7 +730,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionThroughputCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -473,7 +747,7 @@ func (client *MongoDBResourcesClient) getMongoDBCollectionThroughputHandleRespon // GetMongoDBDatabase - Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -512,54 +786,259 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseCreateRequest(ctx contex if databaseName == "" { return nil, errors.New("parameter databaseName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getMongoDBDatabaseHandleResponse handles the GetMongoDBDatabase response. +func (client *MongoDBResourcesClient) getMongoDBDatabaseHandleResponse(resp *http.Response) (MongoDBResourcesClientGetMongoDBDatabaseResponse, error) { + result := MongoDBResourcesClientGetMongoDBDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MongoDBDatabaseGetResults); err != nil { + return MongoDBResourcesClientGetMongoDBDatabaseResponse{}, err + } + return result, nil +} + +// GetMongoDBDatabaseThroughput - Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database +// account with the provided name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// options - MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBDatabaseThroughput +// method. +func (client *MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions) (MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse, error) { + req, err := client.getMongoDBDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) + if err != nil { + return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, runtime.NewResponseError(resp) + } + return client.getMongoDBDatabaseThroughputHandleResponse(resp) +} + +// getMongoDBDatabaseThroughputCreateRequest creates the GetMongoDBDatabaseThroughput request. +func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getMongoDBDatabaseThroughputHandleResponse handles the GetMongoDBDatabaseThroughput response. +func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputHandleResponse(resp *http.Response) (MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse, error) { + result := MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ThroughputSettingsGetResults); err != nil { + return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, err + } + return result, nil +} + +// GetMongoRoleDefinition - Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// mongoRoleDefinitionID - The ID for the Role Definition {dbName.roleName}. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - MongoDBResourcesClientGetMongoRoleDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoRoleDefinition +// method. +func (client *MongoDBResourcesClient) GetMongoRoleDefinition(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientGetMongoRoleDefinitionOptions) (MongoDBResourcesClientGetMongoRoleDefinitionResponse, error) { + req, err := client.getMongoRoleDefinitionCreateRequest(ctx, mongoRoleDefinitionID, resourceGroupName, accountName, options) + if err != nil { + return MongoDBResourcesClientGetMongoRoleDefinitionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MongoDBResourcesClientGetMongoRoleDefinitionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MongoDBResourcesClientGetMongoRoleDefinitionResponse{}, runtime.NewResponseError(resp) + } + return client.getMongoRoleDefinitionHandleResponse(resp) +} + +// getMongoRoleDefinitionCreateRequest creates the GetMongoRoleDefinition request. +func (client *MongoDBResourcesClient) getMongoRoleDefinitionCreateRequest(ctx context.Context, mongoRoleDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientGetMongoRoleDefinitionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}" + if mongoRoleDefinitionID == "" { + return nil, errors.New("parameter mongoRoleDefinitionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mongoRoleDefinitionId}", url.PathEscape(mongoRoleDefinitionID)) + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getMongoRoleDefinitionHandleResponse handles the GetMongoRoleDefinition response. +func (client *MongoDBResourcesClient) getMongoRoleDefinitionHandleResponse(resp *http.Response) (MongoDBResourcesClientGetMongoRoleDefinitionResponse, error) { + result := MongoDBResourcesClientGetMongoRoleDefinitionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MongoRoleDefinitionGetResults); err != nil { + return MongoDBResourcesClientGetMongoRoleDefinitionResponse{}, err + } + return result, nil +} + +// GetMongoUserDefinition - Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// mongoUserDefinitionID - The ID for the User Definition {dbName.userName}. +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - MongoDBResourcesClientGetMongoUserDefinitionOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoUserDefinition +// method. +func (client *MongoDBResourcesClient) GetMongoUserDefinition(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientGetMongoUserDefinitionOptions) (MongoDBResourcesClientGetMongoUserDefinitionResponse, error) { + req, err := client.getMongoUserDefinitionCreateRequest(ctx, mongoUserDefinitionID, resourceGroupName, accountName, options) + if err != nil { + return MongoDBResourcesClientGetMongoUserDefinitionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MongoDBResourcesClientGetMongoUserDefinitionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MongoDBResourcesClientGetMongoUserDefinitionResponse{}, runtime.NewResponseError(resp) + } + return client.getMongoUserDefinitionHandleResponse(resp) +} + +// getMongoUserDefinitionCreateRequest creates the GetMongoUserDefinition request. +func (client *MongoDBResourcesClient) getMongoUserDefinitionCreateRequest(ctx context.Context, mongoUserDefinitionID string, resourceGroupName string, accountName string, options *MongoDBResourcesClientGetMongoUserDefinitionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}" + if mongoUserDefinitionID == "" { + return nil, errors.New("parameter mongoUserDefinitionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{mongoUserDefinitionId}", url.PathEscape(mongoUserDefinitionID)) + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// getMongoDBDatabaseHandleResponse handles the GetMongoDBDatabase response. -func (client *MongoDBResourcesClient) getMongoDBDatabaseHandleResponse(resp *http.Response) (MongoDBResourcesClientGetMongoDBDatabaseResponse, error) { - result := MongoDBResourcesClientGetMongoDBDatabaseResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MongoDBDatabaseGetResults); err != nil { - return MongoDBResourcesClientGetMongoDBDatabaseResponse{}, err +// getMongoUserDefinitionHandleResponse handles the GetMongoUserDefinition response. +func (client *MongoDBResourcesClient) getMongoUserDefinitionHandleResponse(resp *http.Response) (MongoDBResourcesClientGetMongoUserDefinitionResponse, error) { + result := MongoDBResourcesClientGetMongoUserDefinitionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MongoUserDefinitionGetResults); err != nil { + return MongoDBResourcesClientGetMongoUserDefinitionResponse{}, err } return result, nil } -// GetMongoDBDatabaseThroughput - Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database -// account with the provided name. +// BeginListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. -// options - MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions contains the optional parameters for the MongoDBResourcesClient.GetMongoDBDatabaseThroughput -// method. -func (client *MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions) (MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse, error) { - req, err := client.getMongoDBDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) +// collectionName - Cosmos DB collection name. +// mergeParameters - The parameters for the merge operation. +// options - MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions contains the optional parameters for the +// MongoDBResourcesClient.BeginListMongoDBCollectionPartitionMerge method. +func (client *MongoDBResourcesClient) BeginListMongoDBCollectionPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*runtime.Poller[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listMongoDBCollectionPartitionMerge(ctx, resourceGroupName, accountName, databaseName, collectionName, mergeParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse](options.ResumeToken, client.pl, nil) + } +} + +// ListMongoDBCollectionPartitionMerge - Merges the partitions of a MongoDB Collection +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*http.Response, error) { + req, err := client.listMongoDBCollectionPartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, mergeParameters, options) if err != nil { - return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.getMongoDBDatabaseThroughputHandleResponse(resp) + return resp, nil } -// getMongoDBDatabaseThroughputCreateRequest creates the GetMongoDBDatabaseThroughput request. -func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientGetMongoDBDatabaseThroughputOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default" +// listMongoDBCollectionPartitionMergeCreateRequest creates the ListMongoDBCollectionPartitionMerge request. +func (client *MongoDBResourcesClient) listMongoDBCollectionPartitionMergeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, mergeParameters MergeParameters, options *MongoDBResourcesClientBeginListMongoDBCollectionPartitionMergeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -576,29 +1055,24 @@ func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputCreateRequest( return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if collectionName == "" { + return nil, errors.New("parameter collectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{collectionName}", url.PathEscape(collectionName)) + 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-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getMongoDBDatabaseThroughputHandleResponse handles the GetMongoDBDatabaseThroughput response. -func (client *MongoDBResourcesClient) getMongoDBDatabaseThroughputHandleResponse(resp *http.Response) (MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse, error) { - result := MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ThroughputSettingsGetResults); err != nil { - return MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse{}, err - } - return result, nil + return req, runtime.MarshalAsJSON(req, mergeParameters) } // NewListMongoDBCollectionsPager - Lists the MongoDB collection under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -650,7 +1124,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -667,7 +1141,7 @@ func (client *MongoDBResourcesClient) listMongoDBCollectionsHandleResponse(resp // NewListMongoDBDatabasesPager - Lists the MongoDB databases under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - MongoDBResourcesClientListMongoDBDatabasesOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoDBDatabases @@ -714,7 +1188,7 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -729,9 +1203,137 @@ func (client *MongoDBResourcesClient) listMongoDBDatabasesHandleResponse(resp *h return result, nil } +// NewListMongoRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - MongoDBResourcesClientListMongoRoleDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoRoleDefinitions +// method. +func (client *MongoDBResourcesClient) NewListMongoRoleDefinitionsPager(resourceGroupName string, accountName string, options *MongoDBResourcesClientListMongoRoleDefinitionsOptions) *runtime.Pager[MongoDBResourcesClientListMongoRoleDefinitionsResponse] { + return runtime.NewPager(runtime.PagingHandler[MongoDBResourcesClientListMongoRoleDefinitionsResponse]{ + More: func(page MongoDBResourcesClientListMongoRoleDefinitionsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *MongoDBResourcesClientListMongoRoleDefinitionsResponse) (MongoDBResourcesClientListMongoRoleDefinitionsResponse, error) { + req, err := client.listMongoRoleDefinitionsCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return MongoDBResourcesClientListMongoRoleDefinitionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MongoDBResourcesClientListMongoRoleDefinitionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MongoDBResourcesClientListMongoRoleDefinitionsResponse{}, runtime.NewResponseError(resp) + } + return client.listMongoRoleDefinitionsHandleResponse(resp) + }, + }) +} + +// listMongoRoleDefinitionsCreateRequest creates the ListMongoRoleDefinitions request. +func (client *MongoDBResourcesClient) listMongoRoleDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *MongoDBResourcesClientListMongoRoleDefinitionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listMongoRoleDefinitionsHandleResponse handles the ListMongoRoleDefinitions response. +func (client *MongoDBResourcesClient) listMongoRoleDefinitionsHandleResponse(resp *http.Response) (MongoDBResourcesClientListMongoRoleDefinitionsResponse, error) { + result := MongoDBResourcesClientListMongoRoleDefinitionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MongoRoleDefinitionListResult); err != nil { + return MongoDBResourcesClientListMongoRoleDefinitionsResponse{}, err + } + return result, nil +} + +// NewListMongoUserDefinitionsPager - Retrieves the list of all Azure Cosmos DB Mongo User Definition. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - MongoDBResourcesClientListMongoUserDefinitionsOptions contains the optional parameters for the MongoDBResourcesClient.ListMongoUserDefinitions +// method. +func (client *MongoDBResourcesClient) NewListMongoUserDefinitionsPager(resourceGroupName string, accountName string, options *MongoDBResourcesClientListMongoUserDefinitionsOptions) *runtime.Pager[MongoDBResourcesClientListMongoUserDefinitionsResponse] { + return runtime.NewPager(runtime.PagingHandler[MongoDBResourcesClientListMongoUserDefinitionsResponse]{ + More: func(page MongoDBResourcesClientListMongoUserDefinitionsResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *MongoDBResourcesClientListMongoUserDefinitionsResponse) (MongoDBResourcesClientListMongoUserDefinitionsResponse, error) { + req, err := client.listMongoUserDefinitionsCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return MongoDBResourcesClientListMongoUserDefinitionsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MongoDBResourcesClientListMongoUserDefinitionsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MongoDBResourcesClientListMongoUserDefinitionsResponse{}, runtime.NewResponseError(resp) + } + return client.listMongoUserDefinitionsHandleResponse(resp) + }, + }) +} + +// listMongoUserDefinitionsCreateRequest creates the ListMongoUserDefinitions request. +func (client *MongoDBResourcesClient) listMongoUserDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *MongoDBResourcesClientListMongoUserDefinitionsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listMongoUserDefinitionsHandleResponse handles the ListMongoUserDefinitions response. +func (client *MongoDBResourcesClient) listMongoUserDefinitionsHandleResponse(resp *http.Response) (MongoDBResourcesClientListMongoUserDefinitionsResponse, error) { + result := MongoDBResourcesClientListMongoUserDefinitionsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MongoUserDefinitionListResult); err != nil { + return MongoDBResourcesClientListMongoUserDefinitionsResponse{}, err + } + return result, nil +} + // BeginMigrateMongoDBCollectionToAutoscale - Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -752,7 +1354,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBCollectionToAutoscale(c // MigrateMongoDBCollectionToAutoscale - Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateMongoDBCollectionToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, options) if err != nil { @@ -796,7 +1398,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -805,7 +1407,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToAutoscaleCreateR // BeginMigrateMongoDBCollectionToManualThroughput - Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual // throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -826,7 +1428,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBCollectionToManualThrou // MigrateMongoDBCollectionToManualThroughput - Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, options *MongoDBResourcesClientBeginMigrateMongoDBCollectionToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateMongoDBCollectionToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, options) if err != nil { @@ -870,7 +1472,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -878,7 +1480,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBCollectionToManualThroughput // BeginMigrateMongoDBDatabaseToAutoscale - Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -898,7 +1500,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBDatabaseToAutoscale(ctx // MigrateMongoDBDatabaseToAutoscale - Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginMigrateMongoDBDatabaseToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateMongoDBDatabaseToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -938,7 +1540,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscaleCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -946,7 +1548,7 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToAutoscaleCreateReq // BeginMigrateMongoDBDatabaseToManualThroughput - Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -966,7 +1568,7 @@ func (client *MongoDBResourcesClient) BeginMigrateMongoDBDatabaseToManualThrough // MigrateMongoDBDatabaseToManualThroughput - Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *MongoDBResourcesClientBeginMigrateMongoDBDatabaseToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateMongoDBDatabaseToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -1006,15 +1608,168 @@ func (client *MongoDBResourcesClient) migrateMongoDBDatabaseToManualThroughputCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginMongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// collectionName - Cosmos DB collection name. +// redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current MongoDB container. +// options - MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions contains the optional parameters for +// the MongoDBResourcesClient.BeginMongoDBContainerRedistributeThroughput method. +func (client *MongoDBResourcesClient) BeginMongoDBContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.mongoDBContainerRedistributeThroughput(ctx, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse](options.ResumeToken, client.pl, nil) + } +} + +// MongoDBContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB MongoDB container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*http.Response, error) { + req, err := client.mongoDBContainerRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// mongoDBContainerRedistributeThroughputCreateRequest creates the MongoDBContainerRedistributeThroughput request. +func (client *MongoDBResourcesClient) mongoDBContainerRedistributeThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, redistributeThroughputParameters RedistributeThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRedistributeThroughputOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if collectionName == "" { + return nil, errors.New("parameter collectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{collectionName}", url.PathEscape(collectionName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, redistributeThroughputParameters) +} + +// BeginMongoDBContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// collectionName - Cosmos DB collection name. +// retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current MongoDB +// container. +// options - MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions contains the optional parameters +// for the MongoDBResourcesClient.BeginMongoDBContainerRetrieveThroughputDistribution method. +func (client *MongoDBResourcesClient) BeginMongoDBContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.mongoDBContainerRetrieveThroughputDistribution(ctx, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse](options.ResumeToken, client.pl, nil) + } +} + +// MongoDBContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB MongoDB container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { + req, err := client.mongoDBContainerRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// mongoDBContainerRetrieveThroughputDistributionCreateRequest creates the MongoDBContainerRetrieveThroughputDistribution request. +func (client *MongoDBResourcesClient) mongoDBContainerRetrieveThroughputDistributionCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, retrieveThroughputParameters RetrieveThroughputParameters, options *MongoDBResourcesClientBeginMongoDBContainerRetrieveThroughputDistributionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if collectionName == "" { + return nil, errors.New("parameter collectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{collectionName}", url.PathEscape(collectionName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, retrieveThroughputParameters) +} + // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a Mongodb collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1038,7 +1793,7 @@ func (client *MongoDBResourcesClient) BeginRetrieveContinuousBackupInformation(c // RetrieveContinuousBackupInformation - Retrieves continuous backup information for a Mongodb collection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, location ContinuousBackupRestoreLocation, options *MongoDBResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, location, options) if err != nil { @@ -1082,7 +1837,7 @@ func (client *MongoDBResourcesClient) retrieveContinuousBackupInformationCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, location) @@ -1090,7 +1845,7 @@ func (client *MongoDBResourcesClient) retrieveContinuousBackupInformationCreateR // BeginUpdateMongoDBCollectionThroughput - Update the RUs per second of an Azure Cosmos DB MongoDB collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1112,7 +1867,7 @@ func (client *MongoDBResourcesClient) BeginUpdateMongoDBCollectionThroughput(ctx // UpdateMongoDBCollectionThroughput - Update the RUs per second of an Azure Cosmos DB MongoDB collection // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, collectionName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBCollectionThroughputOptions) (*http.Response, error) { req, err := client.updateMongoDBCollectionThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, collectionName, updateThroughputParameters, options) if err != nil { @@ -1156,7 +1911,7 @@ func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -1164,7 +1919,7 @@ func (client *MongoDBResourcesClient) updateMongoDBCollectionThroughputCreateReq // BeginUpdateMongoDBDatabaseThroughput - Update RUs per second of the an Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1185,7 +1940,7 @@ func (client *MongoDBResourcesClient) BeginUpdateMongoDBDatabaseThroughput(ctx c // UpdateMongoDBDatabaseThroughput - Update RUs per second of the an Azure Cosmos DB MongoDB database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *MongoDBResourcesClient) updateMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *MongoDBResourcesClientBeginUpdateMongoDBDatabaseThroughputOptions) (*http.Response, error) { req, err := client.updateMongoDBDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters, options) if err != nil { @@ -1225,7 +1980,7 @@ func (client *MongoDBResourcesClient) updateMongoDBDatabaseThroughputCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_notebookworkspaces_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_notebookworkspaces_client.go index 12841a5e2cd8..1d167dc222ca 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_notebookworkspaces_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_notebookworkspaces_client.go @@ -56,7 +56,7 @@ func NewNotebookWorkspacesClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Creates the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -77,7 +77,7 @@ func (client *NotebookWorkspacesClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *NotebookWorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters, options *NotebookWorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, notebookCreateUpdateParameters, options) if err != nil { @@ -117,7 +117,7 @@ func (client *NotebookWorkspacesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, notebookCreateUpdateParameters) @@ -125,7 +125,7 @@ func (client *NotebookWorkspacesClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Deletes the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -145,7 +145,7 @@ func (client *NotebookWorkspacesClient) BeginDelete(ctx context.Context, resourc // Delete - Deletes the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *NotebookWorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *NotebookWorkspacesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *NotebookWorkspacesClient) deleteCreateRequest(ctx context.Context, // Get - Gets the notebook workspace for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -237,7 +237,7 @@ func (client *NotebookWorkspacesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *NotebookWorkspacesClient) getHandleResponse(resp *http.Response) ( // NewListByDatabaseAccountPager - Gets the notebook workspace resources of an existing Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - NotebookWorkspacesClientListByDatabaseAccountOptions contains the optional parameters for the NotebookWorkspacesClient.ListByDatabaseAccount @@ -301,7 +301,7 @@ func (client *NotebookWorkspacesClient) listByDatabaseAccountCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,7 +318,7 @@ func (client *NotebookWorkspacesClient) listByDatabaseAccountHandleResponse(resp // ListConnectionInfo - Retrieves the connection info for the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -363,7 +363,7 @@ func (client *NotebookWorkspacesClient) listConnectionInfoCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *NotebookWorkspacesClient) listConnectionInfoHandleResponse(resp *h // BeginRegenerateAuthToken - Regenerates the auth token for the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -400,7 +400,7 @@ func (client *NotebookWorkspacesClient) BeginRegenerateAuthToken(ctx context.Con // RegenerateAuthToken - Regenerates the auth token for the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *NotebookWorkspacesClient) regenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginRegenerateAuthTokenOptions) (*http.Response, error) { req, err := client.regenerateAuthTokenCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, options) if err != nil { @@ -440,7 +440,7 @@ func (client *NotebookWorkspacesClient) regenerateAuthTokenCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -448,7 +448,7 @@ func (client *NotebookWorkspacesClient) regenerateAuthTokenCreateRequest(ctx con // BeginStart - Starts the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // notebookWorkspaceName - The name of the notebook workspace resource. @@ -468,7 +468,7 @@ func (client *NotebookWorkspacesClient) BeginStart(ctx context.Context, resource // Start - Starts the notebook workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *NotebookWorkspacesClient) start(ctx context.Context, resourceGroupName string, accountName string, notebookWorkspaceName NotebookWorkspaceName, options *NotebookWorkspacesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, resourceGroupName, accountName, notebookWorkspaceName, options) if err != nil { @@ -508,7 +508,7 @@ func (client *NotebookWorkspacesClient) startCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_operations_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_operations_client.go index a4ebf97c4406..97a6b9db84f2 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_operations_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Cosmos DB Resource Provider operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeid_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeid_client.go index 1b3924aa56f4..6bde1cadecc7 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeid_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeid_client.go @@ -56,7 +56,7 @@ func NewPartitionKeyRangeIDClient(subscriptionID string, credential azcore.Token // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given partition key range id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseRid - Cosmos DB database rid. @@ -121,7 +121,7 @@ func (client *PartitionKeyRangeIDClient) listMetricsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeidregion_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeidregion_client.go index 641bdb120726..1351cc29afca 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeidregion_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_partitionkeyrangeidregion_client.go @@ -56,7 +56,7 @@ func NewPartitionKeyRangeIDRegionClient(subscriptionID string, credential azcore // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given partition key range id and region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // region - Cosmos DB region, with spaces between words and each word capitalized. @@ -126,7 +126,7 @@ func (client *PartitionKeyRangeIDRegionClient) listMetricsCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentile_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentile_client.go index ff2ac0d97ff6..b9e4fb23270d 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentile_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentile_client.go @@ -57,7 +57,7 @@ func NewPercentileClient(subscriptionID string, credential azcore.TokenCredentia // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given database account. This url is // only for PBS and Replication Latency data // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // filter - An OData filter expression that describes a subset of metrics to return. The parameters that can be filtered are @@ -106,7 +106,7 @@ func (client *PercentileClient) listMetricsCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentilesourcetarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentilesourcetarget_client.go index a3b09b1dff21..85e7f08f8c03 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentilesourcetarget_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentilesourcetarget_client.go @@ -57,7 +57,7 @@ func NewPercentileSourceTargetClient(subscriptionID string, credential azcore.To // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given account, source and target region. // This url is only for PBS and Replication Latency data // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // sourceRegion - Source region from which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -117,7 +117,7 @@ func (client *PercentileSourceTargetClient) listMetricsCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentiletarget_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentiletarget_client.go index 1a4698203017..4a0a5d0a0e5e 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentiletarget_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_percentiletarget_client.go @@ -57,7 +57,7 @@ func NewPercentileTargetClient(subscriptionID string, credential azcore.TokenCre // NewListMetricsPager - Retrieves the metrics determined by the given filter for the given account target region. This url // is only for PBS and Replication Latency data // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // targetRegion - Target region to which data is written. Cosmos DB region, with spaces between words and each word capitalized. @@ -112,7 +112,7 @@ func (client *PercentileTargetClient) listMetricsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") reqQP.Set("$filter", filter) req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_polymorphic_helpers.go index 58987d3f2157..f4b8279149fc 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_polymorphic_helpers.go @@ -29,3 +29,49 @@ func unmarshalBackupPolicyClassification(rawMsg json.RawMessage) (BackupPolicyCl } return b, json.Unmarshal(rawMsg, b) } + +func unmarshalDataTransferDataSourceSinkClassification(rawMsg json.RawMessage) (DataTransferDataSourceSinkClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b DataTransferDataSourceSinkClassification + switch m["component"] { + case string(DataTransferComponentAzureBlobStorage): + b = &AzureBlobDataTransferDataSourceSink{} + case string(DataTransferComponentCosmosDBCassandra): + b = &CassandraDataTransferDataSourceSink{} + case string(DataTransferComponentCosmosDBSQL): + b = &SQLDataTransferDataSourceSink{} + default: + b = &DataTransferDataSourceSink{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalServiceResourcePropertiesClassification(rawMsg json.RawMessage) (ServiceResourcePropertiesClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ServiceResourcePropertiesClassification + switch m["serviceType"] { + case string(ServiceTypeDataTransfer): + b = &DataTransferServiceResourceProperties{} + case string(ServiceTypeGraphAPICompute): + b = &GraphAPIComputeServiceResourceProperties{} + case string(ServiceTypeMaterializedViewsBuilder): + b = &MaterializedViewsBuilderServiceResourceProperties{} + case string(ServiceTypeSQLDedicatedGateway): + b = &SQLDedicatedGatewayServiceResourceProperties{} + default: + b = &ServiceResourceProperties{} + } + return b, json.Unmarshal(rawMsg, b) +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privateendpointconnections_client.go index 7d5459ad4a37..2f9025bbe612 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privateendpointconnections_client.go @@ -56,7 +56,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -76,7 +76,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -116,7 +116,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -124,7 +124,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -144,7 +144,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) if err != nil { @@ -184,7 +184,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // privateEndpointConnectionName - The name of the private endpoint connection. @@ -237,7 +237,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByDatabaseAccountPager - List all private endpoint connections on a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - PrivateEndpointConnectionsClientListByDatabaseAccountOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByDatabaseAccount @@ -301,7 +301,7 @@ func (client *PrivateEndpointConnectionsClient) listByDatabaseAccountCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privatelinkresources_client.go index 78cffb88488b..02b34a7bb3ea 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_privatelinkresources_client.go @@ -56,7 +56,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets the private link resources that need to be created for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // groupName - The name of the private link resource. @@ -101,7 +101,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +118,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // NewListByDatabaseAccountPager - Gets the private link resources that need to be created for a Cosmos DB account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - PrivateLinkResourcesClientListByDatabaseAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByDatabaseAccount @@ -165,7 +165,7 @@ func (client *PrivateLinkResourcesClient) listByDatabaseAccountCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_response_types.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_response_types.go index 8bb5840705f0..4c89487500f8 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_response_types.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_response_types.go @@ -23,6 +23,11 @@ type CassandraClustersClientDeleteResponse struct { // placeholder for future response values } +// CassandraClustersClientGetBackupResponse contains the response from method CassandraClustersClient.GetBackup. +type CassandraClustersClientGetBackupResponse struct { + BackupResource +} + // CassandraClustersClientGetResponse contains the response from method CassandraClustersClient.Get. type CassandraClustersClientGetResponse struct { ClusterResource @@ -33,6 +38,11 @@ type CassandraClustersClientInvokeCommandResponse struct { CommandOutput } +// CassandraClustersClientListBackupsResponse contains the response from method CassandraClustersClient.ListBackups. +type CassandraClustersClientListBackupsResponse struct { + ListBackups +} + // CassandraClustersClientListByResourceGroupResponse contains the response from method CassandraClustersClient.ListByResourceGroup. type CassandraClustersClientListByResourceGroupResponse struct { ListClusters @@ -93,6 +103,11 @@ type CassandraResourcesClientCreateUpdateCassandraTableResponse struct { CassandraTableGetResults } +// CassandraResourcesClientCreateUpdateCassandraViewResponse contains the response from method CassandraResourcesClient.CreateUpdateCassandraView. +type CassandraResourcesClientCreateUpdateCassandraViewResponse struct { + CassandraViewGetResults +} + // CassandraResourcesClientDeleteCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.DeleteCassandraKeyspace. type CassandraResourcesClientDeleteCassandraKeyspaceResponse struct { // placeholder for future response values @@ -103,6 +118,11 @@ type CassandraResourcesClientDeleteCassandraTableResponse struct { // placeholder for future response values } +// CassandraResourcesClientDeleteCassandraViewResponse contains the response from method CassandraResourcesClient.DeleteCassandraView. +type CassandraResourcesClientDeleteCassandraViewResponse struct { + // placeholder for future response values +} + // CassandraResourcesClientGetCassandraKeyspaceResponse contains the response from method CassandraResourcesClient.GetCassandraKeyspace. type CassandraResourcesClientGetCassandraKeyspaceResponse struct { CassandraKeyspaceGetResults @@ -123,6 +143,16 @@ type CassandraResourcesClientGetCassandraTableThroughputResponse struct { ThroughputSettingsGetResults } +// CassandraResourcesClientGetCassandraViewResponse contains the response from method CassandraResourcesClient.GetCassandraView. +type CassandraResourcesClientGetCassandraViewResponse struct { + CassandraViewGetResults +} + +// CassandraResourcesClientGetCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.GetCassandraViewThroughput. +type CassandraResourcesClientGetCassandraViewThroughputResponse struct { + ThroughputSettingsGetResults +} + // CassandraResourcesClientListCassandraKeyspacesResponse contains the response from method CassandraResourcesClient.ListCassandraKeyspaces. type CassandraResourcesClientListCassandraKeyspacesResponse struct { CassandraKeyspaceListResult @@ -133,6 +163,11 @@ type CassandraResourcesClientListCassandraTablesResponse struct { CassandraTableListResult } +// CassandraResourcesClientListCassandraViewsResponse contains the response from method CassandraResourcesClient.ListCassandraViews. +type CassandraResourcesClientListCassandraViewsResponse struct { + CassandraViewListResult +} + // CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse contains the response from method CassandraResourcesClient.MigrateCassandraKeyspaceToAutoscale. type CassandraResourcesClientMigrateCassandraKeyspaceToAutoscaleResponse struct { ThroughputSettingsGetResults @@ -153,6 +188,16 @@ type CassandraResourcesClientMigrateCassandraTableToManualThroughputResponse str ThroughputSettingsGetResults } +// CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse contains the response from method CassandraResourcesClient.MigrateCassandraViewToAutoscale. +type CassandraResourcesClientMigrateCassandraViewToAutoscaleResponse struct { + ThroughputSettingsGetResults +} + +// CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse contains the response from method CassandraResourcesClient.MigrateCassandraViewToManualThroughput. +type CassandraResourcesClientMigrateCassandraViewToManualThroughputResponse struct { + ThroughputSettingsGetResults +} + // CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse contains the response from method CassandraResourcesClient.UpdateCassandraKeyspaceThroughput. type CassandraResourcesClientUpdateCassandraKeyspaceThroughputResponse struct { ThroughputSettingsGetResults @@ -163,6 +208,11 @@ type CassandraResourcesClientUpdateCassandraTableThroughputResponse struct { ThroughputSettingsGetResults } +// CassandraResourcesClientUpdateCassandraViewThroughputResponse contains the response from method CassandraResourcesClient.UpdateCassandraViewThroughput. +type CassandraResourcesClientUpdateCassandraViewThroughputResponse struct { + ThroughputSettingsGetResults +} + // CollectionClientListMetricDefinitionsResponse contains the response from method CollectionClient.ListMetricDefinitions. type CollectionClientListMetricDefinitionsResponse struct { MetricDefinitionsListResult @@ -198,6 +248,36 @@ type CollectionRegionClientListMetricsResponse struct { MetricListResult } +// DataTransferJobsClientCancelResponse contains the response from method DataTransferJobsClient.Cancel. +type DataTransferJobsClientCancelResponse struct { + DataTransferJobGetResults +} + +// DataTransferJobsClientCreateResponse contains the response from method DataTransferJobsClient.Create. +type DataTransferJobsClientCreateResponse struct { + DataTransferJobGetResults +} + +// DataTransferJobsClientGetResponse contains the response from method DataTransferJobsClient.Get. +type DataTransferJobsClientGetResponse struct { + DataTransferJobGetResults +} + +// DataTransferJobsClientListByDatabaseAccountResponse contains the response from method DataTransferJobsClient.ListByDatabaseAccount. +type DataTransferJobsClientListByDatabaseAccountResponse struct { + DataTransferJobFeedResults +} + +// DataTransferJobsClientPauseResponse contains the response from method DataTransferJobsClient.Pause. +type DataTransferJobsClientPauseResponse struct { + DataTransferJobGetResults +} + +// DataTransferJobsClientResumeResponse contains the response from method DataTransferJobsClient.Resume. +type DataTransferJobsClientResumeResponse struct { + DataTransferJobGetResults +} + // DatabaseAccountRegionClientListMetricsResponse contains the response from method DatabaseAccountRegionClient.ListMetrics. type DatabaseAccountRegionClientListMetricsResponse struct { MetricListResult @@ -309,6 +389,26 @@ type DatabaseClientListUsagesResponse struct { UsagesResult } +// GraphResourcesClientCreateUpdateGraphResponse contains the response from method GraphResourcesClient.CreateUpdateGraph. +type GraphResourcesClientCreateUpdateGraphResponse struct { + GraphResourceGetResults +} + +// GraphResourcesClientDeleteGraphResourceResponse contains the response from method GraphResourcesClient.DeleteGraphResource. +type GraphResourcesClientDeleteGraphResourceResponse struct { + // placeholder for future response values +} + +// GraphResourcesClientGetGraphResponse contains the response from method GraphResourcesClient.GetGraph. +type GraphResourcesClientGetGraphResponse struct { + GraphResourceGetResults +} + +// GraphResourcesClientListGraphsResponse contains the response from method GraphResourcesClient.ListGraphs. +type GraphResourcesClientListGraphsResponse struct { + GraphResourcesListResult +} + // GremlinResourcesClientCreateUpdateGremlinDatabaseResponse contains the response from method GremlinResourcesClient.CreateUpdateGremlinDatabase. type GremlinResourcesClientCreateUpdateGremlinDatabaseResponse struct { GremlinDatabaseGetResults @@ -379,6 +479,11 @@ type GremlinResourcesClientMigrateGremlinGraphToManualThroughputResponse struct ThroughputSettingsGetResults } +// GremlinResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method GremlinResourcesClient.RetrieveContinuousBackupInformation. +type GremlinResourcesClientRetrieveContinuousBackupInformationResponse struct { + BackupInformation +} + // GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse contains the response from method GremlinResourcesClient.UpdateGremlinDatabaseThroughput. type GremlinResourcesClientUpdateGremlinDatabaseThroughputResponse struct { ThroughputSettingsGetResults @@ -409,6 +514,16 @@ type MongoDBResourcesClientCreateUpdateMongoDBDatabaseResponse struct { MongoDBDatabaseGetResults } +// MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse contains the response from method MongoDBResourcesClient.CreateUpdateMongoRoleDefinition. +type MongoDBResourcesClientCreateUpdateMongoRoleDefinitionResponse struct { + MongoRoleDefinitionGetResults +} + +// MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse contains the response from method MongoDBResourcesClient.CreateUpdateMongoUserDefinition. +type MongoDBResourcesClientCreateUpdateMongoUserDefinitionResponse struct { + MongoUserDefinitionGetResults +} + // MongoDBResourcesClientDeleteMongoDBCollectionResponse contains the response from method MongoDBResourcesClient.DeleteMongoDBCollection. type MongoDBResourcesClientDeleteMongoDBCollectionResponse struct { // placeholder for future response values @@ -419,6 +534,16 @@ type MongoDBResourcesClientDeleteMongoDBDatabaseResponse struct { // placeholder for future response values } +// MongoDBResourcesClientDeleteMongoRoleDefinitionResponse contains the response from method MongoDBResourcesClient.DeleteMongoRoleDefinition. +type MongoDBResourcesClientDeleteMongoRoleDefinitionResponse struct { + // placeholder for future response values +} + +// MongoDBResourcesClientDeleteMongoUserDefinitionResponse contains the response from method MongoDBResourcesClient.DeleteMongoUserDefinition. +type MongoDBResourcesClientDeleteMongoUserDefinitionResponse struct { + // placeholder for future response values +} + // MongoDBResourcesClientGetMongoDBCollectionResponse contains the response from method MongoDBResourcesClient.GetMongoDBCollection. type MongoDBResourcesClientGetMongoDBCollectionResponse struct { MongoDBCollectionGetResults @@ -439,6 +564,21 @@ type MongoDBResourcesClientGetMongoDBDatabaseThroughputResponse struct { ThroughputSettingsGetResults } +// MongoDBResourcesClientGetMongoRoleDefinitionResponse contains the response from method MongoDBResourcesClient.GetMongoRoleDefinition. +type MongoDBResourcesClientGetMongoRoleDefinitionResponse struct { + MongoRoleDefinitionGetResults +} + +// MongoDBResourcesClientGetMongoUserDefinitionResponse contains the response from method MongoDBResourcesClient.GetMongoUserDefinition. +type MongoDBResourcesClientGetMongoUserDefinitionResponse struct { + MongoUserDefinitionGetResults +} + +// MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse contains the response from method MongoDBResourcesClient.ListMongoDBCollectionPartitionMerge. +type MongoDBResourcesClientListMongoDBCollectionPartitionMergeResponse struct { + PhysicalPartitionStorageInfoCollection +} + // MongoDBResourcesClientListMongoDBCollectionsResponse contains the response from method MongoDBResourcesClient.ListMongoDBCollections. type MongoDBResourcesClientListMongoDBCollectionsResponse struct { MongoDBCollectionListResult @@ -449,6 +589,16 @@ type MongoDBResourcesClientListMongoDBDatabasesResponse struct { MongoDBDatabaseListResult } +// MongoDBResourcesClientListMongoRoleDefinitionsResponse contains the response from method MongoDBResourcesClient.ListMongoRoleDefinitions. +type MongoDBResourcesClientListMongoRoleDefinitionsResponse struct { + MongoRoleDefinitionListResult +} + +// MongoDBResourcesClientListMongoUserDefinitionsResponse contains the response from method MongoDBResourcesClient.ListMongoUserDefinitions. +type MongoDBResourcesClientListMongoUserDefinitionsResponse struct { + MongoUserDefinitionListResult +} + // MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse contains the response from method MongoDBResourcesClient.MigrateMongoDBCollectionToAutoscale. type MongoDBResourcesClientMigrateMongoDBCollectionToAutoscaleResponse struct { ThroughputSettingsGetResults @@ -469,6 +619,16 @@ type MongoDBResourcesClientMigrateMongoDBDatabaseToManualThroughputResponse stru ThroughputSettingsGetResults } +// MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse contains the response from method MongoDBResourcesClient.MongoDBContainerRedistributeThroughput. +type MongoDBResourcesClientMongoDBContainerRedistributeThroughputResponse struct { + PhysicalPartitionThroughputInfoResult +} + +// MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse contains the response from method MongoDBResourcesClient.MongoDBContainerRetrieveThroughputDistribution. +type MongoDBResourcesClientMongoDBContainerRetrieveThroughputDistributionResponse struct { + PhysicalPartitionThroughputInfoResult +} + // MongoDBResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method MongoDBResourcesClient.RetrieveContinuousBackupInformation. type MongoDBResourcesClientRetrieveContinuousBackupInformationResponse struct { BackupInformation @@ -594,6 +754,21 @@ type RestorableDatabaseAccountsClientListResponse struct { RestorableDatabaseAccountsListResult } +// RestorableGremlinDatabasesClientListResponse contains the response from method RestorableGremlinDatabasesClient.List. +type RestorableGremlinDatabasesClientListResponse struct { + RestorableGremlinDatabasesListResult +} + +// RestorableGremlinGraphsClientListResponse contains the response from method RestorableGremlinGraphsClient.List. +type RestorableGremlinGraphsClientListResponse struct { + RestorableGremlinGraphsListResult +} + +// RestorableGremlinResourcesClientListResponse contains the response from method RestorableGremlinResourcesClient.List. +type RestorableGremlinResourcesClientListResponse struct { + RestorableGremlinResourcesListResult +} + // RestorableMongodbCollectionsClientListResponse contains the response from method RestorableMongodbCollectionsClient.List. type RestorableMongodbCollectionsClientListResponse struct { RestorableMongodbCollectionsListResult @@ -624,6 +799,21 @@ type RestorableSQLResourcesClientListResponse struct { RestorableSQLResourcesListResult } +// RestorableTableResourcesClientListResponse contains the response from method RestorableTableResourcesClient.List. +type RestorableTableResourcesClientListResponse struct { + RestorableTableResourcesListResult +} + +// RestorableTablesClientListResponse contains the response from method RestorableTablesClient.List. +type RestorableTablesClientListResponse struct { + RestorableTablesListResult +} + +// SQLResourcesClientCreateUpdateClientEncryptionKeyResponse contains the response from method SQLResourcesClient.CreateUpdateClientEncryptionKey. +type SQLResourcesClientCreateUpdateClientEncryptionKeyResponse struct { + ClientEncryptionKeyGetResults +} + // SQLResourcesClientCreateUpdateSQLContainerResponse contains the response from method SQLResourcesClient.CreateUpdateSQLContainer. type SQLResourcesClientCreateUpdateSQLContainerResponse struct { SQLContainerGetResults @@ -694,6 +884,11 @@ type SQLResourcesClientDeleteSQLUserDefinedFunctionResponse struct { // placeholder for future response values } +// SQLResourcesClientGetClientEncryptionKeyResponse contains the response from method SQLResourcesClient.GetClientEncryptionKey. +type SQLResourcesClientGetClientEncryptionKeyResponse struct { + ClientEncryptionKeyGetResults +} + // SQLResourcesClientGetSQLContainerResponse contains the response from method SQLResourcesClient.GetSQLContainer. type SQLResourcesClientGetSQLContainerResponse struct { SQLContainerGetResults @@ -739,6 +934,16 @@ type SQLResourcesClientGetSQLUserDefinedFunctionResponse struct { SQLUserDefinedFunctionGetResults } +// SQLResourcesClientListClientEncryptionKeysResponse contains the response from method SQLResourcesClient.ListClientEncryptionKeys. +type SQLResourcesClientListClientEncryptionKeysResponse struct { + ClientEncryptionKeysListResult +} + +// SQLResourcesClientListSQLContainerPartitionMergeResponse contains the response from method SQLResourcesClient.ListSQLContainerPartitionMerge. +type SQLResourcesClientListSQLContainerPartitionMergeResponse struct { + PhysicalPartitionStorageInfoCollection +} + // SQLResourcesClientListSQLContainersResponse contains the response from method SQLResourcesClient.ListSQLContainers. type SQLResourcesClientListSQLContainersResponse struct { SQLContainerListResult @@ -799,6 +1004,16 @@ type SQLResourcesClientRetrieveContinuousBackupInformationResponse struct { BackupInformation } +// SQLResourcesClientSQLContainerRedistributeThroughputResponse contains the response from method SQLResourcesClient.SQLContainerRedistributeThroughput. +type SQLResourcesClientSQLContainerRedistributeThroughputResponse struct { + PhysicalPartitionThroughputInfoResult +} + +// SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse contains the response from method SQLResourcesClient.SQLContainerRetrieveThroughputDistribution. +type SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse struct { + PhysicalPartitionThroughputInfoResult +} + // SQLResourcesClientUpdateSQLContainerThroughputResponse contains the response from method SQLResourcesClient.UpdateSQLContainerThroughput. type SQLResourcesClientUpdateSQLContainerThroughputResponse struct { ThroughputSettingsGetResults @@ -809,6 +1024,26 @@ type SQLResourcesClientUpdateSQLDatabaseThroughputResponse struct { ThroughputSettingsGetResults } +// ServiceClientCreateResponse contains the response from method ServiceClient.Create. +type ServiceClientCreateResponse struct { + ServiceResource +} + +// ServiceClientDeleteResponse contains the response from method ServiceClient.Delete. +type ServiceClientDeleteResponse struct { + // placeholder for future response values +} + +// ServiceClientGetResponse contains the response from method ServiceClient.Get. +type ServiceClientGetResponse struct { + ServiceResource +} + +// ServiceClientListResponse contains the response from method ServiceClient.List. +type ServiceClientListResponse struct { + ServiceResourceListResult +} + // TableResourcesClientCreateUpdateTableResponse contains the response from method TableResourcesClient.CreateUpdateTable. type TableResourcesClientCreateUpdateTableResponse struct { TableGetResults @@ -844,6 +1079,11 @@ type TableResourcesClientMigrateTableToManualThroughputResponse struct { ThroughputSettingsGetResults } +// TableResourcesClientRetrieveContinuousBackupInformationResponse contains the response from method TableResourcesClient.RetrieveContinuousBackupInformation. +type TableResourcesClientRetrieveContinuousBackupInformationResponse struct { + BackupInformation +} + // TableResourcesClientUpdateTableThroughputResponse contains the response from method TableResourcesClient.UpdateTableThroughput. type TableResourcesClientUpdateTableThroughputResponse struct { ThroughputSettingsGetResults diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabledatabaseaccounts_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabledatabaseaccounts_client.go index 842848ac1aa2..1051be68c512 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabledatabaseaccounts_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabledatabaseaccounts_client.go @@ -57,7 +57,7 @@ func NewRestorableDatabaseAccountsClient(subscriptionID string, credential azcor // GetByLocation - Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableDatabaseAccountsClientGetByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.GetByLocation @@ -97,7 +97,7 @@ func (client *RestorableDatabaseAccountsClient) getByLocationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *RestorableDatabaseAccountsClient) getByLocationHandleResponse(resp // NewListPager - Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // options - RestorableDatabaseAccountsClientListOptions contains the optional parameters for the RestorableDatabaseAccountsClient.List // method. func (client *RestorableDatabaseAccountsClient) NewListPager(options *RestorableDatabaseAccountsClientListOptions) *runtime.Pager[RestorableDatabaseAccountsClientListResponse] { @@ -152,7 +152,7 @@ func (client *RestorableDatabaseAccountsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *RestorableDatabaseAccountsClient) listHandleResponse(resp *http.Re // in a region. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' // permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // options - RestorableDatabaseAccountsClientListByLocationOptions contains the optional parameters for the RestorableDatabaseAccountsClient.ListByLocation // method. @@ -213,7 +213,7 @@ func (client *RestorableDatabaseAccountsClient) listByLocationCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlindatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlindatabases_client.go new file mode 100644 index 000000000000..834859cb65f0 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlindatabases_client.go @@ -0,0 +1,121 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// RestorableGremlinDatabasesClient contains the methods for the RestorableGremlinDatabases group. +// Don't use this type directly, use NewRestorableGremlinDatabasesClient() instead. +type RestorableGremlinDatabasesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewRestorableGremlinDatabasesClient creates a new instance of RestorableGremlinDatabasesClient with the specified values. +// 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 NewRestorableGremlinDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinDatabasesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &RestorableGremlinDatabasesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin databases under the restorable +// account. This helps in scenario where database was accidentally deleted to get the deletion +// time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// location - Cosmos DB region, with spaces between words and each word capitalized. +// instanceID - The instanceId GUID of a restorable database account. +// options - RestorableGremlinDatabasesClientListOptions contains the optional parameters for the RestorableGremlinDatabasesClient.List +// method. +func (client *RestorableGremlinDatabasesClient) NewListPager(location string, instanceID string, options *RestorableGremlinDatabasesClientListOptions) *runtime.Pager[RestorableGremlinDatabasesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RestorableGremlinDatabasesClientListResponse]{ + More: func(page RestorableGremlinDatabasesClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *RestorableGremlinDatabasesClientListResponse) (RestorableGremlinDatabasesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, instanceID, options) + if err != nil { + return RestorableGremlinDatabasesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RestorableGremlinDatabasesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RestorableGremlinDatabasesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RestorableGremlinDatabasesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableGremlinDatabasesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RestorableGremlinDatabasesClient) listHandleResponse(resp *http.Response) (RestorableGremlinDatabasesClientListResponse, error) { + result := RestorableGremlinDatabasesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RestorableGremlinDatabasesListResult); err != nil { + return RestorableGremlinDatabasesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlingraphs_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlingraphs_client.go new file mode 100644 index 000000000000..b6aff4aa8cab --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlingraphs_client.go @@ -0,0 +1,130 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// RestorableGremlinGraphsClient contains the methods for the RestorableGremlinGraphs group. +// Don't use this type directly, use NewRestorableGremlinGraphsClient() instead. +type RestorableGremlinGraphsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewRestorableGremlinGraphsClient creates a new instance of RestorableGremlinGraphsClient with the specified values. +// 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 NewRestorableGremlinGraphsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinGraphsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &RestorableGremlinGraphsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB Gremlin graphs under a specific database. +// This helps in scenario where container was accidentally deleted. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// location - Cosmos DB region, with spaces between words and each word capitalized. +// instanceID - The instanceId GUID of a restorable database account. +// options - RestorableGremlinGraphsClientListOptions contains the optional parameters for the RestorableGremlinGraphsClient.List +// method. +func (client *RestorableGremlinGraphsClient) NewListPager(location string, instanceID string, options *RestorableGremlinGraphsClientListOptions) *runtime.Pager[RestorableGremlinGraphsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RestorableGremlinGraphsClientListResponse]{ + More: func(page RestorableGremlinGraphsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *RestorableGremlinGraphsClientListResponse) (RestorableGremlinGraphsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, instanceID, options) + if err != nil { + return RestorableGremlinGraphsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RestorableGremlinGraphsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RestorableGremlinGraphsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RestorableGremlinGraphsClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableGremlinGraphsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + if options != nil && options.RestorableGremlinDatabaseRid != nil { + reqQP.Set("restorableGremlinDatabaseRid", *options.RestorableGremlinDatabaseRid) + } + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", *options.StartTime) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", *options.EndTime) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RestorableGremlinGraphsClient) listHandleResponse(resp *http.Response) (RestorableGremlinGraphsClientListResponse, error) { + result := RestorableGremlinGraphsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RestorableGremlinGraphsListResult); err != nil { + return RestorableGremlinGraphsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlinresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlinresources_client.go new file mode 100644 index 000000000000..91604be09e8c --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablegremlinresources_client.go @@ -0,0 +1,127 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// RestorableGremlinResourcesClient contains the methods for the RestorableGremlinResources group. +// Don't use this type directly, use NewRestorableGremlinResourcesClient() instead. +type RestorableGremlinResourcesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewRestorableGremlinResourcesClient creates a new instance of RestorableGremlinResourcesClient with the specified values. +// 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 NewRestorableGremlinResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableGremlinResourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &RestorableGremlinResourcesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Return a list of gremlin database and graphs combo that exist on the account at the given timestamp and +// location. This helps in scenarios to validate what resources exist at given timestamp and +// location. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// location - Cosmos DB region, with spaces between words and each word capitalized. +// instanceID - The instanceId GUID of a restorable database account. +// options - RestorableGremlinResourcesClientListOptions contains the optional parameters for the RestorableGremlinResourcesClient.List +// method. +func (client *RestorableGremlinResourcesClient) NewListPager(location string, instanceID string, options *RestorableGremlinResourcesClientListOptions) *runtime.Pager[RestorableGremlinResourcesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RestorableGremlinResourcesClientListResponse]{ + More: func(page RestorableGremlinResourcesClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *RestorableGremlinResourcesClientListResponse) (RestorableGremlinResourcesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, instanceID, options) + if err != nil { + return RestorableGremlinResourcesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RestorableGremlinResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RestorableGremlinResourcesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RestorableGremlinResourcesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableGremlinResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + if options != nil && options.RestoreLocation != nil { + reqQP.Set("restoreLocation", *options.RestoreLocation) + } + if options != nil && options.RestoreTimestampInUTC != nil { + reqQP.Set("restoreTimestampInUtc", *options.RestoreTimestampInUTC) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RestorableGremlinResourcesClient) listHandleResponse(resp *http.Response) (RestorableGremlinResourcesClientListResponse, error) { + result := RestorableGremlinResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RestorableGremlinResourcesListResult); err != nil { + return RestorableGremlinResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbcollections_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbcollections_client.go index 7180b54bad28..a73b9129b9bc 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbcollections_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbcollections_client.go @@ -58,7 +58,7 @@ func NewRestorableMongodbCollectionsClient(subscriptionID string, credential azc // database. This helps in scenario where container was accidentally deleted. This API requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableMongodbCollectionsClientListOptions contains the optional parameters for the RestorableMongodbCollectionsClient.List @@ -105,10 +105,16 @@ func (client *RestorableMongodbCollectionsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.RestorableMongodbDatabaseRid != nil { reqQP.Set("restorableMongodbDatabaseRid", *options.RestorableMongodbDatabaseRid) } + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", *options.StartTime) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", *options.EndTime) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbdatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbdatabases_client.go index 20210491e574..9dd55497b5b6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbdatabases_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbdatabases_client.go @@ -58,7 +58,7 @@ func NewRestorableMongodbDatabasesClient(subscriptionID string, credential azcor // account. This helps in scenario where database was accidentally deleted to get the deletion // time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableMongodbDatabasesClientListOptions contains the optional parameters for the RestorableMongodbDatabasesClient.List @@ -105,7 +105,7 @@ func (client *RestorableMongodbDatabasesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbresources_client.go index 9c09f1817af5..0d8c4f557113 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablemongodbresources_client.go @@ -58,7 +58,7 @@ func NewRestorableMongodbResourcesClient(subscriptionID string, credential azcor // This helps in scenarios to validate what resources exist at given timestamp and location. // This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableMongodbResourcesClientListOptions contains the optional parameters for the RestorableMongodbResourcesClient.List @@ -105,7 +105,7 @@ func (client *RestorableMongodbResourcesClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlcontainers_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlcontainers_client.go index 720c7b7b317f..42bb17710a46 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlcontainers_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlcontainers_client.go @@ -58,7 +58,7 @@ func NewRestorableSQLContainersClient(subscriptionID string, credential azcore.T // This helps in scenario where container was accidentally deleted. This API requires // 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableSQLContainersClientListOptions contains the optional parameters for the RestorableSQLContainersClient.List @@ -105,7 +105,7 @@ func (client *RestorableSQLContainersClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.RestorableSQLDatabaseRid != nil { reqQP.Set("restorableSqlDatabaseRid", *options.RestorableSQLDatabaseRid) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqldatabases_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqldatabases_client.go index 2293b99faa14..5592a9a79fb0 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqldatabases_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqldatabases_client.go @@ -58,7 +58,7 @@ func NewRestorableSQLDatabasesClient(subscriptionID string, credential azcore.To // account. This helps in scenario where database was accidentally deleted to get the deletion // time. This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableSQLDatabasesClientListOptions contains the optional parameters for the RestorableSQLDatabasesClient.List @@ -105,7 +105,7 @@ func (client *RestorableSQLDatabasesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlresources_client.go index a8f5170b0f7e..0423957bcee5 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorablesqlresources_client.go @@ -58,7 +58,7 @@ func NewRestorableSQLResourcesClient(subscriptionID string, credential azcore.To // This helps in scenarios to validate what resources exist at given timestamp and location. // This API requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // location - Cosmos DB region, with spaces between words and each word capitalized. // instanceID - The instanceId GUID of a restorable database account. // options - RestorableSQLResourcesClientListOptions contains the optional parameters for the RestorableSQLResourcesClient.List @@ -105,7 +105,7 @@ func (client *RestorableSQLResourcesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") if options != nil && options.RestoreLocation != nil { reqQP.Set("restoreLocation", *options.RestoreLocation) } diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabletableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabletableresources_client.go new file mode 100644 index 000000000000..3f7325a3cc91 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabletableresources_client.go @@ -0,0 +1,127 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// RestorableTableResourcesClient contains the methods for the RestorableTableResources group. +// Don't use this type directly, use NewRestorableTableResourcesClient() instead. +type RestorableTableResourcesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewRestorableTableResourcesClient creates a new instance of RestorableTableResourcesClient with the specified values. +// 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 NewRestorableTableResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableTableResourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &RestorableTableResourcesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Return a list of tables that exist on the account at the given timestamp and location. This helps in scenarios +// to validate what resources exist at given timestamp and location. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// location - Cosmos DB region, with spaces between words and each word capitalized. +// instanceID - The instanceId GUID of a restorable database account. +// options - RestorableTableResourcesClientListOptions contains the optional parameters for the RestorableTableResourcesClient.List +// method. +func (client *RestorableTableResourcesClient) NewListPager(location string, instanceID string, options *RestorableTableResourcesClientListOptions) *runtime.Pager[RestorableTableResourcesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RestorableTableResourcesClientListResponse]{ + More: func(page RestorableTableResourcesClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *RestorableTableResourcesClientListResponse) (RestorableTableResourcesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, instanceID, options) + if err != nil { + return RestorableTableResourcesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RestorableTableResourcesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RestorableTableResourcesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RestorableTableResourcesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableTableResourcesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + if options != nil && options.RestoreLocation != nil { + reqQP.Set("restoreLocation", *options.RestoreLocation) + } + if options != nil && options.RestoreTimestampInUTC != nil { + reqQP.Set("restoreTimestampInUtc", *options.RestoreTimestampInUTC) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RestorableTableResourcesClient) listHandleResponse(resp *http.Response) (RestorableTableResourcesClientListResponse, error) { + result := RestorableTableResourcesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RestorableTableResourcesListResult); err != nil { + return RestorableTableResourcesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabletables_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabletables_client.go new file mode 100644 index 000000000000..da6a551098e1 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_restorabletables_client.go @@ -0,0 +1,126 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// RestorableTablesClient contains the methods for the RestorableTables group. +// Don't use this type directly, use NewRestorableTablesClient() instead. +type RestorableTablesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewRestorableTablesClient creates a new instance of RestorableTablesClient with the specified values. +// 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 NewRestorableTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableTablesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &RestorableTablesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Show the event feed of all mutations done on all the Azure Cosmos DB Tables. This helps in scenario where +// table was accidentally deleted. This API requires +// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/…/read' permission +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// location - Cosmos DB region, with spaces between words and each word capitalized. +// instanceID - The instanceId GUID of a restorable database account. +// options - RestorableTablesClientListOptions contains the optional parameters for the RestorableTablesClient.List method. +func (client *RestorableTablesClient) NewListPager(location string, instanceID string, options *RestorableTablesClientListOptions) *runtime.Pager[RestorableTablesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[RestorableTablesClientListResponse]{ + More: func(page RestorableTablesClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *RestorableTablesClientListResponse) (RestorableTablesClientListResponse, error) { + req, err := client.listCreateRequest(ctx, location, instanceID, options) + if err != nil { + return RestorableTablesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return RestorableTablesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return RestorableTablesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *RestorableTablesClient) listCreateRequest(ctx context.Context, location string, instanceID string, options *RestorableTablesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + if instanceID == "" { + return nil, errors.New("parameter instanceID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{instanceId}", url.PathEscape(instanceID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + if options != nil && options.StartTime != nil { + reqQP.Set("startTime", *options.StartTime) + } + if options != nil && options.EndTime != nil { + reqQP.Set("endTime", *options.EndTime) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *RestorableTablesClient) listHandleResponse(resp *http.Response) (RestorableTablesClientListResponse, error) { + result := RestorableTablesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RestorableTablesListResult); err != nil { + return RestorableTablesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_service_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_service_client.go new file mode 100644 index 000000000000..4ebd2b6d3d27 --- /dev/null +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_service_client.go @@ -0,0 +1,314 @@ +//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 armcosmos + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// ServiceClient contains the methods for the Service group. +// Don't use this type directly, use NewServiceClient() instead. +type ServiceClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewServiceClient creates a new instance of ServiceClient with the specified values. +// 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 NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &ServiceClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreate - Creates a service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// serviceName - Cosmos DB service name. +// createUpdateParameters - The Service resource parameters. +// options - ServiceClientBeginCreateOptions contains the optional parameters for the ServiceClient.BeginCreate method. +func (client *ServiceClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters, options *ServiceClientBeginCreateOptions) (*runtime.Poller[ServiceClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, accountName, serviceName, createUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServiceClientCreateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ServiceClientCreateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Create - Creates a service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *ServiceClient) create(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters, options *ServiceClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, accountName, serviceName, createUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *ServiceClient) createCreateRequest(ctx context.Context, resourceGroupName string, accountName string, serviceName string, createUpdateParameters ServiceResourceCreateUpdateParameters, options *ServiceClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, createUpdateParameters) +} + +// BeginDelete - Deletes service with the given serviceName. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// serviceName - Cosmos DB service name. +// options - ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method. +func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*runtime.Poller[ServiceClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, serviceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServiceClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ServiceClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes service with the given serviceName. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *ServiceClient) deleteOperation(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, accountName, serviceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the status of service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// serviceName - Cosmos DB service name. +// options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. +func (client *ServiceClient) Get(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientGetOptions) (ServiceClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, accountName, serviceName, options) + if err != nil { + return ServiceClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ServiceClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ServiceClient) getCreateRequest(ctx context.Context, resourceGroupName string, accountName string, serviceName string, options *ServiceClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServiceClient) getHandleResponse(resp *http.Response) (ServiceClientGetResponse, error) { + result := ServiceClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceResource); err != nil { + return ServiceClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets the status of service. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// options - ServiceClientListOptions contains the optional parameters for the ServiceClient.List method. +func (client *ServiceClient) NewListPager(resourceGroupName string, accountName string, options *ServiceClientListOptions) *runtime.Pager[ServiceClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ServiceClientListResponse]{ + More: func(page ServiceClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *ServiceClientListResponse) (ServiceClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return ServiceClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ServiceClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServiceClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ServiceClient) listCreateRequest(ctx context.Context, resourceGroupName string, accountName string, options *ServiceClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ServiceClient) listHandleResponse(resp *http.Response) (ServiceClientListResponse, error) { + result := ServiceClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServiceResourceListResult); err != nil { + return ServiceClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_sqlresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_sqlresources_client.go index 34857a23ab4b..500d75f0ce77 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_sqlresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_sqlresources_client.go @@ -54,9 +54,85 @@ func NewSQLResourcesClient(subscriptionID string, credential azcore.TokenCredent return client, nil } +// BeginCreateUpdateClientEncryptionKey - Create or update a ClientEncryptionKey. This API is meant to be invoked via tools +// such as the Azure Powershell (instead of directly). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// clientEncryptionKeyName - Cosmos DB ClientEncryptionKey name. +// createUpdateClientEncryptionKeyParameters - The parameters to provide for the client encryption key. +// options - SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.BeginCreateUpdateClientEncryptionKey +// method. +func (client *SQLResourcesClient) BeginCreateUpdateClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*runtime.Poller[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createUpdateClientEncryptionKey(ctx, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[SQLResourcesClientCreateUpdateClientEncryptionKeyResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateUpdateClientEncryptionKey - Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such +// as the Azure Powershell (instead of directly). +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *SQLResourcesClient) createUpdateClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*http.Response, error) { + req, err := client.createUpdateClientEncryptionKeyCreateRequest(ctx, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createUpdateClientEncryptionKeyCreateRequest creates the CreateUpdateClientEncryptionKey request. +func (client *SQLResourcesClient) createUpdateClientEncryptionKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, createUpdateClientEncryptionKeyParameters ClientEncryptionKeyCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateClientEncryptionKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if clientEncryptionKeyName == "" { + return nil, errors.New("parameter clientEncryptionKeyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientEncryptionKeyName}", url.PathEscape(clientEncryptionKeyName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, createUpdateClientEncryptionKeyParameters) +} + // BeginCreateUpdateSQLContainer - Create or update an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -78,7 +154,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLContainer(ctx context.Cont // CreateUpdateSQLContainer - Create or update an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) createUpdateSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, createUpdateSQLContainerParameters SQLContainerCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLContainerOptions) (*http.Response, error) { req, err := client.createUpdateSQLContainerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, createUpdateSQLContainerParameters, options) if err != nil { @@ -122,7 +198,7 @@ func (client *SQLResourcesClient) createUpdateSQLContainerCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLContainerParameters) @@ -130,7 +206,7 @@ func (client *SQLResourcesClient) createUpdateSQLContainerCreateRequest(ctx cont // BeginCreateUpdateSQLDatabase - Create or update an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -151,7 +227,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLDatabase(ctx context.Conte // CreateUpdateSQLDatabase - Create or update an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) createUpdateSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, createUpdateSQLDatabaseParameters SQLDatabaseCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLDatabaseOptions) (*http.Response, error) { req, err := client.createUpdateSQLDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, createUpdateSQLDatabaseParameters, options) if err != nil { @@ -191,7 +267,7 @@ func (client *SQLResourcesClient) createUpdateSQLDatabaseCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLDatabaseParameters) @@ -199,7 +275,7 @@ func (client *SQLResourcesClient) createUpdateSQLDatabaseCreateRequest(ctx conte // BeginCreateUpdateSQLRoleAssignment - Creates or updates an Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // roleAssignmentID - The GUID for the Role Assignment. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -220,7 +296,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLRoleAssignment(ctx context // CreateUpdateSQLRoleAssignment - Creates or updates an Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) createUpdateSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, createUpdateSQLRoleAssignmentParameters SQLRoleAssignmentCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleAssignmentOptions) (*http.Response, error) { req, err := client.createUpdateSQLRoleAssignmentCreateRequest(ctx, roleAssignmentID, resourceGroupName, accountName, createUpdateSQLRoleAssignmentParameters, options) if err != nil { @@ -260,7 +336,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleAssignmentCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLRoleAssignmentParameters) @@ -268,7 +344,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleAssignmentCreateRequest(ctx // BeginCreateUpdateSQLRoleDefinition - Creates or updates an Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // roleDefinitionID - The GUID for the Role Definition. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -289,7 +365,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLRoleDefinition(ctx context // CreateUpdateSQLRoleDefinition - Creates or updates an Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) createUpdateSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, createUpdateSQLRoleDefinitionParameters SQLRoleDefinitionCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLRoleDefinitionOptions) (*http.Response, error) { req, err := client.createUpdateSQLRoleDefinitionCreateRequest(ctx, roleDefinitionID, resourceGroupName, accountName, createUpdateSQLRoleDefinitionParameters, options) if err != nil { @@ -329,7 +405,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleDefinitionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLRoleDefinitionParameters) @@ -337,7 +413,7 @@ func (client *SQLResourcesClient) createUpdateSQLRoleDefinitionCreateRequest(ctx // BeginCreateUpdateSQLStoredProcedure - Create or update an Azure Cosmos DB SQL storedProcedure // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -360,7 +436,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLStoredProcedure(ctx contex // CreateUpdateSQLStoredProcedure - Create or update an Azure Cosmos DB SQL storedProcedure // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) createUpdateSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, createUpdateSQLStoredProcedureParameters SQLStoredProcedureCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLStoredProcedureOptions) (*http.Response, error) { req, err := client.createUpdateSQLStoredProcedureCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName, createUpdateSQLStoredProcedureParameters, options) if err != nil { @@ -408,7 +484,7 @@ func (client *SQLResourcesClient) createUpdateSQLStoredProcedureCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLStoredProcedureParameters) @@ -416,7 +492,7 @@ func (client *SQLResourcesClient) createUpdateSQLStoredProcedureCreateRequest(ct // BeginCreateUpdateSQLTrigger - Create or update an Azure Cosmos DB SQL trigger // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -439,7 +515,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLTrigger(ctx context.Contex // CreateUpdateSQLTrigger - Create or update an Azure Cosmos DB SQL trigger // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) createUpdateSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, createUpdateSQLTriggerParameters SQLTriggerCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLTriggerOptions) (*http.Response, error) { req, err := client.createUpdateSQLTriggerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName, createUpdateSQLTriggerParameters, options) if err != nil { @@ -487,7 +563,7 @@ func (client *SQLResourcesClient) createUpdateSQLTriggerCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLTriggerParameters) @@ -495,7 +571,7 @@ func (client *SQLResourcesClient) createUpdateSQLTriggerCreateRequest(ctx contex // BeginCreateUpdateSQLUserDefinedFunction - Create or update an Azure Cosmos DB SQL userDefinedFunction // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -518,7 +594,7 @@ func (client *SQLResourcesClient) BeginCreateUpdateSQLUserDefinedFunction(ctx co // CreateUpdateSQLUserDefinedFunction - Create or update an Azure Cosmos DB SQL userDefinedFunction // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) createUpdateSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, createUpdateSQLUserDefinedFunctionParameters SQLUserDefinedFunctionCreateUpdateParameters, options *SQLResourcesClientBeginCreateUpdateSQLUserDefinedFunctionOptions) (*http.Response, error) { req, err := client.createUpdateSQLUserDefinedFunctionCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, createUpdateSQLUserDefinedFunctionParameters, options) if err != nil { @@ -566,7 +642,7 @@ func (client *SQLResourcesClient) createUpdateSQLUserDefinedFunctionCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateSQLUserDefinedFunctionParameters) @@ -574,7 +650,7 @@ func (client *SQLResourcesClient) createUpdateSQLUserDefinedFunctionCreateReques // BeginDeleteSQLContainer - Deletes an existing Azure Cosmos DB SQL container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -595,7 +671,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLContainer(ctx context.Context, r // DeleteSQLContainer - Deletes an existing Azure Cosmos DB SQL container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) deleteSQLContainer(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginDeleteSQLContainerOptions) (*http.Response, error) { req, err := client.deleteSQLContainerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, options) if err != nil { @@ -639,14 +715,14 @@ func (client *SQLResourcesClient) deleteSQLContainerCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLDatabase - Deletes an existing Azure Cosmos DB SQL database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -666,7 +742,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLDatabase(ctx context.Context, re // DeleteSQLDatabase - Deletes an existing Azure Cosmos DB SQL database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) deleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginDeleteSQLDatabaseOptions) (*http.Response, error) { req, err := client.deleteSQLDatabaseCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -706,14 +782,14 @@ func (client *SQLResourcesClient) deleteSQLDatabaseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLRoleAssignment - Deletes an existing Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // roleAssignmentID - The GUID for the Role Assignment. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -733,7 +809,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLRoleAssignment(ctx context.Conte // DeleteSQLRoleAssignment - Deletes an existing Azure Cosmos DB SQL Role Assignment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) deleteSQLRoleAssignment(ctx context.Context, roleAssignmentID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleAssignmentOptions) (*http.Response, error) { req, err := client.deleteSQLRoleAssignmentCreateRequest(ctx, roleAssignmentID, resourceGroupName, accountName, options) if err != nil { @@ -773,7 +849,7 @@ func (client *SQLResourcesClient) deleteSQLRoleAssignmentCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -781,7 +857,7 @@ func (client *SQLResourcesClient) deleteSQLRoleAssignmentCreateRequest(ctx conte // BeginDeleteSQLRoleDefinition - Deletes an existing Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // roleDefinitionID - The GUID for the Role Definition. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -801,7 +877,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLRoleDefinition(ctx context.Conte // DeleteSQLRoleDefinition - Deletes an existing Azure Cosmos DB SQL Role Definition. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) deleteSQLRoleDefinition(ctx context.Context, roleDefinitionID string, resourceGroupName string, accountName string, options *SQLResourcesClientBeginDeleteSQLRoleDefinitionOptions) (*http.Response, error) { req, err := client.deleteSQLRoleDefinitionCreateRequest(ctx, roleDefinitionID, resourceGroupName, accountName, options) if err != nil { @@ -841,7 +917,7 @@ func (client *SQLResourcesClient) deleteSQLRoleDefinitionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -849,7 +925,7 @@ func (client *SQLResourcesClient) deleteSQLRoleDefinitionCreateRequest(ctx conte // BeginDeleteSQLStoredProcedure - Deletes an existing Azure Cosmos DB SQL storedProcedure. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -871,7 +947,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLStoredProcedure(ctx context.Cont // DeleteSQLStoredProcedure - Deletes an existing Azure Cosmos DB SQL storedProcedure. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) deleteSQLStoredProcedure(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, storedProcedureName string, options *SQLResourcesClientBeginDeleteSQLStoredProcedureOptions) (*http.Response, error) { req, err := client.deleteSQLStoredProcedureCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, storedProcedureName, options) if err != nil { @@ -919,14 +995,14 @@ func (client *SQLResourcesClient) deleteSQLStoredProcedureCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLTrigger - Deletes an existing Azure Cosmos DB SQL trigger. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -948,7 +1024,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLTrigger(ctx context.Context, res // DeleteSQLTrigger - Deletes an existing Azure Cosmos DB SQL trigger. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) deleteSQLTrigger(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, triggerName string, options *SQLResourcesClientBeginDeleteSQLTriggerOptions) (*http.Response, error) { req, err := client.deleteSQLTriggerCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, triggerName, options) if err != nil { @@ -996,14 +1072,14 @@ func (client *SQLResourcesClient) deleteSQLTriggerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteSQLUserDefinedFunction - Deletes an existing Azure Cosmos DB SQL userDefinedFunction. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1025,7 +1101,7 @@ func (client *SQLResourcesClient) BeginDeleteSQLUserDefinedFunction(ctx context. // DeleteSQLUserDefinedFunction - Deletes an existing Azure Cosmos DB SQL userDefinedFunction. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) deleteSQLUserDefinedFunction(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, userDefinedFunctionName string, options *SQLResourcesClientBeginDeleteSQLUserDefinedFunctionOptions) (*http.Response, error) { req, err := client.deleteSQLUserDefinedFunctionCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, options) if err != nil { @@ -1073,14 +1149,81 @@ func (client *SQLResourcesClient) deleteSQLUserDefinedFunctionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } +// GetClientEncryptionKey - Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// clientEncryptionKeyName - Cosmos DB ClientEncryptionKey name. +// options - SQLResourcesClientGetClientEncryptionKeyOptions contains the optional parameters for the SQLResourcesClient.GetClientEncryptionKey +// method. +func (client *SQLResourcesClient) GetClientEncryptionKey(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, options *SQLResourcesClientGetClientEncryptionKeyOptions) (SQLResourcesClientGetClientEncryptionKeyResponse, error) { + req, err := client.getClientEncryptionKeyCreateRequest(ctx, resourceGroupName, accountName, databaseName, clientEncryptionKeyName, options) + if err != nil { + return SQLResourcesClientGetClientEncryptionKeyResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLResourcesClientGetClientEncryptionKeyResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLResourcesClientGetClientEncryptionKeyResponse{}, runtime.NewResponseError(resp) + } + return client.getClientEncryptionKeyHandleResponse(resp) +} + +// getClientEncryptionKeyCreateRequest creates the GetClientEncryptionKey request. +func (client *SQLResourcesClient) getClientEncryptionKeyCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, clientEncryptionKeyName string, options *SQLResourcesClientGetClientEncryptionKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if clientEncryptionKeyName == "" { + return nil, errors.New("parameter clientEncryptionKeyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clientEncryptionKeyName}", url.PathEscape(clientEncryptionKeyName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getClientEncryptionKeyHandleResponse handles the GetClientEncryptionKey response. +func (client *SQLResourcesClient) getClientEncryptionKeyHandleResponse(resp *http.Response) (SQLResourcesClientGetClientEncryptionKeyResponse, error) { + result := SQLResourcesClientGetClientEncryptionKeyResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ClientEncryptionKeyGetResults); err != nil { + return SQLResourcesClientGetClientEncryptionKeyResponse{}, err + } + return result, nil +} + // GetSQLContainer - Gets the SQL container under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1130,7 +1273,7 @@ func (client *SQLResourcesClient) getSQLContainerCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1147,7 +1290,7 @@ func (client *SQLResourcesClient) getSQLContainerHandleResponse(resp *http.Respo // GetSQLContainerThroughput - Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1197,7 +1340,7 @@ func (client *SQLResourcesClient) getSQLContainerThroughputCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1214,7 +1357,7 @@ func (client *SQLResourcesClient) getSQLContainerThroughputHandleResponse(resp * // GetSQLDatabase - Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1259,7 +1402,7 @@ func (client *SQLResourcesClient) getSQLDatabaseCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1277,7 +1420,7 @@ func (client *SQLResourcesClient) getSQLDatabaseHandleResponse(resp *http.Respon // GetSQLDatabaseThroughput - Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account // with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1322,7 +1465,7 @@ func (client *SQLResourcesClient) getSQLDatabaseThroughputCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1339,7 +1482,7 @@ func (client *SQLResourcesClient) getSQLDatabaseThroughputHandleResponse(resp *h // GetSQLRoleAssignment - Retrieves the properties of an existing Azure Cosmos DB SQL Role Assignment with the given Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // roleAssignmentID - The GUID for the Role Assignment. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -1384,7 +1527,7 @@ func (client *SQLResourcesClient) getSQLRoleAssignmentCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1401,7 +1544,7 @@ func (client *SQLResourcesClient) getSQLRoleAssignmentHandleResponse(resp *http. // GetSQLRoleDefinition - Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // roleDefinitionID - The GUID for the Role Definition. // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. @@ -1446,7 +1589,7 @@ func (client *SQLResourcesClient) getSQLRoleDefinitionCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1463,7 +1606,7 @@ func (client *SQLResourcesClient) getSQLRoleDefinitionHandleResponse(resp *http. // GetSQLStoredProcedure - Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1518,7 +1661,7 @@ func (client *SQLResourcesClient) getSQLStoredProcedureCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1535,7 +1678,7 @@ func (client *SQLResourcesClient) getSQLStoredProcedureHandleResponse(resp *http // GetSQLTrigger - Gets the SQL trigger under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1590,7 +1733,7 @@ func (client *SQLResourcesClient) getSQLTriggerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1607,7 +1750,7 @@ func (client *SQLResourcesClient) getSQLTriggerHandleResponse(resp *http.Respons // GetSQLUserDefinedFunction - Gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1662,7 +1805,7 @@ func (client *SQLResourcesClient) getSQLUserDefinedFunctionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1677,9 +1820,154 @@ func (client *SQLResourcesClient) getSQLUserDefinedFunctionHandleResponse(resp * return result, nil } +// NewListClientEncryptionKeysPager - Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// options - SQLResourcesClientListClientEncryptionKeysOptions contains the optional parameters for the SQLResourcesClient.ListClientEncryptionKeys +// method. +func (client *SQLResourcesClient) NewListClientEncryptionKeysPager(resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientListClientEncryptionKeysOptions) *runtime.Pager[SQLResourcesClientListClientEncryptionKeysResponse] { + return runtime.NewPager(runtime.PagingHandler[SQLResourcesClientListClientEncryptionKeysResponse]{ + More: func(page SQLResourcesClientListClientEncryptionKeysResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *SQLResourcesClientListClientEncryptionKeysResponse) (SQLResourcesClientListClientEncryptionKeysResponse, error) { + req, err := client.listClientEncryptionKeysCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) + if err != nil { + return SQLResourcesClientListClientEncryptionKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SQLResourcesClientListClientEncryptionKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SQLResourcesClientListClientEncryptionKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listClientEncryptionKeysHandleResponse(resp) + }, + }) +} + +// listClientEncryptionKeysCreateRequest creates the ListClientEncryptionKeys request. +func (client *SQLResourcesClient) listClientEncryptionKeysCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientListClientEncryptionKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listClientEncryptionKeysHandleResponse handles the ListClientEncryptionKeys response. +func (client *SQLResourcesClient) listClientEncryptionKeysHandleResponse(resp *http.Response) (SQLResourcesClientListClientEncryptionKeysResponse, error) { + result := SQLResourcesClientListClientEncryptionKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ClientEncryptionKeysListResult); err != nil { + return SQLResourcesClientListClientEncryptionKeysResponse{}, err + } + return result, nil +} + +// BeginListSQLContainerPartitionMerge - Merges the partitions of a SQL Container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// containerName - Cosmos DB container name. +// mergeParameters - The parameters for the merge operation. +// options - SQLResourcesClientBeginListSQLContainerPartitionMergeOptions contains the optional parameters for the SQLResourcesClient.BeginListSQLContainerPartitionMerge +// method. +func (client *SQLResourcesClient) BeginListSQLContainerPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*runtime.Poller[SQLResourcesClientListSQLContainerPartitionMergeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.listSQLContainerPartitionMerge(ctx, resourceGroupName, accountName, databaseName, containerName, mergeParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLResourcesClientListSQLContainerPartitionMergeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SQLResourcesClientListSQLContainerPartitionMergeResponse](options.ResumeToken, client.pl, nil) + } +} + +// ListSQLContainerPartitionMerge - Merges the partitions of a SQL Container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *SQLResourcesClient) listSQLContainerPartitionMerge(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*http.Response, error) { + req, err := client.listSQLContainerPartitionMergeCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, mergeParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// listSQLContainerPartitionMergeCreateRequest creates the ListSQLContainerPartitionMerge request. +func (client *SQLResourcesClient) listSQLContainerPartitionMergeCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, mergeParameters MergeParameters, options *SQLResourcesClientBeginListSQLContainerPartitionMergeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if containerName == "" { + return nil, errors.New("parameter containerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, mergeParameters) +} + // NewListSQLContainersPager - Lists the SQL container under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1731,7 +2019,7 @@ func (client *SQLResourcesClient) listSQLContainersCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1748,7 +2036,7 @@ func (client *SQLResourcesClient) listSQLContainersHandleResponse(resp *http.Res // NewListSQLDatabasesPager - Lists the SQL databases under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - SQLResourcesClientListSQLDatabasesOptions contains the optional parameters for the SQLResourcesClient.ListSQLDatabases @@ -1795,7 +2083,7 @@ func (client *SQLResourcesClient) listSQLDatabasesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1812,7 +2100,7 @@ func (client *SQLResourcesClient) listSQLDatabasesHandleResponse(resp *http.Resp // NewListSQLRoleAssignmentsPager - Retrieves the list of all Azure Cosmos DB SQL Role Assignments. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - SQLResourcesClientListSQLRoleAssignmentsOptions contains the optional parameters for the SQLResourcesClient.ListSQLRoleAssignments @@ -1859,7 +2147,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1876,7 +2164,7 @@ func (client *SQLResourcesClient) listSQLRoleAssignmentsHandleResponse(resp *htt // NewListSQLRoleDefinitionsPager - Retrieves the list of all Azure Cosmos DB SQL Role Definitions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - SQLResourcesClientListSQLRoleDefinitionsOptions contains the optional parameters for the SQLResourcesClient.ListSQLRoleDefinitions @@ -1923,7 +2211,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1940,7 +2228,7 @@ func (client *SQLResourcesClient) listSQLRoleDefinitionsHandleResponse(resp *htt // NewListSQLStoredProceduresPager - Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -1997,7 +2285,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2014,7 +2302,7 @@ func (client *SQLResourcesClient) listSQLStoredProceduresHandleResponse(resp *ht // NewListSQLTriggersPager - Lists the SQL trigger under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2071,7 +2359,7 @@ func (client *SQLResourcesClient) listSQLTriggersCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2088,7 +2376,7 @@ func (client *SQLResourcesClient) listSQLTriggersHandleResponse(resp *http.Respo // NewListSQLUserDefinedFunctionsPager - Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2145,7 +2433,7 @@ func (client *SQLResourcesClient) listSQLUserDefinedFunctionsCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2162,7 +2450,7 @@ func (client *SQLResourcesClient) listSQLUserDefinedFunctionsHandleResponse(resp // BeginMigrateSQLContainerToAutoscale - Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2183,7 +2471,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLContainerToAutoscale(ctx contex // MigrateSQLContainerToAutoscale - Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) migrateSQLContainerToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateSQLContainerToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, options) if err != nil { @@ -2227,7 +2515,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToAutoscaleCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2235,7 +2523,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToAutoscaleCreateRequest(ct // BeginMigrateSQLContainerToManualThroughput - Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2256,7 +2544,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLContainerToManualThroughput(ctx // MigrateSQLContainerToManualThroughput - Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) migrateSQLContainerToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, options *SQLResourcesClientBeginMigrateSQLContainerToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateSQLContainerToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, options) if err != nil { @@ -2300,7 +2588,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToManualThroughputCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2308,7 +2596,7 @@ func (client *SQLResourcesClient) migrateSQLContainerToManualThroughputCreateReq // BeginMigrateSQLDatabaseToAutoscale - Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2328,7 +2616,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLDatabaseToAutoscale(ctx context // MigrateSQLDatabaseToAutoscale - Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscale(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateSQLDatabaseToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -2368,7 +2656,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscaleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2376,7 +2664,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToAutoscaleCreateRequest(ctx // BeginMigrateSQLDatabaseToManualThroughput - Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2396,7 +2684,7 @@ func (client *SQLResourcesClient) BeginMigrateSQLDatabaseToManualThroughput(ctx // MigrateSQLDatabaseToManualThroughput - Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, options *SQLResourcesClientBeginMigrateSQLDatabaseToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateSQLDatabaseToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, options) if err != nil { @@ -2436,7 +2724,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughputCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -2444,7 +2732,7 @@ func (client *SQLResourcesClient) migrateSQLDatabaseToManualThroughputCreateRequ // BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a container resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2468,7 +2756,7 @@ func (client *SQLResourcesClient) BeginRetrieveContinuousBackupInformation(ctx c // RetrieveContinuousBackupInformation - Retrieves continuous backup information for a container resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, location ContinuousBackupRestoreLocation, options *SQLResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, location, options) if err != nil { @@ -2512,15 +2800,167 @@ func (client *SQLResourcesClient) retrieveContinuousBackupInformationCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, location) } +// BeginSQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// containerName - Cosmos DB container name. +// redistributeThroughputParameters - The parameters to provide for redistributing throughput for the current SQL container. +// options - SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions contains the optional parameters for the SQLResourcesClient.BeginSQLContainerRedistributeThroughput +// method. +func (client *SQLResourcesClient) BeginSQLContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRedistributeThroughputResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.sQLContainerRedistributeThroughput(ctx, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLResourcesClientSQLContainerRedistributeThroughputResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SQLResourcesClientSQLContainerRedistributeThroughputResponse](options.ResumeToken, client.pl, nil) + } +} + +// SQLContainerRedistributeThroughput - Redistribute throughput for an Azure Cosmos DB SQL container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *SQLResourcesClient) sQLContainerRedistributeThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*http.Response, error) { + req, err := client.sqlContainerRedistributeThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, redistributeThroughputParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// sqlContainerRedistributeThroughputCreateRequest creates the SQLContainerRedistributeThroughput request. +func (client *SQLResourcesClient) sqlContainerRedistributeThroughputCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, redistributeThroughputParameters RedistributeThroughputParameters, options *SQLResourcesClientBeginSQLContainerRedistributeThroughputOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if containerName == "" { + return nil, errors.New("parameter containerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, redistributeThroughputParameters) +} + +// BeginSQLContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// databaseName - Cosmos DB database name. +// containerName - Cosmos DB container name. +// retrieveThroughputParameters - The parameters to provide for retrieving throughput distribution for the current SQL container. +// options - SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions contains the optional parameters for +// the SQLResourcesClient.BeginSQLContainerRetrieveThroughputDistribution method. +func (client *SQLResourcesClient) BeginSQLContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*runtime.Poller[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.sQLContainerRetrieveThroughputDistribution(ctx, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[SQLResourcesClientSQLContainerRetrieveThroughputDistributionResponse](options.ResumeToken, client.pl, nil) + } +} + +// SQLContainerRetrieveThroughputDistribution - Retrieve throughput distribution for an Azure Cosmos DB SQL container +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *SQLResourcesClient) sQLContainerRetrieveThroughputDistribution(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*http.Response, error) { + req, err := client.sqlContainerRetrieveThroughputDistributionCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// sqlContainerRetrieveThroughputDistributionCreateRequest creates the SQLContainerRetrieveThroughputDistribution request. +func (client *SQLResourcesClient) sqlContainerRetrieveThroughputDistributionCreateRequest(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, retrieveThroughputParameters RetrieveThroughputParameters, options *SQLResourcesClientBeginSQLContainerRetrieveThroughputDistributionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if containerName == "" { + return nil, errors.New("parameter containerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{containerName}", url.PathEscape(containerName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, retrieveThroughputParameters) +} + // BeginUpdateSQLContainerThroughput - Update RUs per second of an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2542,7 +2982,7 @@ func (client *SQLResourcesClient) BeginUpdateSQLContainerThroughput(ctx context. // UpdateSQLContainerThroughput - Update RUs per second of an Azure Cosmos DB SQL container // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) updateSQLContainerThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, containerName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLContainerThroughputOptions) (*http.Response, error) { req, err := client.updateSQLContainerThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, containerName, updateThroughputParameters, options) if err != nil { @@ -2586,7 +3026,7 @@ func (client *SQLResourcesClient) updateSQLContainerThroughputCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) @@ -2594,7 +3034,7 @@ func (client *SQLResourcesClient) updateSQLContainerThroughputCreateRequest(ctx // BeginUpdateSQLDatabaseThroughput - Update RUs per second of an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // databaseName - Cosmos DB database name. @@ -2615,7 +3055,7 @@ func (client *SQLResourcesClient) BeginUpdateSQLDatabaseThroughput(ctx context.C // UpdateSQLDatabaseThroughput - Update RUs per second of an Azure Cosmos DB SQL database // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *SQLResourcesClient) updateSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *SQLResourcesClientBeginUpdateSQLDatabaseThroughputOptions) (*http.Response, error) { req, err := client.updateSQLDatabaseThroughputCreateRequest(ctx, resourceGroupName, accountName, databaseName, updateThroughputParameters, options) if err != nil { @@ -2655,7 +3095,7 @@ func (client *SQLResourcesClient) updateSQLDatabaseThroughputCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_tableresources_client.go b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_tableresources_client.go index febedd3f50af..bbb8f17f49d6 100644 --- a/sdk/resourcemanager/cosmos/armcosmos/zz_generated_tableresources_client.go +++ b/sdk/resourcemanager/cosmos/armcosmos/zz_generated_tableresources_client.go @@ -56,7 +56,7 @@ func NewTableResourcesClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateUpdateTable - Create or update an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -77,7 +77,7 @@ func (client *TableResourcesClient) BeginCreateUpdateTable(ctx context.Context, // CreateUpdateTable - Create or update an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *TableResourcesClient) createUpdateTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, createUpdateTableParameters TableCreateUpdateParameters, options *TableResourcesClientBeginCreateUpdateTableOptions) (*http.Response, error) { req, err := client.createUpdateTableCreateRequest(ctx, resourceGroupName, accountName, tableName, createUpdateTableParameters, options) if err != nil { @@ -117,7 +117,7 @@ func (client *TableResourcesClient) createUpdateTableCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, createUpdateTableParameters) @@ -125,7 +125,7 @@ func (client *TableResourcesClient) createUpdateTableCreateRequest(ctx context.C // BeginDeleteTable - Deletes an existing Azure Cosmos DB Table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -145,7 +145,7 @@ func (client *TableResourcesClient) BeginDeleteTable(ctx context.Context, resour // DeleteTable - Deletes an existing Azure Cosmos DB Table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *TableResourcesClient) deleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginDeleteTableOptions) (*http.Response, error) { req, err := client.deleteTableCreateRequest(ctx, resourceGroupName, accountName, tableName, options) if err != nil { @@ -185,14 +185,14 @@ func (client *TableResourcesClient) deleteTableCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // GetTable - Gets the Tables under an existing Azure Cosmos DB database account with the provided name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -236,7 +236,7 @@ func (client *TableResourcesClient) getTableCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *TableResourcesClient) getTableHandleResponse(resp *http.Response) // GetTableThroughput - Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided // name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -299,7 +299,7 @@ func (client *TableResourcesClient) getTableThroughputCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,7 +316,7 @@ func (client *TableResourcesClient) getTableThroughputHandleResponse(resp *http. // NewListTablesPager - Lists the Tables under an existing Azure Cosmos DB database account. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // options - TableResourcesClientListTablesOptions contains the optional parameters for the TableResourcesClient.ListTables @@ -363,7 +363,7 @@ func (client *TableResourcesClient) listTablesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +380,7 @@ func (client *TableResourcesClient) listTablesHandleResponse(resp *http.Response // BeginMigrateTableToAutoscale - Migrate an Azure Cosmos DB Table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -400,7 +400,7 @@ func (client *TableResourcesClient) BeginMigrateTableToAutoscale(ctx context.Con // MigrateTableToAutoscale - Migrate an Azure Cosmos DB Table from manual throughput to autoscale // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *TableResourcesClient) migrateTableToAutoscale(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginMigrateTableToAutoscaleOptions) (*http.Response, error) { req, err := client.migrateTableToAutoscaleCreateRequest(ctx, resourceGroupName, accountName, tableName, options) if err != nil { @@ -440,7 +440,7 @@ func (client *TableResourcesClient) migrateTableToAutoscaleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -448,7 +448,7 @@ func (client *TableResourcesClient) migrateTableToAutoscaleCreateRequest(ctx con // BeginMigrateTableToManualThroughput - Migrate an Azure Cosmos DB Table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -468,7 +468,7 @@ func (client *TableResourcesClient) BeginMigrateTableToManualThroughput(ctx cont // MigrateTableToManualThroughput - Migrate an Azure Cosmos DB Table from autoscale to manual throughput // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *TableResourcesClient) migrateTableToManualThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, options *TableResourcesClientBeginMigrateTableToManualThroughputOptions) (*http.Response, error) { req, err := client.migrateTableToManualThroughputCreateRequest(ctx, resourceGroupName, accountName, tableName, options) if err != nil { @@ -508,15 +508,86 @@ func (client *TableResourcesClient) migrateTableToManualThroughputCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginRetrieveContinuousBackupInformation - Retrieves continuous backup information for a table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// accountName - Cosmos DB database account name. +// tableName - Cosmos DB table name. +// location - The name of the continuous backup restore location. +// options - TableResourcesClientBeginRetrieveContinuousBackupInformationOptions contains the optional parameters for the +// TableResourcesClient.BeginRetrieveContinuousBackupInformation method. +func (client *TableResourcesClient) BeginRetrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, tableName string, location ContinuousBackupRestoreLocation, options *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*runtime.Poller[TableResourcesClientRetrieveContinuousBackupInformationResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.retrieveContinuousBackupInformation(ctx, resourceGroupName, accountName, tableName, location, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[TableResourcesClientRetrieveContinuousBackupInformationResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[TableResourcesClientRetrieveContinuousBackupInformationResponse](options.ResumeToken, client.pl, nil) + } +} + +// RetrieveContinuousBackupInformation - Retrieves continuous backup information for a table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-15-preview +func (client *TableResourcesClient) retrieveContinuousBackupInformation(ctx context.Context, resourceGroupName string, accountName string, tableName string, location ContinuousBackupRestoreLocation, options *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*http.Response, error) { + req, err := client.retrieveContinuousBackupInformationCreateRequest(ctx, resourceGroupName, accountName, tableName, location, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// retrieveContinuousBackupInformationCreateRequest creates the RetrieveContinuousBackupInformation request. +func (client *TableResourcesClient) retrieveContinuousBackupInformationCreateRequest(ctx context.Context, resourceGroupName string, accountName string, tableName string, location ContinuousBackupRestoreLocation, options *TableResourcesClientBeginRetrieveContinuousBackupInformationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if tableName == "" { + return nil, errors.New("parameter tableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName)) + 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-02-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, location) +} + // BeginUpdateTableThroughput - Update RUs per second of an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // accountName - Cosmos DB database account name. // tableName - Cosmos DB table name. @@ -537,7 +608,7 @@ func (client *TableResourcesClient) BeginUpdateTableThroughput(ctx context.Conte // UpdateTableThroughput - Update RUs per second of an Azure Cosmos DB Table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-15 +// Generated from API version 2022-02-15-preview func (client *TableResourcesClient) updateTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string, updateThroughputParameters ThroughputSettingsUpdateParameters, options *TableResourcesClientBeginUpdateTableThroughputOptions) (*http.Response, error) { req, err := client.updateTableThroughputCreateRequest(ctx, resourceGroupName, accountName, tableName, updateThroughputParameters, options) if err != nil { @@ -577,7 +648,7 @@ func (client *TableResourcesClient) updateTableThroughputCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-15") + reqQP.Set("api-version", "2022-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, updateThroughputParameters) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md index 773b786717ea..6ed9bdc2e3a1 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md @@ -1,5 +1,120 @@ # Release History +## 2.0.0-beta.1 (2022-05-19) +### Breaking Changes + +- Type of `ScalingPlanProperties.HostPoolType` has been changed from `*HostPoolType` to `*ScalingHostPoolType` +- Type of `ScalingSchedule.PeakStartTime` has been changed from `*time.Time` to `*Time` +- Type of `ScalingSchedule.OffPeakStartTime` has been changed from `*time.Time` to `*Time` +- Type of `ScalingSchedule.RampUpStartTime` has been changed from `*time.Time` to `*Time` +- Type of `ScalingSchedule.RampDownStartTime` has been changed from `*time.Time` to `*Time` +- Function `*ScalingSchedule.UnmarshalJSON` has been removed +- Function `*DesktopsClient.List` has been removed +- Function `*OperationsClient.List` has been removed +- Field `HostPoolType` of struct `ScalingPlanPatchProperties` has been removed + +### Features Added + +- New const `HostpoolPublicNetworkAccessEnabledForSessionHostsOnly` +- New const `PrivateEndpointConnectionProvisioningStateSucceeded` +- New const `CreatedByTypeUser` +- New const `DayOfWeekTuesday` +- New const `HostpoolPublicNetworkAccessEnabled` +- New const `DayOfWeekFriday` +- New const `PrivateEndpointServiceConnectionStatusRejected` +- New const `HostpoolPublicNetworkAccessDisabled` +- New const `DayOfWeekThursday` +- New const `PublicNetworkAccessEnabled` +- New const `SessionHostComponentUpdateTypeScheduled` +- New const `CreatedByTypeKey` +- New const `PublicNetworkAccessDisabled` +- New const `ScalingHostPoolTypePooled` +- New const `DayOfWeekSaturday` +- New const `PrivateEndpointConnectionProvisioningStateCreating` +- New const `CreatedByTypeApplication` +- New const `CreatedByTypeManagedIdentity` +- New const `HostpoolPublicNetworkAccessEnabledForClientsOnly` +- New const `SessionHostComponentUpdateTypeDefault` +- New const `PrivateEndpointServiceConnectionStatusPending` +- New const `PrivateEndpointConnectionProvisioningStateDeleting` +- New const `PrivateEndpointConnectionProvisioningStateFailed` +- New const `PrivateEndpointServiceConnectionStatusApproved` +- New const `DayOfWeekSunday` +- New const `DayOfWeekMonday` +- New const `DayOfWeekWednesday` +- New function `PrivateLinkResourceProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleHostpoolPublicNetworkAccessValues() []HostpoolPublicNetworkAccess` +- New function `PossibleSessionHostComponentUpdateTypeValues() []SessionHostComponentUpdateType` +- New function `PossibleScalingHostPoolTypeValues() []ScalingHostPoolType` +- New function `AgentUpdatePatchProperties.MarshalJSON() ([]byte, error)` +- New function `*OperationsClient.NewListPager(*OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse]` +- New function `PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState` +- New function `AgentUpdateProperties.MarshalJSON() ([]byte, error)` +- New function `PossiblePublicNetworkAccessValues() []PublicNetworkAccess` +- New function `PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus` +- New function `*SystemData.UnmarshalJSON([]byte) error` +- New function `SystemData.MarshalJSON() ([]byte, error)` +- New function `PossibleDayOfWeekValues() []DayOfWeek` +- New function `*DesktopsClient.NewListPager(string, string, *DesktopsClientListOptions) *runtime.Pager[DesktopsClientListResponse]` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New struct `AgentUpdatePatchProperties` +- New struct `AgentUpdateProperties` +- New struct `MaintenanceWindowPatchProperties` +- New struct `MaintenanceWindowProperties` +- New struct `PrivateEndpoint` +- New struct `PrivateEndpointConnection` +- New struct `PrivateEndpointConnectionListResultWithSystemData` +- New struct `PrivateEndpointConnectionProperties` +- New struct `PrivateEndpointConnectionWithSystemData` +- New struct `PrivateEndpointConnectionsClientDeleteByHostPoolOptions` +- New struct `PrivateEndpointConnectionsClientDeleteByHostPoolResponse` +- New struct `PrivateEndpointConnectionsClientDeleteByWorkspaceOptions` +- New struct `PrivateEndpointConnectionsClientDeleteByWorkspaceResponse` +- New struct `PrivateEndpointConnectionsClientGetByHostPoolOptions` +- New struct `PrivateEndpointConnectionsClientGetByHostPoolResponse` +- New struct `PrivateEndpointConnectionsClientGetByWorkspaceOptions` +- New struct `PrivateEndpointConnectionsClientGetByWorkspaceResponse` +- New struct `PrivateEndpointConnectionsClientListByHostPoolOptions` +- New struct `PrivateEndpointConnectionsClientListByHostPoolResponse` +- New struct `PrivateEndpointConnectionsClientListByWorkspaceOptions` +- New struct `PrivateEndpointConnectionsClientListByWorkspaceResponse` +- New struct `PrivateEndpointConnectionsClientUpdateByHostPoolOptions` +- New struct `PrivateEndpointConnectionsClientUpdateByHostPoolResponse` +- New struct `PrivateEndpointConnectionsClientUpdateByWorkspaceOptions` +- New struct `PrivateEndpointConnectionsClientUpdateByWorkspaceResponse` +- New struct `PrivateLinkResource` +- New struct `PrivateLinkResourceListResult` +- New struct `PrivateLinkResourceProperties` +- New struct `PrivateLinkResourcesClientListByHostPoolOptions` +- New struct `PrivateLinkResourcesClientListByHostPoolResponse` +- New struct `PrivateLinkResourcesClientListByWorkspaceOptions` +- New struct `PrivateLinkResourcesClientListByWorkspaceResponse` +- New struct `PrivateLinkServiceConnectionState` +- New struct `SystemData` +- New struct `Time` +- New field `SystemData` in struct `ApplicationGroup` +- New field `SystemData` in struct `UserSession` +- New field `SystemData` in struct `ScalingPlan` +- New field `Force` in struct `SessionHostsClientUpdateOptions` +- New field `FriendlyName` in struct `SessionHostPatchProperties` +- New field `AgentUpdate` in struct `HostPoolPatchProperties` +- New field `PublicNetworkAccess` in struct `HostPoolPatchProperties` +- New field `SystemData` in struct `SessionHost` +- New field `PublicNetworkAccess` in struct `WorkspaceProperties` +- New field `PrivateEndpointConnections` in struct `WorkspaceProperties` +- New field `PublicNetworkAccess` in struct `WorkspacePatchProperties` +- New field `SystemData` in struct `MSIXPackage` +- New field `NextLink` in struct `ResourceProviderOperationList` +- New field `PublicNetworkAccess` in struct `HostPoolProperties` +- New field `PrivateEndpointConnections` in struct `HostPoolProperties` +- New field `AgentUpdate` in struct `HostPoolProperties` +- New field `SystemData` in struct `Application` +- New field `SystemData` in struct `Desktop` +- New field `SystemData` in struct `Workspace` +- New field `FriendlyName` in struct `SessionHostProperties` +- New field `SystemData` in struct `HostPool` + + ## 1.0.0 (2022-05-18) ### Breaking Changes diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md index 5674bdcf31f2..0b3b68df5ad2 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-2021-07 require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/desktopvirtualization/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/desktopvirtualization/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/desktopvirtualization/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/desktopvirtualization/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go index 78ab457d8f8d..5ac5e8f1f654 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ApplicationGroup_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Get.json func ExampleApplicationGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleApplicationGroupsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ApplicationGroup_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Create.json func ExampleApplicationGroupsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -78,7 +78,7 @@ func ExampleApplicationGroupsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ApplicationGroup_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Delete.json func ExampleApplicationGroupsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleApplicationGroupsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ApplicationGroup_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Update.json func ExampleApplicationGroupsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExampleApplicationGroupsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ApplicationGroup_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_ListByResourceGroup.json func ExampleApplicationGroupsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -155,7 +155,7 @@ func ExampleApplicationGroupsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ApplicationGroup_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_ListBySubscription.json func ExampleApplicationGroupsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go index 92bed52fce1d..66581c0c3ece 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Application_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Get.json func ExampleApplicationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleApplicationsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Application_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Create.json func ExampleApplicationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleApplicationsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Application_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Delete.json func ExampleApplicationsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleApplicationsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Application_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Update.json func ExampleApplicationsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -132,7 +132,7 @@ func ExampleApplicationsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Application_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_List.json func ExampleApplicationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go index d7da61f5f77b..e959e2ad687d 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Desktop_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Desktop_Get.json func ExampleDesktopsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleDesktopsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Desktop_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Desktop_Update.json func ExampleDesktopsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -69,8 +69,8 @@ func ExampleDesktopsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Desktop_List.json -func ExampleDesktopsClient_List() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Desktop_List.json +func ExampleDesktopsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -80,13 +80,17 @@ func ExampleDesktopsClient_List() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.List(ctx, - "resourceGroup1", + pager := client.NewListPager("resourceGroup1", "applicationGroup1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - // TODO: use response item - _ = res } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go index 15134fe4c7e5..91b5697bf529 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go @@ -19,7 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/HostPool_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Get.json func ExampleHostPoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleHostPoolsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/HostPool_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Create.json func ExampleHostPoolsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,21 @@ func ExampleHostPoolsClient_CreateOrUpdate() { "tag2": to.Ptr("value2"), }, Properties: &armdesktopvirtualization.HostPoolProperties{ - Description: to.Ptr("des1"), + Description: to.Ptr("des1"), + AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ + Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), + MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), + MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), + Hour: to.Ptr[int32](7), + }, + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), + Hour: to.Ptr[int32](8), + }}, + UseSessionHostLocalTime: to.Ptr(false), + }, FriendlyName: to.Ptr("friendly"), HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), @@ -73,6 +87,7 @@ func ExampleHostPoolsClient_CreateOrUpdate() { }, PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), + PublicNetworkAccess: to.Ptr(armdesktopvirtualization.HostpoolPublicNetworkAccessEnabled), RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.9571247Z"); return t }()), RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), @@ -93,7 +108,7 @@ func ExampleHostPoolsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/HostPool_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Delete.json func ExampleHostPoolsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -113,7 +128,7 @@ func ExampleHostPoolsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/HostPool_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Update.json func ExampleHostPoolsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -129,11 +144,26 @@ func ExampleHostPoolsClient_Update() { "hostPool1", &armdesktopvirtualization.HostPoolsClientUpdateOptions{HostPool: &armdesktopvirtualization.HostPoolPatch{ Properties: &armdesktopvirtualization.HostPoolPatchProperties{ - Description: to.Ptr("des1"), + Description: to.Ptr("des1"), + AgentUpdate: &armdesktopvirtualization.AgentUpdatePatchProperties{ + Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), + MaintenanceWindowTimeZone: to.Ptr("Alaskan Standard Time"), + MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowPatchProperties{ + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), + Hour: to.Ptr[int32](7), + }, + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), + Hour: to.Ptr[int32](8), + }}, + UseSessionHostLocalTime: to.Ptr(false), + }, FriendlyName: to.Ptr("friendly"), LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), MaxSessionLimit: to.Ptr[int32](999999), PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), + PublicNetworkAccess: to.Ptr(armdesktopvirtualization.HostpoolPublicNetworkAccessEnabled), RegistrationInfo: &armdesktopvirtualization.RegistrationInfoPatch{ ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T15:01:54.9571247Z"); return t }()), RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), @@ -158,7 +188,7 @@ func ExampleHostPoolsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/HostPool_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_ListByResourceGroup.json func ExampleHostPoolsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -183,7 +213,7 @@ func ExampleHostPoolsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/HostPool_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_List.json func ExampleHostPoolsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -207,7 +237,7 @@ func ExampleHostPoolsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/HostPools_RetrieveRegistrationToken_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPools_RetrieveRegistrationToken_Post.json func ExampleHostPoolsClient_RetrieveRegistrationToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go index 97834e39d1b4..2fcf0f06d711 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/MsixImage_Expand_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixImage_Expand_Post.json func ExampleMsixImagesClient_NewExpandPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go index b12036fff7f6..3c3de0a5a6ae 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go @@ -19,7 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/MsixPackage_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Get.json func ExampleMSIXPackagesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleMSIXPackagesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/MsixPackage_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Create.json func ExampleMSIXPackagesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleMSIXPackagesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/MsixPackage_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Delete.json func ExampleMSIXPackagesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +115,7 @@ func ExampleMSIXPackagesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/MsixPackage_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Update.json func ExampleMSIXPackagesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleMSIXPackagesClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/MsixPackage_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_List.json func ExampleMSIXPackagesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go index 172ed7323f98..4cb8e88c3127 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go @@ -16,8 +16,8 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/OperationDescription_List.json -func ExampleOperationsClient_List() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/OperationDescription_List.json +func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -27,11 +27,15 @@ func ExampleOperationsClient_List() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.List(ctx, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := client.NewListPager(nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - // TODO: use response item - _ = res } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go new file mode 100644 index 000000000000..2b3ee3309621 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go @@ -0,0 +1,222 @@ +//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 armdesktopvirtualization_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/desktopvirtualization/armdesktopvirtualization" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_ListByHostPool.json +func ExamplePrivateEndpointConnectionsClient_NewListByHostPoolPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByHostPoolPager("resourceGroup1", + "hostPool1", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_GetByHostPool.json +func ExamplePrivateEndpointConnectionsClient_GetByHostPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetByHostPool(ctx, + "resourceGroup1", + "hostPool1", + "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_DeleteByHostPool.json +func ExamplePrivateEndpointConnectionsClient_DeleteByHostPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.DeleteByHostPool(ctx, + "resourceGroup1", + "hostPool1", + "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_UpdateByHostPool.json +func ExamplePrivateEndpointConnectionsClient_UpdateByHostPool() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.UpdateByHostPool(ctx, + "resourceGroup1", + "hostPool1", + "hostPool1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + armdesktopvirtualization.PrivateEndpointConnection{ + Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Approved by admin@consoto.com"), + ActionsRequired: to.Ptr("None"), + Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_ListByWorkspace.json +func ExamplePrivateEndpointConnectionsClient_NewListByWorkspacePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByWorkspacePager("resourceGroup1", + "workspace1", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_GetByWorkspace.json +func ExamplePrivateEndpointConnectionsClient_GetByWorkspace() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetByWorkspace(ctx, + "resourceGroup1", + "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_DeleteByWorkspace.json +func ExamplePrivateEndpointConnectionsClient_DeleteByWorkspace() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.DeleteByWorkspace(ctx, + "resourceGroup1", + "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_UpdateByWorkspace.json +func ExamplePrivateEndpointConnectionsClient_UpdateByWorkspace() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.UpdateByWorkspace(ctx, + "resourceGroup1", + "workspace1", + "workspace1.377103f1-5179-4bdf-8556-4cdd3207cc5b", + armdesktopvirtualization.PrivateEndpointConnection{ + Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Approved by admin@consoto.com"), + ActionsRequired: to.Ptr("None"), + Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go new file mode 100644 index 000000000000..bb88b4a5f8d6 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go @@ -0,0 +1,69 @@ +//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 armdesktopvirtualization_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateLinkResources_ListByHostPool.json +func ExamplePrivateLinkResourcesClient_NewListByHostPoolPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateLinkResourcesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByHostPoolPager("resourceGroup1", + "hostPool1", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateLinkResources_ListByWorkspace.json +func ExamplePrivateLinkResourcesClient_NewListByWorkspacePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armdesktopvirtualization.NewPrivateLinkResourcesClient("daefabc0-95b4-48b3-b645-8a753a63c4fa", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByWorkspacePager("resourceGroup1", + "workspace1", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go index a75b24e6a66e..5473cbbd21b1 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go @@ -12,14 +12,12 @@ 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/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ScalingPlan_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Get.json func ExampleScalingPlansClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +39,7 @@ func ExampleScalingPlansClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ScalingPlan_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Create.json func ExampleScalingPlansClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,15 +60,15 @@ func ExampleScalingPlansClient_Create() { "tag2": to.Ptr("value2"), }, Properties: &armdesktopvirtualization.ScalingPlanProperties{ - Description: to.Ptr("des1"), + Description: to.Ptr("Description of Scaling Plan"), ExclusionTag: to.Ptr("value"), - FriendlyName: to.Ptr("friendly"), + FriendlyName: to.Ptr("Scaling Plan 1"), HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ { HostPoolArmPath: to.Ptr("/subscriptions/daefabc0-95b4-48b3-b645-8a753a63c4fa/resourceGroups/resourceGroup1/providers/Microsoft.DesktopVirtualization/hostPools/hostPool1"), ScalingPlanEnabled: to.Ptr(true), }}, - HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePersonal), + HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), Schedules: []*armdesktopvirtualization.ScalingSchedule{ { Name: to.Ptr("schedule1"), @@ -80,23 +78,35 @@ func ExampleScalingPlansClient_Create() { to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, - OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - OffPeakStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-10T20:00:00.000Z"); return t }()), - PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), - PeakStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-10T08:00:00.000Z"); return t }()), + OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), + OffPeakStartTime: &armdesktopvirtualization.Time{ + Hour: to.Ptr[int32](20), + Minute: to.Ptr[int32](0), + }, + PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), + PeakStartTime: &armdesktopvirtualization.Time{ + Hour: to.Ptr[int32](8), + Minute: to.Ptr[int32](0), + }, RampDownCapacityThresholdPct: to.Ptr[int32](50), RampDownForceLogoffUsers: to.Ptr(true), RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), RampDownMinimumHostsPct: to.Ptr[int32](20), RampDownNotificationMessage: to.Ptr("message"), - RampDownStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-10T18:00:00.000Z"); return t }()), - RampDownWaitTimeMinutes: to.Ptr[int32](30), - RampUpCapacityThresholdPct: to.Ptr[int32](80), - RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), - RampUpMinimumHostsPct: to.Ptr[int32](20), - RampUpStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-11-10T06:00:00.000Z"); return t }()), + RampDownStartTime: &armdesktopvirtualization.Time{ + Hour: to.Ptr[int32](18), + Minute: to.Ptr[int32](0), + }, + RampDownWaitTimeMinutes: to.Ptr[int32](30), + RampUpCapacityThresholdPct: to.Ptr[int32](80), + RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), + RampUpMinimumHostsPct: to.Ptr[int32](20), + RampUpStartTime: &armdesktopvirtualization.Time{ + Hour: to.Ptr[int32](6), + Minute: to.Ptr[int32](0), + }, }}, - TimeZone: to.Ptr(""), + TimeZone: to.Ptr("Central Standard Time"), }, }, nil) @@ -107,7 +117,7 @@ func ExampleScalingPlansClient_Create() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ScalingPlan_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Delete.json func ExampleScalingPlansClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -127,7 +137,7 @@ func ExampleScalingPlansClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ScalingPlan_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Update.json func ExampleScalingPlansClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -149,7 +159,7 @@ func ExampleScalingPlansClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ScalingPlan_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_ListByResourceGroup.json func ExampleScalingPlansClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +184,7 @@ func ExampleScalingPlansClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ScalingPlan_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_ListBySubscription.json func ExampleScalingPlansClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -198,7 +208,7 @@ func ExampleScalingPlansClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/ScalingPlan_ListByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_ListByHostPool.json func ExampleScalingPlansClient_NewListByHostPoolPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go index 0b7d9bbe2009..5f6847c2f502 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/SessionHost_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_Get.json func ExampleSessionHostsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleSessionHostsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/SessionHost_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_Delete.json func ExampleSessionHostsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleSessionHostsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/SessionHost_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_Update.json func ExampleSessionHostsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,12 +76,14 @@ func ExampleSessionHostsClient_Update() { "resourceGroup1", "hostPool1", "sessionHost1.microsoft.com", - &armdesktopvirtualization.SessionHostsClientUpdateOptions{SessionHost: &armdesktopvirtualization.SessionHostPatch{ - Properties: &armdesktopvirtualization.SessionHostPatchProperties{ - AllowNewSession: to.Ptr(true), - AssignedUser: to.Ptr("user1@microsoft.com"), + &armdesktopvirtualization.SessionHostsClientUpdateOptions{Force: to.Ptr(true), + SessionHost: &armdesktopvirtualization.SessionHostPatch{ + Properties: &armdesktopvirtualization.SessionHostPatchProperties{ + AllowNewSession: to.Ptr(true), + AssignedUser: to.Ptr("user1@microsoft.com"), + FriendlyName: to.Ptr("friendly"), + }, }, - }, }) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -90,7 +92,7 @@ func ExampleSessionHostsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/SessionHost_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_List.json func ExampleSessionHostsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go index 04e3cc99ba0d..f3ed4100fabd 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/StartMenuItem_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/StartMenuItem_List.json func ExampleStartMenuItemsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go index 5dbdad5e8ad1..26c753bd8f95 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/UserSession_ListByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_ListByHostPool.json func ExampleUserSessionsClient_NewListByHostPoolPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleUserSessionsClient_NewListByHostPoolPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/UserSession_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_Get.json func ExampleUserSessionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -67,7 +67,7 @@ func ExampleUserSessionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/UserSession_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_Delete.json func ExampleUserSessionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -89,7 +89,7 @@ func ExampleUserSessionsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/UserSession_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_List.json func ExampleUserSessionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleUserSessionsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/UserSession_Disconnect_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_Disconnect_Post.json func ExampleUserSessionsClient_Disconnect() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -138,7 +138,7 @@ func ExampleUserSessionsClient_Disconnect() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/UserSession_SendMessage_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_SendMessage_Post.json func ExampleUserSessionsClient_SendMessage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go index b3c0bb3d2ea4..6833b0ca0abb 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Workspace_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Get.json func ExampleWorkspacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleWorkspacesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Workspace_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Create.json func ExampleWorkspacesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +72,7 @@ func ExampleWorkspacesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Workspace_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Delete.json func ExampleWorkspacesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -92,7 +92,7 @@ func ExampleWorkspacesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Workspace_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Update.json func ExampleWorkspacesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -108,8 +108,9 @@ func ExampleWorkspacesClient_Update() { "workspace1", &armdesktopvirtualization.WorkspacesClientUpdateOptions{Workspace: &armdesktopvirtualization.WorkspacePatch{ Properties: &armdesktopvirtualization.WorkspacePatchProperties{ - Description: to.Ptr("des1"), - FriendlyName: to.Ptr("friendly"), + Description: to.Ptr("des1"), + FriendlyName: to.Ptr("friendly"), + PublicNetworkAccess: to.Ptr(armdesktopvirtualization.PublicNetworkAccessEnabled), }, Tags: map[string]*string{ "tag1": to.Ptr("value1"), @@ -124,7 +125,7 @@ func ExampleWorkspacesClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Workspace_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_ListByResourceGroup.json func ExampleWorkspacesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -149,7 +150,7 @@ func ExampleWorkspacesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/stable/2021-07-12/examples/Workspace_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_ListBySubscription.json func ExampleWorkspacesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go index 107ede7ff9c0..e5ad763dc9e0 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go @@ -56,7 +56,7 @@ func NewApplicationGroupsClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create or update an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // applicationGroup - Object containing ApplicationGroup definitions. @@ -97,7 +97,7 @@ func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, applicationGroup) @@ -114,7 +114,7 @@ func (client *ApplicationGroupsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Remove an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - ApplicationGroupsClientDeleteOptions contains the optional parameters for the ApplicationGroupsClient.Delete @@ -154,7 +154,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -162,7 +162,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, // Get - Get an application group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - ApplicationGroupsClientGetOptions contains the optional parameters for the ApplicationGroupsClient.Get method. @@ -201,7 +201,7 @@ func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -218,7 +218,7 @@ func (client *ApplicationGroupsClient) getHandleResponse(resp *http.Response) (A // NewListByResourceGroupPager - List applicationGroups. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ApplicationGroupsClientListByResourceGroupOptions contains the optional parameters for the ApplicationGroupsClient.ListByResourceGroup // method. @@ -266,7 +266,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -286,7 +286,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupHandleResponse(resp *h // NewListBySubscriptionPager - List applicationGroups in subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // options - ApplicationGroupsClientListBySubscriptionOptions contains the optional parameters for the ApplicationGroupsClient.ListBySubscription // method. func (client *ApplicationGroupsClient) NewListBySubscriptionPager(options *ApplicationGroupsClientListBySubscriptionOptions) *runtime.Pager[ApplicationGroupsClientListBySubscriptionResponse] { @@ -329,7 +329,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -349,7 +349,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionHandleResponse(resp *ht // Update - Update an applicationGroup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - ApplicationGroupsClientUpdateOptions contains the optional parameters for the ApplicationGroupsClient.Update @@ -389,7 +389,7 @@ func (client *ApplicationGroupsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ApplicationGroup != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go index 51f35fb3cbbf..8f53b2ee9d46 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go @@ -56,7 +56,7 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or update an application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // applicationName - The name of the application within the specified application group @@ -102,7 +102,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, application) @@ -119,7 +119,7 @@ func (client *ApplicationsClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // applicationName - The name of the application within the specified application group @@ -163,7 +163,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get an application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // applicationName - The name of the application within the specified application group @@ -215,7 +215,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // NewListPager - List applications. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. @@ -284,7 +284,7 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +301,7 @@ func (client *ApplicationsClient) listHandleResponse(resp *http.Response) (Appli // Update - Update an application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // applicationName - The name of the application within the specified application group @@ -345,7 +345,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Application != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go index d9d4a7aa2d5f..27b2696b8bda 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go @@ -10,7 +10,7 @@ package armdesktopvirtualization const ( moduleName = "armdesktopvirtualization" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // ApplicationGroupType - Resource Type of ApplicationGroup. @@ -64,6 +64,52 @@ func PossibleCommandLineSettingValues() []CommandLineSetting { } } +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// DayOfWeek - The day of the week (Monday-Sunday). +type DayOfWeek string + +const ( + DayOfWeekMonday DayOfWeek = "Monday" + DayOfWeekTuesday DayOfWeek = "Tuesday" + DayOfWeekWednesday DayOfWeek = "Wednesday" + DayOfWeekThursday DayOfWeek = "Thursday" + DayOfWeekFriday DayOfWeek = "Friday" + DayOfWeekSaturday DayOfWeek = "Saturday" + DayOfWeekSunday DayOfWeek = "Sunday" +) + +// PossibleDayOfWeekValues returns the possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{ + DayOfWeekMonday, + DayOfWeekTuesday, + DayOfWeekWednesday, + DayOfWeekThursday, + DayOfWeekFriday, + DayOfWeekSaturday, + DayOfWeekSunday, + } +} + // HealthCheckName - Represents the name of the health check operation performed. type HealthCheckName string @@ -179,6 +225,27 @@ func PossibleHostPoolTypeValues() []HostPoolType { } } +// HostpoolPublicNetworkAccess - Enabled allows this resource to be accessed from both public and private networks, Disabled +// allows this resource to only be accessed via private endpoints +type HostpoolPublicNetworkAccess string + +const ( + HostpoolPublicNetworkAccessDisabled HostpoolPublicNetworkAccess = "Disabled" + HostpoolPublicNetworkAccessEnabled HostpoolPublicNetworkAccess = "Enabled" + HostpoolPublicNetworkAccessEnabledForClientsOnly HostpoolPublicNetworkAccess = "EnabledForClientsOnly" + HostpoolPublicNetworkAccessEnabledForSessionHostsOnly HostpoolPublicNetworkAccess = "EnabledForSessionHostsOnly" +) + +// PossibleHostpoolPublicNetworkAccessValues returns the possible values for the HostpoolPublicNetworkAccess const type. +func PossibleHostpoolPublicNetworkAccessValues() []HostpoolPublicNetworkAccess { + return []HostpoolPublicNetworkAccess{ + HostpoolPublicNetworkAccessDisabled, + HostpoolPublicNetworkAccessEnabled, + HostpoolPublicNetworkAccessEnabledForClientsOnly, + HostpoolPublicNetworkAccessEnabledForSessionHostsOnly, + } +} + // LoadBalancerType - The type of the load balancer. type LoadBalancerType string @@ -258,6 +325,61 @@ func PossiblePreferredAppGroupTypeValues() []PreferredAppGroupType { } } +// PrivateEndpointConnectionProvisioningState - The current provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{ + PrivateEndpointConnectionProvisioningStateCreating, + PrivateEndpointConnectionProvisioningStateDeleting, + PrivateEndpointConnectionProvisioningStateFailed, + PrivateEndpointConnectionProvisioningStateSucceeded, + } +} + +// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{ + PrivateEndpointServiceConnectionStatusApproved, + PrivateEndpointServiceConnectionStatusPending, + PrivateEndpointServiceConnectionStatusRejected, + } +} + +// PublicNetworkAccess - Enabled allows this resource to be accessed from both public and private networks, Disabled allows +// this resource to only be accessed via private endpoints +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + } +} + // RegistrationTokenOperation - The type of resetting the token. type RegistrationTokenOperation string @@ -333,6 +455,21 @@ func PossibleSSOSecretTypeValues() []SSOSecretType { } } +// ScalingHostPoolType - HostPool type for desktop. +type ScalingHostPoolType string + +const ( + // ScalingHostPoolTypePooled - Users get a new (random) SessionHost every time it connects to the HostPool. + ScalingHostPoolTypePooled ScalingHostPoolType = "Pooled" +) + +// PossibleScalingHostPoolTypeValues returns the possible values for the ScalingHostPoolType const type. +func PossibleScalingHostPoolTypeValues() []ScalingHostPoolType { + return []ScalingHostPoolType{ + ScalingHostPoolTypePooled, + } +} + type ScalingScheduleDaysOfWeekItem string const ( @@ -358,6 +495,27 @@ func PossibleScalingScheduleDaysOfWeekItemValues() []ScalingScheduleDaysOfWeekIt } } +// SessionHostComponentUpdateType - The preferred mechanism for updating the agent components. This is either Scheduled or +// Default. +type SessionHostComponentUpdateType string + +const ( + // SessionHostComponentUpdateTypeDefault - The agent components are updated according to the AVD infrastructure flighting. + // For more information, see https://aka.ms/avdagent. + SessionHostComponentUpdateTypeDefault SessionHostComponentUpdateType = "Default" + // SessionHostComponentUpdateTypeScheduled - This enables the Scheduled Agent Updates feature which allows the agent components + // to get updated according to the schedule that the admin define. For more information, see https://aka.ms/avdsau. + SessionHostComponentUpdateTypeScheduled SessionHostComponentUpdateType = "Scheduled" +) + +// PossibleSessionHostComponentUpdateTypeValues returns the possible values for the SessionHostComponentUpdateType const type. +func PossibleSessionHostComponentUpdateTypeValues() []SessionHostComponentUpdateType { + return []SessionHostComponentUpdateType{ + SessionHostComponentUpdateTypeDefault, + SessionHostComponentUpdateTypeScheduled, + } +} + // SessionHostLoadBalancingAlgorithm - Load balancing algorithm for ramp up period. type SessionHostLoadBalancingAlgorithm string diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go index 725e22fe5c03..10db4b463ee3 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go @@ -56,7 +56,7 @@ func NewDesktopsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Get a desktop. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // desktopName - The name of the desktop within the specified desktop group @@ -100,7 +100,7 @@ func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,25 +115,38 @@ func (client *DesktopsClient) getHandleResponse(resp *http.Response) (DesktopsCl return result, nil } -// List - List desktops. +// NewListPager - List desktops. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - DesktopsClientListOptions contains the optional parameters for the DesktopsClient.List method. -func (client *DesktopsClient) List(ctx context.Context, resourceGroupName string, applicationGroupName string, options *DesktopsClientListOptions) (DesktopsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) - if err != nil { - return DesktopsClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DesktopsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DesktopsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) +func (client *DesktopsClient) NewListPager(resourceGroupName string, applicationGroupName string, options *DesktopsClientListOptions) *runtime.Pager[DesktopsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DesktopsClientListResponse]{ + More: func(page DesktopsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DesktopsClientListResponse) (DesktopsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DesktopsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DesktopsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DesktopsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } // listCreateRequest creates the List request. @@ -156,7 +169,7 @@ func (client *DesktopsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +186,7 @@ func (client *DesktopsClient) listHandleResponse(resp *http.Response) (DesktopsC // Update - Update a desktop. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // desktopName - The name of the desktop within the specified desktop group @@ -217,7 +230,7 @@ func (client *DesktopsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Desktop != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go index f224e7f7f933..10bd019fcfd2 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go @@ -57,7 +57,7 @@ func NewHostPoolsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Create or update a host pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // hostPool - Object containing HostPool definitions. @@ -98,7 +98,7 @@ func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, hostPool) @@ -115,7 +115,7 @@ func (client *HostPoolsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Remove a host pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - HostPoolsClientDeleteOptions contains the optional parameters for the HostPoolsClient.Delete method. @@ -154,7 +154,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -165,7 +165,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource // Get - Get a host pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - HostPoolsClientGetOptions contains the optional parameters for the HostPoolsClient.Get method. @@ -204,7 +204,7 @@ func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -221,7 +221,7 @@ func (client *HostPoolsClient) getHandleResponse(resp *http.Response) (HostPools // NewListPager - List hostPools in subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // options - HostPoolsClientListOptions contains the optional parameters for the HostPoolsClient.List method. func (client *HostPoolsClient) NewListPager(options *HostPoolsClientListOptions) *runtime.Pager[HostPoolsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[HostPoolsClientListResponse]{ @@ -263,7 +263,7 @@ func (client *HostPoolsClient) listCreateRequest(ctx context.Context, options *H return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *HostPoolsClient) listHandleResponse(resp *http.Response) (HostPool // NewListByResourceGroupPager - List hostPools. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - HostPoolsClientListByResourceGroupOptions contains the optional parameters for the HostPoolsClient.ListByResourceGroup // method. @@ -328,7 +328,7 @@ func (client *HostPoolsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -345,7 +345,7 @@ func (client *HostPoolsClient) listByResourceGroupHandleResponse(resp *http.Resp // RetrieveRegistrationToken - Registration token of the host pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - HostPoolsClientRetrieveRegistrationTokenOptions contains the optional parameters for the HostPoolsClient.RetrieveRegistrationToken @@ -385,7 +385,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +402,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenHandleResponse(resp *htt // Update - Update a host pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - HostPoolsClientUpdateOptions contains the optional parameters for the HostPoolsClient.Update method. @@ -441,7 +441,7 @@ func (client *HostPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.HostPool != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go index 02749332aaf8..200598b0965e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go @@ -10,6 +10,46 @@ package armdesktopvirtualization import "time" +// AgentUpdatePatchProperties - The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, +// and side-by-side stack) on session hosts. +type AgentUpdatePatchProperties struct { + // The time zone for updating the agent components. Valid time zones can be found here: https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. + // A time zone + // must be specified if useSessionHostLocalTime is false. + MaintenanceWindowTimeZone *string `json:"maintenanceWindowTimeZone,omitempty"` + + // The maintenance windows (day and time) for updating the agent components. At least 1 window must be specified. Optionally, + // a 2nd window can be specified. + MaintenanceWindows []*MaintenanceWindowPatchProperties `json:"maintenanceWindows,omitempty"` + + // The preferred mechanism for updating the agent components. This is either Scheduled or Default. + Type *SessionHostComponentUpdateType `json:"type,omitempty"` + + // Boolean indicating whether to update the agent components in the local time zone of each session host in the host pool. + // By default, this is false. + UseSessionHostLocalTime *bool `json:"useSessionHostLocalTime,omitempty"` +} + +// AgentUpdateProperties - The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, and +// side-by-side stack) on session hosts. +type AgentUpdateProperties struct { + // The time zone for updating the agent components. Valid time zones can be found here: https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. + // A time zone + // must be specified if useSessionHostLocalTime is false. + MaintenanceWindowTimeZone *string `json:"maintenanceWindowTimeZone,omitempty"` + + // The maintenance windows (day and time) for updating the agent components. At least 1 window must be specified. Optionally, + // a 2nd window can be specified. + MaintenanceWindows []*MaintenanceWindowProperties `json:"maintenanceWindows,omitempty"` + + // The preferred mechanism for updating the agent components. This is either Scheduled or Default. + Type *SessionHostComponentUpdateType `json:"type,omitempty"` + + // Boolean indicating whether to update the agent components in the local time zone of each session host in the host pool. + // By default, this is false. + UseSessionHostLocalTime *bool `json:"useSessionHostLocalTime,omitempty"` +} + // Application - Schema for Application properties. type Application struct { // REQUIRED; Detailed properties for Application @@ -21,6 +61,9 @@ type Application struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -61,6 +104,9 @@ type ApplicationGroup struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -291,10 +337,13 @@ type ApplicationsClientUpdateOptions struct { Application *ApplicationPatch } +// CloudError - Cloud error object. type CloudError struct { + // Cloud error object properties. Error *CloudErrorProperties `json:"error,omitempty"` } +// CloudErrorProperties - Cloud error object properties. type CloudErrorProperties struct { // Error code Code *string `json:"code,omitempty"` @@ -314,6 +363,9 @@ type Desktop struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -481,6 +533,9 @@ type HostPool struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -514,6 +569,10 @@ type HostPoolPatch struct { // HostPoolPatchProperties - Properties of HostPool. type HostPoolPatchProperties struct { + // The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, and side-by-side stack) on + // session hosts. + AgentUpdate *AgentUpdatePatchProperties `json:"agentUpdate,omitempty"` + // Custom rdp property of HostPool. CustomRdpProperty *string `json:"customRdpProperty,omitempty"` @@ -535,6 +594,9 @@ type HostPoolPatchProperties struct { // The type of preferred application group type, default to Desktop Application Group PreferredAppGroupType *PreferredAppGroupType `json:"preferredAppGroupType,omitempty"` + // Enabled to allow this resource to be access from the public network + PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // The registration info of HostPool. RegistrationInfo *RegistrationInfoPatch `json:"registrationInfo,omitempty"` @@ -574,6 +636,10 @@ type HostPoolProperties struct { // REQUIRED; The type of preferred application group type, default to Desktop Application Group PreferredAppGroupType *PreferredAppGroupType `json:"preferredAppGroupType,omitempty"` + // The preferred settings for updating the agent components (RDAgent, Geneva Monitoring agent, and side-by-side stack) on + // session hosts. + AgentUpdate *AgentUpdateProperties `json:"agentUpdate,omitempty"` + // Custom rdp property of HostPool. CustomRdpProperty *string `json:"customRdpProperty,omitempty"` @@ -592,6 +658,10 @@ type HostPoolProperties struct { // PersonalDesktopAssignment type for HostPool. PersonalDesktopAssignmentType *PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` + // Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only + // be accessed via private endpoints + PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // The registration info of HostPool. RegistrationInfo *RegistrationInfo `json:"registrationInfo,omitempty"` @@ -627,6 +697,9 @@ type HostPoolProperties struct { // READ-ONLY; ObjectId of HostPool. (internal use) ObjectID *string `json:"objectId,omitempty" azure:"ro"` + + // READ-ONLY; List of private endpoint connection associated with the specified resource + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` } // HostPoolsClientCreateOrUpdateOptions contains the optional parameters for the HostPoolsClient.CreateOrUpdate method. @@ -709,6 +782,9 @@ type MSIXPackage struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -811,6 +887,26 @@ type MSIXPackagesClientUpdateOptions struct { MsixPackage *MSIXPackagePatch } +// MaintenanceWindowPatchProperties - Maintenance window starting hour and day of week. +type MaintenanceWindowPatchProperties struct { + // The day of the week (Monday-Sunday). + DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"` + + // The starting hour of the maintenance window (0-23). Note that maintenance windows are 2 hours long. This means that updates + // can be applied anytime from the specified start hour to 2 hours after. + Hour *int32 `json:"hour,omitempty"` +} + +// MaintenanceWindowProperties - Maintenance window starting hour and day of week. +type MaintenanceWindowProperties struct { + // The day of the week (Monday-Sunday). + DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"` + + // The starting hour of the maintenance window (0-23). Note that maintenance windows are 2 hours long. This means that updates + // can be applied anytime from the specified start hour to 2 hours after. + Hour *int32 `json:"hour,omitempty"` +} + // MigrationRequestProperties - Properties for arm migration. type MigrationRequestProperties struct { // The path to the legacy object to migrate. @@ -891,6 +987,176 @@ type Plan struct { Version *string `json:"version,omitempty"` } +// PrivateEndpoint - The Private Endpoint resource. +type PrivateEndpoint struct { + // READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty" azure:"ro"` +} + +// PrivateEndpointConnection - The Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + // Resource properties. + Properties *PrivateEndpointConnectionProperties `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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionListResultWithSystemData - List of private endpoint connection associated with the specified storage +// account +type PrivateEndpointConnectionListResultWithSystemData struct { + // Array of private endpoint connections + Value []*PrivateEndpointConnectionWithSystemData `json:"value,omitempty"` + + // READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // REQUIRED; A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + + // The resource of private end point. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + + // The provisioning state of the private endpoint connection resource. + ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} + +// PrivateEndpointConnectionWithSystemData - The Private Endpoint Connection resource. +type PrivateEndpointConnectionWithSystemData struct { + // Resource properties. + Properties *PrivateEndpointConnectionProperties `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; Metadata pertaining to creation and last modification of the resource. + 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"` +} + +// PrivateEndpointConnectionsClientDeleteByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByHostPool +// method. +type PrivateEndpointConnectionsClientDeleteByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientDeleteByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByWorkspace +// method. +type PrivateEndpointConnectionsClientDeleteByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientGetByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByHostPool +// method. +type PrivateEndpointConnectionsClientGetByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientGetByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByWorkspace +// method. +type PrivateEndpointConnectionsClientGetByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByHostPool +// method. +type PrivateEndpointConnectionsClientListByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByWorkspace +// method. +type PrivateEndpointConnectionsClientListByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientUpdateByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByHostPool +// method. +type PrivateEndpointConnectionsClientUpdateByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientUpdateByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByWorkspace +// method. +type PrivateEndpointConnectionsClientUpdateByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResource - A private link resource +type PrivateLinkResource struct { + // Resource properties. + Properties *PrivateLinkResourceProperties `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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PrivateLinkResourceListResult - A list of private link resources +type PrivateLinkResourceListResult struct { + // Array of private link resources + Value []*PrivateLinkResource `json:"value,omitempty"` + + // READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// PrivateLinkResourceProperties - Properties of a private link resource. +type PrivateLinkResourceProperties struct { + // The private link resource Private link DNS zone name. + RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` + + // READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty" azure:"ro"` + + // READ-ONLY; The private link resource required member names. + RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` +} + +// PrivateLinkResourcesClientListByHostPoolOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByHostPool +// method. +type PrivateLinkResourcesClientListByHostPoolOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByWorkspace +// method. +type PrivateLinkResourcesClientListByWorkspaceOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer +// and provider. +type PrivateLinkServiceConnectionState struct { + // A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` + + // The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + + // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} + // RegistrationInfo - Represents a RegistrationInfo definition. type RegistrationInfo struct { // Expiration time of registration token. @@ -1045,6 +1311,9 @@ type ResourceProviderOperationDisplay struct { type ResourceProviderOperationList struct { // List of operations supported by this resource provider. Value []*ResourceProviderOperation `json:"value,omitempty"` + + // READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` } // SKU - The resource model definition representing SKU @@ -1113,6 +1382,9 @@ type ScalingPlan struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -1149,9 +1421,6 @@ type ScalingPlanPatchProperties struct { // List of ScalingHostPoolReference definitions. HostPoolReferences []*ScalingHostPoolReference `json:"hostPoolReferences,omitempty"` - // HostPool type for desktop. - HostPoolType *HostPoolType `json:"hostPoolType,omitempty"` - // List of ScalingSchedule definitions. Schedules []*ScalingSchedule `json:"schedules,omitempty"` @@ -1174,7 +1443,7 @@ type ScalingPlanProperties struct { HostPoolReferences []*ScalingHostPoolReference `json:"hostPoolReferences,omitempty"` // HostPool type for desktop. - HostPoolType *HostPoolType `json:"hostPoolType,omitempty"` + HostPoolType *ScalingHostPoolType `json:"hostPoolType,omitempty"` // List of ScalingSchedule definitions. Schedules []*ScalingSchedule `json:"schedules,omitempty"` @@ -1236,13 +1505,13 @@ type ScalingSchedule struct { OffPeakLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm `json:"offPeakLoadBalancingAlgorithm,omitempty"` // Starting time for off-peak period. - OffPeakStartTime *time.Time `json:"offPeakStartTime,omitempty"` + OffPeakStartTime *Time `json:"offPeakStartTime,omitempty"` // Load balancing algorithm for peak period. PeakLoadBalancingAlgorithm *SessionHostLoadBalancingAlgorithm `json:"peakLoadBalancingAlgorithm,omitempty"` // Starting time for peak period. - PeakStartTime *time.Time `json:"peakStartTime,omitempty"` + PeakStartTime *Time `json:"peakStartTime,omitempty"` // Capacity threshold for ramp down period. RampDownCapacityThresholdPct *int32 `json:"rampDownCapacityThresholdPct,omitempty"` @@ -1260,7 +1529,7 @@ type ScalingSchedule struct { RampDownNotificationMessage *string `json:"rampDownNotificationMessage,omitempty"` // Starting time for ramp down period. - RampDownStartTime *time.Time `json:"rampDownStartTime,omitempty"` + RampDownStartTime *Time `json:"rampDownStartTime,omitempty"` // Specifies when to stop hosts during ramp down period. RampDownStopHostsWhen *StopHostsWhen `json:"rampDownStopHostsWhen,omitempty"` @@ -1278,7 +1547,7 @@ type ScalingSchedule struct { RampUpMinimumHostsPct *int32 `json:"rampUpMinimumHostsPct,omitempty"` // Starting time for ramp up period. - RampUpStartTime *time.Time `json:"rampUpStartTime,omitempty"` + RampUpStartTime *Time `json:"rampUpStartTime,omitempty"` } // SendMessage - Represents message sent to a UserSession. @@ -1307,6 +1576,9 @@ type SessionHost struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -1366,6 +1638,9 @@ type SessionHostPatchProperties struct { // User assigned to SessionHost. AssignedUser *string `json:"assignedUser,omitempty"` + + // Friendly name of SessionHost + FriendlyName *string `json:"friendlyName,omitempty"` } // SessionHostProperties - Schema for SessionHost properties. @@ -1379,6 +1654,9 @@ type SessionHostProperties struct { // User assigned to SessionHost. AssignedUser *string `json:"assignedUser,omitempty"` + // Friendly name of SessionHost + FriendlyName *string `json:"friendlyName,omitempty"` + // Last heart beat from SessionHost. LastHeartBeat *time.Time `json:"lastHeartBeat,omitempty"` @@ -1437,6 +1715,8 @@ type SessionHostsClientListOptions struct { // SessionHostsClientUpdateOptions contains the optional parameters for the SessionHostsClient.Update method. type SessionHostsClientUpdateOptions struct { + // Force flag to update assign, unassign or reassign personal desktop. + Force *bool // Object containing SessionHost definitions. SessionHost *SessionHostPatch } @@ -1488,6 +1768,36 @@ type StartMenuItemsClientListOptions struct { // placeholder for future optional parameters } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + +// Time - The time for a scaling action to occur. +type Time struct { + // REQUIRED; The hour. + Hour *int32 `json:"hour,omitempty"` + + // REQUIRED; The minute. + Minute *int32 `json:"minute,omitempty"` +} + // UserSession - Represents a UserSession definition. type UserSession struct { // Detailed properties for UserSession @@ -1499,6 +1809,9 @@ type UserSession struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -1603,6 +1916,9 @@ type Workspace struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + 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"` } @@ -1635,6 +1951,9 @@ type WorkspacePatchProperties struct { // Friendly name of Workspace. FriendlyName *string `json:"friendlyName,omitempty"` + + // Enabled to allow this resource to be access from the public network + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` } // WorkspaceProperties - Schema for Workspace properties. @@ -1648,11 +1967,18 @@ type WorkspaceProperties struct { // Friendly name of Workspace. FriendlyName *string `json:"friendlyName,omitempty"` + // Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only + // be accessed via private endpoints + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // READ-ONLY; Is cloud pc resource. CloudPcResource *bool `json:"cloudPcResource,omitempty" azure:"ro"` // READ-ONLY; ObjectId of Workspace. (internal use) ObjectID *string `json:"objectId,omitempty" azure:"ro"` + + // READ-ONLY; List of private endpoint connection associated with the specified resource + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` } // WorkspacesClientCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.CreateOrUpdate method. diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go index 80ede902a462..05fd0b990818 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go @@ -16,6 +16,26 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type AgentUpdatePatchProperties. +func (a AgentUpdatePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) + populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) + populate(objectMap, "type", a.Type) + populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AgentUpdateProperties. +func (a AgentUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) + populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) + populate(objectMap, "type", a.Type) + populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type ApplicationGroup. func (a ApplicationGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -29,6 +49,7 @@ func (a ApplicationGroup) MarshalJSON() ([]byte, error) { populate(objectMap, "plan", a.Plan) populate(objectMap, "properties", a.Properties) populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) populate(objectMap, "tags", a.Tags) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) @@ -271,6 +292,7 @@ func (h HostPool) MarshalJSON() ([]byte, error) { populate(objectMap, "plan", h.Plan) populate(objectMap, "properties", h.Properties) populate(objectMap, "sku", h.SKU) + populate(objectMap, "systemData", h.SystemData) populate(objectMap, "tags", h.Tags) populate(objectMap, "type", h.Type) return json.Marshal(objectMap) @@ -290,6 +312,7 @@ func (h HostPoolPatch) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type HostPoolProperties. func (h HostPoolProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "agentUpdate", h.AgentUpdate) populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) populate(objectMap, "cloudPcResource", h.CloudPcResource) populate(objectMap, "customRdpProperty", h.CustomRdpProperty) @@ -302,6 +325,8 @@ func (h HostPoolProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "objectId", h.ObjectID) populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) + populate(objectMap, "privateEndpointConnections", h.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", h.PublicNetworkAccess) populate(objectMap, "registrationInfo", h.RegistrationInfo) populate(objectMap, "ring", h.Ring) populate(objectMap, "ssoClientId", h.SsoClientID) @@ -442,6 +467,15 @@ func (m *MsixPackageApplications) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type RegistrationInfo. func (r RegistrationInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -538,6 +572,7 @@ func (s ScalingPlan) MarshalJSON() ([]byte, error) { populate(objectMap, "plan", s.Plan) populate(objectMap, "properties", s.Properties) populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) @@ -558,7 +593,6 @@ func (s ScalingPlanPatchProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "exclusionTag", s.ExclusionTag) populate(objectMap, "friendlyName", s.FriendlyName) populate(objectMap, "hostPoolReferences", s.HostPoolReferences) - populate(objectMap, "hostPoolType", s.HostPoolType) populate(objectMap, "schedules", s.Schedules) populate(objectMap, "timeZone", s.TimeZone) return json.Marshal(objectMap) @@ -584,95 +618,24 @@ func (s ScalingSchedule) MarshalJSON() ([]byte, error) { populate(objectMap, "daysOfWeek", s.DaysOfWeek) populate(objectMap, "name", s.Name) populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) - populateTimeRFC3339(objectMap, "offPeakStartTime", s.OffPeakStartTime) + populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) - populateTimeRFC3339(objectMap, "peakStartTime", s.PeakStartTime) + populate(objectMap, "peakStartTime", s.PeakStartTime) populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) - populateTimeRFC3339(objectMap, "rampDownStartTime", s.RampDownStartTime) + populate(objectMap, "rampDownStartTime", s.RampDownStartTime) populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) - populateTimeRFC3339(objectMap, "rampUpStartTime", s.RampUpStartTime) + populate(objectMap, "rampUpStartTime", s.RampUpStartTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ScalingSchedule. -func (s *ScalingSchedule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "daysOfWeek": - err = unpopulate(val, "DaysOfWeek", &s.DaysOfWeek) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "offPeakLoadBalancingAlgorithm": - err = unpopulate(val, "OffPeakLoadBalancingAlgorithm", &s.OffPeakLoadBalancingAlgorithm) - delete(rawMsg, key) - case "offPeakStartTime": - err = unpopulateTimeRFC3339(val, "OffPeakStartTime", &s.OffPeakStartTime) - delete(rawMsg, key) - case "peakLoadBalancingAlgorithm": - err = unpopulate(val, "PeakLoadBalancingAlgorithm", &s.PeakLoadBalancingAlgorithm) - delete(rawMsg, key) - case "peakStartTime": - err = unpopulateTimeRFC3339(val, "PeakStartTime", &s.PeakStartTime) - delete(rawMsg, key) - case "rampDownCapacityThresholdPct": - err = unpopulate(val, "RampDownCapacityThresholdPct", &s.RampDownCapacityThresholdPct) - delete(rawMsg, key) - case "rampDownForceLogoffUsers": - err = unpopulate(val, "RampDownForceLogoffUsers", &s.RampDownForceLogoffUsers) - delete(rawMsg, key) - case "rampDownLoadBalancingAlgorithm": - err = unpopulate(val, "RampDownLoadBalancingAlgorithm", &s.RampDownLoadBalancingAlgorithm) - delete(rawMsg, key) - case "rampDownMinimumHostsPct": - err = unpopulate(val, "RampDownMinimumHostsPct", &s.RampDownMinimumHostsPct) - delete(rawMsg, key) - case "rampDownNotificationMessage": - err = unpopulate(val, "RampDownNotificationMessage", &s.RampDownNotificationMessage) - delete(rawMsg, key) - case "rampDownStartTime": - err = unpopulateTimeRFC3339(val, "RampDownStartTime", &s.RampDownStartTime) - delete(rawMsg, key) - case "rampDownStopHostsWhen": - err = unpopulate(val, "RampDownStopHostsWhen", &s.RampDownStopHostsWhen) - delete(rawMsg, key) - case "rampDownWaitTimeMinutes": - err = unpopulate(val, "RampDownWaitTimeMinutes", &s.RampDownWaitTimeMinutes) - delete(rawMsg, key) - case "rampUpCapacityThresholdPct": - err = unpopulate(val, "RampUpCapacityThresholdPct", &s.RampUpCapacityThresholdPct) - delete(rawMsg, key) - case "rampUpLoadBalancingAlgorithm": - err = unpopulate(val, "RampUpLoadBalancingAlgorithm", &s.RampUpLoadBalancingAlgorithm) - delete(rawMsg, key) - case "rampUpMinimumHostsPct": - err = unpopulate(val, "RampUpMinimumHostsPct", &s.RampUpMinimumHostsPct) - delete(rawMsg, key) - case "rampUpStartTime": - err = unpopulateTimeRFC3339(val, "RampUpStartTime", &s.RampUpStartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckFailureDetails. func (s SessionHostHealthCheckFailureDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -724,6 +687,7 @@ func (s SessionHostProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "agentVersion", s.AgentVersion) populate(objectMap, "allowNewSession", s.AllowNewSession) populate(objectMap, "assignedUser", s.AssignedUser) + populate(objectMap, "friendlyName", s.FriendlyName) populateTimeRFC3339(objectMap, "lastHeartBeat", s.LastHeartBeat) populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) populate(objectMap, "osVersion", s.OSVersion) @@ -758,6 +722,9 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { case "assignedUser": err = unpopulate(val, "AssignedUser", &s.AssignedUser) delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &s.FriendlyName) + delete(rawMsg, key) case "lastHeartBeat": err = unpopulateTimeRFC3339(val, "LastHeartBeat", &s.LastHeartBeat) delete(rawMsg, key) @@ -805,6 +772,53 @@ func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { 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 fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserSessionProperties. func (u UserSessionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -865,6 +879,7 @@ func (w Workspace) MarshalJSON() ([]byte, error) { populate(objectMap, "plan", w.Plan) populate(objectMap, "properties", w.Properties) populate(objectMap, "sku", w.SKU) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "tags", w.Tags) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) @@ -884,6 +899,7 @@ func (w WorkspacePatchProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) populate(objectMap, "description", w.Description) populate(objectMap, "friendlyName", w.FriendlyName) + populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) return json.Marshal(objectMap) } @@ -895,6 +911,8 @@ func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "description", w.Description) populate(objectMap, "friendlyName", w.FriendlyName) populate(objectMap, "objectId", w.ObjectID) + populate(objectMap, "privateEndpointConnections", w.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) return json.Marshal(objectMap) } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go index fa5c9f0d28e5..ac5e9c620d77 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go @@ -56,7 +56,7 @@ func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredentia // NewExpandPager - Expands and Lists MSIX packages in an Image, given the Image Path. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // msixImageURI - Object containing URI to MSIX Image @@ -109,7 +109,7 @@ func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, msixImageURI) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go index 877a5696b6bc..4ee85546daca 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go @@ -56,7 +56,7 @@ func NewMSIXPackagesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or update a MSIX package. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -102,7 +102,7 @@ func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, msixPackage) @@ -119,7 +119,7 @@ func (client *MSIXPackagesClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Remove an MSIX Package. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -163,7 +163,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a msixpackage. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -215,7 +215,7 @@ func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *MSIXPackagesClient) getHandleResponse(resp *http.Response) (MSIXPa // NewListPager - List MSIX packages in hostpool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - MSIXPackagesClientListOptions contains the optional parameters for the MSIXPackagesClient.List method. @@ -284,7 +284,7 @@ func (client *MSIXPackagesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -301,7 +301,7 @@ func (client *MSIXPackagesClient) listHandleResponse(resp *http.Response) (MSIXP // Update - Update an MSIX Package. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // msixPackageFullName - The version specific package full name of the MSIX package within specified hostpool @@ -345,7 +345,7 @@ func (client *MSIXPackagesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.MsixPackage != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go index dd0f3bbb4328..08fa3bddf0de 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go @@ -48,23 +48,36 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO return client, nil } -// List - List all of the available operations the Desktop Virtualization resource provider supports. +// NewListPager - List all of the available operations the Desktop Virtualization resource provider supports. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(ctx context.Context, options *OperationsClientListOptions) (OperationsClientListResponse, error) { - req, err := client.listCreateRequest(ctx, options) - 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) +func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. @@ -75,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go new file mode 100644 index 000000000000..7dca43baf40c --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go @@ -0,0 +1,551 @@ +//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 armdesktopvirtualization + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. +// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. +type PrivateEndpointConnectionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. +// 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 NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// DeleteByHostPool - Remove a connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// hostPoolName - The name of the host pool within the specified resource group +// privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// options - PrivateEndpointConnectionsClientDeleteByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByHostPool +// method. +func (client *PrivateEndpointConnectionsClient) DeleteByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByHostPoolOptions) (PrivateEndpointConnectionsClientDeleteByHostPoolResponse, error) { + req, err := client.deleteByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, nil +} + +// deleteByHostPoolCreateRequest creates the DeleteByHostPool request. +func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// DeleteByWorkspace - Remove a connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace +// privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// options - PrivateEndpointConnectionsClientDeleteByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.DeleteByWorkspace +// method. +func (client *PrivateEndpointConnectionsClient) DeleteByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByWorkspaceOptions) (PrivateEndpointConnectionsClientDeleteByWorkspaceResponse, error) { + req, err := client.deleteByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, runtime.NewResponseError(resp) + } + return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, nil +} + +// deleteByWorkspaceCreateRequest creates the DeleteByWorkspace request. +func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientDeleteByWorkspaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// GetByHostPool - Get a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// hostPoolName - The name of the host pool within the specified resource group +// privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// options - PrivateEndpointConnectionsClientGetByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByHostPool +// method. +func (client *PrivateEndpointConnectionsClient) GetByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByHostPoolOptions) (PrivateEndpointConnectionsClientGetByHostPoolResponse, error) { + req, err := client.getByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.getByHostPoolHandleResponse(resp) +} + +// getByHostPoolCreateRequest creates the GetByHostPool request. +func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getByHostPoolHandleResponse handles the GetByHostPool response. +func (client *PrivateEndpointConnectionsClient) getByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetByHostPoolResponse, error) { + result := PrivateEndpointConnectionsClientGetByHostPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { + return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, err + } + return result, nil +} + +// GetByWorkspace - Get a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace +// privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// options - PrivateEndpointConnectionsClientGetByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.GetByWorkspace +// method. +func (client *PrivateEndpointConnectionsClient) GetByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByWorkspaceOptions) (PrivateEndpointConnectionsClientGetByWorkspaceResponse, error) { + req, err := client.getByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, runtime.NewResponseError(resp) + } + return client.getByWorkspaceHandleResponse(resp) +} + +// getByWorkspaceCreateRequest creates the GetByWorkspace request. +func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetByWorkspaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getByWorkspaceHandleResponse handles the GetByWorkspace response. +func (client *PrivateEndpointConnectionsClient) getByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetByWorkspaceResponse, error) { + result := PrivateEndpointConnectionsClientGetByWorkspaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { + return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, err + } + return result, nil +} + +// NewListByHostPoolPager - List private endpoint connections associated with hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// hostPoolName - The name of the host pool within the specified resource group +// options - PrivateEndpointConnectionsClientListByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByHostPool +// method. +func (client *PrivateEndpointConnectionsClient) NewListByHostPoolPager(resourceGroupName string, hostPoolName string, options *PrivateEndpointConnectionsClientListByHostPoolOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByHostPoolResponse]{ + More: func(page PrivateEndpointConnectionsClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByHostPoolResponse) (PrivateEndpointConnectionsClientListByHostPoolResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.listByHostPoolHandleResponse(resp) + }, + }) +} + +// listByHostPoolCreateRequest creates the ListByHostPool request. +func (client *PrivateEndpointConnectionsClient) listByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *PrivateEndpointConnectionsClientListByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByHostPoolHandleResponse handles the ListByHostPool response. +func (client *PrivateEndpointConnectionsClient) listByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByHostPoolResponse, error) { + result := PrivateEndpointConnectionsClientListByHostPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResultWithSystemData); err != nil { + return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err + } + return result, nil +} + +// NewListByWorkspacePager - List private endpoint connections. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace +// options - PrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByWorkspace +// method. +func (client *PrivateEndpointConnectionsClient) NewListByWorkspacePager(resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListByWorkspaceOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByWorkspaceResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByWorkspaceResponse]{ + More: func(page PrivateEndpointConnectionsClientListByWorkspaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByWorkspaceResponse) (PrivateEndpointConnectionsClientListByWorkspaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByWorkspaceHandleResponse(resp) + }, + }) +} + +// listByWorkspaceCreateRequest creates the ListByWorkspace request. +func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListByWorkspaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByWorkspaceHandleResponse handles the ListByWorkspace response. +func (client *PrivateEndpointConnectionsClient) listByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByWorkspaceResponse, error) { + result := PrivateEndpointConnectionsClientListByWorkspaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResultWithSystemData); err != nil { + return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err + } + return result, nil +} + +// UpdateByHostPool - Approve or reject a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// hostPoolName - The name of the host pool within the specified resource group +// privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// connection - Object containing the updated connection. +// options - PrivateEndpointConnectionsClientUpdateByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByHostPool +// method. +func (client *PrivateEndpointConnectionsClient) UpdateByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByHostPoolOptions) (PrivateEndpointConnectionsClientUpdateByHostPoolResponse, error) { + req, err := client.updateByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, options) + if err != nil { + return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.updateByHostPoolHandleResponse(resp) +} + +// updateByHostPoolCreateRequest creates the UpdateByHostPool request. +func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, connection) +} + +// updateByHostPoolHandleResponse handles the UpdateByHostPool response. +func (client *PrivateEndpointConnectionsClient) updateByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateByHostPoolResponse, error) { + result := PrivateEndpointConnectionsClientUpdateByHostPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { + return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, err + } + return result, nil +} + +// UpdateByWorkspace - Approve or reject a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace +// privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// connection - Object containing the updated connection. +// options - PrivateEndpointConnectionsClientUpdateByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.UpdateByWorkspace +// method. +func (client *PrivateEndpointConnectionsClient) UpdateByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByWorkspaceOptions) (PrivateEndpointConnectionsClientUpdateByWorkspaceResponse, error) { + req, err := client.updateByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, connection, options) + if err != nil { + return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, runtime.NewResponseError(resp) + } + return client.updateByWorkspaceHandleResponse(resp) +} + +// updateByWorkspaceCreateRequest creates the UpdateByWorkspace request. +func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, connection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientUpdateByWorkspaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, connection) +} + +// updateByWorkspaceHandleResponse handles the UpdateByWorkspace response. +func (client *PrivateEndpointConnectionsClient) updateByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateByWorkspaceResponse, error) { + result := PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { + return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go new file mode 100644 index 000000000000..f86c0fac2333 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go @@ -0,0 +1,195 @@ +//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 armdesktopvirtualization + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. +// Don't use this type directly, use NewPrivateLinkResourcesClient() instead. +type PrivateLinkResourcesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. +// 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 NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PrivateLinkResourcesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListByHostPoolPager - List the private link resources available for this hostpool. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// hostPoolName - The name of the host pool within the specified resource group +// options - PrivateLinkResourcesClientListByHostPoolOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByHostPool +// method. +func (client *PrivateLinkResourcesClient) NewListByHostPoolPager(resourceGroupName string, hostPoolName string, options *PrivateLinkResourcesClientListByHostPoolOptions) *runtime.Pager[PrivateLinkResourcesClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByHostPoolResponse]{ + More: func(page PrivateLinkResourcesClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByHostPoolResponse) (PrivateLinkResourcesClientListByHostPoolResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkResourcesClientListByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinkResourcesClientListByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.listByHostPoolHandleResponse(resp) + }, + }) +} + +// listByHostPoolCreateRequest creates the ListByHostPool request. +func (client *PrivateLinkResourcesClient) listByHostPoolCreateRequest(ctx context.Context, resourceGroupName string, hostPoolName string, options *PrivateLinkResourcesClientListByHostPoolOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources" + 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 hostPoolName == "" { + return nil, errors.New("parameter hostPoolName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{hostPoolName}", url.PathEscape(hostPoolName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByHostPoolHandleResponse handles the ListByHostPool response. +func (client *PrivateLinkResourcesClient) listByHostPoolHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByHostPoolResponse, error) { + result := PrivateLinkResourcesClientListByHostPoolResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { + return PrivateLinkResourcesClientListByHostPoolResponse{}, err + } + return result, nil +} + +// NewListByWorkspacePager - List the private link resources available for this workspace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-02-10-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace +// options - PrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByWorkspace +// method. +func (client *PrivateLinkResourcesClient) NewListByWorkspacePager(resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListByWorkspaceOptions) *runtime.Pager[PrivateLinkResourcesClientListByWorkspaceResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByWorkspaceResponse]{ + More: func(page PrivateLinkResourcesClientListByWorkspaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByWorkspaceResponse) (PrivateLinkResourcesClientListByWorkspaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkResourcesClientListByWorkspaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinkResourcesClientListByWorkspaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListByWorkspaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByWorkspaceHandleResponse(resp) + }, + }) +} + +// listByWorkspaceCreateRequest creates the ListByWorkspace request. +func (client *PrivateLinkResourcesClient) listByWorkspaceCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListByWorkspaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-02-10-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByWorkspaceHandleResponse handles the ListByWorkspace response. +func (client *PrivateLinkResourcesClient) listByWorkspaceHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByWorkspaceResponse, error) { + result := PrivateLinkResourcesClientListByWorkspaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { + return PrivateLinkResourcesClientListByWorkspaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go index cb59d0409978..c24e32c275bf 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go @@ -148,6 +148,56 @@ type OperationsClientListResponse struct { ResourceProviderOperationList } +// PrivateEndpointConnectionsClientDeleteByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.DeleteByHostPool. +type PrivateEndpointConnectionsClientDeleteByHostPoolResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientDeleteByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.DeleteByWorkspace. +type PrivateEndpointConnectionsClientDeleteByWorkspaceResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientGetByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.GetByHostPool. +type PrivateEndpointConnectionsClientGetByHostPoolResponse struct { + PrivateEndpointConnectionWithSystemData +} + +// PrivateEndpointConnectionsClientGetByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.GetByWorkspace. +type PrivateEndpointConnectionsClientGetByWorkspaceResponse struct { + PrivateEndpointConnectionWithSystemData +} + +// PrivateEndpointConnectionsClientListByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.ListByHostPool. +type PrivateEndpointConnectionsClientListByHostPoolResponse struct { + PrivateEndpointConnectionListResultWithSystemData +} + +// PrivateEndpointConnectionsClientListByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.ListByWorkspace. +type PrivateEndpointConnectionsClientListByWorkspaceResponse struct { + PrivateEndpointConnectionListResultWithSystemData +} + +// PrivateEndpointConnectionsClientUpdateByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.UpdateByHostPool. +type PrivateEndpointConnectionsClientUpdateByHostPoolResponse struct { + PrivateEndpointConnectionWithSystemData +} + +// PrivateEndpointConnectionsClientUpdateByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.UpdateByWorkspace. +type PrivateEndpointConnectionsClientUpdateByWorkspaceResponse struct { + PrivateEndpointConnectionWithSystemData +} + +// PrivateLinkResourcesClientListByHostPoolResponse contains the response from method PrivateLinkResourcesClient.ListByHostPool. +type PrivateLinkResourcesClientListByHostPoolResponse struct { + PrivateLinkResourceListResult +} + +// PrivateLinkResourcesClientListByWorkspaceResponse contains the response from method PrivateLinkResourcesClient.ListByWorkspace. +type PrivateLinkResourcesClientListByWorkspaceResponse struct { + PrivateLinkResourceListResult +} + // ScalingPlansClientCreateResponse contains the response from method ScalingPlansClient.Create. type ScalingPlansClientCreateResponse struct { ScalingPlan diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go index f10508d4c478..a9c4a800ec52 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go @@ -56,7 +56,7 @@ func NewScalingPlansClient(subscriptionID string, credential azcore.TokenCredent // Create - Create or update a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scalingPlanName - The name of the scaling plan. // scalingPlan - Object containing scaling plan definitions. @@ -96,7 +96,7 @@ func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, scalingPlan) @@ -113,7 +113,7 @@ func (client *ScalingPlansClient) createHandleResponse(resp *http.Response) (Sca // Delete - Remove a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scalingPlanName - The name of the scaling plan. // options - ScalingPlansClientDeleteOptions contains the optional parameters for the ScalingPlansClient.Delete method. @@ -152,7 +152,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -160,7 +160,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scalingPlanName - The name of the scaling plan. // options - ScalingPlansClientGetOptions contains the optional parameters for the ScalingPlansClient.Get method. @@ -199,7 +199,7 @@ func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -216,7 +216,7 @@ func (client *ScalingPlansClient) getHandleResponse(resp *http.Response) (Scalin // NewListByHostPoolPager - List scaling plan associated with hostpool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - ScalingPlansClientListByHostPoolOptions contains the optional parameters for the ScalingPlansClient.ListByHostPool @@ -269,7 +269,7 @@ func (client *ScalingPlansClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *ScalingPlansClient) listByHostPoolHandleResponse(resp *http.Respon // NewListByResourceGroupPager - List scaling plans. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ScalingPlansClientListByResourceGroupOptions contains the optional parameters for the ScalingPlansClient.ListByResourceGroup // method. @@ -334,7 +334,7 @@ func (client *ScalingPlansClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *ScalingPlansClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List scaling plans in subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // options - ScalingPlansClientListBySubscriptionOptions contains the optional parameters for the ScalingPlansClient.ListBySubscription // method. func (client *ScalingPlansClient) NewListBySubscriptionPager(options *ScalingPlansClientListBySubscriptionOptions) *runtime.Pager[ScalingPlansClientListBySubscriptionResponse] { @@ -394,7 +394,7 @@ func (client *ScalingPlansClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -411,7 +411,7 @@ func (client *ScalingPlansClient) listBySubscriptionHandleResponse(resp *http.Re // Update - Update a scaling plan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // scalingPlanName - The name of the scaling plan. // options - ScalingPlansClientUpdateOptions contains the optional parameters for the ScalingPlansClient.Update method. @@ -450,7 +450,7 @@ func (client *ScalingPlansClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ScalingPlan != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go index be86fcc331a4..fb4b37e97358 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go @@ -57,7 +57,7 @@ func NewSessionHostsClient(subscriptionID string, credential azcore.TokenCredent // Delete - Remove a SessionHost. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -101,7 +101,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -112,7 +112,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou // Get - Get a session host. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -156,7 +156,7 @@ func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +173,7 @@ func (client *SessionHostsClient) getHandleResponse(resp *http.Response) (Sessio // NewListPager - List sessionHosts. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - SessionHostsClientListOptions contains the optional parameters for the SessionHostsClient.List method. @@ -225,7 +225,7 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +242,7 @@ func (client *SessionHostsClient) listHandleResponse(resp *http.Response) (Sessi // Update - Update a session host. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -286,7 +286,10 @@ func (client *SessionHostsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") + if options != nil && options.Force != nil { + reqQP.Set("force", strconv.FormatBool(*options.Force)) + } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SessionHost != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go index 4991d11a65e2..21be7eebc156 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go @@ -56,7 +56,7 @@ func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - List start menu items in the given application group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - StartMenuItemsClientListOptions contains the optional parameters for the StartMenuItemsClient.List method. @@ -108,7 +108,7 @@ func (client *StartMenuItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go index d14e2bd59df0..a5e96a7e47b6 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go @@ -57,7 +57,7 @@ func NewUserSessionsClient(subscriptionID string, credential azcore.TokenCredent // Delete - Remove a userSession. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -106,7 +106,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -117,7 +117,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou // Disconnect - Disconnect a userSession. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -166,7 +166,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +174,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r // Get - Get a userSession. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -223,7 +223,7 @@ func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +240,7 @@ func (client *UserSessionsClient) getHandleResponse(resp *http.Response) (UserSe // NewListPager - List userSessions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -297,7 +297,7 @@ func (client *UserSessionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -314,7 +314,7 @@ func (client *UserSessionsClient) listHandleResponse(resp *http.Response) (UserS // NewListByHostPoolPager - List userSessions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - UserSessionsClientListByHostPoolOptions contains the optional parameters for the UserSessionsClient.ListByHostPool @@ -367,7 +367,7 @@ func (client *UserSessionsClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -387,7 +387,7 @@ func (client *UserSessionsClient) listByHostPoolHandleResponse(resp *http.Respon // SendMessage - Send a message to a user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool @@ -437,7 +437,7 @@ func (client *UserSessionsClient) sendMessageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SendMessage != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go index ea3455ef6602..43a612fb511a 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go @@ -56,7 +56,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Create or update a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace // workspace - Object containing Workspace definitions. @@ -97,7 +97,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workspace) @@ -114,7 +114,7 @@ func (client *WorkspacesClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Remove a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace // options - WorkspacesClientDeleteOptions contains the optional parameters for the WorkspacesClient.Delete method. @@ -153,7 +153,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,7 +161,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Get a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace // options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. @@ -200,7 +200,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +217,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListByResourceGroupPager - List workspaces. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup // method. @@ -265,7 +265,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -282,7 +282,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - List workspaces in subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.ListBySubscription // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -325,7 +325,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -342,7 +342,7 @@ func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Resp // Update - Update a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-07-12 +// Generated from API version 2022-02-10-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace // options - WorkspacesClientUpdateOptions contains the optional parameters for the WorkspacesClient.Update method. @@ -381,7 +381,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-07-12") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Workspace != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md b/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md index b03d8c1b9912..36053467cb12 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md +++ b/sdk/resourcemanager/eventgrid/armeventgrid/CHANGELOG.md @@ -1,5 +1,394 @@ # Release History +## 2.0.0-beta.1 (2022-05-19) +### Breaking Changes + +- Function `*PrivateEndpointConnectionsClient.BeginUpdate` parameter(s) have been changed from `(context.Context, string, PrivateEndpointConnectionsParentType, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionsClientBeginUpdateOptions)` to `(context.Context, string, ParentType, string, string, PrivateEndpointConnection, *PrivateEndpointConnectionsClientBeginUpdateOptions)` +- Function `*PrivateEndpointConnectionsClient.BeginDelete` parameter(s) have been changed from `(context.Context, string, PrivateEndpointConnectionsParentType, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions)` to `(context.Context, string, ParentType, string, string, *PrivateEndpointConnectionsClientBeginDeleteOptions)` +- Function `*PrivateEndpointConnectionsClient.Get` parameter(s) have been changed from `(context.Context, string, PrivateEndpointConnectionsParentType, string, string, *PrivateEndpointConnectionsClientGetOptions)` to `(context.Context, string, ParentType, string, string, *PrivateEndpointConnectionsClientGetOptions)` +- Function `*PrivateEndpointConnectionsClient.NewListByResourcePager` parameter(s) have been changed from `(string, PrivateEndpointConnectionsParentType, string, *PrivateEndpointConnectionsClientListByResourceOptions)` to `(string, ParentType, string, *PrivateEndpointConnectionsClientListByResourceOptions)` +- Const `PrivateEndpointConnectionsParentTypeDomains` has been removed +- Const `PrivateEndpointConnectionsParentTypeTopics` has been removed +- Function `PossiblePrivateEndpointConnectionsParentTypeValues` has been removed + +### Features Added + +- New const `VerifiedPartnerProvisioningStateFailed` +- New const `PartnerTopicProvisioningStateCanceled` +- New const `PartnerConfigurationProvisioningStateUpdating` +- New const `PartnerNamespaceProvisioningStateUpdating` +- New const `PartnerNamespaceProvisioningStateSucceeded` +- New const `PartnerRegistrationVisibilityStateGenerallyAvailable` +- New const `ParentTypeDomains` +- New const `PartnerConfigurationProvisioningStateCreating` +- New const `TopicTypePropertiesSupportedScopesForSourceItemManagementGroup` +- New const `ResourceKindAzure` +- New const `PartnerTopicRoutingModeChannelNameHeader` +- New const `PartnerTopicProvisioningStateUpdating` +- New const `PartnerTopicProvisioningStateDeleting` +- New const `PartnerNamespaceProvisioningStateDeleting` +- New const `PartnerConfigurationProvisioningStateFailed` +- New const `PartnerTopicActivationStateNeverActivated` +- New const `PartnerTopicProvisioningStateSucceeded` +- New const `PartnerTopicActivationStateDeactivated` +- New const `VerifiedPartnerProvisioningStateCanceled` +- New const `PartnerTopicProvisioningStateCreating` +- New const `PartnerTopicReadinessStateNotActivatedByUserYet` +- New const `PartnerRegistrationProvisioningStateUpdating` +- New const `EventChannelProvisioningStateSucceeded` +- New const `PartnerClientAuthenticationTypeAzureAD` +- New const `EventDefinitionKindInline` +- New const `DataResidencyBoundaryWithinGeopair` +- New const `PartnerTopicReadinessStateDeletedByUser` +- New const `PartnerNamespaceProvisioningStateFailed` +- New const `PartnerTopicReadinessStateDeactivatedByUser` +- New const `PartnerEndpointTypeWebHook` +- New const `EventChannelProvisioningStateFailed` +- New const `PartnerDestinationProvisioningStateUpdating` +- New const `PartnerDestinationProvisioningStateFailed` +- New const `ChannelTypePartnerTopic` +- New const `SKUPremium` +- New const `DataResidencyBoundaryWithinRegion` +- New const `PartnerDestinationProvisioningStateCreating` +- New const `PartnerRegistrationProvisioningStateSucceeded` +- New const `PartnerRegistrationProvisioningStateFailed` +- New const `ChannelProvisioningStateFailed` +- New const `EndpointTypePartnerDestination` +- New const `ChannelProvisioningStateUpdating` +- New const `PartnerTopicProvisioningStateFailed` +- New const `SKUBasic` +- New const `PartnerTopicActivationStateActivated` +- New const `VerifiedPartnerProvisioningStateUpdating` +- New const `PartnerRegistrationProvisioningStateCanceled` +- New const `ChannelProvisioningStateCreating` +- New const `PartnerConfigurationProvisioningStateCanceled` +- New const `EventChannelProvisioningStateDeleting` +- New const `EventChannelProvisioningStateUpdating` +- New const `ParentTypeTopics` +- New const `PartnerDestinationActivationStateNeverActivated` +- New const `PartnerRegistrationVisibilityStateHidden` +- New const `ChannelProvisioningStateCanceled` +- New const `PartnerDestinationProvisioningStateCanceled` +- New const `EventChannelProvisioningStateCreating` +- New const `PartnerDestinationProvisioningStateSucceeded` +- New const `ReadinessStateNeverActivated` +- New const `PartnerConfigurationProvisioningStateSucceeded` +- New const `PartnerNamespaceProvisioningStateCreating` +- New const `PartnerDestinationProvisioningStateDeleting` +- New const `PartnerRegistrationVisibilityStatePublicPreview` +- New const `VerifiedPartnerProvisioningStateSucceeded` +- New const `ReadinessStateActivated` +- New const `PartnerConfigurationProvisioningStateDeleting` +- New const `PartnerTopicRoutingModeSourceEventAttribute` +- New const `ChannelProvisioningStateDeleting` +- New const `PartnerRegistrationProvisioningStateCreating` +- New const `ChannelTypePartnerDestination` +- New const `PartnerDestinationActivationStateActivated` +- New const `VerifiedPartnerProvisioningStateCreating` +- New const `EventChannelProvisioningStateCanceled` +- New const `PartnerTopicReadinessStateActivatedByUser` +- New const `ChannelProvisioningStateSucceeded` +- New const `ResourceKindAzureArc` +- New const `VerifiedPartnerProvisioningStateDeleting` +- New const `ParentTypePartnerNamespaces` +- New const `PartnerNamespaceProvisioningStateCanceled` +- New const `PartnerRegistrationProvisioningStateDeleting` +- New function `*ChannelUpdateParametersProperties.UnmarshalJSON([]byte) error` +- New function `PartnerNamespaceUpdateParameterProperties.MarshalJSON() ([]byte, error)` +- New function `WebhookUpdatePartnerDestinationInfo.MarshalJSON() ([]byte, error)` +- New function `PartnerDestinationInfo.MarshalJSON() ([]byte, error)` +- New function `ResourceMoveChangeHistory.MarshalJSON() ([]byte, error)` +- New function `PartnerTopicProperties.MarshalJSON() ([]byte, error)` +- New function `PartnerConfigurationUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `PossiblePartnerTopicActivationStateValues() []PartnerTopicActivationState` +- New function `PossibleResourceKindValues() []ResourceKind` +- New function `PartnerAuthorization.MarshalJSON() ([]byte, error)` +- New function `PartnerDestinationUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `PartnerNamespaceProperties.MarshalJSON() ([]byte, error)` +- New function `ChannelProperties.MarshalJSON() ([]byte, error)` +- New function `*PartnerUpdateDestinationInfo.GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo` +- New function `PossibleParentTypeValues() []ParentType` +- New function `PartnerEventSubscriptionDestination.MarshalJSON() ([]byte, error)` +- New function `*PartnerDestinationInfo.GetPartnerDestinationInfo() *PartnerDestinationInfo` +- New function `EventChannelProperties.MarshalJSON() ([]byte, error)` +- New function `PossiblePartnerDestinationActivationStateValues() []PartnerDestinationActivationState` +- New function `*WebhookPartnerDestinationInfo.GetPartnerDestinationInfo() *PartnerDestinationInfo` +- New function `PossiblePartnerTopicRoutingModeValues() []PartnerTopicRoutingMode` +- New function `PossibleReadinessStateValues() []ReadinessState` +- New function `PossiblePartnerEndpointTypeValues() []PartnerEndpointType` +- New function `EventChannelFilter.MarshalJSON() ([]byte, error)` +- New function `PartnerTopicUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `PartnerDestination.MarshalJSON() ([]byte, error)` +- New function `PartnerRegistrationUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `PossibleDataResidencyBoundaryValues() []DataResidencyBoundary` +- New function `PartnerNamespace.MarshalJSON() ([]byte, error)` +- New function `ChannelUpdateParametersProperties.MarshalJSON() ([]byte, error)` +- New function `PartnerRegistrationProperties.MarshalJSON() ([]byte, error)` +- New function `*ChannelProperties.UnmarshalJSON([]byte) error` +- New function `PossibleEventChannelProvisioningStateValues() []EventChannelProvisioningState` +- New function `*PartnerClientAuthentication.GetPartnerClientAuthentication() *PartnerClientAuthentication` +- New function `PossiblePartnerTopicProvisioningStateValues() []PartnerTopicProvisioningState` +- New function `ChannelUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `PossibleSKUValues() []SKU` +- New function `PartnerConfiguration.MarshalJSON() ([]byte, error)` +- New function `*WebhookUpdatePartnerDestinationInfo.UnmarshalJSON([]byte) error` +- New function `*EventChannelProperties.UnmarshalJSON([]byte) error` +- New function `PossiblePartnerRegistrationProvisioningStateValues() []PartnerRegistrationProvisioningState` +- New function `PossibleChannelTypeValues() []ChannelType` +- New function `PossiblePartnerTopicReadinessStateValues() []PartnerTopicReadinessState` +- New function `*PartnerEventSubscriptionDestination.GetEventSubscriptionDestination() *EventSubscriptionDestination` +- New function `WebhookPartnerDestinationInfo.MarshalJSON() ([]byte, error)` +- New function `PartnerNamespaceUpdateParameters.MarshalJSON() ([]byte, error)` +- New function `*WebhookUpdatePartnerDestinationInfo.GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo` +- New function `PossiblePartnerNamespaceProvisioningStateValues() []PartnerNamespaceProvisioningState` +- New function `*AzureADPartnerClientAuthentication.GetPartnerClientAuthentication() *PartnerClientAuthentication` +- New function `PartnerTopic.MarshalJSON() ([]byte, error)` +- New function `EventTypeInfo.MarshalJSON() ([]byte, error)` +- New function `*EventChannelFilter.UnmarshalJSON([]byte) error` +- New function `*PartnerDestinationProperties.UnmarshalJSON([]byte) error` +- New function `PartnerRegistration.MarshalJSON() ([]byte, error)` +- New function `Partner.MarshalJSON() ([]byte, error)` +- New function `*WebhookPartnerDestinationProperties.UnmarshalJSON([]byte) error` +- New function `*AzureADPartnerClientAuthentication.UnmarshalJSON([]byte) error` +- New function `AzureADPartnerClientAuthentication.MarshalJSON() ([]byte, error)` +- New function `WebhookPartnerDestinationProperties.MarshalJSON() ([]byte, error)` +- New function `*WebhookPartnerDestinationInfo.UnmarshalJSON([]byte) error` +- New function `PossibleEventDefinitionKindValues() []EventDefinitionKind` +- New function `PossiblePartnerConfigurationProvisioningStateValues() []PartnerConfigurationProvisioningState` +- New function `PossiblePartnerClientAuthenticationTypeValues() []PartnerClientAuthenticationType` +- New function `PossiblePartnerRegistrationVisibilityStateValues() []PartnerRegistrationVisibilityState` +- New function `*Partner.UnmarshalJSON([]byte) error` +- New function `PossiblePartnerDestinationProvisioningStateValues() []PartnerDestinationProvisioningState` +- New function `*PartnerTopicProperties.UnmarshalJSON([]byte) error` +- New function `*ResourceMoveChangeHistory.UnmarshalJSON([]byte) error` +- New function `PossibleChannelProvisioningStateValues() []ChannelProvisioningState` +- New function `PossibleVerifiedPartnerProvisioningStateValues() []VerifiedPartnerProvisioningState` +- New function `*PartnerEventSubscriptionDestination.UnmarshalJSON([]byte) error` +- New function `PartnerDestinationProperties.MarshalJSON() ([]byte, error)` +- New struct `AzureADPartnerClientAuthentication` +- New struct `AzureADPartnerClientAuthenticationProperties` +- New struct `Channel` +- New struct `ChannelProperties` +- New struct `ChannelUpdateParameters` +- New struct `ChannelUpdateParametersProperties` +- New struct `ChannelsClientBeginDeleteOptions` +- New struct `ChannelsClientCreateOrUpdateOptions` +- New struct `ChannelsClientCreateOrUpdateResponse` +- New struct `ChannelsClientDeleteResponse` +- New struct `ChannelsClientGetFullURLOptions` +- New struct `ChannelsClientGetFullURLResponse` +- New struct `ChannelsClientGetOptions` +- New struct `ChannelsClientGetResponse` +- New struct `ChannelsClientListByPartnerNamespaceOptions` +- New struct `ChannelsClientListByPartnerNamespaceResponse` +- New struct `ChannelsClientUpdateOptions` +- New struct `ChannelsClientUpdateResponse` +- New struct `ChannelsListResult` +- New struct `DomainEventSubscriptionsClientBeginCreateOrUpdateOptions` +- New struct `DomainEventSubscriptionsClientBeginDeleteOptions` +- New struct `DomainEventSubscriptionsClientBeginUpdateOptions` +- New struct `DomainEventSubscriptionsClientCreateOrUpdateResponse` +- New struct `DomainEventSubscriptionsClientDeleteResponse` +- New struct `DomainEventSubscriptionsClientGetDeliveryAttributesOptions` +- New struct `DomainEventSubscriptionsClientGetDeliveryAttributesResponse` +- New struct `DomainEventSubscriptionsClientGetFullURLOptions` +- New struct `DomainEventSubscriptionsClientGetFullURLResponse` +- New struct `DomainEventSubscriptionsClientGetOptions` +- New struct `DomainEventSubscriptionsClientGetResponse` +- New struct `DomainEventSubscriptionsClientListOptions` +- New struct `DomainEventSubscriptionsClientListResponse` +- New struct `DomainEventSubscriptionsClientUpdateResponse` +- New struct `DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions` +- New struct `DomainTopicEventSubscriptionsClientBeginDeleteOptions` +- New struct `DomainTopicEventSubscriptionsClientBeginUpdateOptions` +- New struct `DomainTopicEventSubscriptionsClientCreateOrUpdateResponse` +- New struct `DomainTopicEventSubscriptionsClientDeleteResponse` +- New struct `DomainTopicEventSubscriptionsClientGetDeliveryAttributesOptions` +- New struct `DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse` +- New struct `DomainTopicEventSubscriptionsClientGetFullURLOptions` +- New struct `DomainTopicEventSubscriptionsClientGetFullURLResponse` +- New struct `DomainTopicEventSubscriptionsClientGetOptions` +- New struct `DomainTopicEventSubscriptionsClientGetResponse` +- New struct `DomainTopicEventSubscriptionsClientListOptions` +- New struct `DomainTopicEventSubscriptionsClientListResponse` +- New struct `DomainTopicEventSubscriptionsClientUpdateResponse` +- New struct `EventChannel` +- New struct `EventChannelDestination` +- New struct `EventChannelFilter` +- New struct `EventChannelProperties` +- New struct `EventChannelSource` +- New struct `EventChannelsClientBeginDeleteOptions` +- New struct `EventChannelsClientCreateOrUpdateOptions` +- New struct `EventChannelsClientCreateOrUpdateResponse` +- New struct `EventChannelsClientDeleteResponse` +- New struct `EventChannelsClientGetOptions` +- New struct `EventChannelsClientGetResponse` +- New struct `EventChannelsClientListByPartnerNamespaceOptions` +- New struct `EventChannelsClientListByPartnerNamespaceResponse` +- New struct `EventChannelsListResult` +- New struct `EventTypeInfo` +- New struct `ExtendedLocation` +- New struct `InlineEventProperties` +- New struct `Partner` +- New struct `PartnerAuthorization` +- New struct `PartnerClientAuthentication` +- New struct `PartnerConfiguration` +- New struct `PartnerConfigurationProperties` +- New struct `PartnerConfigurationUpdateParameterProperties` +- New struct `PartnerConfigurationUpdateParameters` +- New struct `PartnerConfigurationsClientAuthorizePartnerOptions` +- New struct `PartnerConfigurationsClientAuthorizePartnerResponse` +- New struct `PartnerConfigurationsClientBeginCreateOrUpdateOptions` +- New struct `PartnerConfigurationsClientBeginDeleteOptions` +- New struct `PartnerConfigurationsClientBeginUpdateOptions` +- New struct `PartnerConfigurationsClientCreateOrUpdateResponse` +- New struct `PartnerConfigurationsClientDeleteResponse` +- New struct `PartnerConfigurationsClientGetOptions` +- New struct `PartnerConfigurationsClientGetResponse` +- New struct `PartnerConfigurationsClientListByResourceGroupOptions` +- New struct `PartnerConfigurationsClientListByResourceGroupResponse` +- New struct `PartnerConfigurationsClientListBySubscriptionOptions` +- New struct `PartnerConfigurationsClientListBySubscriptionResponse` +- New struct `PartnerConfigurationsClientUnauthorizePartnerOptions` +- New struct `PartnerConfigurationsClientUnauthorizePartnerResponse` +- New struct `PartnerConfigurationsClientUpdateResponse` +- New struct `PartnerConfigurationsListResult` +- New struct `PartnerDestination` +- New struct `PartnerDestinationInfo` +- New struct `PartnerDestinationProperties` +- New struct `PartnerDestinationUpdateParameters` +- New struct `PartnerDestinationsClientActivateOptions` +- New struct `PartnerDestinationsClientActivateResponse` +- New struct `PartnerDestinationsClientBeginDeleteOptions` +- New struct `PartnerDestinationsClientCreateOrUpdateOptions` +- New struct `PartnerDestinationsClientCreateOrUpdateResponse` +- New struct `PartnerDestinationsClientDeleteResponse` +- New struct `PartnerDestinationsClientGetOptions` +- New struct `PartnerDestinationsClientGetResponse` +- New struct `PartnerDestinationsClientListByResourceGroupOptions` +- New struct `PartnerDestinationsClientListByResourceGroupResponse` +- New struct `PartnerDestinationsClientListBySubscriptionOptions` +- New struct `PartnerDestinationsClientListBySubscriptionResponse` +- New struct `PartnerDestinationsClientUpdateOptions` +- New struct `PartnerDestinationsClientUpdateResponse` +- New struct `PartnerDestinationsListResult` +- New struct `PartnerDetails` +- New struct `PartnerEventSubscriptionDestination` +- New struct `PartnerEventSubscriptionDestinationProperties` +- New struct `PartnerNamespace` +- New struct `PartnerNamespaceProperties` +- New struct `PartnerNamespaceRegenerateKeyRequest` +- New struct `PartnerNamespaceSharedAccessKeys` +- New struct `PartnerNamespaceUpdateParameterProperties` +- New struct `PartnerNamespaceUpdateParameters` +- New struct `PartnerNamespacesClientBeginCreateOrUpdateOptions` +- New struct `PartnerNamespacesClientBeginDeleteOptions` +- New struct `PartnerNamespacesClientBeginUpdateOptions` +- New struct `PartnerNamespacesClientCreateOrUpdateResponse` +- New struct `PartnerNamespacesClientDeleteResponse` +- New struct `PartnerNamespacesClientGetOptions` +- New struct `PartnerNamespacesClientGetResponse` +- New struct `PartnerNamespacesClientListByResourceGroupOptions` +- New struct `PartnerNamespacesClientListByResourceGroupResponse` +- New struct `PartnerNamespacesClientListBySubscriptionOptions` +- New struct `PartnerNamespacesClientListBySubscriptionResponse` +- New struct `PartnerNamespacesClientListSharedAccessKeysOptions` +- New struct `PartnerNamespacesClientListSharedAccessKeysResponse` +- New struct `PartnerNamespacesClientRegenerateKeyOptions` +- New struct `PartnerNamespacesClientRegenerateKeyResponse` +- New struct `PartnerNamespacesClientUpdateResponse` +- New struct `PartnerNamespacesListResult` +- New struct `PartnerRegistration` +- New struct `PartnerRegistrationProperties` +- New struct `PartnerRegistrationUpdateParameters` +- New struct `PartnerRegistrationsClientBeginCreateOrUpdateOptions` +- New struct `PartnerRegistrationsClientBeginDeleteOptions` +- New struct `PartnerRegistrationsClientBeginUpdateOptions` +- New struct `PartnerRegistrationsClientCreateOrUpdateResponse` +- New struct `PartnerRegistrationsClientDeleteResponse` +- New struct `PartnerRegistrationsClientGetOptions` +- New struct `PartnerRegistrationsClientGetResponse` +- New struct `PartnerRegistrationsClientListByResourceGroupOptions` +- New struct `PartnerRegistrationsClientListByResourceGroupResponse` +- New struct `PartnerRegistrationsClientListBySubscriptionOptions` +- New struct `PartnerRegistrationsClientListBySubscriptionResponse` +- New struct `PartnerRegistrationsClientUpdateResponse` +- New struct `PartnerRegistrationsListResult` +- New struct `PartnerTopic` +- New struct `PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions` +- New struct `PartnerTopicEventSubscriptionsClientBeginDeleteOptions` +- New struct `PartnerTopicEventSubscriptionsClientBeginUpdateOptions` +- New struct `PartnerTopicEventSubscriptionsClientCreateOrUpdateResponse` +- New struct `PartnerTopicEventSubscriptionsClientDeleteResponse` +- New struct `PartnerTopicEventSubscriptionsClientGetDeliveryAttributesOptions` +- New struct `PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse` +- New struct `PartnerTopicEventSubscriptionsClientGetFullURLOptions` +- New struct `PartnerTopicEventSubscriptionsClientGetFullURLResponse` +- New struct `PartnerTopicEventSubscriptionsClientGetOptions` +- New struct `PartnerTopicEventSubscriptionsClientGetResponse` +- New struct `PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions` +- New struct `PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse` +- New struct `PartnerTopicEventSubscriptionsClientUpdateResponse` +- New struct `PartnerTopicInfo` +- New struct `PartnerTopicProperties` +- New struct `PartnerTopicUpdateParameters` +- New struct `PartnerTopicsClientActivateOptions` +- New struct `PartnerTopicsClientActivateResponse` +- New struct `PartnerTopicsClientBeginDeleteOptions` +- New struct `PartnerTopicsClientCreateOrUpdateOptions` +- New struct `PartnerTopicsClientCreateOrUpdateResponse` +- New struct `PartnerTopicsClientDeactivateOptions` +- New struct `PartnerTopicsClientDeactivateResponse` +- New struct `PartnerTopicsClientDeleteResponse` +- New struct `PartnerTopicsClientGetOptions` +- New struct `PartnerTopicsClientGetResponse` +- New struct `PartnerTopicsClientListByResourceGroupOptions` +- New struct `PartnerTopicsClientListByResourceGroupResponse` +- New struct `PartnerTopicsClientListBySubscriptionOptions` +- New struct `PartnerTopicsClientListBySubscriptionResponse` +- New struct `PartnerTopicsClientUpdateOptions` +- New struct `PartnerTopicsClientUpdateResponse` +- New struct `PartnerTopicsListResult` +- New struct `PartnerUpdateDestinationInfo` +- New struct `PartnerUpdateTopicInfo` +- New struct `ResourceMoveChangeHistory` +- New struct `ResourceSKU` +- New struct `TopicEventSubscriptionsClientBeginCreateOrUpdateOptions` +- New struct `TopicEventSubscriptionsClientBeginDeleteOptions` +- New struct `TopicEventSubscriptionsClientBeginUpdateOptions` +- New struct `TopicEventSubscriptionsClientCreateOrUpdateResponse` +- New struct `TopicEventSubscriptionsClientDeleteResponse` +- New struct `TopicEventSubscriptionsClientGetDeliveryAttributesOptions` +- New struct `TopicEventSubscriptionsClientGetDeliveryAttributesResponse` +- New struct `TopicEventSubscriptionsClientGetFullURLOptions` +- New struct `TopicEventSubscriptionsClientGetFullURLResponse` +- New struct `TopicEventSubscriptionsClientGetOptions` +- New struct `TopicEventSubscriptionsClientGetResponse` +- New struct `TopicEventSubscriptionsClientListOptions` +- New struct `TopicEventSubscriptionsClientListResponse` +- New struct `TopicEventSubscriptionsClientUpdateResponse` +- New struct `VerifiedPartner` +- New struct `VerifiedPartnerProperties` +- New struct `VerifiedPartnersClientGetOptions` +- New struct `VerifiedPartnersClientGetResponse` +- New struct `VerifiedPartnersClientListOptions` +- New struct `VerifiedPartnersClientListResponse` +- New struct `VerifiedPartnersListResult` +- New struct `WebhookPartnerDestinationInfo` +- New struct `WebhookPartnerDestinationProperties` +- New struct `WebhookUpdatePartnerDestinationInfo` +- New field `Kind` in struct `Topic` +- New field `ExtendedLocation` in struct `Topic` +- New field `SKU` in struct `Topic` +- New field `DataResidencyBoundary` in struct `TopicProperties` +- New field `SKU` in struct `TopicUpdateParameters` +- New field `SKU` in struct `Domain` +- New field `DataResidencyBoundary` in struct `DomainUpdateParameterProperties` +- New field `SKU` in struct `DomainUpdateParameters` +- New field `DataResidencyBoundary` in struct `DomainProperties` +- New field `DataResidencyBoundary` in struct `TopicUpdateParameterProperties` + + ## 1.0.0 (2022-05-17) ### Breaking Changes diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md b/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md index 97a4f9f2f6e4..272b84ff5790 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md +++ b/sdk/resourcemanager/eventgrid/armeventgrid/autorest.md @@ -4,10 +4,10 @@ ``` yaml azure-arm: true -tag: package-2021-12 + require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/eventgrid/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/eventgrid/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/eventgrid/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/eventgrid/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_channels_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_channels_client_test.go new file mode 100644 index 000000000000..9a2716759ebf --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_channels_client_test.go @@ -0,0 +1,158 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Channels_Get.json +func ExampleChannelsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "examplePartnerNamespaceName1", + "exampleChannelName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Channels_CreateOrUpdate.json +func ExampleChannelsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "examplerg", + "examplePartnerNamespaceName1", + "exampleChannelName1", + armeventgrid.Channel{ + Properties: &armeventgrid.ChannelProperties{ + ChannelType: to.Ptr(armeventgrid.ChannelTypePartnerTopic), + ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-21T22:50:25.410433Z"); return t }()), + MessageForActivation: to.Ptr("Example message to approver"), + PartnerTopicInfo: &armeventgrid.PartnerTopicInfo{ + Name: to.Ptr("examplePartnerTopic1"), + AzureSubscriptionID: to.Ptr("5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), + ResourceGroupName: to.Ptr("examplerg2"), + Source: to.Ptr("ContosoCorp.Accounts.User1"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Channels_Delete.json +func ExampleChannelsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "examplePartnerNamespaceName1", + "exampleEventChannelName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Channels_Update.json +func ExampleChannelsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Update(ctx, + "examplerg", + "examplePartnerNamespaceName1", + "exampleChannelName1", + armeventgrid.ChannelUpdateParameters{ + Properties: &armeventgrid.ChannelUpdateParametersProperties{ + ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T23:06:11.785Z"); return t }()), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Channels_ListByPartnerNamespace.json +func ExampleChannelsClient_NewListByPartnerNamespacePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByPartnerNamespacePager("examplerg", + "examplePartnerNamespaceName1", + &armeventgrid.ChannelsClientListByPartnerNamespaceOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaineventsubscriptions_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaineventsubscriptions_client_test.go new file mode 100644 index 000000000000..0d917d0aa3f3 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaineventsubscriptions_client_test.go @@ -0,0 +1,200 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainEventSubscriptions_Get.json +func ExampleDomainEventSubscriptionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "exampleDomain1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainEventSubscriptions_CreateOrUpdate.json +func ExampleDomainEventSubscriptionsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "examplerg", + "exampleDomain1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscription{ + Properties: &armeventgrid.EventSubscriptionProperties{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(false), + SubjectBeginsWith: to.Ptr("ExamplePrefix"), + SubjectEndsWith: to.Ptr("ExampleSuffix"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainEventSubscriptions_Delete.json +func ExampleDomainEventSubscriptionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "exampleDomain1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainEventSubscriptions_Update.json +func ExampleDomainEventSubscriptionsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "examplerg", + "exampleDomain1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscriptionUpdateParameters{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(true), + SubjectBeginsWith: to.Ptr("existingPrefix"), + SubjectEndsWith: to.Ptr("newSuffix"), + }, + Labels: []*string{ + to.Ptr("label1"), + to.Ptr("label2")}, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainEventSubscriptions_List.json +func ExampleDomainEventSubscriptionsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("examplerg", + "exampleDomain1", + &armeventgrid.DomainEventSubscriptionsClientListOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainEventSubscriptions_GetDeliveryAttributes.json +func ExampleDomainEventSubscriptionsClient_GetDeliveryAttributes() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetDeliveryAttributes(ctx, + "examplerg", + "exampleDomain1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domains_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domains_client_test.go index 9c99552f1558..57a715ad3af2 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domains_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domains_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_Get.json func ExampleDomainsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleDomainsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_CreateOrUpdate.json func ExampleDomainsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleDomainsClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_Delete.json func ExampleDomainsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -106,7 +106,7 @@ func ExampleDomainsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_Update.json func ExampleDomainsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -148,7 +148,7 @@ func ExampleDomainsClient_BeginUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_ListBySubscription.json func ExampleDomainsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +174,7 @@ func ExampleDomainsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_ListByResourceGroup.json func ExampleDomainsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -201,7 +201,7 @@ func ExampleDomainsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_ListSharedAccessKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_ListSharedAccessKeys.json func ExampleDomainsClient_ListSharedAccessKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -223,7 +223,7 @@ func ExampleDomainsClient_ListSharedAccessKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Domains_RegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Domains_RegenerateKey.json func ExampleDomainsClient_RegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaintopiceventsubscriptions_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaintopiceventsubscriptions_client_test.go new file mode 100644 index 000000000000..9ccc74ca02a3 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaintopiceventsubscriptions_client_test.go @@ -0,0 +1,206 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopicEventSubscriptions_Get.json +func ExampleDomainTopicEventSubscriptionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "exampleDomain1", + "exampleDomainTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopicEventSubscriptions_CreateOrUpdate.json +func ExampleDomainTopicEventSubscriptionsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "examplerg", + "exampleDomain1", + "exampleDomainTopic1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscription{ + Properties: &armeventgrid.EventSubscriptionProperties{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(false), + SubjectBeginsWith: to.Ptr("ExamplePrefix"), + SubjectEndsWith: to.Ptr("ExampleSuffix"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopicEventSubscriptions_Delete.json +func ExampleDomainTopicEventSubscriptionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "exampleDomain1", + "exampleDomainTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopicEventSubscriptions_Update.json +func ExampleDomainTopicEventSubscriptionsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "examplerg", + "exampleDomain1", + "exampleDomainTopic1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscriptionUpdateParameters{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(true), + SubjectBeginsWith: to.Ptr("existingPrefix"), + SubjectEndsWith: to.Ptr("newSuffix"), + }, + Labels: []*string{ + to.Ptr("label1"), + to.Ptr("label2")}, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopicEventSubscriptions_List.json +func ExampleDomainTopicEventSubscriptionsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("examplerg", + "exampleDomain1", + "exampleDomainTopic1", + &armeventgrid.DomainTopicEventSubscriptionsClientListOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopicEventSubscriptions_GetDeliveryAttributes.json +func ExampleDomainTopicEventSubscriptionsClient_GetDeliveryAttributes() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewDomainTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetDeliveryAttributes(ctx, + "examplerg", + "exampleDomain1", + "exampleDomainTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaintopics_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaintopics_client_test.go index c8c9e7ec6996..94e97b3deca9 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaintopics_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_domaintopics_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/DomainTopics_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopics_Get.json func ExampleDomainTopicsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleDomainTopicsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/DomainTopics_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopics_CreateOrUpdate.json func ExampleDomainTopicsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,7 +64,7 @@ func ExampleDomainTopicsClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/DomainTopics_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopics_Delete.json func ExampleDomainTopicsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -89,7 +89,7 @@ func ExampleDomainTopicsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/DomainTopics_ListByDomain.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/DomainTopics_ListByDomain.json func ExampleDomainTopicsClient_NewListByDomainPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_eventchannels_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_eventchannels_client_test.go new file mode 100644 index 000000000000..9935ba4864fd --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_eventchannels_client_test.go @@ -0,0 +1,129 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventChannels_Get.json +func ExampleEventChannelsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewEventChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "examplePartnerNamespaceName1", + "exampleEventChannelName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventChannels_CreateOrUpdate.json +func ExampleEventChannelsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewEventChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "examplerg", + "examplePartnerNamespaceName1", + "exampleEventChannelName1", + armeventgrid.EventChannel{ + Properties: &armeventgrid.EventChannelProperties{ + Destination: &armeventgrid.EventChannelDestination{ + AzureSubscriptionID: to.Ptr("5b4b650e-28b9-4790-b3ab-ddbd88d727c4"), + PartnerTopicName: to.Ptr("examplePartnerTopic1"), + ResourceGroup: to.Ptr("examplerg2"), + }, + Source: &armeventgrid.EventChannelSource{ + Source: to.Ptr("ContosoCorp.Accounts.User1"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventChannels_Delete.json +func ExampleEventChannelsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewEventChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "examplePartnerNamespaceName1", + "exampleEventChannelName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventChannels_ListByPartnerNamespace.json +func ExampleEventChannelsClient_NewListByPartnerNamespacePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewEventChannelsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByPartnerNamespacePager("examplerg", + "partnerNamespace123", + &armeventgrid.EventChannelsClientListByPartnerNamespaceOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_eventsubscriptions_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_eventsubscriptions_client_test.go index 78ba117bef26..291645f3d88a 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_eventsubscriptions_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_eventsubscriptions_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_GetForCustomTopic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_GetForCustomTopic.json func ExampleEventSubscriptionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleEventSubscriptionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_CreateOrUpdateForCustomTopic_EventHubDestination.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_CreateOrUpdateForCustomTopic.json func ExampleEventSubscriptionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -55,13 +55,6 @@ func ExampleEventSubscriptionsClient_BeginCreateOrUpdate() { "examplesubscription1", armeventgrid.EventSubscription{ Properties: &armeventgrid.EventSubscriptionProperties{ - DeadLetterDestination: &armeventgrid.StorageBlobDeadLetterDestination{ - EndpointType: to.Ptr(armeventgrid.DeadLetterEndPointTypeStorageBlob), - Properties: &armeventgrid.StorageBlobDeadLetterDestinationProperties{ - BlobContainerName: to.Ptr("contosocontainer"), - ResourceID: to.Ptr("/subscriptions/55f3dcd4-cac7-43b4-990b-a139d62a1eb2/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/contosostg"), - }, - }, Destination: &armeventgrid.EventHubEventSubscriptionDestination{ EndpointType: to.Ptr(armeventgrid.EndpointTypeEventHub), Properties: &armeventgrid.EventHubEventSubscriptionDestinationProperties{ @@ -85,7 +78,7 @@ func ExampleEventSubscriptionsClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_DeleteForCustomTopic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_DeleteForCustomTopic.json func ExampleEventSubscriptionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -109,7 +102,7 @@ func ExampleEventSubscriptionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_UpdateForCustomTopic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_UpdateForCustomTopic.json func ExampleEventSubscriptionsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -149,7 +142,7 @@ func ExampleEventSubscriptionsClient_BeginUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListGlobalBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListGlobalBySubscription.json func ExampleEventSubscriptionsClient_NewListGlobalBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +168,7 @@ func ExampleEventSubscriptionsClient_NewListGlobalBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListGlobalBySubscriptionForTopicType.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListGlobalBySubscriptionForTopicType.json func ExampleEventSubscriptionsClient_NewListGlobalBySubscriptionForTopicTypePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -202,7 +195,7 @@ func ExampleEventSubscriptionsClient_NewListGlobalBySubscriptionForTopicTypePage } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListGlobalByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListGlobalByResourceGroup.json func ExampleEventSubscriptionsClient_NewListGlobalByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -229,7 +222,7 @@ func ExampleEventSubscriptionsClient_NewListGlobalByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListGlobalByResourceGroupForTopicType.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListGlobalByResourceGroupForTopicType.json func ExampleEventSubscriptionsClient_NewListGlobalByResourceGroupForTopicTypePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -257,7 +250,7 @@ func ExampleEventSubscriptionsClient_NewListGlobalByResourceGroupForTopicTypePag } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListRegionalBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListRegionalBySubscription.json func ExampleEventSubscriptionsClient_NewListRegionalBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -284,7 +277,7 @@ func ExampleEventSubscriptionsClient_NewListRegionalBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListRegionalByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListRegionalByResourceGroup.json func ExampleEventSubscriptionsClient_NewListRegionalByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -312,7 +305,7 @@ func ExampleEventSubscriptionsClient_NewListRegionalByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListRegionalBySubscriptionForTopicType.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListRegionalBySubscriptionForTopicType.json func ExampleEventSubscriptionsClient_NewListRegionalBySubscriptionForTopicTypePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -340,7 +333,7 @@ func ExampleEventSubscriptionsClient_NewListRegionalBySubscriptionForTopicTypePa } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListRegionalByResourceGroupForTopicType.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListRegionalByResourceGroupForTopicType.json func ExampleEventSubscriptionsClient_NewListRegionalByResourceGroupForTopicTypePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -369,7 +362,7 @@ func ExampleEventSubscriptionsClient_NewListRegionalByResourceGroupForTopicTypeP } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListByResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListByResource.json func ExampleEventSubscriptionsClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -399,7 +392,7 @@ func ExampleEventSubscriptionsClient_NewListByResourcePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_ListByDomainTopic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_ListByDomainTopic.json func ExampleEventSubscriptionsClient_NewListByDomainTopicPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -428,7 +421,7 @@ func ExampleEventSubscriptionsClient_NewListByDomainTopicPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/EventSubscriptions_GetDeliveryAttributes.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/EventSubscriptions_GetDeliveryAttributes.json func ExampleEventSubscriptionsClient_GetDeliveryAttributes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -440,8 +433,8 @@ func ExampleEventSubscriptionsClient_GetDeliveryAttributes() { log.Fatalf("failed to create client: %v", err) } res, err := client.GetDeliveryAttributes(ctx, - "aaaaaaaaaaaaaaaaaaaaaaaaa", - "aaaaaaaaaaaaaaaaaa", + "subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2", + "examplesubscription1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_extensiontopics_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_extensiontopics_client_test.go index 37858c7fda1b..ef4ea6697a40 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_extensiontopics_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_extensiontopics_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/ExtensionTopics_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/ExtensionTopics_Get.json func ExampleExtensionTopicsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_operations_client_test.go index 9a1658d95ecf..3fbbca64ded7 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Operations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerconfigurations_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerconfigurations_client_test.go new file mode 100644 index 000000000000..e91431d5c083 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerconfigurations_client_test.go @@ -0,0 +1,244 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_Get.json +func ExamplePartnerConfigurationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_CreateOrUpdate.json +func ExamplePartnerConfigurationsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "examplerg", + armeventgrid.PartnerConfiguration{ + Properties: &armeventgrid.PartnerConfigurationProperties{ + PartnerAuthorization: &armeventgrid.PartnerAuthorization{ + AuthorizedPartnersList: []*armeventgrid.Partner{ + { + AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t }()), + PartnerName: to.Ptr("Contoso.Finance"), + PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), + }, + { + AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-02-20T01:00:00.142Z"); return t }()), + PartnerName: to.Ptr("fabrikam.HR"), + PartnerRegistrationImmutableID: to.Ptr("5362bdb6-ce3e-4d0d-9a5b-3eb92c8aab38"), + }}, + DefaultMaximumExpirationTimeInDays: to.Ptr[int32](10), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_Delete.json +func ExamplePartnerConfigurationsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_Update.json +func ExamplePartnerConfigurationsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "examplerg", + armeventgrid.PartnerConfigurationUpdateParameters{ + Properties: &armeventgrid.PartnerConfigurationUpdateParameterProperties{ + DefaultMaximumExpirationTimeInDays: to.Ptr[int32](100), + }, + Tags: map[string]*string{ + "tag1": to.Ptr("value11"), + "tag2": to.Ptr("value22"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_ListByResourceGroup.json +func ExamplePartnerConfigurationsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager("examplerg", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_ListBySubscription.json +func ExamplePartnerConfigurationsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListBySubscriptionPager(&armeventgrid.PartnerConfigurationsClientListBySubscriptionOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_AuthorizePartner.json +func ExamplePartnerConfigurationsClient_AuthorizePartner() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.AuthorizePartner(ctx, + "examplerg", + armeventgrid.Partner{ + AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t }()), + PartnerName: to.Ptr("Contoso.Finance"), + PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerConfigurations_UnauthorizePartner.json +func ExamplePartnerConfigurationsClient_UnauthorizePartner() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerConfigurationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.UnauthorizePartner(ctx, + "examplerg", + armeventgrid.Partner{ + AuthorizationExpirationTimeInUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-28T01:20:55.142Z"); return t }()), + PartnerName: to.Ptr("Contoso.Finance"), + PartnerRegistrationImmutableID: to.Ptr("941892bc-f5d0-4d1c-8fb5-477570fc2b71"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerdestinations_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerdestinations_client_test.go new file mode 100644 index 000000000000..4a1050d2e044 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerdestinations_client_test.go @@ -0,0 +1,199 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerDestinations_Get.json +func ExamplePartnerDestinationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerDestinationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "examplePartnerDestinationName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerDestinations_CreateOrUpdate.json +func ExamplePartnerDestinationsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerDestinationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "examplerg", + "examplePartnerDestinationName1", + armeventgrid.PartnerDestination{ + Location: to.Ptr("westus2"), + Properties: &armeventgrid.PartnerDestinationProperties{ + EndpointBaseURL: to.Ptr("https://www.example/endpoint"), + EndpointServiceContext: to.Ptr("This is an example"), + ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-14T19:33:43.430Z"); return t }()), + MessageForActivation: to.Ptr("Sample Activation message"), + PartnerRegistrationImmutableID: to.Ptr("0bd70ee2-7d95-447e-ab1f-c4f320019404"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerDestinations_Delete.json +func ExamplePartnerDestinationsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerDestinationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "examplePartnerDestinationName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerDestinations_Update.json +func ExamplePartnerDestinationsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerDestinationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Update(ctx, + "examplerg", + "examplePartnerDestinationName1", + armeventgrid.PartnerDestinationUpdateParameters{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerDestinations_ListBySubscription.json +func ExamplePartnerDestinationsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerDestinationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListBySubscriptionPager(&armeventgrid.PartnerDestinationsClientListBySubscriptionOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerDestinations_ListByResourceGroup.json +func ExamplePartnerDestinationsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerDestinationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager("examplerg", + &armeventgrid.PartnerDestinationsClientListByResourceGroupOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerDestinations_Activate.json +func ExamplePartnerDestinationsClient_Activate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerDestinationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Activate(ctx, + "examplerg", + "examplePartnerDestination1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnernamespaces_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnernamespaces_client_test.go new file mode 100644 index 000000000000..00fc9b9f7d88 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnernamespaces_client_test.go @@ -0,0 +1,227 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_Get.json +func ExamplePartnerNamespacesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "examplePartnerNamespaceName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_CreateOrUpdate.json +func ExamplePartnerNamespacesClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "examplerg", + "examplePartnerNamespaceName1", + armeventgrid.PartnerNamespace{ + Location: to.Ptr("westus"), + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + Properties: &armeventgrid.PartnerNamespaceProperties{ + PartnerRegistrationFullyQualifiedID: to.Ptr("/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/partnerRegistrations/ContosoCorpAccount1"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_Delete.json +func ExamplePartnerNamespacesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "examplePartnerNamespaceName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_Update.json +func ExamplePartnerNamespacesClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "examplerg", + "examplePartnerNamespaceName1", + armeventgrid.PartnerNamespaceUpdateParameters{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_ListBySubscription.json +func ExamplePartnerNamespacesClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListBySubscriptionPager(&armeventgrid.PartnerNamespacesClientListBySubscriptionOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_ListByResourceGroup.json +func ExamplePartnerNamespacesClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager("examplerg", + &armeventgrid.PartnerNamespacesClientListByResourceGroupOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_ListSharedAccessKeys.json +func ExamplePartnerNamespacesClient_ListSharedAccessKeys() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.ListSharedAccessKeys(ctx, + "examplerg", + "examplePartnerNamespaceName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerNamespaces_RegenerateKey.json +func ExamplePartnerNamespacesClient_RegenerateKey() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerNamespacesClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.RegenerateKey(ctx, + "examplerg", + "examplePartnerNamespaceName1", + armeventgrid.PartnerNamespaceRegenerateKeyRequest{ + KeyName: to.Ptr("key1"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerregistrations_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerregistrations_client_test.go new file mode 100644 index 000000000000..a105d6fe97b9 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnerregistrations_client_test.go @@ -0,0 +1,189 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerRegistrations_Get.json +func ExamplePartnerRegistrationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerRegistrationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "examplePartnerRegistrationName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerRegistrations_CreateOrUpdate.json +func ExamplePartnerRegistrationsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerRegistrationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "examplerg", + "examplePartnerRegistrationName1", + armeventgrid.PartnerRegistration{ + Location: to.Ptr("global"), + Tags: map[string]*string{ + "key1": to.Ptr("value1"), + "key2": to.Ptr("Value2"), + "key3": to.Ptr("Value3"), + }, + Properties: &armeventgrid.PartnerRegistrationProperties{ + AuthorizedAzureSubscriptionIDs: []*string{ + to.Ptr("d48566a8-2428-4a6c-8347-9675d09fb851")}, + LogoURI: to.Ptr("https://www.example.com/logo.png"), + PartnerName: to.Ptr("ContosoCorp"), + PartnerResourceTypeDescription: to.Ptr("ContocoCorp Accounts Description Text"), + PartnerResourceTypeDisplayName: to.Ptr("ContocoCorp Accounts DisplayName Text"), + PartnerResourceTypeName: to.Ptr("ContosoCorp.Accounts"), + SetupURI: to.Ptr("https://www.example.com/setup.html"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerRegistrations_Delete.json +func ExamplePartnerRegistrationsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerRegistrationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "examplePartnerRegistrationName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerRegistrations_Update.json +func ExamplePartnerRegistrationsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerRegistrationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "examplerg", + "examplePartnerRegistrationName1", + armeventgrid.PartnerRegistrationUpdateParameters{ + LogoURI: to.Ptr("https://www.example.com/newlogo.png"), + SetupURI: to.Ptr("https://www.example.com/newsetup.html"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerRegistrations_ListBySubscription.json +func ExamplePartnerRegistrationsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerRegistrationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListBySubscriptionPager(&armeventgrid.PartnerRegistrationsClientListBySubscriptionOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerRegistrations_ListByResourceGroup.json +func ExamplePartnerRegistrationsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerRegistrationsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager("examplerg", + &armeventgrid.PartnerRegistrationsClientListByResourceGroupOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnertopiceventsubscriptions_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnertopiceventsubscriptions_client_test.go new file mode 100644 index 000000000000..05832780289f --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnertopiceventsubscriptions_client_test.go @@ -0,0 +1,200 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopicEventSubscriptions_Get.json +func ExamplePartnerTopicEventSubscriptionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "examplePartnerTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopicEventSubscriptions_CreateOrUpdate.json +func ExamplePartnerTopicEventSubscriptionsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "examplerg", + "examplePartnerTopic1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscription{ + Properties: &armeventgrid.EventSubscriptionProperties{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(false), + SubjectBeginsWith: to.Ptr("ExamplePrefix"), + SubjectEndsWith: to.Ptr("ExampleSuffix"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopicEventSubscriptions_Delete.json +func ExamplePartnerTopicEventSubscriptionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "examplePartnerTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopicEventSubscriptions_Update.json +func ExamplePartnerTopicEventSubscriptionsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "examplerg", + "examplePartnerTopic1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscriptionUpdateParameters{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(true), + SubjectBeginsWith: to.Ptr("existingPrefix"), + SubjectEndsWith: to.Ptr("newSuffix"), + }, + Labels: []*string{ + to.Ptr("label1"), + to.Ptr("label2")}, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopicEventSubscriptions_ListByPartnerTopic.json +func ExamplePartnerTopicEventSubscriptionsClient_NewListByPartnerTopicPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByPartnerTopicPager("examplerg", + "examplePartnerTopic1", + &armeventgrid.PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopicEventSubscriptions_GetDeliveryAttributes.json +func ExamplePartnerTopicEventSubscriptionsClient_GetDeliveryAttributes() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetDeliveryAttributes(ctx, + "examplerg", + "examplePartnerTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnertopics_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnertopics_client_test.go new file mode 100644 index 000000000000..e986737405e2 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_partnertopics_client_test.go @@ -0,0 +1,221 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_Get.json +func ExamplePartnerTopicsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "examplePartnerTopicName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_CreateOrUpdate.json +func ExamplePartnerTopicsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "examplerg", + "examplePartnerTopicName1", + armeventgrid.PartnerTopic{ + Location: to.Ptr("westus2"), + Properties: &armeventgrid.PartnerTopicProperties{ + ExpirationTimeIfNotActivatedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-03-23T23:06:13.109Z"); return t }()), + MessageForActivation: to.Ptr("Example message for activation"), + PartnerRegistrationImmutableID: to.Ptr("6f541064-031d-4cc8-9ec3-a3b4fc0f7185"), + PartnerTopicFriendlyDescription: to.Ptr("Example description"), + Source: to.Ptr("ContosoCorp.Accounts.User1"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_Delete.json +func ExamplePartnerTopicsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "examplePartnerTopicName1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_Update.json +func ExamplePartnerTopicsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Update(ctx, + "examplerg", + "examplePartnerTopicName1", + armeventgrid.PartnerTopicUpdateParameters{ + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_ListBySubscription.json +func ExamplePartnerTopicsClient_NewListBySubscriptionPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListBySubscriptionPager(&armeventgrid.PartnerTopicsClientListBySubscriptionOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_ListByResourceGroup.json +func ExamplePartnerTopicsClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager("examplerg", + &armeventgrid.PartnerTopicsClientListByResourceGroupOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_Activate.json +func ExamplePartnerTopicsClient_Activate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Activate(ctx, + "examplerg", + "examplePartnerTopic1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PartnerTopics_Deactivate.json +func ExamplePartnerTopicsClient_Deactivate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewPartnerTopicsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Deactivate(ctx, + "examplerg", + "examplePartnerTopic1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privateendpointconnections_client_test.go index 9086ccef4e3d..79e550a4c9be 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/PrivateEndpointConnections_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PrivateEndpointConnections_Get.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,7 +30,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { } res, err := client.Get(ctx, "examplerg", - armeventgrid.PrivateEndpointConnectionsParentTypeTopics, + armeventgrid.ParentTypeTopics, "exampletopic1", "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", nil) @@ -41,7 +41,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/PrivateEndpointConnections_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PrivateEndpointConnections_Update.json func ExamplePrivateEndpointConnectionsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -54,7 +54,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginUpdate() { } poller, err := client.BeginUpdate(ctx, "examplerg", - armeventgrid.PrivateEndpointConnectionsParentTypeTopics, + armeventgrid.ParentTypeTopics, "exampletopic1", "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", armeventgrid.PrivateEndpointConnection{ @@ -78,7 +78,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/PrivateEndpointConnections_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PrivateEndpointConnections_Delete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -91,7 +91,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { } poller, err := client.BeginDelete(ctx, "examplerg", - armeventgrid.PrivateEndpointConnectionsParentTypeTopics, + armeventgrid.ParentTypeTopics, "exampletopic1", "BMTPE5.8A30D251-4C61-489D-A1AA-B37C4A329B8B", nil) @@ -104,7 +104,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/PrivateEndpointConnections_ListByResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PrivateEndpointConnections_ListByResource.json func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { log.Fatalf("failed to create client: %v", err) } pager := client.NewListByResourcePager("examplerg", - armeventgrid.PrivateEndpointConnectionsParentTypeTopics, + armeventgrid.ParentTypeTopics, "exampletopic1", &armeventgrid.PrivateEndpointConnectionsClientListByResourceOptions{Filter: nil, Top: nil, diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privatelinkresources_client_test.go index 69924bfb1875..0a666a6fa3d2 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_privatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/PrivateLinkResources_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PrivateLinkResources_Get.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExamplePrivateLinkResourcesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/PrivateLinkResources_ListByResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/PrivateLinkResources_ListByResource.json func ExamplePrivateLinkResourcesClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopiceventsubscriptions_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopiceventsubscriptions_client_test.go index f2d82e32a603..bf5091f92de2 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopiceventsubscriptions_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopiceventsubscriptions_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopicEventSubscriptions_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopicEventSubscriptions_Get.json func ExampleSystemTopicEventSubscriptionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleSystemTopicEventSubscriptionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopicEventSubscriptions_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopicEventSubscriptions_CreateOrUpdate.json func ExampleSystemTopicEventSubscriptionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -80,7 +80,7 @@ func ExampleSystemTopicEventSubscriptionsClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopicEventSubscriptions_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopicEventSubscriptions_Delete.json func ExampleSystemTopicEventSubscriptionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,7 +105,7 @@ func ExampleSystemTopicEventSubscriptionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopicEventSubscriptions_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopicEventSubscriptions_Update.json func ExampleSystemTopicEventSubscriptionsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -146,7 +146,7 @@ func ExampleSystemTopicEventSubscriptionsClient_BeginUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopicEventSubscriptions_ListBySystemTopic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopicEventSubscriptions_ListBySystemTopic.json func ExampleSystemTopicEventSubscriptionsClient_NewListBySystemTopicPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +174,7 @@ func ExampleSystemTopicEventSubscriptionsClient_NewListBySystemTopicPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopicEventSubscriptions_GetDeliveryAttributes.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopicEventSubscriptions_GetDeliveryAttributes.json func ExampleSystemTopicEventSubscriptionsClient_GetDeliveryAttributes() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopics_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopics_client_test.go index 13be4c246319..f7c2b60b26a3 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopics_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_systemtopics_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopics_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopics_Get.json func ExampleSystemTopicsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleSystemTopicsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopics_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopics_CreateOrUpdate.json func ExampleSystemTopicsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,7 +76,7 @@ func ExampleSystemTopicsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopics_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopics_Delete.json func ExampleSystemTopicsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -100,7 +100,7 @@ func ExampleSystemTopicsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopics_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopics_Update.json func ExampleSystemTopicsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -132,7 +132,7 @@ func ExampleSystemTopicsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopics_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopics_ListBySubscription.json func ExampleSystemTopicsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -158,7 +158,7 @@ func ExampleSystemTopicsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/SystemTopics_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/SystemTopics_ListByResourceGroup.json func ExampleSystemTopicsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topiceventsubscriptions_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topiceventsubscriptions_client_test.go new file mode 100644 index 000000000000..e931c0fbe89f --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topiceventsubscriptions_client_test.go @@ -0,0 +1,200 @@ +//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 armeventgrid_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/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicEventSubscriptions_Get.json +func ExampleTopicEventSubscriptionsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "exampleTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicEventSubscriptions_CreateOrUpdate.json +func ExampleTopicEventSubscriptionsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "examplerg", + "exampleTopic1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscription{ + Properties: &armeventgrid.EventSubscriptionProperties{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(false), + SubjectBeginsWith: to.Ptr("ExamplePrefix"), + SubjectEndsWith: to.Ptr("ExampleSuffix"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicEventSubscriptions_Delete.json +func ExampleTopicEventSubscriptionsClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "examplerg", + "exampleTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicEventSubscriptions_Update.json +func ExampleTopicEventSubscriptionsClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "examplerg", + "exampleTopic1", + "exampleEventSubscriptionName1", + armeventgrid.EventSubscriptionUpdateParameters{ + Destination: &armeventgrid.WebHookEventSubscriptionDestination{ + EndpointType: to.Ptr(armeventgrid.EndpointTypeWebHook), + Properties: &armeventgrid.WebHookEventSubscriptionDestinationProperties{ + EndpointURL: to.Ptr("https://requestb.in/15ksip71"), + }, + }, + Filter: &armeventgrid.EventSubscriptionFilter{ + IsSubjectCaseSensitive: to.Ptr(true), + SubjectBeginsWith: to.Ptr("existingPrefix"), + SubjectEndsWith: to.Ptr("newSuffix"), + }, + Labels: []*string{ + to.Ptr("label1"), + to.Ptr("label2")}, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicEventSubscriptions_List.json +func ExampleTopicEventSubscriptionsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("examplerg", + "exampleTopic1", + &armeventgrid.TopicEventSubscriptionsClientListOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicEventSubscriptions_GetDeliveryAttributes.json +func ExampleTopicEventSubscriptionsClient_GetDeliveryAttributes() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewTopicEventSubscriptionsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetDeliveryAttributes(ctx, + "examplerg", + "exampleTopic1", + "examplesubscription1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topics_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topics_client_test.go index c79ab0467592..ba549703f209 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topics_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topics_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_Get.json func ExampleTopicsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleTopicsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_CreateOrUpdate.json func ExampleTopicsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleTopicsClient_BeginCreateOrUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_Delete.json func ExampleTopicsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleTopicsClient_BeginDelete() { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginDelete(ctx, - "examplerg", + "examplerg1", "exampletopic1", nil) if err != nil { @@ -106,7 +106,7 @@ func ExampleTopicsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_Update.json func ExampleTopicsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -148,7 +148,7 @@ func ExampleTopicsClient_BeginUpdate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_ListBySubscription.json func ExampleTopicsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +174,7 @@ func ExampleTopicsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_ListByResourceGroup.json func ExampleTopicsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -201,7 +201,7 @@ func ExampleTopicsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_ListSharedAccessKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_ListSharedAccessKeys.json func ExampleTopicsClient_ListSharedAccessKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -223,7 +223,7 @@ func ExampleTopicsClient_ListSharedAccessKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_RegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_RegenerateKey.json func ExampleTopicsClient_BeginRegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -252,7 +252,7 @@ func ExampleTopicsClient_BeginRegenerateKey() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/Topics_ListEventTypes.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/Topics_ListEventTypes.json func ExampleTopicsClient_NewListEventTypesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topictypes_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topictypes_client_test.go index f59c7c1b91fc..2c009e71effd 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topictypes_client_test.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_topictypes_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/TopicTypes_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicTypes_List.json func ExampleTopicTypesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleTopicTypesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/TopicTypes_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicTypes_Get.json func ExampleTopicTypesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleTopicTypesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/stable/2021-12-01/examples/TopicTypes_ListEventTypes.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/TopicTypes_ListEventTypes.json func ExampleTopicTypesClient_NewListEventTypesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_verifiedpartners_client_test.go b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_verifiedpartners_client_test.go new file mode 100644 index 000000000000..9192ddcb5de0 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/ze_generated_example_verifiedpartners_client_test.go @@ -0,0 +1,64 @@ +//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 armeventgrid_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventgrid/armeventgrid" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/VerifiedPartners_Get.json +func ExampleVerifiedPartnersClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewVerifiedPartnersClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "Contoso.Finance", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventgrid/resource-manager/Microsoft.EventGrid/preview/2021-10-15-preview/examples/VerifiedPartners_List.json +func ExampleVerifiedPartnersClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventgrid.NewVerifiedPartnersClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager(&armeventgrid.VerifiedPartnersClientListOptions{Filter: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_channels_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_channels_client.go new file mode 100644 index 000000000000..b27c4d2c4432 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_channels_client.go @@ -0,0 +1,435 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// ChannelsClient contains the methods for the Channels group. +// Don't use this type directly, use NewChannelsClient() instead. +type ChannelsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewChannelsClient creates a new instance of ChannelsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewChannelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ChannelsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &ChannelsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Synchronously creates or updates a new channel with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the partners subscription. +// partnerNamespaceName - Name of the partner namespace. +// channelName - Name of the channel. +// channelInfo - Channel information. +// options - ChannelsClientCreateOrUpdateOptions contains the optional parameters for the ChannelsClient.CreateOrUpdate method. +func (client *ChannelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, channelInfo Channel, options *ChannelsClientCreateOrUpdateOptions) (ChannelsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerNamespaceName, channelName, channelInfo, options) + if err != nil { + return ChannelsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ChannelsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ChannelsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ChannelsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, channelInfo Channel, options *ChannelsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if channelName == "" { + return nil, errors.New("parameter channelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, channelInfo) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ChannelsClient) createOrUpdateHandleResponse(resp *http.Response) (ChannelsClientCreateOrUpdateResponse, error) { + result := ChannelsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Channel); err != nil { + return ChannelsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Delete an existing channel. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the partners subscription. +// partnerNamespaceName - Name of the partner namespace. +// channelName - Name of the channel. +// options - ChannelsClientBeginDeleteOptions contains the optional parameters for the ChannelsClient.BeginDelete method. +func (client *ChannelsClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientBeginDeleteOptions) (*runtime.Poller[ChannelsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerNamespaceName, channelName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ChannelsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ChannelsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete an existing channel. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *ChannelsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerNamespaceName, channelName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ChannelsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if channelName == "" { + return nil, errors.New("parameter channelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of a channel. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the partners subscription. +// partnerNamespaceName - Name of the partner namespace. +// channelName - Name of the channel. +// options - ChannelsClientGetOptions contains the optional parameters for the ChannelsClient.Get method. +func (client *ChannelsClient) Get(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientGetOptions) (ChannelsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerNamespaceName, channelName, options) + if err != nil { + return ChannelsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ChannelsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ChannelsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ChannelsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if channelName == "" { + return nil, errors.New("parameter channelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ChannelsClient) getHandleResponse(resp *http.Response) (ChannelsClientGetResponse, error) { + result := ChannelsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Channel); err != nil { + return ChannelsClientGetResponse{}, err + } + return result, nil +} + +// GetFullURL - Get the full endpoint URL of a partner destination channel. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the partners subscription. +// partnerNamespaceName - Name of the partner namespace. +// channelName - Name of the Channel. +// options - ChannelsClientGetFullURLOptions contains the optional parameters for the ChannelsClient.GetFullURL method. +func (client *ChannelsClient) GetFullURL(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientGetFullURLOptions) (ChannelsClientGetFullURLResponse, error) { + req, err := client.getFullURLCreateRequest(ctx, resourceGroupName, partnerNamespaceName, channelName, options) + if err != nil { + return ChannelsClientGetFullURLResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ChannelsClientGetFullURLResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ChannelsClientGetFullURLResponse{}, runtime.NewResponseError(resp) + } + return client.getFullURLHandleResponse(resp) +} + +// getFullURLCreateRequest creates the GetFullURL request. +func (client *ChannelsClient) getFullURLCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, options *ChannelsClientGetFullURLOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}/getFullUrl" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if channelName == "" { + return nil, errors.New("parameter channelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getFullURLHandleResponse handles the GetFullURL response. +func (client *ChannelsClient) getFullURLHandleResponse(resp *http.Response) (ChannelsClientGetFullURLResponse, error) { + result := ChannelsClientGetFullURLResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionFullURL); err != nil { + return ChannelsClientGetFullURLResponse{}, err + } + return result, nil +} + +// NewListByPartnerNamespacePager - List all the channels in a partner namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the partners subscription. +// partnerNamespaceName - Name of the partner namespace. +// options - ChannelsClientListByPartnerNamespaceOptions contains the optional parameters for the ChannelsClient.ListByPartnerNamespace +// method. +func (client *ChannelsClient) NewListByPartnerNamespacePager(resourceGroupName string, partnerNamespaceName string, options *ChannelsClientListByPartnerNamespaceOptions) *runtime.Pager[ChannelsClientListByPartnerNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[ChannelsClientListByPartnerNamespaceResponse]{ + More: func(page ChannelsClientListByPartnerNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ChannelsClientListByPartnerNamespaceResponse) (ChannelsClientListByPartnerNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPartnerNamespaceCreateRequest(ctx, resourceGroupName, partnerNamespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ChannelsClientListByPartnerNamespaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ChannelsClientListByPartnerNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ChannelsClientListByPartnerNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByPartnerNamespaceHandleResponse(resp) + }, + }) +} + +// listByPartnerNamespaceCreateRequest creates the ListByPartnerNamespace request. +func (client *ChannelsClient) listByPartnerNamespaceCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *ChannelsClientListByPartnerNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPartnerNamespaceHandleResponse handles the ListByPartnerNamespace response. +func (client *ChannelsClient) listByPartnerNamespaceHandleResponse(resp *http.Response) (ChannelsClientListByPartnerNamespaceResponse, error) { + result := ChannelsClientListByPartnerNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ChannelsListResult); err != nil { + return ChannelsClientListByPartnerNamespaceResponse{}, err + } + return result, nil +} + +// Update - Synchronously updates a channel with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the partners subscription. +// partnerNamespaceName - Name of the partner namespace. +// channelName - Name of the channel. +// channelUpdateParameters - Channel update information. +// options - ChannelsClientUpdateOptions contains the optional parameters for the ChannelsClient.Update method. +func (client *ChannelsClient) Update(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, channelUpdateParameters ChannelUpdateParameters, options *ChannelsClientUpdateOptions) (ChannelsClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerNamespaceName, channelName, channelUpdateParameters, options) + if err != nil { + return ChannelsClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ChannelsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ChannelsClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return ChannelsClientUpdateResponse{}, nil +} + +// updateCreateRequest creates the Update request. +func (client *ChannelsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, channelName string, channelUpdateParameters ChannelUpdateParameters, options *ChannelsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/channels/{channelName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if channelName == "" { + return nil, errors.New("parameter channelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{channelName}", url.PathEscape(channelName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, channelUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_constants.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_constants.go index c5ce350f0549..c4506ce75e11 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_constants.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_constants.go @@ -10,7 +10,7 @@ package armeventgrid const ( moduleName = "armeventgrid" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // AdvancedFilterOperatorType - The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. @@ -63,6 +63,46 @@ func PossibleAdvancedFilterOperatorTypeValues() []AdvancedFilterOperatorType { } } +// ChannelProvisioningState - Provisioning state of the channel. +type ChannelProvisioningState string + +const ( + ChannelProvisioningStateCanceled ChannelProvisioningState = "Canceled" + ChannelProvisioningStateCreating ChannelProvisioningState = "Creating" + ChannelProvisioningStateDeleting ChannelProvisioningState = "Deleting" + ChannelProvisioningStateFailed ChannelProvisioningState = "Failed" + ChannelProvisioningStateSucceeded ChannelProvisioningState = "Succeeded" + ChannelProvisioningStateUpdating ChannelProvisioningState = "Updating" +) + +// PossibleChannelProvisioningStateValues returns the possible values for the ChannelProvisioningState const type. +func PossibleChannelProvisioningStateValues() []ChannelProvisioningState { + return []ChannelProvisioningState{ + ChannelProvisioningStateCanceled, + ChannelProvisioningStateCreating, + ChannelProvisioningStateDeleting, + ChannelProvisioningStateFailed, + ChannelProvisioningStateSucceeded, + ChannelProvisioningStateUpdating, + } +} + +// ChannelType - The type of the event channel which represents the direction flow of events. +type ChannelType string + +const ( + ChannelTypePartnerDestination ChannelType = "PartnerDestination" + ChannelTypePartnerTopic ChannelType = "PartnerTopic" +) + +// PossibleChannelTypeValues returns the possible values for the ChannelType const type. +func PossibleChannelTypeValues() []ChannelType { + return []ChannelType{ + ChannelTypePartnerDestination, + ChannelTypePartnerTopic, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -83,6 +123,22 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// DataResidencyBoundary - Data Residency Boundary of the resource. +type DataResidencyBoundary string + +const ( + DataResidencyBoundaryWithinGeopair DataResidencyBoundary = "WithinGeopair" + DataResidencyBoundaryWithinRegion DataResidencyBoundary = "WithinRegion" +) + +// PossibleDataResidencyBoundaryValues returns the possible values for the DataResidencyBoundary const type. +func PossibleDataResidencyBoundaryValues() []DataResidencyBoundary { + return []DataResidencyBoundary{ + DataResidencyBoundaryWithinGeopair, + DataResidencyBoundaryWithinRegion, + } +} + // DeadLetterEndPointType - Type of the endpoint for the dead letter destination type DeadLetterEndPointType string @@ -165,13 +221,14 @@ func PossibleDomainTopicProvisioningStateValues() []DomainTopicProvisioningState type EndpointType string const ( - EndpointTypeAzureFunction EndpointType = "AzureFunction" - EndpointTypeEventHub EndpointType = "EventHub" - EndpointTypeHybridConnection EndpointType = "HybridConnection" - EndpointTypeServiceBusQueue EndpointType = "ServiceBusQueue" - EndpointTypeServiceBusTopic EndpointType = "ServiceBusTopic" - EndpointTypeStorageQueue EndpointType = "StorageQueue" - EndpointTypeWebHook EndpointType = "WebHook" + EndpointTypeAzureFunction EndpointType = "AzureFunction" + EndpointTypeEventHub EndpointType = "EventHub" + EndpointTypeHybridConnection EndpointType = "HybridConnection" + EndpointTypePartnerDestination EndpointType = "PartnerDestination" + EndpointTypeServiceBusQueue EndpointType = "ServiceBusQueue" + EndpointTypeServiceBusTopic EndpointType = "ServiceBusTopic" + EndpointTypeStorageQueue EndpointType = "StorageQueue" + EndpointTypeWebHook EndpointType = "WebHook" ) // PossibleEndpointTypeValues returns the possible values for the EndpointType const type. @@ -180,6 +237,7 @@ func PossibleEndpointTypeValues() []EndpointType { EndpointTypeAzureFunction, EndpointTypeEventHub, EndpointTypeHybridConnection, + EndpointTypePartnerDestination, EndpointTypeServiceBusQueue, EndpointTypeServiceBusTopic, EndpointTypeStorageQueue, @@ -187,6 +245,44 @@ func PossibleEndpointTypeValues() []EndpointType { } } +// EventChannelProvisioningState - Provisioning state of the event channel. +type EventChannelProvisioningState string + +const ( + EventChannelProvisioningStateCanceled EventChannelProvisioningState = "Canceled" + EventChannelProvisioningStateCreating EventChannelProvisioningState = "Creating" + EventChannelProvisioningStateDeleting EventChannelProvisioningState = "Deleting" + EventChannelProvisioningStateFailed EventChannelProvisioningState = "Failed" + EventChannelProvisioningStateSucceeded EventChannelProvisioningState = "Succeeded" + EventChannelProvisioningStateUpdating EventChannelProvisioningState = "Updating" +) + +// PossibleEventChannelProvisioningStateValues returns the possible values for the EventChannelProvisioningState const type. +func PossibleEventChannelProvisioningStateValues() []EventChannelProvisioningState { + return []EventChannelProvisioningState{ + EventChannelProvisioningStateCanceled, + EventChannelProvisioningStateCreating, + EventChannelProvisioningStateDeleting, + EventChannelProvisioningStateFailed, + EventChannelProvisioningStateSucceeded, + EventChannelProvisioningStateUpdating, + } +} + +// EventDefinitionKind - The kind of event type used. +type EventDefinitionKind string + +const ( + EventDefinitionKindInline EventDefinitionKind = "Inline" +) + +// PossibleEventDefinitionKindValues returns the possible values for the EventDefinitionKind const type. +func PossibleEventDefinitionKindValues() []EventDefinitionKind { + return []EventDefinitionKind{ + EventDefinitionKindInline, + } +} + // EventDeliverySchema - The event delivery schema for the event subscription. type EventDeliverySchema string @@ -283,7 +379,8 @@ func PossibleIdentityTypeValues() []IdentityType { } } -// InputSchema - This determines the format that Event Grid should expect for incoming events published to the domain. +// InputSchema - This determines the format that Event Grid should expect for incoming events published to the Event Grid +// Domain Resource. type InputSchema string const ( @@ -315,6 +412,261 @@ func PossibleInputSchemaMappingTypeValues() []InputSchemaMappingType { } } +type ParentType string + +const ( + ParentTypeDomains ParentType = "domains" + ParentTypePartnerNamespaces ParentType = "partnerNamespaces" + ParentTypeTopics ParentType = "topics" +) + +// PossibleParentTypeValues returns the possible values for the ParentType const type. +func PossibleParentTypeValues() []ParentType { + return []ParentType{ + ParentTypeDomains, + ParentTypePartnerNamespaces, + ParentTypeTopics, + } +} + +// PartnerClientAuthenticationType - Type of client authentication +type PartnerClientAuthenticationType string + +const ( + PartnerClientAuthenticationTypeAzureAD PartnerClientAuthenticationType = "AzureAD" +) + +// PossiblePartnerClientAuthenticationTypeValues returns the possible values for the PartnerClientAuthenticationType const type. +func PossiblePartnerClientAuthenticationTypeValues() []PartnerClientAuthenticationType { + return []PartnerClientAuthenticationType{ + PartnerClientAuthenticationTypeAzureAD, + } +} + +// PartnerConfigurationProvisioningState - Provisioning state of the partner configuration. +type PartnerConfigurationProvisioningState string + +const ( + PartnerConfigurationProvisioningStateCanceled PartnerConfigurationProvisioningState = "Canceled" + PartnerConfigurationProvisioningStateCreating PartnerConfigurationProvisioningState = "Creating" + PartnerConfigurationProvisioningStateDeleting PartnerConfigurationProvisioningState = "Deleting" + PartnerConfigurationProvisioningStateFailed PartnerConfigurationProvisioningState = "Failed" + PartnerConfigurationProvisioningStateSucceeded PartnerConfigurationProvisioningState = "Succeeded" + PartnerConfigurationProvisioningStateUpdating PartnerConfigurationProvisioningState = "Updating" +) + +// PossiblePartnerConfigurationProvisioningStateValues returns the possible values for the PartnerConfigurationProvisioningState const type. +func PossiblePartnerConfigurationProvisioningStateValues() []PartnerConfigurationProvisioningState { + return []PartnerConfigurationProvisioningState{ + PartnerConfigurationProvisioningStateCanceled, + PartnerConfigurationProvisioningStateCreating, + PartnerConfigurationProvisioningStateDeleting, + PartnerConfigurationProvisioningStateFailed, + PartnerConfigurationProvisioningStateSucceeded, + PartnerConfigurationProvisioningStateUpdating, + } +} + +// PartnerDestinationActivationState - Activation state of the partner destination. +type PartnerDestinationActivationState string + +const ( + PartnerDestinationActivationStateActivated PartnerDestinationActivationState = "Activated" + PartnerDestinationActivationStateNeverActivated PartnerDestinationActivationState = "NeverActivated" +) + +// PossiblePartnerDestinationActivationStateValues returns the possible values for the PartnerDestinationActivationState const type. +func PossiblePartnerDestinationActivationStateValues() []PartnerDestinationActivationState { + return []PartnerDestinationActivationState{ + PartnerDestinationActivationStateActivated, + PartnerDestinationActivationStateNeverActivated, + } +} + +// PartnerDestinationProvisioningState - Provisioning state of the partner destination. +type PartnerDestinationProvisioningState string + +const ( + PartnerDestinationProvisioningStateCanceled PartnerDestinationProvisioningState = "Canceled" + PartnerDestinationProvisioningStateCreating PartnerDestinationProvisioningState = "Creating" + PartnerDestinationProvisioningStateDeleting PartnerDestinationProvisioningState = "Deleting" + PartnerDestinationProvisioningStateFailed PartnerDestinationProvisioningState = "Failed" + PartnerDestinationProvisioningStateSucceeded PartnerDestinationProvisioningState = "Succeeded" + PartnerDestinationProvisioningStateUpdating PartnerDestinationProvisioningState = "Updating" +) + +// PossiblePartnerDestinationProvisioningStateValues returns the possible values for the PartnerDestinationProvisioningState const type. +func PossiblePartnerDestinationProvisioningStateValues() []PartnerDestinationProvisioningState { + return []PartnerDestinationProvisioningState{ + PartnerDestinationProvisioningStateCanceled, + PartnerDestinationProvisioningStateCreating, + PartnerDestinationProvisioningStateDeleting, + PartnerDestinationProvisioningStateFailed, + PartnerDestinationProvisioningStateSucceeded, + PartnerDestinationProvisioningStateUpdating, + } +} + +// PartnerEndpointType - Type of the endpoint for the partner destination +type PartnerEndpointType string + +const ( + PartnerEndpointTypeWebHook PartnerEndpointType = "WebHook" +) + +// PossiblePartnerEndpointTypeValues returns the possible values for the PartnerEndpointType const type. +func PossiblePartnerEndpointTypeValues() []PartnerEndpointType { + return []PartnerEndpointType{ + PartnerEndpointTypeWebHook, + } +} + +// PartnerNamespaceProvisioningState - Provisioning state of the partner namespace. +type PartnerNamespaceProvisioningState string + +const ( + PartnerNamespaceProvisioningStateCanceled PartnerNamespaceProvisioningState = "Canceled" + PartnerNamespaceProvisioningStateCreating PartnerNamespaceProvisioningState = "Creating" + PartnerNamespaceProvisioningStateDeleting PartnerNamespaceProvisioningState = "Deleting" + PartnerNamespaceProvisioningStateFailed PartnerNamespaceProvisioningState = "Failed" + PartnerNamespaceProvisioningStateSucceeded PartnerNamespaceProvisioningState = "Succeeded" + PartnerNamespaceProvisioningStateUpdating PartnerNamespaceProvisioningState = "Updating" +) + +// PossiblePartnerNamespaceProvisioningStateValues returns the possible values for the PartnerNamespaceProvisioningState const type. +func PossiblePartnerNamespaceProvisioningStateValues() []PartnerNamespaceProvisioningState { + return []PartnerNamespaceProvisioningState{ + PartnerNamespaceProvisioningStateCanceled, + PartnerNamespaceProvisioningStateCreating, + PartnerNamespaceProvisioningStateDeleting, + PartnerNamespaceProvisioningStateFailed, + PartnerNamespaceProvisioningStateSucceeded, + PartnerNamespaceProvisioningStateUpdating, + } +} + +// PartnerRegistrationProvisioningState - Provisioning state of the partner registration. +type PartnerRegistrationProvisioningState string + +const ( + PartnerRegistrationProvisioningStateCanceled PartnerRegistrationProvisioningState = "Canceled" + PartnerRegistrationProvisioningStateCreating PartnerRegistrationProvisioningState = "Creating" + PartnerRegistrationProvisioningStateDeleting PartnerRegistrationProvisioningState = "Deleting" + PartnerRegistrationProvisioningStateFailed PartnerRegistrationProvisioningState = "Failed" + PartnerRegistrationProvisioningStateSucceeded PartnerRegistrationProvisioningState = "Succeeded" + PartnerRegistrationProvisioningStateUpdating PartnerRegistrationProvisioningState = "Updating" +) + +// PossiblePartnerRegistrationProvisioningStateValues returns the possible values for the PartnerRegistrationProvisioningState const type. +func PossiblePartnerRegistrationProvisioningStateValues() []PartnerRegistrationProvisioningState { + return []PartnerRegistrationProvisioningState{ + PartnerRegistrationProvisioningStateCanceled, + PartnerRegistrationProvisioningStateCreating, + PartnerRegistrationProvisioningStateDeleting, + PartnerRegistrationProvisioningStateFailed, + PartnerRegistrationProvisioningStateSucceeded, + PartnerRegistrationProvisioningStateUpdating, + } +} + +// PartnerRegistrationVisibilityState - Visibility state of the partner registration. +type PartnerRegistrationVisibilityState string + +const ( + PartnerRegistrationVisibilityStateGenerallyAvailable PartnerRegistrationVisibilityState = "GenerallyAvailable" + PartnerRegistrationVisibilityStateHidden PartnerRegistrationVisibilityState = "Hidden" + PartnerRegistrationVisibilityStatePublicPreview PartnerRegistrationVisibilityState = "PublicPreview" +) + +// PossiblePartnerRegistrationVisibilityStateValues returns the possible values for the PartnerRegistrationVisibilityState const type. +func PossiblePartnerRegistrationVisibilityStateValues() []PartnerRegistrationVisibilityState { + return []PartnerRegistrationVisibilityState{ + PartnerRegistrationVisibilityStateGenerallyAvailable, + PartnerRegistrationVisibilityStateHidden, + PartnerRegistrationVisibilityStatePublicPreview, + } +} + +// PartnerTopicActivationState - Activation state of the partner topic. +type PartnerTopicActivationState string + +const ( + PartnerTopicActivationStateActivated PartnerTopicActivationState = "Activated" + PartnerTopicActivationStateDeactivated PartnerTopicActivationState = "Deactivated" + PartnerTopicActivationStateNeverActivated PartnerTopicActivationState = "NeverActivated" +) + +// PossiblePartnerTopicActivationStateValues returns the possible values for the PartnerTopicActivationState const type. +func PossiblePartnerTopicActivationStateValues() []PartnerTopicActivationState { + return []PartnerTopicActivationState{ + PartnerTopicActivationStateActivated, + PartnerTopicActivationStateDeactivated, + PartnerTopicActivationStateNeverActivated, + } +} + +// PartnerTopicProvisioningState - Provisioning state of the partner topic. +type PartnerTopicProvisioningState string + +const ( + PartnerTopicProvisioningStateCanceled PartnerTopicProvisioningState = "Canceled" + PartnerTopicProvisioningStateCreating PartnerTopicProvisioningState = "Creating" + PartnerTopicProvisioningStateDeleting PartnerTopicProvisioningState = "Deleting" + PartnerTopicProvisioningStateFailed PartnerTopicProvisioningState = "Failed" + PartnerTopicProvisioningStateSucceeded PartnerTopicProvisioningState = "Succeeded" + PartnerTopicProvisioningStateUpdating PartnerTopicProvisioningState = "Updating" +) + +// PossiblePartnerTopicProvisioningStateValues returns the possible values for the PartnerTopicProvisioningState const type. +func PossiblePartnerTopicProvisioningStateValues() []PartnerTopicProvisioningState { + return []PartnerTopicProvisioningState{ + PartnerTopicProvisioningStateCanceled, + PartnerTopicProvisioningStateCreating, + PartnerTopicProvisioningStateDeleting, + PartnerTopicProvisioningStateFailed, + PartnerTopicProvisioningStateSucceeded, + PartnerTopicProvisioningStateUpdating, + } +} + +// PartnerTopicReadinessState - The readiness state of the corresponding partner topic. +type PartnerTopicReadinessState string + +const ( + PartnerTopicReadinessStateActivatedByUser PartnerTopicReadinessState = "ActivatedByUser" + PartnerTopicReadinessStateDeactivatedByUser PartnerTopicReadinessState = "DeactivatedByUser" + PartnerTopicReadinessStateDeletedByUser PartnerTopicReadinessState = "DeletedByUser" + PartnerTopicReadinessStateNotActivatedByUserYet PartnerTopicReadinessState = "NotActivatedByUserYet" +) + +// PossiblePartnerTopicReadinessStateValues returns the possible values for the PartnerTopicReadinessState const type. +func PossiblePartnerTopicReadinessStateValues() []PartnerTopicReadinessState { + return []PartnerTopicReadinessState{ + PartnerTopicReadinessStateActivatedByUser, + PartnerTopicReadinessStateDeactivatedByUser, + PartnerTopicReadinessStateDeletedByUser, + PartnerTopicReadinessStateNotActivatedByUserYet, + } +} + +// PartnerTopicRoutingMode - This determines if events published to this partner namespace should use the source attribute +// in the event payload or use the channel name in the header when matching to the partner topic. If none is +// specified, source attribute routing will be used to match the partner topic. +type PartnerTopicRoutingMode string + +const ( + PartnerTopicRoutingModeChannelNameHeader PartnerTopicRoutingMode = "ChannelNameHeader" + PartnerTopicRoutingModeSourceEventAttribute PartnerTopicRoutingMode = "SourceEventAttribute" +) + +// PossiblePartnerTopicRoutingModeValues returns the possible values for the PartnerTopicRoutingMode const type. +func PossiblePartnerTopicRoutingModeValues() []PartnerTopicRoutingMode { + return []PartnerTopicRoutingMode{ + PartnerTopicRoutingModeChannelNameHeader, + PartnerTopicRoutingModeSourceEventAttribute, + } +} + // PersistedConnectionStatus - Status of the connection. type PersistedConnectionStatus string @@ -335,21 +687,6 @@ func PossiblePersistedConnectionStatusValues() []PersistedConnectionStatus { } } -type PrivateEndpointConnectionsParentType string - -const ( - PrivateEndpointConnectionsParentTypeDomains PrivateEndpointConnectionsParentType = "domains" - PrivateEndpointConnectionsParentTypeTopics PrivateEndpointConnectionsParentType = "topics" -) - -// PossiblePrivateEndpointConnectionsParentTypeValues returns the possible values for the PrivateEndpointConnectionsParentType const type. -func PossiblePrivateEndpointConnectionsParentTypeValues() []PrivateEndpointConnectionsParentType { - return []PrivateEndpointConnectionsParentType{ - PrivateEndpointConnectionsParentTypeDomains, - PrivateEndpointConnectionsParentTypeTopics, - } -} - // PublicNetworkAccess - This determines if traffic is allowed over public network. By default it is enabled. You can further // restrict to specific IPs by configuring type PublicNetworkAccess string @@ -367,6 +704,38 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { } } +// ReadinessState - The readiness state of the corresponding partner topic. +type ReadinessState string + +const ( + ReadinessStateActivated ReadinessState = "Activated" + ReadinessStateNeverActivated ReadinessState = "NeverActivated" +) + +// PossibleReadinessStateValues returns the possible values for the ReadinessState const type. +func PossibleReadinessStateValues() []ReadinessState { + return []ReadinessState{ + ReadinessStateActivated, + ReadinessStateNeverActivated, + } +} + +// ResourceKind - Kind of the resource. +type ResourceKind string + +const ( + ResourceKindAzure ResourceKind = "Azure" + ResourceKindAzureArc ResourceKind = "AzureArc" +) + +// PossibleResourceKindValues returns the possible values for the ResourceKind const type. +func PossibleResourceKindValues() []ResourceKind { + return []ResourceKind{ + ResourceKindAzure, + ResourceKindAzureArc, + } +} + // ResourceProvisioningState - Provisioning state of the Private Endpoint Connection. type ResourceProvisioningState string @@ -407,6 +776,22 @@ func PossibleResourceRegionTypeValues() []ResourceRegionType { } } +// SKU - The Sku name of the resource. The possible values are: Basic or Premium. +type SKU string + +const ( + SKUBasic SKU = "Basic" + SKUPremium SKU = "Premium" +) + +// PossibleSKUValues returns the possible values for the SKU const type. +func PossibleSKUValues() []SKU { + return []SKU{ + SKUBasic, + SKUPremium, + } +} + // TopicProvisioningState - Provisioning state of the topic. type TopicProvisioningState string @@ -435,6 +820,7 @@ type TopicTypePropertiesSupportedScopesForSourceItem string const ( TopicTypePropertiesSupportedScopesForSourceItemAzureSubscription TopicTypePropertiesSupportedScopesForSourceItem = "AzureSubscription" + TopicTypePropertiesSupportedScopesForSourceItemManagementGroup TopicTypePropertiesSupportedScopesForSourceItem = "ManagementGroup" TopicTypePropertiesSupportedScopesForSourceItemResource TopicTypePropertiesSupportedScopesForSourceItem = "Resource" TopicTypePropertiesSupportedScopesForSourceItemResourceGroup TopicTypePropertiesSupportedScopesForSourceItem = "ResourceGroup" ) @@ -443,6 +829,7 @@ const ( func PossibleTopicTypePropertiesSupportedScopesForSourceItemValues() []TopicTypePropertiesSupportedScopesForSourceItem { return []TopicTypePropertiesSupportedScopesForSourceItem{ TopicTypePropertiesSupportedScopesForSourceItemAzureSubscription, + TopicTypePropertiesSupportedScopesForSourceItemManagementGroup, TopicTypePropertiesSupportedScopesForSourceItemResource, TopicTypePropertiesSupportedScopesForSourceItemResourceGroup, } @@ -471,3 +858,27 @@ func PossibleTopicTypeProvisioningStateValues() []TopicTypeProvisioningState { TopicTypeProvisioningStateUpdating, } } + +// VerifiedPartnerProvisioningState - Provisioning state of the verified partner. +type VerifiedPartnerProvisioningState string + +const ( + VerifiedPartnerProvisioningStateCanceled VerifiedPartnerProvisioningState = "Canceled" + VerifiedPartnerProvisioningStateCreating VerifiedPartnerProvisioningState = "Creating" + VerifiedPartnerProvisioningStateDeleting VerifiedPartnerProvisioningState = "Deleting" + VerifiedPartnerProvisioningStateFailed VerifiedPartnerProvisioningState = "Failed" + VerifiedPartnerProvisioningStateSucceeded VerifiedPartnerProvisioningState = "Succeeded" + VerifiedPartnerProvisioningStateUpdating VerifiedPartnerProvisioningState = "Updating" +) + +// PossibleVerifiedPartnerProvisioningStateValues returns the possible values for the VerifiedPartnerProvisioningState const type. +func PossibleVerifiedPartnerProvisioningStateValues() []VerifiedPartnerProvisioningState { + return []VerifiedPartnerProvisioningState{ + VerifiedPartnerProvisioningStateCanceled, + VerifiedPartnerProvisioningStateCreating, + VerifiedPartnerProvisioningStateDeleting, + VerifiedPartnerProvisioningStateFailed, + VerifiedPartnerProvisioningStateSucceeded, + VerifiedPartnerProvisioningStateUpdating, + } +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaineventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaineventsubscriptions_client.go new file mode 100644 index 000000000000..184318aa62b7 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaineventsubscriptions_client.go @@ -0,0 +1,527 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// DomainEventSubscriptionsClient contains the methods for the DomainEventSubscriptions group. +// Don't use this type directly, use NewDomainEventSubscriptionsClient() instead. +type DomainEventSubscriptionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDomainEventSubscriptionsClient creates a new instance of DomainEventSubscriptionsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewDomainEventSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DomainEventSubscriptionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &DomainEventSubscriptionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// eventSubscriptionInfo - Event subscription properties containing the destination and filter information. +// options - DomainEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainEventSubscriptionsClient.BeginCreateOrUpdate +// method. +func (client *DomainEventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainEventSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DomainEventSubscriptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, domainName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DomainEventSubscriptionsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DomainEventSubscriptionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *DomainEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DomainEventSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainEventSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) +} + +// BeginDelete - Delete an existing event subscription for a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the domain. +// eventSubscriptionName - Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - DomainEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the DomainEventSubscriptionsClient.BeginDelete +// method. +func (client *DomainEventSubscriptionsClient) BeginDelete(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[DomainEventSubscriptionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, domainName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DomainEventSubscriptionsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DomainEventSubscriptionsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete an existing event subscription for a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *DomainEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DomainEventSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of an event subscription of a domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be found. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - DomainEventSubscriptionsClientGetOptions contains the optional parameters for the DomainEventSubscriptionsClient.Get +// method. +func (client *DomainEventSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientGetOptions) (DomainEventSubscriptionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, options) + if err != nil { + return DomainEventSubscriptionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainEventSubscriptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainEventSubscriptionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DomainEventSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DomainEventSubscriptionsClient) getHandleResponse(resp *http.Response) (DomainEventSubscriptionsClientGetResponse, error) { + result := DomainEventSubscriptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscription); err != nil { + return DomainEventSubscriptionsClientGetResponse{}, err + } + return result, nil +} + +// GetDeliveryAttributes - Get all delivery attributes for an event subscription for domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription. +// options - DomainEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the DomainEventSubscriptionsClient.GetDeliveryAttributes +// method. +func (client *DomainEventSubscriptionsClient) GetDeliveryAttributes(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientGetDeliveryAttributesOptions) (DomainEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + req, err := client.getDeliveryAttributesCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, options) + if err != nil { + return DomainEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainEventSubscriptionsClientGetDeliveryAttributesResponse{}, runtime.NewResponseError(resp) + } + return client.getDeliveryAttributesHandleResponse(resp) +} + +// getDeliveryAttributesCreateRequest creates the GetDeliveryAttributes request. +func (client *DomainEventSubscriptionsClient) getDeliveryAttributesCreateRequest(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientGetDeliveryAttributesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getDeliveryAttributesHandleResponse handles the GetDeliveryAttributes response. +func (client *DomainEventSubscriptionsClient) getDeliveryAttributesHandleResponse(resp *http.Response) (DomainEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + result := DomainEventSubscriptionsClientGetDeliveryAttributesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeliveryAttributeListResult); err != nil { + return DomainEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + return result, nil +} + +// GetFullURL - Get the full endpoint URL for an event subscription for domain. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription. +// options - DomainEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the DomainEventSubscriptionsClient.GetFullURL +// method. +func (client *DomainEventSubscriptionsClient) GetFullURL(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientGetFullURLOptions) (DomainEventSubscriptionsClientGetFullURLResponse, error) { + req, err := client.getFullURLCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, options) + if err != nil { + return DomainEventSubscriptionsClientGetFullURLResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainEventSubscriptionsClientGetFullURLResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainEventSubscriptionsClientGetFullURLResponse{}, runtime.NewResponseError(resp) + } + return client.getFullURLHandleResponse(resp) +} + +// getFullURLCreateRequest creates the GetFullURL request. +func (client *DomainEventSubscriptionsClient) getFullURLCreateRequest(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, options *DomainEventSubscriptionsClientGetFullURLOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getFullURLHandleResponse handles the GetFullURL response. +func (client *DomainEventSubscriptionsClient) getFullURLHandleResponse(resp *http.Response) (DomainEventSubscriptionsClientGetFullURLResponse, error) { + result := DomainEventSubscriptionsClientGetFullURLResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionFullURL); err != nil { + return DomainEventSubscriptionsClientGetFullURLResponse{}, err + } + return result, nil +} + +// NewListPager - List all event subscriptions that have been created for a specific topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the domain. +// options - DomainEventSubscriptionsClientListOptions contains the optional parameters for the DomainEventSubscriptionsClient.List +// method. +func (client *DomainEventSubscriptionsClient) NewListPager(resourceGroupName string, domainName string, options *DomainEventSubscriptionsClientListOptions) *runtime.Pager[DomainEventSubscriptionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DomainEventSubscriptionsClientListResponse]{ + More: func(page DomainEventSubscriptionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DomainEventSubscriptionsClientListResponse) (DomainEventSubscriptionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, domainName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DomainEventSubscriptionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainEventSubscriptionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainEventSubscriptionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DomainEventSubscriptionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, domainName string, options *DomainEventSubscriptionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DomainEventSubscriptionsClient) listHandleResponse(resp *http.Response) (DomainEventSubscriptionsClientListResponse, error) { + result := DomainEventSubscriptionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionsListResult); err != nil { + return DomainEventSubscriptionsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update an existing event subscription for a topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the domain. +// eventSubscriptionName - Name of the event subscription to be updated. +// eventSubscriptionUpdateParameters - Updated event subscription information. +// options - DomainEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the DomainEventSubscriptionsClient.BeginUpdate +// method. +func (client *DomainEventSubscriptionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainEventSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[DomainEventSubscriptionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, domainName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DomainEventSubscriptionsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DomainEventSubscriptionsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update an existing event subscription for a topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *DomainEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *DomainEventSubscriptionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainEventSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domains_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domains_client.go index 6d5baab8212a..555e91b763ae 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domains_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domains_client.go @@ -58,7 +58,7 @@ func NewDomainsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Asynchronously creates or updates a new domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // domainInfo - Domain information. @@ -78,7 +78,7 @@ func (client *DomainsClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Asynchronously creates or updates a new domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *DomainsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domainInfo Domain, options *DomainsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, domainInfo, options) if err != nil { @@ -114,7 +114,7 @@ func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainInfo) @@ -122,7 +122,7 @@ func (client *DomainsClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Delete existing domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // options - DomainsClientBeginDeleteOptions contains the optional parameters for the DomainsClient.BeginDelete method. @@ -140,7 +140,7 @@ func (client *DomainsClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete existing domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *DomainsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, options *DomainsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, options) if err != nil { @@ -176,14 +176,14 @@ func (client *DomainsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get properties of a domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // options - DomainsClientGetOptions contains the optional parameters for the DomainsClient.Get method. @@ -222,7 +222,7 @@ func (client *DomainsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +239,7 @@ func (client *DomainsClient) getHandleResponse(resp *http.Response) (DomainsClie // NewListByResourceGroupPager - List all the domains under a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // options - DomainsClientListByResourceGroupOptions contains the optional parameters for the DomainsClient.ListByResourceGroup // method. @@ -287,7 +287,7 @@ func (client *DomainsClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -310,7 +310,7 @@ func (client *DomainsClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListBySubscriptionPager - List all the domains under an Azure subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // options - DomainsClientListBySubscriptionOptions contains the optional parameters for the DomainsClient.ListBySubscription // method. func (client *DomainsClient) NewListBySubscriptionPager(options *DomainsClientListBySubscriptionOptions) *runtime.Pager[DomainsClientListBySubscriptionResponse] { @@ -353,7 +353,7 @@ func (client *DomainsClient) listBySubscriptionCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -376,7 +376,7 @@ func (client *DomainsClient) listBySubscriptionHandleResponse(resp *http.Respons // ListSharedAccessKeys - List the two keys used to publish to a domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // options - DomainsClientListSharedAccessKeysOptions contains the optional parameters for the DomainsClient.ListSharedAccessKeys @@ -416,7 +416,7 @@ func (client *DomainsClient) listSharedAccessKeysCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -433,7 +433,7 @@ func (client *DomainsClient) listSharedAccessKeysHandleResponse(resp *http.Respo // RegenerateKey - Regenerate a shared access key for a domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // regenerateKeyRequest - Request body to regenerate key. @@ -473,7 +473,7 @@ func (client *DomainsClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) @@ -490,7 +490,7 @@ func (client *DomainsClient) regenerateKeyHandleResponse(resp *http.Response) (D // BeginUpdate - Asynchronously updates a domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // domainUpdateParameters - Domain update information. @@ -509,7 +509,7 @@ func (client *DomainsClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Asynchronously updates a domain with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *DomainsClient) update(ctx context.Context, resourceGroupName string, domainName string, domainUpdateParameters DomainUpdateParameters, options *DomainsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, domainUpdateParameters, options) if err != nil { @@ -545,7 +545,7 @@ func (client *DomainsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, domainUpdateParameters) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaintopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaintopiceventsubscriptions_client.go new file mode 100644 index 000000000000..603d4dcb801d --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaintopiceventsubscriptions_client.go @@ -0,0 +1,561 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// DomainTopicEventSubscriptionsClient contains the methods for the DomainTopicEventSubscriptions group. +// Don't use this type directly, use NewDomainTopicEventSubscriptionsClient() instead. +type DomainTopicEventSubscriptionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDomainTopicEventSubscriptionsClient creates a new instance of DomainTopicEventSubscriptionsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewDomainTopicEventSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DomainTopicEventSubscriptionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &DomainTopicEventSubscriptionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the top level domain. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// eventSubscriptionInfo - Event subscription properties containing the destination and filter information. +// options - DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +func (client *DomainTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DomainTopicEventSubscriptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DomainTopicEventSubscriptionsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DomainTopicEventSubscriptionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *DomainTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DomainTopicEventSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) +} + +// BeginDelete - Delete a nested existing event subscription for a domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the top level domain. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - DomainTopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.BeginDelete +// method. +func (client *DomainTopicEventSubscriptionsClient) BeginDelete(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[DomainTopicEventSubscriptionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DomainTopicEventSubscriptionsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DomainTopicEventSubscriptionsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete a nested existing event subscription for a domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *DomainTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DomainTopicEventSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of a nested event subscription for a domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the top level domain. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription. +// options - DomainTopicEventSubscriptionsClientGetOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.Get +// method. +func (client *DomainTopicEventSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientGetOptions) (DomainTopicEventSubscriptionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, options) + if err != nil { + return DomainTopicEventSubscriptionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainTopicEventSubscriptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainTopicEventSubscriptionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DomainTopicEventSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DomainTopicEventSubscriptionsClient) getHandleResponse(resp *http.Response) (DomainTopicEventSubscriptionsClientGetResponse, error) { + result := DomainTopicEventSubscriptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscription); err != nil { + return DomainTopicEventSubscriptionsClientGetResponse{}, err + } + return result, nil +} + +// GetDeliveryAttributes - Get all delivery attributes for an event subscription for domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the top level domain. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription. +// options - DomainTopicEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.GetDeliveryAttributes +// method. +func (client *DomainTopicEventSubscriptionsClient) GetDeliveryAttributes(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientGetDeliveryAttributesOptions) (DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + req, err := client.getDeliveryAttributesCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, options) + if err != nil { + return DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, runtime.NewResponseError(resp) + } + return client.getDeliveryAttributesHandleResponse(resp) +} + +// getDeliveryAttributesCreateRequest creates the GetDeliveryAttributes request. +func (client *DomainTopicEventSubscriptionsClient) getDeliveryAttributesCreateRequest(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientGetDeliveryAttributesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getDeliveryAttributesHandleResponse handles the GetDeliveryAttributes response. +func (client *DomainTopicEventSubscriptionsClient) getDeliveryAttributesHandleResponse(resp *http.Response) (DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + result := DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeliveryAttributeListResult); err != nil { + return DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + return result, nil +} + +// GetFullURL - Get the full endpoint URL for a nested event subscription for domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the top level domain. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription. +// options - DomainTopicEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.GetFullURL +// method. +func (client *DomainTopicEventSubscriptionsClient) GetFullURL(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientGetFullURLOptions) (DomainTopicEventSubscriptionsClientGetFullURLResponse, error) { + req, err := client.getFullURLCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, options) + if err != nil { + return DomainTopicEventSubscriptionsClientGetFullURLResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainTopicEventSubscriptionsClientGetFullURLResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainTopicEventSubscriptionsClientGetFullURLResponse{}, runtime.NewResponseError(resp) + } + return client.getFullURLHandleResponse(resp) +} + +// getFullURLCreateRequest creates the GetFullURL request. +func (client *DomainTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, options *DomainTopicEventSubscriptionsClientGetFullURLOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getFullURLHandleResponse handles the GetFullURL response. +func (client *DomainTopicEventSubscriptionsClient) getFullURLHandleResponse(resp *http.Response) (DomainTopicEventSubscriptionsClientGetFullURLResponse, error) { + result := DomainTopicEventSubscriptionsClientGetFullURLResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionFullURL); err != nil { + return DomainTopicEventSubscriptionsClientGetFullURLResponse{}, err + } + return result, nil +} + +// NewListPager - List all event subscriptions that have been created for a specific domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the top level domain. +// topicName - Name of the domain topic. +// options - DomainTopicEventSubscriptionsClientListOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.List +// method. +func (client *DomainTopicEventSubscriptionsClient) NewListPager(resourceGroupName string, domainName string, topicName string, options *DomainTopicEventSubscriptionsClientListOptions) *runtime.Pager[DomainTopicEventSubscriptionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DomainTopicEventSubscriptionsClientListResponse]{ + More: func(page DomainTopicEventSubscriptionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DomainTopicEventSubscriptionsClientListResponse) (DomainTopicEventSubscriptionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, domainName, topicName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DomainTopicEventSubscriptionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainTopicEventSubscriptionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainTopicEventSubscriptionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DomainTopicEventSubscriptionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, domainName string, topicName string, options *DomainTopicEventSubscriptionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DomainTopicEventSubscriptionsClient) listHandleResponse(resp *http.Response) (DomainTopicEventSubscriptionsClientListResponse, error) { + result := DomainTopicEventSubscriptionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionsListResult); err != nil { + return DomainTopicEventSubscriptionsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update an existing event subscription for a domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// domainName - Name of the domain. +// topicName - Name of the topic. +// eventSubscriptionName - Name of the event subscription to be updated. +// eventSubscriptionUpdateParameters - Updated event subscription information. +// options - DomainTopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.BeginUpdate +// method. +func (client *DomainTopicEventSubscriptionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainTopicEventSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[DomainTopicEventSubscriptionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DomainTopicEventSubscriptionsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DomainTopicEventSubscriptionsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update an existing event subscription for a domain topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *DomainTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, domainName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *DomainTopicEventSubscriptionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, domainName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *DomainTopicEventSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/domains/{domainName}/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 domainName == "" { + return nil, errors.New("parameter domainName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{domainName}", url.PathEscape(domainName)) + if topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaintopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaintopics_client.go index 665e10f8d2e9..ca76f3ee0640 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaintopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_domaintopics_client.go @@ -58,7 +58,7 @@ func NewDomainTopicsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Asynchronously creates or updates a new domain topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // domainTopicName - Name of the domain topic. @@ -78,7 +78,7 @@ func (client *DomainTopicsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Asynchronously creates or updates a new domain topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *DomainTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domainTopicName string, options *DomainTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, domainName, domainTopicName, options) if err != nil { @@ -118,7 +118,7 @@ func (client *DomainTopicsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *DomainTopicsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete existing domain topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // domainTopicName - Name of the domain topic. @@ -146,7 +146,7 @@ func (client *DomainTopicsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete existing domain topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *DomainTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, domainName string, domainTopicName string, options *DomainTopicsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, domainName, domainTopicName, options) if err != nil { @@ -186,14 +186,14 @@ func (client *DomainTopicsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get properties of a domain topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the domain. // domainTopicName - Name of the topic. @@ -237,7 +237,7 @@ func (client *DomainTopicsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *DomainTopicsClient) getHandleResponse(resp *http.Response) (Domain // NewListByDomainPager - List all the topics in a domain. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Domain name. // options - DomainTopicsClientListByDomainOptions contains the optional parameters for the DomainTopicsClient.ListByDomain @@ -307,7 +307,7 @@ func (client *DomainTopicsClient) listByDomainCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_eventchannels_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_eventchannels_client.go new file mode 100644 index 000000000000..4e83f93a1353 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_eventchannels_client.go @@ -0,0 +1,324 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// EventChannelsClient contains the methods for the EventChannels group. +// Don't use this type directly, use NewEventChannelsClient() instead. +type EventChannelsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEventChannelsClient creates a new instance of EventChannelsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewEventChannelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EventChannelsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &EventChannelsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Asynchronously creates a new event channel with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// eventChannelName - Name of the event channel. +// eventChannelInfo - EventChannel information. +// options - EventChannelsClientCreateOrUpdateOptions contains the optional parameters for the EventChannelsClient.CreateOrUpdate +// method. +func (client *EventChannelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, partnerNamespaceName string, eventChannelName string, eventChannelInfo EventChannel, options *EventChannelsClientCreateOrUpdateOptions) (EventChannelsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerNamespaceName, eventChannelName, eventChannelInfo, options) + if err != nil { + return EventChannelsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EventChannelsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EventChannelsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *EventChannelsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, eventChannelName string, eventChannelInfo EventChannel, options *EventChannelsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if eventChannelName == "" { + return nil, errors.New("parameter eventChannelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventChannelName}", url.PathEscape(eventChannelName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventChannelInfo) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *EventChannelsClient) createOrUpdateHandleResponse(resp *http.Response) (EventChannelsClientCreateOrUpdateResponse, error) { + result := EventChannelsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventChannel); err != nil { + return EventChannelsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Delete existing event channel. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// eventChannelName - Name of the event channel. +// options - EventChannelsClientBeginDeleteOptions contains the optional parameters for the EventChannelsClient.BeginDelete +// method. +func (client *EventChannelsClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerNamespaceName string, eventChannelName string, options *EventChannelsClientBeginDeleteOptions) (*runtime.Poller[EventChannelsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerNamespaceName, eventChannelName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[EventChannelsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[EventChannelsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete existing event channel. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *EventChannelsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerNamespaceName string, eventChannelName string, options *EventChannelsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerNamespaceName, eventChannelName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *EventChannelsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, eventChannelName string, options *EventChannelsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if eventChannelName == "" { + return nil, errors.New("parameter eventChannelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventChannelName}", url.PathEscape(eventChannelName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of an event channel. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// eventChannelName - Name of the event channel. +// options - EventChannelsClientGetOptions contains the optional parameters for the EventChannelsClient.Get method. +func (client *EventChannelsClient) Get(ctx context.Context, resourceGroupName string, partnerNamespaceName string, eventChannelName string, options *EventChannelsClientGetOptions) (EventChannelsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerNamespaceName, eventChannelName, options) + if err != nil { + return EventChannelsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EventChannelsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EventChannelsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *EventChannelsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, eventChannelName string, options *EventChannelsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels/{eventChannelName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + if eventChannelName == "" { + return nil, errors.New("parameter eventChannelName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventChannelName}", url.PathEscape(eventChannelName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *EventChannelsClient) getHandleResponse(resp *http.Response) (EventChannelsClientGetResponse, error) { + result := EventChannelsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventChannel); err != nil { + return EventChannelsClientGetResponse{}, err + } + return result, nil +} + +// NewListByPartnerNamespacePager - List all the event channels in a partner namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// options - EventChannelsClientListByPartnerNamespaceOptions contains the optional parameters for the EventChannelsClient.ListByPartnerNamespace +// method. +func (client *EventChannelsClient) NewListByPartnerNamespacePager(resourceGroupName string, partnerNamespaceName string, options *EventChannelsClientListByPartnerNamespaceOptions) *runtime.Pager[EventChannelsClientListByPartnerNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[EventChannelsClientListByPartnerNamespaceResponse]{ + More: func(page EventChannelsClientListByPartnerNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *EventChannelsClientListByPartnerNamespaceResponse) (EventChannelsClientListByPartnerNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPartnerNamespaceCreateRequest(ctx, resourceGroupName, partnerNamespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return EventChannelsClientListByPartnerNamespaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EventChannelsClientListByPartnerNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EventChannelsClientListByPartnerNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByPartnerNamespaceHandleResponse(resp) + }, + }) +} + +// listByPartnerNamespaceCreateRequest creates the ListByPartnerNamespace request. +func (client *EventChannelsClient) listByPartnerNamespaceCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *EventChannelsClientListByPartnerNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/eventChannels" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPartnerNamespaceHandleResponse handles the ListByPartnerNamespace response. +func (client *EventChannelsClient) listByPartnerNamespaceHandleResponse(resp *http.Response) (EventChannelsClientListByPartnerNamespaceResponse, error) { + result := EventChannelsClientListByPartnerNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventChannelsListResult); err != nil { + return EventChannelsClientListByPartnerNamespaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_eventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_eventsubscriptions_client.go index 40d1cd2eb0d7..cb744da97125 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_eventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_eventsubscriptions_client.go @@ -59,7 +59,7 @@ func NewEventSubscriptionsClient(subscriptionID string, credential azcore.TokenC // BeginCreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription based on // the specified scope. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // scope - The identifier of the resource to which the event subscription needs to be created or updated. The scope can be // a subscription, or a resource group, or a top level resource belonging to a resource // provider namespace, or an EventGrid topic. For example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -88,7 +88,7 @@ func (client *EventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription based on the // specified scope. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *EventSubscriptionsClient) createOrUpdate(ctx context.Context, scope string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *EventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, scope, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -117,7 +117,7 @@ func (client *EventSubscriptionsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) @@ -125,7 +125,7 @@ func (client *EventSubscriptionsClient) createOrUpdateCreateRequest(ctx context. // BeginDelete - Delete an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -151,7 +151,7 @@ func (client *EventSubscriptionsClient) BeginDelete(ctx context.Context, scope s // Delete - Delete an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *EventSubscriptionsClient) deleteOperation(ctx context.Context, scope string, eventSubscriptionName string, options *EventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, scope, eventSubscriptionName, options) if err != nil { @@ -180,14 +180,14 @@ func (client *EventSubscriptionsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get properties of an event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -226,7 +226,7 @@ func (client *EventSubscriptionsClient) getCreateRequest(ctx context.Context, sc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -243,7 +243,7 @@ func (client *EventSubscriptionsClient) getHandleResponse(resp *http.Response) ( // GetDeliveryAttributes - Get all delivery attributes for an event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -283,7 +283,7 @@ func (client *EventSubscriptionsClient) getDeliveryAttributesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,7 @@ func (client *EventSubscriptionsClient) getDeliveryAttributesHandleResponse(resp // GetFullURL - Get the full endpoint URL for an event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // scope - The scope of the event subscription. The scope can be a subscription, or a resource group, or a top level resource // belonging to a resource provider namespace, or an EventGrid topic. For example, use // '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -340,7 +340,7 @@ func (client *EventSubscriptionsClient) getFullURLCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -357,7 +357,7 @@ func (client *EventSubscriptionsClient) getFullURLHandleResponse(resp *http.Resp // NewListByDomainTopicPager - List all event subscriptions that have been created for a specific domain topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // domainName - Name of the top level domain. // topicName - Name of the domain topic. @@ -415,7 +415,7 @@ func (client *EventSubscriptionsClient) listByDomainTopicCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -436,9 +436,9 @@ func (client *EventSubscriptionsClient) listByDomainTopicHandleResponse(resp *ht return result, nil } -// NewListByResourcePager - List all event subscriptions that have been created for a specific topic. +// NewListByResourcePager - List all event subscriptions that have been created for a specific resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // providerNamespace - Namespace of the provider of the topic. // resourceTypeName - Name of the resource type. @@ -501,7 +501,7 @@ func (client *EventSubscriptionsClient) listByResourceCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -525,7 +525,7 @@ func (client *EventSubscriptionsClient) listByResourceHandleResponse(resp *http. // NewListGlobalByResourceGroupPager - List all global event subscriptions under a specific Azure subscription and resource // group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // options - EventSubscriptionsClientListGlobalByResourceGroupOptions contains the optional parameters for the EventSubscriptionsClient.ListGlobalByResourceGroup // method. @@ -573,7 +573,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -597,7 +597,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupHandleResponse( // NewListGlobalByResourceGroupForTopicTypePager - List all global event subscriptions under a resource group for a specific // topic type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // topicTypeName - Name of the topic type. // options - EventSubscriptionsClientListGlobalByResourceGroupForTopicTypeOptions contains the optional parameters for the @@ -650,7 +650,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupForTopicTypeCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -673,7 +673,7 @@ func (client *EventSubscriptionsClient) listGlobalByResourceGroupForTopicTypeHan // NewListGlobalBySubscriptionPager - List all aggregated global event subscriptions under a specific Azure subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // options - EventSubscriptionsClientListGlobalBySubscriptionOptions contains the optional parameters for the EventSubscriptionsClient.ListGlobalBySubscription // method. func (client *EventSubscriptionsClient) NewListGlobalBySubscriptionPager(options *EventSubscriptionsClientListGlobalBySubscriptionOptions) *runtime.Pager[EventSubscriptionsClientListGlobalBySubscriptionResponse] { @@ -716,7 +716,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -740,7 +740,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionHandleResponse(r // NewListGlobalBySubscriptionForTopicTypePager - List all global event subscriptions under an Azure subscription for a topic // type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // topicTypeName - Name of the topic type. // options - EventSubscriptionsClientListGlobalBySubscriptionForTopicTypeOptions contains the optional parameters for the // EventSubscriptionsClient.ListGlobalBySubscriptionForTopicType method. @@ -788,7 +788,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionForTopicTypeCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -812,7 +812,7 @@ func (client *EventSubscriptionsClient) listGlobalBySubscriptionForTopicTypeHand // NewListRegionalByResourceGroupPager - List all event subscriptions from the given location under a specific Azure subscription // and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // location - Name of the location. // options - EventSubscriptionsClientListRegionalByResourceGroupOptions contains the optional parameters for the EventSubscriptionsClient.ListRegionalByResourceGroup @@ -865,7 +865,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -889,7 +889,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupHandleRespons // NewListRegionalByResourceGroupForTopicTypePager - List all event subscriptions from the given location under a specific // Azure subscription and resource group and topic type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // location - Name of the location. // topicTypeName - Name of the topic type. @@ -947,7 +947,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupForTopicTypeC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -970,7 +970,7 @@ func (client *EventSubscriptionsClient) listRegionalByResourceGroupForTopicTypeH // NewListRegionalBySubscriptionPager - List all event subscriptions from the given location under a specific Azure subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // location - Name of the location. // options - EventSubscriptionsClientListRegionalBySubscriptionOptions contains the optional parameters for the EventSubscriptionsClient.ListRegionalBySubscription // method. @@ -1018,7 +1018,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -1042,7 +1042,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionHandleResponse // NewListRegionalBySubscriptionForTopicTypePager - List all event subscriptions from the given location under a specific // Azure subscription and topic type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // location - Name of the location. // topicTypeName - Name of the topic type. // options - EventSubscriptionsClientListRegionalBySubscriptionForTopicTypeOptions contains the optional parameters for the @@ -1095,7 +1095,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionForTopicTypeCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -1118,7 +1118,7 @@ func (client *EventSubscriptionsClient) listRegionalBySubscriptionForTopicTypeHa // BeginUpdate - Asynchronously updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // scope - The scope of existing event subscription. The scope can be a subscription, or a resource group, or a top level // resource belonging to a resource provider namespace, or an EventGrid topic. For example, // use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -1145,7 +1145,7 @@ func (client *EventSubscriptionsClient) BeginUpdate(ctx context.Context, scope s // Update - Asynchronously updates an existing event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *EventSubscriptionsClient) update(ctx context.Context, scope string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *EventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, scope, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -1174,7 +1174,7 @@ func (client *EventSubscriptionsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_extensiontopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_extensiontopics_client.go index 2027e586feb7..3195534a3645 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_extensiontopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_extensiontopics_client.go @@ -53,7 +53,7 @@ func NewExtensionTopicsClient(credential azcore.TokenCredential, options *arm.Cl // Get - Get the properties of an extension topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // scope - The identifier of the resource to which extension topic is queried. The scope can be a subscription, or a resource // group, or a top level resource belonging to a resource provider namespace. For // example, use '/subscriptions/{subscriptionId}/' for a subscription, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' @@ -88,7 +88,7 @@ func (client *ExtensionTopicsClient) getCreateRequest(ctx context.Context, scope return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models.go index e006e13b2245..55cb5c71801c 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models.go @@ -38,6 +38,32 @@ type AdvancedFilter struct { // GetAdvancedFilter implements the AdvancedFilterClassification interface for type AdvancedFilter. func (a *AdvancedFilter) GetAdvancedFilter() *AdvancedFilter { return a } +// AzureADPartnerClientAuthentication - Azure Active Directory Partner Client Authentication +type AzureADPartnerClientAuthentication struct { + // REQUIRED; Type of client authentication + ClientAuthenticationType *PartnerClientAuthenticationType `json:"clientAuthenticationType,omitempty"` + + // AzureAD ClientAuthentication Properties + Properties *AzureADPartnerClientAuthenticationProperties `json:"properties,omitempty"` +} + +// GetPartnerClientAuthentication implements the PartnerClientAuthenticationClassification interface for type AzureADPartnerClientAuthentication. +func (a *AzureADPartnerClientAuthentication) GetPartnerClientAuthentication() *PartnerClientAuthentication { + return &PartnerClientAuthentication{ + ClientAuthenticationType: a.ClientAuthenticationType, + } +} + +// AzureADPartnerClientAuthenticationProperties - Properties of an Azure Active Directory Partner Client Authentication. +type AzureADPartnerClientAuthenticationProperties struct { + // The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery + // requests. + AzureActiveDirectoryApplicationIDOrURI *string `json:"azureActiveDirectoryApplicationIdOrUri,omitempty"` + + // The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. + AzureActiveDirectoryTenantID *string `json:"azureActiveDirectoryTenantId,omitempty"` +} + // AzureFunctionEventSubscriptionDestination - Information about the azure function destination for an event subscription. type AzureFunctionEventSubscriptionDestination struct { // REQUIRED; Type of the endpoint for the event subscription destination. @@ -90,6 +116,121 @@ func (b *BoolEqualsAdvancedFilter) GetAdvancedFilter() *AdvancedFilter { } } +// Channel info. +type Channel struct { + // Properties of the Channel. + Properties *ChannelProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to Channel resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ChannelProperties - Properties of the Channel. +type ChannelProperties struct { + // The type of the event channel which represents the direction flow of events. + ChannelType *ChannelType `json:"channelType,omitempty"` + + // Expiration time of the channel. If this timer expires while the corresponding partner topic is never activated, the channel + // and corresponding partner topic are deleted. + ExpirationTimeIfNotActivatedUTC *time.Time `json:"expirationTimeIfNotActivatedUtc,omitempty"` + + // Context or helpful message that can be used during the approval process by the subscriber. + MessageForActivation *string `json:"messageForActivation,omitempty"` + + // This property should be populated when channelType is PartnerDestination and represents information about the partner destination + // resource corresponding to the channel. + PartnerDestinationInfo PartnerDestinationInfoClassification `json:"partnerDestinationInfo,omitempty"` + + // This property should be populated when channelType is PartnerTopic and represents information about the partner topic resource + // corresponding to the channel. + PartnerTopicInfo *PartnerTopicInfo `json:"partnerTopicInfo,omitempty"` + + // Provisioning state of the channel. + ProvisioningState *ChannelProvisioningState `json:"provisioningState,omitempty"` + + // The readiness state of the corresponding partner topic. + ReadinessState *ReadinessState `json:"readinessState,omitempty"` +} + +// ChannelUpdateParameters - Properties of the Channel update. +type ChannelUpdateParameters struct { + // Properties of the channel update parameters. + Properties *ChannelUpdateParametersProperties `json:"properties,omitempty"` +} + +// ChannelUpdateParametersProperties - Properties of the channel update parameters. +type ChannelUpdateParametersProperties struct { + // Expiration time of the event channel. If this timer expires while the corresponding partner topic or partner destination + // is never activated, the channel and corresponding partner topic or partner + // destination are deleted. + ExpirationTimeIfNotActivatedUTC *time.Time `json:"expirationTimeIfNotActivatedUtc,omitempty"` + + // Partner destination properties which can be updated if the channel is of type PartnerDestination. + PartnerDestinationInfo PartnerUpdateDestinationInfoClassification `json:"partnerDestinationInfo,omitempty"` + + // Partner topic properties which can be updated if the channel is of type PartnerTopic. + PartnerTopicInfo *PartnerUpdateTopicInfo `json:"partnerTopicInfo,omitempty"` +} + +// ChannelsClientBeginDeleteOptions contains the optional parameters for the ChannelsClient.BeginDelete method. +type ChannelsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ChannelsClientCreateOrUpdateOptions contains the optional parameters for the ChannelsClient.CreateOrUpdate method. +type ChannelsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientGetFullURLOptions contains the optional parameters for the ChannelsClient.GetFullURL method. +type ChannelsClientGetFullURLOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientGetOptions contains the optional parameters for the ChannelsClient.Get method. +type ChannelsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ChannelsClientListByPartnerNamespaceOptions contains the optional parameters for the ChannelsClient.ListByPartnerNamespace +// method. +type ChannelsClientListByPartnerNamespaceOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// ChannelsClientUpdateOptions contains the optional parameters for the ChannelsClient.Update method. +type ChannelsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ChannelsListResult - Result of the List Channels operation +type ChannelsListResult struct { + // A link for the next page of channels. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of Channels. + Value []*Channel `json:"value,omitempty"` +} + // ConnectionState information. type ConnectionState struct { // Actions required (if any). @@ -182,6 +323,9 @@ type Domain struct { // Properties of the Event Grid Domain resource. Properties *DomainProperties `json:"properties,omitempty"` + // The Sku pricing tier for the Event Grid Domain resource. + SKU *ResourceSKU `json:"sku,omitempty"` + // Tags of the resource. Tags map[string]*string `json:"tags,omitempty"` @@ -191,13 +335,66 @@ type Domain struct { // READ-ONLY; Name of the resource. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The system metadata relating to Domain resource. + // READ-ONLY; The system metadata relating to the Event Grid Domain resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; Type of the resource. Type *string `json:"type,omitempty" azure:"ro"` } +// DomainEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainEventSubscriptionsClient.BeginCreateOrUpdate +// method. +type DomainEventSubscriptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the DomainEventSubscriptionsClient.BeginDelete +// method. +type DomainEventSubscriptionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the DomainEventSubscriptionsClient.BeginUpdate +// method. +type DomainEventSubscriptionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the DomainEventSubscriptionsClient.GetDeliveryAttributes +// method. +type DomainEventSubscriptionsClientGetDeliveryAttributesOptions struct { + // placeholder for future optional parameters +} + +// DomainEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the DomainEventSubscriptionsClient.GetFullURL +// method. +type DomainEventSubscriptionsClientGetFullURLOptions struct { + // placeholder for future optional parameters +} + +// DomainEventSubscriptionsClientGetOptions contains the optional parameters for the DomainEventSubscriptionsClient.Get method. +type DomainEventSubscriptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DomainEventSubscriptionsClientListOptions contains the optional parameters for the DomainEventSubscriptionsClient.List +// method. +type DomainEventSubscriptionsClientListOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + // DomainProperties - Properties of the Event Grid Domain Resource. type DomainProperties struct { // This Boolean is used to specify the creation mechanism for 'all' the Event Grid Domain Topics associated with this Event @@ -224,6 +421,9 @@ type DomainProperties struct { // user. AutoDeleteTopicWithLastSubscription *bool `json:"autoDeleteTopicWithLastSubscription,omitempty"` + // Data Residency Boundary of the resource. + DataResidencyBoundary *DataResidencyBoundary `json:"dataResidencyBoundary,omitempty"` + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD // token will be used to authenticate if user is allowed to publish to the domain. DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` @@ -232,7 +432,7 @@ type DomainProperties struct { // is enabled. InboundIPRules []*InboundIPRule `json:"inboundIpRules,omitempty"` - // This determines the format that Event Grid should expect for incoming events published to the domain. + // This determines the format that Event Grid should expect for incoming events published to the Event Grid Domain Resource. InputSchema *InputSchema `json:"inputSchema,omitempty"` // Information about the InputSchemaMapping which specified the info about mapping event payload. @@ -242,10 +442,10 @@ type DomainProperties struct { // IPs by configuring PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - // READ-ONLY; Endpoint for the domain. + // READ-ONLY; Endpoint for the Event Grid Domain Resource which is used for publishing the events. Endpoint *string `json:"endpoint,omitempty" azure:"ro"` - // READ-ONLY; Metric resource id for the domain. + // READ-ONLY; Metric resource id for the Event Grid Domain Resource. MetricResourceID *string `json:"metricResourceId,omitempty" azure:"ro"` // READ-ONLY; List of private endpoint connections. @@ -288,6 +488,60 @@ type DomainTopic struct { Type *string `json:"type,omitempty" azure:"ro"` } +// DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +type DomainTopicEventSubscriptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainTopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.BeginDelete +// method. +type DomainTopicEventSubscriptionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainTopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.BeginUpdate +// method. +type DomainTopicEventSubscriptionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DomainTopicEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.GetDeliveryAttributes +// method. +type DomainTopicEventSubscriptionsClientGetDeliveryAttributesOptions struct { + // placeholder for future optional parameters +} + +// DomainTopicEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.GetFullURL +// method. +type DomainTopicEventSubscriptionsClientGetFullURLOptions struct { + // placeholder for future optional parameters +} + +// DomainTopicEventSubscriptionsClientGetOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.Get +// method. +type DomainTopicEventSubscriptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DomainTopicEventSubscriptionsClientListOptions contains the optional parameters for the DomainTopicEventSubscriptionsClient.List +// method. +type DomainTopicEventSubscriptionsClientListOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + // DomainTopicProperties - Properties of the Domain Topic. type DomainTopicProperties struct { // READ-ONLY; Provisioning state of the domain topic. @@ -361,6 +615,9 @@ type DomainUpdateParameterProperties struct { // user. AutoDeleteTopicWithLastSubscription *bool `json:"autoDeleteTopicWithLastSubscription,omitempty"` + // The data residency boundary for the domain. + DataResidencyBoundary *DataResidencyBoundary `json:"dataResidencyBoundary,omitempty"` + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD // token will be used to authenticate if user is allowed to publish to the domain. DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` @@ -382,6 +639,9 @@ type DomainUpdateParameters struct { // Properties of the resource. Properties *DomainUpdateParameterProperties `json:"properties,omitempty"` + // The Sku pricing tier for the domain. + SKU *ResourceSKU `json:"sku,omitempty"` + // Tags of the domains resource. Tags map[string]*string `json:"tags,omitempty"` } @@ -447,12 +707,12 @@ type DomainsClientRegenerateKeyOptions struct { // placeholder for future optional parameters } -// DomainsListResult - Result of the List Domains operation. +// DomainsListResult - Result of the List Domains operation type DomainsListResult struct { - // A link for the next page of domains. + // A link for the next page of domains NextLink *string `json:"nextLink,omitempty"` - // A collection of Domains. + // A collection of Domains Value []*Domain `json:"value,omitempty"` } @@ -482,6 +742,122 @@ type DynamicDeliveryAttributeMappingProperties struct { SourceField *string `json:"sourceField,omitempty"` } +// EventChannel - Event Channel. +type EventChannel struct { + // Properties of the EventChannel. + Properties *EventChannelProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to Event Channel resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// EventChannelDestination - Properties of the destination of an event channel. +type EventChannelDestination struct { + // Azure subscription ID of the customer creating the event channel. The partner topic associated with the event channel will + // be created under this Azure subscription. + AzureSubscriptionID *string `json:"azureSubscriptionId,omitempty"` + + // Name of the partner topic associated with the event channel. + PartnerTopicName *string `json:"partnerTopicName,omitempty"` + + // Azure Resource Group of the customer creating the event channel. The partner topic associated with the event channel will + // be created under this resource group. + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +// EventChannelFilter - Filter for the Event Channel. +type EventChannelFilter struct { + // An array of advanced filters that are used for filtering event channels. + AdvancedFilters []AdvancedFilterClassification `json:"advancedFilters,omitempty"` + + // Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. The default value + // is either false or null. + EnableAdvancedFilteringOnArrays *bool `json:"enableAdvancedFilteringOnArrays,omitempty"` +} + +// EventChannelProperties - Properties of the Event Channel. +type EventChannelProperties struct { + // Represents the destination of an event channel. + Destination *EventChannelDestination `json:"destination,omitempty"` + + // Expiration time of the event channel. If this timer expires while the corresponding partner topic is never activated, the + // event channel and corresponding partner topic are deleted. + ExpirationTimeIfNotActivatedUTC *time.Time `json:"expirationTimeIfNotActivatedUtc,omitempty"` + + // Information about the filter for the event channel. + Filter *EventChannelFilter `json:"filter,omitempty"` + + // Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + // partner topic. This will be helpful to remove any ambiguity of the origin of + // creation of the partner topic for the customer. + PartnerTopicFriendlyDescription *string `json:"partnerTopicFriendlyDescription,omitempty"` + + // Source of the event channel. This represents a unique resource in the partner's resource model. + Source *EventChannelSource `json:"source,omitempty"` + + // READ-ONLY; The readiness state of the corresponding partner topic. + PartnerTopicReadinessState *PartnerTopicReadinessState `json:"partnerTopicReadinessState,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the event channel. + ProvisioningState *EventChannelProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// EventChannelSource - Properties of the source of an event channel. +type EventChannelSource struct { + // The identifier of the resource that's the source of the events. This represents a unique resource in the partner's resource + // model. + Source *string `json:"source,omitempty"` +} + +// EventChannelsClientBeginDeleteOptions contains the optional parameters for the EventChannelsClient.BeginDelete method. +type EventChannelsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// EventChannelsClientCreateOrUpdateOptions contains the optional parameters for the EventChannelsClient.CreateOrUpdate method. +type EventChannelsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// EventChannelsClientGetOptions contains the optional parameters for the EventChannelsClient.Get method. +type EventChannelsClientGetOptions struct { + // placeholder for future optional parameters +} + +// EventChannelsClientListByPartnerNamespaceOptions contains the optional parameters for the EventChannelsClient.ListByPartnerNamespace +// method. +type EventChannelsClientListByPartnerNamespaceOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// EventChannelsListResult - Result of the List Event Channels operation +type EventChannelsListResult struct { + // A link for the next page of event channels + NextLink *string `json:"nextLink,omitempty"` + + // A collection of Event Channels + Value []*EventChannel `json:"value,omitempty"` +} + // EventHubEventSubscriptionDestination - Information about the event hub destination for an event subscription. type EventHubEventSubscriptionDestination struct { // REQUIRED; Type of the endpoint for the event subscription destination. @@ -529,8 +905,8 @@ type EventSubscription struct { // Call the interface's GetEventSubscriptionDestination() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AzureFunctionEventSubscriptionDestination, *EventHubEventSubscriptionDestination, *EventSubscriptionDestination, *HybridConnectionEventSubscriptionDestination, -// - *ServiceBusQueueEventSubscriptionDestination, *ServiceBusTopicEventSubscriptionDestination, *StorageQueueEventSubscriptionDestination, -// - *WebHookEventSubscriptionDestination +// - *PartnerEventSubscriptionDestination, *ServiceBusQueueEventSubscriptionDestination, *ServiceBusTopicEventSubscriptionDestination, +// - *StorageQueueEventSubscriptionDestination, *WebHookEventSubscriptionDestination type EventSubscriptionDestinationClassification interface { // GetEventSubscriptionDestination returns the EventSubscriptionDestination content of the underlying type. GetEventSubscriptionDestination() *EventSubscriptionDestination @@ -591,7 +967,9 @@ type EventSubscriptionIdentity struct { // EventSubscriptionProperties - Properties of the Event Subscription. type EventSubscriptionProperties struct { - // The DeadLetter destination of the event subscription. + // The dead letter destination of the event subscription. Any event that cannot be delivered to its' destination is sent to + // the dead letter destination. Uses Azure Event Grid's identity to acquire the + // authentication tokens being used during delivery / dead-lettering. DeadLetterDestination DeadLetterDestinationClassification `json:"deadLetterDestination,omitempty"` // The dead letter destination of the event subscription. Any event that cannot be delivered to its' destination is sent to @@ -604,7 +982,9 @@ type EventSubscriptionProperties struct { // authentication tokens being used during delivery / dead-lettering. DeliveryWithResourceIdentity *DeliveryWithResourceIdentity `json:"deliveryWithResourceIdentity,omitempty"` - // Information about the destination where events have to be delivered for the event subscription. + // Information about the destination where events have to be delivered for the event subscription. Uses Azure Event Grid's + // identity to acquire the authentication tokens being used during delivery / + // dead-lettering. Destination EventSubscriptionDestinationClassification `json:"destination,omitempty"` // The event delivery schema for the event subscription. @@ -631,7 +1011,9 @@ type EventSubscriptionProperties struct { // EventSubscriptionUpdateParameters - Properties of the Event Subscription update. type EventSubscriptionUpdateParameters struct { - // The DeadLetter destination of the event subscription. + // The dead letter destination of the event subscription. Any event that cannot be delivered to its' destination is sent to + // the dead letter destination. Uses Azure Event Grid's identity to acquire the + // authentication tokens being used during delivery / dead-lettering. DeadLetterDestination DeadLetterDestinationClassification `json:"deadLetterDestination,omitempty"` // The dead letter destination of the event subscription. Any event that cannot be delivered to its' destination is sent to @@ -644,7 +1026,9 @@ type EventSubscriptionUpdateParameters struct { // tokens being used during delivery / dead-lettering. DeliveryWithResourceIdentity *DeliveryWithResourceIdentity `json:"deliveryWithResourceIdentity,omitempty"` - // Information about the destination where events have to be delivered for the event subscription. + // Information about the destination where events have to be delivered for the event subscription. Uses Azure Event Grid's + // identity to acquire the authentication tokens being used during delivery / + // dead-lettering. Destination EventSubscriptionDestinationClassification `json:"destination,omitempty"` // The event delivery schema for the event subscription. @@ -875,6 +1259,18 @@ type EventType struct { Type *string `json:"type,omitempty" azure:"ro"` } +// EventTypeInfo - The event type information for Channels. +type EventTypeInfo struct { + // A collection of inline event types for the resource. The inline event type keys are of type string which represents the + // name of the event. An example of a valid inline event name is + // "Contoso.OrderCreated". The inline event type values are of type InlineEventProperties and will contain additional information + // for every inline event type. + InlineEventTypes map[string]*InlineEventProperties `json:"inlineEventTypes,omitempty"` + + // The kind of event type used. + Kind *EventDefinitionKind `json:"kind,omitempty"` +} + // EventTypeProperties - Properties of the event type type EventTypeProperties struct { // Description of the event type. @@ -896,6 +1292,15 @@ type EventTypesListResult struct { Value []*EventType `json:"value,omitempty"` } +// ExtendedLocation - Definition of an Extended Location +type ExtendedLocation struct { + // Fully qualified name of the extended location. + Name *string `json:"name,omitempty"` + + // Type of the extended location. + Type *string `json:"type,omitempty"` +} + // ExtensionTopic - Event grid Extension Topic. This is used for getting Event Grid related metrics for Azure resources. type ExtensionTopic struct { // Properties of the extension topic @@ -907,7 +1312,7 @@ type ExtensionTopic struct { // READ-ONLY; Name of the resource. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The system metadata relating to the Extension Topic resource. + // READ-ONLY; The system metadata relating to Extension Topic resource. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` // READ-ONLY; Type of the resource. @@ -981,6 +1386,18 @@ type InboundIPRule struct { IPMask *string `json:"ipMask,omitempty"` } +// InlineEventProperties - Additional information about every inline event. +type InlineEventProperties struct { + // The dataSchemaUrl for the inline event. + DataSchemaURL *string `json:"dataSchemaUrl,omitempty"` + + // The description for the inline event. + Description *string `json:"description,omitempty"` + + // The documentationUrl for the inline event. + DocumentationURL *string `json:"documentationUrl,omitempty"` +} + // InputSchemaMappingClassification provides polymorphic access to related types. // Call the interface's GetInputSchemaMapping() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -1299,27 +1716,963 @@ type OperationsListResult struct { Value []*Operation `json:"value,omitempty"` } -// PrivateEndpoint information. -type PrivateEndpoint struct { - // The ARM identifier for Private Endpoint. - ID *string `json:"id,omitempty"` -} +// Partner - Information about the partner. +type Partner struct { + // Expiration time of the partner authorization. If this timer expires, any request from this partner to create, update or + // delete resources in subscriber's context will fail. If specified, the allowed + // values are between 1 to the value of defaultMaximumExpirationTimeInDays specified in PartnerConfiguration. If not specified, + // the default value will be the value of defaultMaximumExpirationTimeInDays + // specified in PartnerConfiguration or 7 if this value is not specified. + AuthorizationExpirationTimeInUTC *time.Time `json:"authorizationExpirationTimeInUtc,omitempty"` -type PrivateEndpointConnection struct { - // Properties of the PrivateEndpointConnection. - Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // The partner name. + PartnerName *string `json:"partnerName,omitempty"` - // READ-ONLY; Fully qualified identifier of the resource. - ID *string `json:"id,omitempty" azure:"ro"` + // The immutableId of the corresponding partner registration. + PartnerRegistrationImmutableID *string `json:"partnerRegistrationImmutableId,omitempty"` +} - // READ-ONLY; Name of the resource. - Name *string `json:"name,omitempty" azure:"ro"` +// PartnerAuthorization - The partner authorization details. +type PartnerAuthorization struct { + // The list of authorized partners. + AuthorizedPartnersList []*Partner `json:"authorizedPartnersList,omitempty"` - // READ-ONLY; Type of the resource. - Type *string `json:"type,omitempty" azure:"ro"` + // Time used to validate the authorization expiration time for each authorized partner. If DefaultMaximumExpirationTimeInDays + // is not specified, the default is 7 days. Otherwise, allowed values are + // between 1 and 365 days. + DefaultMaximumExpirationTimeInDays *int32 `json:"defaultMaximumExpirationTimeInDays,omitempty"` } -// PrivateEndpointConnectionListResult - Result of the list of all private endpoint connections operation. +// PartnerClientAuthenticationClassification provides polymorphic access to related types. +// Call the interface's GetPartnerClientAuthentication() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureADPartnerClientAuthentication, *PartnerClientAuthentication +type PartnerClientAuthenticationClassification interface { + // GetPartnerClientAuthentication returns the PartnerClientAuthentication content of the underlying type. + GetPartnerClientAuthentication() *PartnerClientAuthentication +} + +// PartnerClientAuthentication - Partner client authentication +type PartnerClientAuthentication struct { + // REQUIRED; Type of client authentication + ClientAuthenticationType *PartnerClientAuthenticationType `json:"clientAuthenticationType,omitempty"` +} + +// GetPartnerClientAuthentication implements the PartnerClientAuthenticationClassification interface for type PartnerClientAuthentication. +func (p *PartnerClientAuthentication) GetPartnerClientAuthentication() *PartnerClientAuthentication { + return p +} + +// PartnerConfiguration - Partner configuration information +type PartnerConfiguration struct { + // Location of the resource. + Location *string `json:"location,omitempty"` + + // Properties of the partner configuration. + Properties *PartnerConfigurationProperties `json:"properties,omitempty"` + + // Tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to partner configuration resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PartnerConfigurationProperties - Properties of the partner configuration. +type PartnerConfigurationProperties struct { + // The details of authorized partners. + PartnerAuthorization *PartnerAuthorization `json:"partnerAuthorization,omitempty"` + + // Provisioning state of the partner configuration. + ProvisioningState *PartnerConfigurationProvisioningState `json:"provisioningState,omitempty"` +} + +// PartnerConfigurationUpdateParameterProperties - Information of partner configuration update parameter properties. +type PartnerConfigurationUpdateParameterProperties struct { + // The default time used to validate the maximum expiration time for each authorized partners in days. Allowed values ar between + // 1 and 365 days. + DefaultMaximumExpirationTimeInDays *int32 `json:"defaultMaximumExpirationTimeInDays,omitempty"` +} + +// PartnerConfigurationUpdateParameters - Properties of the partner configuration update. +type PartnerConfigurationUpdateParameters struct { + // Properties of the Topic resource. + Properties *PartnerConfigurationUpdateParameterProperties `json:"properties,omitempty"` + + // Tags of the partner configuration resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartnerConfigurationsClientAuthorizePartnerOptions contains the optional parameters for the PartnerConfigurationsClient.AuthorizePartner +// method. +type PartnerConfigurationsClientAuthorizePartnerOptions struct { + // placeholder for future optional parameters +} + +// PartnerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerConfigurationsClient.BeginCreateOrUpdate +// method. +type PartnerConfigurationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerConfigurationsClientBeginDeleteOptions contains the optional parameters for the PartnerConfigurationsClient.BeginDelete +// method. +type PartnerConfigurationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerConfigurationsClientBeginUpdateOptions contains the optional parameters for the PartnerConfigurationsClient.BeginUpdate +// method. +type PartnerConfigurationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerConfigurationsClientGetOptions contains the optional parameters for the PartnerConfigurationsClient.Get method. +type PartnerConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PartnerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the PartnerConfigurationsClient.ListByResourceGroup +// method. +type PartnerConfigurationsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// PartnerConfigurationsClientListBySubscriptionOptions contains the optional parameters for the PartnerConfigurationsClient.ListBySubscription +// method. +type PartnerConfigurationsClientListBySubscriptionOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerConfigurationsClientUnauthorizePartnerOptions contains the optional parameters for the PartnerConfigurationsClient.UnauthorizePartner +// method. +type PartnerConfigurationsClientUnauthorizePartnerOptions struct { + // placeholder for future optional parameters +} + +// PartnerConfigurationsListResult - Result of the List partner configurations operation +type PartnerConfigurationsListResult struct { + // A link for the next page of partner configurations. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of partner configurations. + Value []*PartnerConfiguration `json:"value,omitempty"` +} + +// PartnerDestination - Event Grid Partner Destination. +type PartnerDestination struct { + // REQUIRED; Location of the resource. + Location *string `json:"location,omitempty"` + + // Properties of the Partner Destination. + Properties *PartnerDestinationProperties `json:"properties,omitempty"` + + // Tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to Partner Destination resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PartnerDestinationInfoClassification provides polymorphic access to related types. +// Call the interface's GetPartnerDestinationInfo() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *PartnerDestinationInfo, *WebhookPartnerDestinationInfo +type PartnerDestinationInfoClassification interface { + // GetPartnerDestinationInfo returns the PartnerDestinationInfo content of the underlying type. + GetPartnerDestinationInfo() *PartnerDestinationInfo +} + +// PartnerDestinationInfo - Properties of the corresponding partner destination of a Channel. +type PartnerDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType `json:"endpointType,omitempty"` + + // Azure subscription ID of the subscriber. The partner destination associated with the channel will be created under this + // Azure subscription. + AzureSubscriptionID *string `json:"azureSubscriptionId,omitempty"` + + // Additional context of the partner destination endpoint. + EndpointServiceContext *string `json:"endpointServiceContext,omitempty"` + + // Name of the partner destination associated with the channel. + Name *string `json:"name,omitempty"` + + // Azure Resource Group of the subscriber. The partner destination associated with the channel will be created under this + // resource group. + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + + // Change history of the resource move. + ResourceMoveChangeHistory []*ResourceMoveChangeHistory `json:"resourceMoveChangeHistory,omitempty"` +} + +// GetPartnerDestinationInfo implements the PartnerDestinationInfoClassification interface for type PartnerDestinationInfo. +func (p *PartnerDestinationInfo) GetPartnerDestinationInfo() *PartnerDestinationInfo { return p } + +// PartnerDestinationProperties - Properties of the Partner Destination. +type PartnerDestinationProperties struct { + // Activation state of the partner destination. + ActivationState *PartnerDestinationActivationState `json:"activationState,omitempty"` + + // Endpoint Base URL of the partner destination + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + + // Endpoint context associated with this partner destination. + EndpointServiceContext *string `json:"endpointServiceContext,omitempty"` + + // Expiration time of the partner destination. If this timer expires and the partner destination was never activated, the + // partner destination and corresponding channel are deleted. + ExpirationTimeIfNotActivatedUTC *time.Time `json:"expirationTimeIfNotActivatedUtc,omitempty"` + + // Context or helpful message that can be used during the approval process. + MessageForActivation *string `json:"messageForActivation,omitempty"` + + // The immutable Id of the corresponding partner registration. + PartnerRegistrationImmutableID *string `json:"partnerRegistrationImmutableId,omitempty"` + + // Provisioning state of the partner destination. + ProvisioningState *PartnerDestinationProvisioningState `json:"provisioningState,omitempty"` +} + +// PartnerDestinationUpdateParameters - Properties of the Partner Destination that can be updated. +type PartnerDestinationUpdateParameters struct { + // Tags of the Partner Destination resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartnerDestinationsClientActivateOptions contains the optional parameters for the PartnerDestinationsClient.Activate method. +type PartnerDestinationsClientActivateOptions struct { + // placeholder for future optional parameters +} + +// PartnerDestinationsClientBeginDeleteOptions contains the optional parameters for the PartnerDestinationsClient.BeginDelete +// method. +type PartnerDestinationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerDestinationsClientCreateOrUpdateOptions contains the optional parameters for the PartnerDestinationsClient.CreateOrUpdate +// method. +type PartnerDestinationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PartnerDestinationsClientGetOptions contains the optional parameters for the PartnerDestinationsClient.Get method. +type PartnerDestinationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PartnerDestinationsClientListByResourceGroupOptions contains the optional parameters for the PartnerDestinationsClient.ListByResourceGroup +// method. +type PartnerDestinationsClientListByResourceGroupOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerDestinationsClientListBySubscriptionOptions contains the optional parameters for the PartnerDestinationsClient.ListBySubscription +// method. +type PartnerDestinationsClientListBySubscriptionOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerDestinationsClientUpdateOptions contains the optional parameters for the PartnerDestinationsClient.Update method. +type PartnerDestinationsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// PartnerDestinationsListResult - Result of the List Partner Destinations operation. +type PartnerDestinationsListResult struct { + // A link for the next page of partner destinations. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of partner destinations. + Value []*PartnerDestination `json:"value,omitempty"` +} + +// PartnerDetails - Information about the partner. +type PartnerDetails struct { + // This is short description about the partner. The length of this description should not exceed 256 characters. + Description *string `json:"description,omitempty"` + + // Long description for the partner's scenarios and integration.Length of this description should not exceed 2048 characters. + LongDescription *string `json:"longDescription,omitempty"` + + // URI of the partner website that can be used by Azure customers to setup Event Grid integration on an event source. + SetupURI *string `json:"setupUri,omitempty"` +} + +type PartnerEventSubscriptionDestination struct { + // REQUIRED; Type of the endpoint for the event subscription destination. + EndpointType *EndpointType `json:"endpointType,omitempty"` + + // Partner Destination Properties of the event subscription destination. + Properties *PartnerEventSubscriptionDestinationProperties `json:"properties,omitempty"` +} + +// GetEventSubscriptionDestination implements the EventSubscriptionDestinationClassification interface for type PartnerEventSubscriptionDestination. +func (p *PartnerEventSubscriptionDestination) GetEventSubscriptionDestination() *EventSubscriptionDestination { + return &EventSubscriptionDestination{ + EndpointType: p.EndpointType, + } +} + +type PartnerEventSubscriptionDestinationProperties struct { + // The Azure Resource Id that represents the endpoint of a Partner Destination of an event subscription. + ResourceID *string `json:"resourceId,omitempty"` +} + +// PartnerNamespace - EventGrid Partner Namespace. +type PartnerNamespace struct { + // REQUIRED; Location of the resource. + Location *string `json:"location,omitempty"` + + // Properties of the Partner Namespace. + Properties *PartnerNamespaceProperties `json:"properties,omitempty"` + + // Tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to Partner Namespace resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PartnerNamespaceProperties - Properties of the partner namespace. +type PartnerNamespaceProperties struct { + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + // token will be used to authenticate if user is allowed to publish to the partner + // namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + // is enabled. + InboundIPRules []*InboundIPRule `json:"inboundIpRules,omitempty"` + + // The fully qualified ARM Id of the partner registration that should be associated with this partner namespace. This takes + // the following format: + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}. + PartnerRegistrationFullyQualifiedID *string `json:"partnerRegistrationFullyQualifiedId,omitempty"` + + // This determines if events published to this partner namespace should use the source attribute in the event payload or use + // the channel name in the header when matching to the partner topic. If none is + // specified, source attribute routing will be used to match the partner topic. + PartnerTopicRoutingMode *PartnerTopicRoutingMode `json:"partnerTopicRoutingMode,omitempty"` + + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + // IPs by configuring + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + + // READ-ONLY; Endpoint for the partner namespace. + Endpoint *string `json:"endpoint,omitempty" azure:"ro"` + + // READ-ONLY + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of the partner namespace. + ProvisioningState *PartnerNamespaceProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// PartnerNamespaceRegenerateKeyRequest - PartnerNamespace regenerate shared access key request. +type PartnerNamespaceRegenerateKeyRequest struct { + // REQUIRED; Key name to regenerate (key1 or key2). + KeyName *string `json:"keyName,omitempty"` +} + +// PartnerNamespaceSharedAccessKeys - Shared access keys of the partner namespace. +type PartnerNamespaceSharedAccessKeys struct { + // Shared access key1 for the partner namespace. + Key1 *string `json:"key1,omitempty"` + + // Shared access key2 for the partner namespace. + Key2 *string `json:"key2,omitempty"` +} + +// PartnerNamespaceUpdateParameterProperties - Information of Partner Namespace update parameter properties. +type PartnerNamespaceUpdateParameterProperties struct { + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD + // token will be used to authenticate if user is allowed to publish to the partner + // namespace. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + + // This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess + // is enabled. + InboundIPRules []*InboundIPRule `json:"inboundIpRules,omitempty"` + + // This determines if traffic is allowed over public network. By default it is enabled. You can further restrict to specific + // IPs by configuring + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` +} + +// PartnerNamespaceUpdateParameters - Properties of the Partner Namespace update. +type PartnerNamespaceUpdateParameters struct { + // Properties of the Partner Namespace. + Properties *PartnerNamespaceUpdateParameterProperties `json:"properties,omitempty"` + + // Tags of the Partner Namespace. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartnerNamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerNamespacesClient.BeginCreateOrUpdate +// method. +type PartnerNamespacesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerNamespacesClientBeginDeleteOptions contains the optional parameters for the PartnerNamespacesClient.BeginDelete +// method. +type PartnerNamespacesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerNamespacesClientBeginUpdateOptions contains the optional parameters for the PartnerNamespacesClient.BeginUpdate +// method. +type PartnerNamespacesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerNamespacesClientGetOptions contains the optional parameters for the PartnerNamespacesClient.Get method. +type PartnerNamespacesClientGetOptions struct { + // placeholder for future optional parameters +} + +// PartnerNamespacesClientListByResourceGroupOptions contains the optional parameters for the PartnerNamespacesClient.ListByResourceGroup +// method. +type PartnerNamespacesClientListByResourceGroupOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerNamespacesClientListBySubscriptionOptions contains the optional parameters for the PartnerNamespacesClient.ListBySubscription +// method. +type PartnerNamespacesClientListBySubscriptionOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerNamespacesClientListSharedAccessKeysOptions contains the optional parameters for the PartnerNamespacesClient.ListSharedAccessKeys +// method. +type PartnerNamespacesClientListSharedAccessKeysOptions struct { + // placeholder for future optional parameters +} + +// PartnerNamespacesClientRegenerateKeyOptions contains the optional parameters for the PartnerNamespacesClient.RegenerateKey +// method. +type PartnerNamespacesClientRegenerateKeyOptions struct { + // placeholder for future optional parameters +} + +// PartnerNamespacesListResult - Result of the List Partner Namespaces operation +type PartnerNamespacesListResult struct { + // A link for the next page of partner namespaces. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of partner namespaces. + Value []*PartnerNamespace `json:"value,omitempty"` +} + +// PartnerRegistration - Information about a partner registration. +type PartnerRegistration struct { + // REQUIRED; Location of the resource. + Location *string `json:"location,omitempty"` + + // Properties of the partner registration. + Properties *PartnerRegistrationProperties `json:"properties,omitempty"` + + // Tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to Partner Registration resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PartnerRegistrationProperties - Properties of the partner registration. +type PartnerRegistrationProperties struct { + // List of Azure subscription Ids that are authorized to create a partner namespace associated with this partner registration. + // This is an optional property. Creating partner namespaces is always + // permitted under the same Azure subscription as the one used for creating the partner registration. + AuthorizedAzureSubscriptionIDs []*string `json:"authorizedAzureSubscriptionIds,omitempty"` + + // The extension of the customer service URI of the publisher. + CustomerServiceURI *string `json:"customerServiceUri,omitempty"` + + // URI of the logo. + LogoURI *string `json:"logoUri,omitempty"` + + // Long description for the custom scenarios and integration to be displayed in the portal if needed. Length of this description + // should not exceed 2048 characters. + LongDescription *string `json:"longDescription,omitempty"` + + // The extension of the customer service number of the publisher. Only digits are allowed and number of digits should not + // exceed 10. + PartnerCustomerServiceExtension *string `json:"partnerCustomerServiceExtension,omitempty"` + + // The customer service number of the publisher. The expected phone format should start with a '+' sign followed by the country + // code. The remaining digits are then followed. Only digits and spaces are + // allowed and its length cannot exceed 16 digits including country code. Examples of valid phone numbers are: +1 515 123 + // 4567 and +966 7 5115 2471. Examples of invalid phone numbers are: +1 (515) + // 123-4567, 1 515 123 4567 and +966 121 5115 24 7 551 1234 43 + PartnerCustomerServiceNumber *string `json:"partnerCustomerServiceNumber,omitempty"` + + // Official name of the partner name. For example: "Contoso". + PartnerName *string `json:"partnerName,omitempty"` + + // The immutableId of the corresponding partner registration. + PartnerRegistrationImmutableID *string `json:"partnerRegistrationImmutableId,omitempty"` + + // Short description of the partner resource type. The length of this description should not exceed 256 characters. + PartnerResourceTypeDescription *string `json:"partnerResourceTypeDescription,omitempty"` + + // Display name of the partner resource type. + PartnerResourceTypeDisplayName *string `json:"partnerResourceTypeDisplayName,omitempty"` + + // Name of the partner resource type. + PartnerResourceTypeName *string `json:"partnerResourceTypeName,omitempty"` + + // URI of the partner website that can be used by Azure customers to setup Event Grid integration on an event source. + SetupURI *string `json:"setupUri,omitempty"` + + // Visibility state of the partner registration. + VisibilityState *PartnerRegistrationVisibilityState `json:"visibilityState,omitempty"` + + // READ-ONLY; Provisioning state of the partner registration. + ProvisioningState *PartnerRegistrationProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// PartnerRegistrationUpdateParameters - Properties of the Partner Registration update. +type PartnerRegistrationUpdateParameters struct { + // List of IDs of Azure AD applications that are authorized to create a partner namespace associated with this partner registration. + // This is an optional property. Creating partner namespaces is always + // permitted under the same Azure subscription as the one used for creating the partner registration. + AuthorizedAzureSubscriptionIDs []*string `json:"authorizedAzureSubscriptionIds,omitempty"` + + // URI of the partner logo. + LogoURI *string `json:"logoUri,omitempty"` + + // Description of the partner topic type. + PartnerTopicTypeDescription *string `json:"partnerTopicTypeDescription,omitempty"` + + // Display name of the partner topic type. + PartnerTopicTypeDisplayName *string `json:"partnerTopicTypeDisplayName,omitempty"` + + // Name of the partner topic type. + PartnerTopicTypeName *string `json:"partnerTopicTypeName,omitempty"` + + // URI of the partner website that can be used by Azure customers to setup Event Grid integration on an event source. + SetupURI *string `json:"setupUri,omitempty"` + + // Tags of the partner registration resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartnerRegistrationsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerRegistrationsClient.BeginCreateOrUpdate +// method. +type PartnerRegistrationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerRegistrationsClientBeginDeleteOptions contains the optional parameters for the PartnerRegistrationsClient.BeginDelete +// method. +type PartnerRegistrationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerRegistrationsClientBeginUpdateOptions contains the optional parameters for the PartnerRegistrationsClient.BeginUpdate +// method. +type PartnerRegistrationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerRegistrationsClientGetOptions contains the optional parameters for the PartnerRegistrationsClient.Get method. +type PartnerRegistrationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PartnerRegistrationsClientListByResourceGroupOptions contains the optional parameters for the PartnerRegistrationsClient.ListByResourceGroup +// method. +type PartnerRegistrationsClientListByResourceGroupOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerRegistrationsClientListBySubscriptionOptions contains the optional parameters for the PartnerRegistrationsClient.ListBySubscription +// method. +type PartnerRegistrationsClientListBySubscriptionOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerRegistrationsListResult - Result of the List Partner Registrations operation. +type PartnerRegistrationsListResult struct { + // A link for the next page of partner registrations. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of partner registrations. + Value []*PartnerRegistration `json:"value,omitempty"` +} + +// PartnerTopic - Event Grid Partner Topic. +type PartnerTopic struct { + // REQUIRED; Location of the resource. + Location *string `json:"location,omitempty"` + + // Identity information for the Partner Topic resource. + Identity *IdentityInfo `json:"identity,omitempty"` + + // Properties of the Partner Topic. + Properties *PartnerTopicProperties `json:"properties,omitempty"` + + // Tags of the resource. + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to Partner Topic resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +type PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerTopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.BeginDelete +// method. +type PartnerTopicEventSubscriptionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerTopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.BeginUpdate +// method. +type PartnerTopicEventSubscriptionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerTopicEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.GetDeliveryAttributes +// method. +type PartnerTopicEventSubscriptionsClientGetDeliveryAttributesOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.GetFullURL +// method. +type PartnerTopicEventSubscriptionsClientGetFullURLOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicEventSubscriptionsClientGetOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.Get +// method. +type PartnerTopicEventSubscriptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.ListByPartnerTopic +// method. +type PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerTopicInfo - Properties of the corresponding partner topic of a Channel. +type PartnerTopicInfo struct { + // Azure subscription ID of the subscriber. The partner topic associated with the channel will be created under this Azure + // subscription. + AzureSubscriptionID *string `json:"azureSubscriptionId,omitempty"` + + // Event Type Information for the partner topic. This information is provided by the publisher and can be used by the subscriber + // to view different types of events that are published. + EventTypeInfo *EventTypeInfo `json:"eventTypeInfo,omitempty"` + + // Name of the partner topic associated with the channel. + Name *string `json:"name,omitempty"` + + // Azure Resource Group of the subscriber. The partner topic associated with the channel will be created under this resource + // group. + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + + // The source information is provided by the publisher to determine the scope or context from which the events are originating. + // This information can be used by the subscriber during the approval process + // of the created partner topic. + Source *string `json:"source,omitempty"` +} + +// PartnerTopicProperties - Properties of the Partner Topic. +type PartnerTopicProperties struct { + // Activation state of the partner topic. + ActivationState *PartnerTopicActivationState `json:"activationState,omitempty"` + + // Event Type information from the corresponding event channel. + EventTypeInfo *EventTypeInfo `json:"eventTypeInfo,omitempty"` + + // Expiration time of the partner topic. If this timer expires while the partner topic is still never activated, the partner + // topic and corresponding event channel are deleted. + ExpirationTimeIfNotActivatedUTC *time.Time `json:"expirationTimeIfNotActivatedUtc,omitempty"` + + // Context or helpful message that can be used during the approval process by the subscriber. + MessageForActivation *string `json:"messageForActivation,omitempty"` + + // The immutableId of the corresponding partner registration. + PartnerRegistrationImmutableID *string `json:"partnerRegistrationImmutableId,omitempty"` + + // Friendly description about the topic. This can be set by the publisher/partner to show custom description for the customer + // partner topic. This will be helpful to remove any ambiguity of the origin of + // creation of the partner topic for the customer. + PartnerTopicFriendlyDescription *string `json:"partnerTopicFriendlyDescription,omitempty"` + + // Source associated with this partner topic. This represents a unique partner resource. + Source *string `json:"source,omitempty"` + + // READ-ONLY; Provisioning state of the partner topic. + ProvisioningState *PartnerTopicProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// PartnerTopicUpdateParameters - Properties of the Partner Topic update. +type PartnerTopicUpdateParameters struct { + // Identity information for the Partner Topic resource. + Identity *IdentityInfo `json:"identity,omitempty"` + + // Tags of the Partner Topic resource. + Tags map[string]*string `json:"tags,omitempty"` +} + +// PartnerTopicsClientActivateOptions contains the optional parameters for the PartnerTopicsClient.Activate method. +type PartnerTopicsClientActivateOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicsClientBeginDeleteOptions contains the optional parameters for the PartnerTopicsClient.BeginDelete method. +type PartnerTopicsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PartnerTopicsClientCreateOrUpdateOptions contains the optional parameters for the PartnerTopicsClient.CreateOrUpdate method. +type PartnerTopicsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicsClientDeactivateOptions contains the optional parameters for the PartnerTopicsClient.Deactivate method. +type PartnerTopicsClientDeactivateOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicsClientGetOptions contains the optional parameters for the PartnerTopicsClient.Get method. +type PartnerTopicsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicsClientListByResourceGroupOptions contains the optional parameters for the PartnerTopicsClient.ListByResourceGroup +// method. +type PartnerTopicsClientListByResourceGroupOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerTopicsClientListBySubscriptionOptions contains the optional parameters for the PartnerTopicsClient.ListBySubscription +// method. +type PartnerTopicsClientListBySubscriptionOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// PartnerTopicsClientUpdateOptions contains the optional parameters for the PartnerTopicsClient.Update method. +type PartnerTopicsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// PartnerTopicsListResult - Result of the List Partner Topics operation. +type PartnerTopicsListResult struct { + // A link for the next page of partner topics. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of partner topics. + Value []*PartnerTopic `json:"value,omitempty"` +} + +// PartnerUpdateDestinationInfoClassification provides polymorphic access to related types. +// Call the interface's GetPartnerUpdateDestinationInfo() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *PartnerUpdateDestinationInfo, *WebhookUpdatePartnerDestinationInfo +type PartnerUpdateDestinationInfoClassification interface { + // GetPartnerUpdateDestinationInfo returns the PartnerUpdateDestinationInfo content of the underlying type. + GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo +} + +// PartnerUpdateDestinationInfo - Properties of the corresponding partner destination of a Channel. +type PartnerUpdateDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType `json:"endpointType,omitempty"` +} + +// GetPartnerUpdateDestinationInfo implements the PartnerUpdateDestinationInfoClassification interface for type PartnerUpdateDestinationInfo. +func (p *PartnerUpdateDestinationInfo) GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo { + return p +} + +// PartnerUpdateTopicInfo - Update properties for the corresponding partner topic of a channel. +type PartnerUpdateTopicInfo struct { + // Event type info for the partner topic + EventTypeInfo *EventTypeInfo `json:"eventTypeInfo,omitempty"` +} + +// PrivateEndpoint information. +type PrivateEndpoint struct { + // The ARM identifier for Private Endpoint. + ID *string `json:"id,omitempty"` +} + +type PrivateEndpointConnection struct { + // Properties of the PrivateEndpointConnection. + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionListResult - Result of the list of all private endpoint connections operation. type PrivateEndpointConnectionListResult struct { // A link for the next page of private endpoint connection resources. NextLink *string `json:"nextLink,omitempty"` @@ -1429,7 +2782,7 @@ type PrivateLinkResourcesListResult struct { Value []*PrivateLinkResource `json:"value,omitempty"` } -// Resource - Definition of a Resource. +// Resource - Definition of a Resource type Resource struct { // READ-ONLY; Fully qualified identifier of the resource. ID *string `json:"id,omitempty" azure:"ro"` @@ -1441,6 +2794,24 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ResourceMoveChangeHistory - The change history of the resource move. +type ResourceMoveChangeHistory struct { + // Azure subscription ID of the resource. + AzureSubscriptionID *string `json:"azureSubscriptionId,omitempty"` + + // UTC timestamp of when the resource was changed. + ChangedTimeUTC *time.Time `json:"changedTimeUtc,omitempty"` + + // Azure Resource Group of the resource. + ResourceGroupName *string `json:"resourceGroupName,omitempty"` +} + +// ResourceSKU - Describes an EventGrid Resource Sku. +type ResourceSKU struct { + // The Sku name of the resource. The possible values are: Basic or Premium. + Name *SKU `json:"name,omitempty"` +} + // RetryPolicy - Information about the retry policy for an event subscription. type RetryPolicy struct { // Time To Live (in minutes) for events. @@ -1938,12 +3309,21 @@ type Topic struct { // REQUIRED; Location of the resource. Location *string `json:"location,omitempty"` + // Extended location of the resource. + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // Identity information for the resource. Identity *IdentityInfo `json:"identity,omitempty"` + // Kind of the resource. + Kind *ResourceKind `json:"kind,omitempty"` + // Properties of the topic. Properties *TopicProperties `json:"properties,omitempty"` + // The Sku pricing tier for the topic. + SKU *ResourceSKU `json:"sku,omitempty"` + // Tags of the resource. Tags map[string]*string `json:"tags,omitempty"` @@ -1960,8 +3340,63 @@ type Topic struct { Type *string `json:"type,omitempty" azure:"ro"` } -// TopicProperties - Properties of the Topic +// TopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the TopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +type TopicEventSubscriptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the TopicEventSubscriptionsClient.BeginDelete +// method. +type TopicEventSubscriptionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the TopicEventSubscriptionsClient.BeginUpdate +// method. +type TopicEventSubscriptionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TopicEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the TopicEventSubscriptionsClient.GetDeliveryAttributes +// method. +type TopicEventSubscriptionsClientGetDeliveryAttributesOptions struct { + // placeholder for future optional parameters +} + +// TopicEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the TopicEventSubscriptionsClient.GetFullURL +// method. +type TopicEventSubscriptionsClientGetFullURLOptions struct { + // placeholder for future optional parameters +} + +// TopicEventSubscriptionsClientGetOptions contains the optional parameters for the TopicEventSubscriptionsClient.Get method. +type TopicEventSubscriptionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// TopicEventSubscriptionsClientListOptions contains the optional parameters for the TopicEventSubscriptionsClient.List method. +type TopicEventSubscriptionsClientListOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// TopicProperties - Properties of the Topic. type TopicProperties struct { + // Data Residency Boundary of the resource. + DataResidencyBoundary *DataResidencyBoundary `json:"dataResidencyBoundary,omitempty"` + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD // token will be used to authenticate if user is allowed to publish to the topic. DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` @@ -2074,6 +3509,9 @@ type TopicTypesListResult struct { // TopicUpdateParameterProperties - Information of topic update parameter properties. type TopicUpdateParameterProperties struct { + // The data residency boundary for the topic. + DataResidencyBoundary *DataResidencyBoundary `json:"dataResidencyBoundary,omitempty"` + // This boolean is used to enable or disable local auth. Default value is false. When the property is set to true, only AAD // token will be used to authenticate if user is allowed to publish to the topic. DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` @@ -2092,10 +3530,13 @@ type TopicUpdateParameters struct { // Topic resource identity information. Identity *IdentityInfo `json:"identity,omitempty"` - // Properties of the resource. + // Properties of the Topic resource. Properties *TopicUpdateParameterProperties `json:"properties,omitempty"` - // Tags of the resource. + // The Sku pricing tier for the topic. + SKU *ResourceSKU `json:"sku,omitempty"` + + // Tags of the Topic resource. Tags map[string]*string `json:"tags,omitempty"` } @@ -2202,6 +3643,73 @@ type UserIdentityProperties struct { PrincipalID *string `json:"principalId,omitempty"` } +// VerifiedPartner - Verified partner information +type VerifiedPartner struct { + // Properties of the verified partner. + Properties *VerifiedPartnerProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified identifier of the resource. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Name of the resource. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system metadata relating to Verified Partner resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Type of the resource. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// VerifiedPartnerProperties - Properties of the verified partner. +type VerifiedPartnerProperties struct { + // Official name of the Partner. + OrganizationName *string `json:"organizationName,omitempty"` + + // Details of the partner destination scenario. + PartnerDestinationDetails *PartnerDetails `json:"partnerDestinationDetails,omitempty"` + + // Display name of the verified partner. + PartnerDisplayName *string `json:"partnerDisplayName,omitempty"` + + // ImmutableId of the corresponding partner registration. + PartnerRegistrationImmutableID *string `json:"partnerRegistrationImmutableId,omitempty"` + + // Details of the partner topic scenario. + PartnerTopicDetails *PartnerDetails `json:"partnerTopicDetails,omitempty"` + + // Provisioning state of the verified partner. + ProvisioningState *VerifiedPartnerProvisioningState `json:"provisioningState,omitempty"` +} + +// VerifiedPartnersClientGetOptions contains the optional parameters for the VerifiedPartnersClient.Get method. +type VerifiedPartnersClientGetOptions struct { + // placeholder for future optional parameters +} + +// VerifiedPartnersClientListOptions contains the optional parameters for the VerifiedPartnersClient.List method. +type VerifiedPartnersClientListOptions struct { + // The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and + // with limited number of OData operations. These operations are: the 'contains' + // function as well as the following logical operations: not, and, or, eq (for equal), and ne (for not equal). No arithmetic + // operations are supported. The following is a valid filter example: + // $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. The following is not a valid filter example: $filter=location + // eq 'westus'. + Filter *string + // The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, + // the default number of results to be returned is 20 items per page. + Top *int32 +} + +// VerifiedPartnersListResult - Result of the List verified partners operation +type VerifiedPartnersListResult struct { + // A link for the next page of verified partners if any. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of verified partners. + Value []*VerifiedPartner `json:"value,omitempty"` +} + // WebHookEventSubscriptionDestination - Information about the webhook destination for an event subscription. type WebHookEventSubscriptionDestination struct { // REQUIRED; Type of the endpoint for the event subscription destination. @@ -2242,3 +3750,69 @@ type WebHookEventSubscriptionDestinationProperties struct { // READ-ONLY; The base URL that represents the endpoint of the destination of an event subscription. EndpointBaseURL *string `json:"endpointBaseUrl,omitempty" azure:"ro"` } + +// WebhookPartnerDestinationInfo - Information about the WebHook of the partner destination. +type WebhookPartnerDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType `json:"endpointType,omitempty"` + + // Azure subscription ID of the subscriber. The partner destination associated with the channel will be created under this + // Azure subscription. + AzureSubscriptionID *string `json:"azureSubscriptionId,omitempty"` + + // Additional context of the partner destination endpoint. + EndpointServiceContext *string `json:"endpointServiceContext,omitempty"` + + // Name of the partner destination associated with the channel. + Name *string `json:"name,omitempty"` + + // WebHook Properties of the partner destination. + Properties *WebhookPartnerDestinationProperties `json:"properties,omitempty"` + + // Azure Resource Group of the subscriber. The partner destination associated with the channel will be created under this + // resource group. + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + + // Change history of the resource move. + ResourceMoveChangeHistory []*ResourceMoveChangeHistory `json:"resourceMoveChangeHistory,omitempty"` +} + +// GetPartnerDestinationInfo implements the PartnerDestinationInfoClassification interface for type WebhookPartnerDestinationInfo. +func (w *WebhookPartnerDestinationInfo) GetPartnerDestinationInfo() *PartnerDestinationInfo { + return &PartnerDestinationInfo{ + AzureSubscriptionID: w.AzureSubscriptionID, + ResourceGroupName: w.ResourceGroupName, + Name: w.Name, + EndpointType: w.EndpointType, + EndpointServiceContext: w.EndpointServiceContext, + ResourceMoveChangeHistory: w.ResourceMoveChangeHistory, + } +} + +// WebhookPartnerDestinationProperties - Properties of a partner destination webhook. +type WebhookPartnerDestinationProperties struct { + // Partner client authentication + ClientAuthentication PartnerClientAuthenticationClassification `json:"clientAuthentication,omitempty"` + + // The base URL that represents the endpoint of the partner destination. + EndpointBaseURL *string `json:"endpointBaseUrl,omitempty"` + + // The URL that represents the endpoint of the partner destination. + EndpointURL *string `json:"endpointUrl,omitempty"` +} + +// WebhookUpdatePartnerDestinationInfo - Information about the update of the WebHook of the partner destination. +type WebhookUpdatePartnerDestinationInfo struct { + // REQUIRED; Type of the endpoint for the partner destination + EndpointType *PartnerEndpointType `json:"endpointType,omitempty"` + + // WebHook Properties of the partner destination. + Properties *WebhookPartnerDestinationProperties `json:"properties,omitempty"` +} + +// GetPartnerUpdateDestinationInfo implements the PartnerUpdateDestinationInfoClassification interface for type WebhookUpdatePartnerDestinationInfo. +func (w *WebhookUpdatePartnerDestinationInfo) GetPartnerUpdateDestinationInfo() *PartnerUpdateDestinationInfo { + return &PartnerUpdateDestinationInfo{ + EndpointType: w.EndpointType, + } +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models_serde.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models_serde.go index 32d093ce07fe..f8b658b8288e 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models_serde.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_models_serde.go @@ -15,6 +15,37 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type AzureADPartnerClientAuthentication. +func (a AzureADPartnerClientAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["clientAuthenticationType"] = PartnerClientAuthenticationTypeAzureAD + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADPartnerClientAuthentication. +func (a *AzureADPartnerClientAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAuthenticationType": + err = unpopulate(val, "ClientAuthenticationType", &a.ClientAuthenticationType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AzureFunctionEventSubscriptionDestination. func (a AzureFunctionEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -120,6 +151,99 @@ func (b *BoolEqualsAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ChannelProperties. +func (c ChannelProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "channelType", c.ChannelType) + populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", c.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "messageForActivation", c.MessageForActivation) + populate(objectMap, "partnerDestinationInfo", c.PartnerDestinationInfo) + populate(objectMap, "partnerTopicInfo", c.PartnerTopicInfo) + populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "readinessState", c.ReadinessState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ChannelProperties. +func (c *ChannelProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "channelType": + err = unpopulate(val, "ChannelType", &c.ChannelType) + delete(rawMsg, key) + case "expirationTimeIfNotActivatedUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &c.ExpirationTimeIfNotActivatedUTC) + delete(rawMsg, key) + case "messageForActivation": + err = unpopulate(val, "MessageForActivation", &c.MessageForActivation) + delete(rawMsg, key) + case "partnerDestinationInfo": + c.PartnerDestinationInfo, err = unmarshalPartnerDestinationInfoClassification(val) + delete(rawMsg, key) + case "partnerTopicInfo": + err = unpopulate(val, "PartnerTopicInfo", &c.PartnerTopicInfo) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) + delete(rawMsg, key) + case "readinessState": + err = unpopulate(val, "ReadinessState", &c.ReadinessState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ChannelUpdateParameters. +func (c ChannelUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ChannelUpdateParametersProperties. +func (c ChannelUpdateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", c.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "partnerDestinationInfo", c.PartnerDestinationInfo) + populate(objectMap, "partnerTopicInfo", c.PartnerTopicInfo) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ChannelUpdateParametersProperties. +func (c *ChannelUpdateParametersProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationTimeIfNotActivatedUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &c.ExpirationTimeIfNotActivatedUTC) + delete(rawMsg, key) + case "partnerDestinationInfo": + c.PartnerDestinationInfo, err = unmarshalPartnerUpdateDestinationInfoClassification(val) + delete(rawMsg, key) + case "partnerTopicInfo": + err = unpopulate(val, "PartnerTopicInfo", &c.PartnerTopicInfo) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DeadLetterWithResourceIdentity. func (d DeadLetterWithResourceIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -210,6 +334,7 @@ func (d Domain) MarshalJSON() ([]byte, error) { populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) populate(objectMap, "systemData", d.SystemData) populate(objectMap, "tags", d.Tags) populate(objectMap, "type", d.Type) @@ -221,6 +346,7 @@ func (d DomainProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) + populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) populate(objectMap, "endpoint", d.Endpoint) populate(objectMap, "inboundIpRules", d.InboundIPRules) @@ -248,6 +374,9 @@ func (d *DomainProperties) UnmarshalJSON(data []byte) error { case "autoDeleteTopicWithLastSubscription": err = unpopulate(val, "AutoDeleteTopicWithLastSubscription", &d.AutoDeleteTopicWithLastSubscription) delete(rawMsg, key) + case "dataResidencyBoundary": + err = unpopulate(val, "DataResidencyBoundary", &d.DataResidencyBoundary) + delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &d.DisableLocalAuth) delete(rawMsg, key) @@ -288,6 +417,7 @@ func (d DomainUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "autoCreateTopicWithFirstSubscription", d.AutoCreateTopicWithFirstSubscription) populate(objectMap, "autoDeleteTopicWithLastSubscription", d.AutoDeleteTopicWithLastSubscription) + populate(objectMap, "dataResidencyBoundary", d.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", d.DisableLocalAuth) populate(objectMap, "inboundIpRules", d.InboundIPRules) populate(objectMap, "publicNetworkAccess", d.PublicNetworkAccess) @@ -299,6 +429,7 @@ func (d DomainUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "identity", d.Identity) populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) populate(objectMap, "tags", d.Tags) return json.Marshal(objectMap) } @@ -338,6 +469,88 @@ func (d *DynamicDeliveryAttributeMapping) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EventChannelFilter. +func (e EventChannelFilter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "advancedFilters", e.AdvancedFilters) + populate(objectMap, "enableAdvancedFilteringOnArrays", e.EnableAdvancedFilteringOnArrays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventChannelFilter. +func (e *EventChannelFilter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "advancedFilters": + e.AdvancedFilters, err = unmarshalAdvancedFilterClassificationArray(val) + delete(rawMsg, key) + case "enableAdvancedFilteringOnArrays": + err = unpopulate(val, "EnableAdvancedFilteringOnArrays", &e.EnableAdvancedFilteringOnArrays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EventChannelProperties. +func (e EventChannelProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "destination", e.Destination) + populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", e.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "filter", e.Filter) + populate(objectMap, "partnerTopicFriendlyDescription", e.PartnerTopicFriendlyDescription) + populate(objectMap, "partnerTopicReadinessState", e.PartnerTopicReadinessState) + populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "source", e.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EventChannelProperties. +func (e *EventChannelProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "destination": + err = unpopulate(val, "Destination", &e.Destination) + delete(rawMsg, key) + case "expirationTimeIfNotActivatedUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &e.ExpirationTimeIfNotActivatedUTC) + delete(rawMsg, key) + case "filter": + err = unpopulate(val, "Filter", &e.Filter) + delete(rawMsg, key) + case "partnerTopicFriendlyDescription": + err = unpopulate(val, "PartnerTopicFriendlyDescription", &e.PartnerTopicFriendlyDescription) + delete(rawMsg, key) + case "partnerTopicReadinessState": + err = unpopulate(val, "PartnerTopicReadinessState", &e.PartnerTopicReadinessState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &e.Source) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type EventHubEventSubscriptionDestination. func (e EventHubEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -573,6 +786,14 @@ func (e *EventSubscriptionUpdateParameters) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EventTypeInfo. +func (e EventTypeInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "inlineEventTypes", e.InlineEventTypes) + populate(objectMap, "kind", e.Kind) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type HybridConnectionEventSubscriptionDestination. func (h HybridConnectionEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1018,6 +1239,351 @@ func (n *NumberNotInRangeAdvancedFilter) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Partner. +func (p Partner) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "authorizationExpirationTimeInUtc", p.AuthorizationExpirationTimeInUTC) + populate(objectMap, "partnerName", p.PartnerName) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Partner. +func (p *Partner) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authorizationExpirationTimeInUtc": + err = unpopulateTimeRFC3339(val, "AuthorizationExpirationTimeInUTC", &p.AuthorizationExpirationTimeInUTC) + delete(rawMsg, key) + case "partnerName": + err = unpopulate(val, "PartnerName", &p.PartnerName) + delete(rawMsg, key) + case "partnerRegistrationImmutableId": + err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerAuthorization. +func (p PartnerAuthorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorizedPartnersList", p.AuthorizedPartnersList) + populate(objectMap, "defaultMaximumExpirationTimeInDays", p.DefaultMaximumExpirationTimeInDays) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerConfiguration. +func (p PartnerConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerConfigurationUpdateParameters. +func (p PartnerConfigurationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestination. +func (p PartnerDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationInfo. +func (p PartnerDestinationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureSubscriptionId", p.AzureSubscriptionID) + populate(objectMap, "endpointServiceContext", p.EndpointServiceContext) + objectMap["endpointType"] = p.EndpointType + populate(objectMap, "name", p.Name) + populate(objectMap, "resourceGroupName", p.ResourceGroupName) + populate(objectMap, "resourceMoveChangeHistory", p.ResourceMoveChangeHistory) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationProperties. +func (p PartnerDestinationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activationState", p.ActivationState) + populate(objectMap, "endpointBaseUrl", p.EndpointBaseURL) + populate(objectMap, "endpointServiceContext", p.EndpointServiceContext) + populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", p.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "messageForActivation", p.MessageForActivation) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerDestinationProperties. +func (p *PartnerDestinationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activationState": + err = unpopulate(val, "ActivationState", &p.ActivationState) + delete(rawMsg, key) + case "endpointBaseUrl": + err = unpopulate(val, "EndpointBaseURL", &p.EndpointBaseURL) + delete(rawMsg, key) + case "endpointServiceContext": + err = unpopulate(val, "EndpointServiceContext", &p.EndpointServiceContext) + delete(rawMsg, key) + case "expirationTimeIfNotActivatedUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &p.ExpirationTimeIfNotActivatedUTC) + delete(rawMsg, key) + case "messageForActivation": + err = unpopulate(val, "MessageForActivation", &p.MessageForActivation) + delete(rawMsg, key) + case "partnerRegistrationImmutableId": + err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerDestinationUpdateParameters. +func (p PartnerDestinationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerEventSubscriptionDestination. +func (p PartnerEventSubscriptionDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["endpointType"] = EndpointTypePartnerDestination + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerEventSubscriptionDestination. +func (p *PartnerEventSubscriptionDestination) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &p.EndpointType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespace. +func (p PartnerNamespace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceProperties. +func (p PartnerNamespaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) + populate(objectMap, "endpoint", p.Endpoint) + populate(objectMap, "inboundIpRules", p.InboundIPRules) + populate(objectMap, "partnerRegistrationFullyQualifiedId", p.PartnerRegistrationFullyQualifiedID) + populate(objectMap, "partnerTopicRoutingMode", p.PartnerTopicRoutingMode) + populate(objectMap, "privateEndpointConnections", p.PrivateEndpointConnections) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceUpdateParameterProperties. +func (p PartnerNamespaceUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "disableLocalAuth", p.DisableLocalAuth) + populate(objectMap, "inboundIpRules", p.InboundIPRules) + populate(objectMap, "publicNetworkAccess", p.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerNamespaceUpdateParameters. +func (p PartnerNamespaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerRegistration. +func (p PartnerRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationProperties. +func (p PartnerRegistrationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorizedAzureSubscriptionIds", p.AuthorizedAzureSubscriptionIDs) + populate(objectMap, "customerServiceUri", p.CustomerServiceURI) + populate(objectMap, "logoUri", p.LogoURI) + populate(objectMap, "longDescription", p.LongDescription) + populate(objectMap, "partnerCustomerServiceExtension", p.PartnerCustomerServiceExtension) + populate(objectMap, "partnerCustomerServiceNumber", p.PartnerCustomerServiceNumber) + populate(objectMap, "partnerName", p.PartnerName) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + populate(objectMap, "partnerResourceTypeDescription", p.PartnerResourceTypeDescription) + populate(objectMap, "partnerResourceTypeDisplayName", p.PartnerResourceTypeDisplayName) + populate(objectMap, "partnerResourceTypeName", p.PartnerResourceTypeName) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "setupUri", p.SetupURI) + populate(objectMap, "visibilityState", p.VisibilityState) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerRegistrationUpdateParameters. +func (p PartnerRegistrationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorizedAzureSubscriptionIds", p.AuthorizedAzureSubscriptionIDs) + populate(objectMap, "logoUri", p.LogoURI) + populate(objectMap, "partnerTopicTypeDescription", p.PartnerTopicTypeDescription) + populate(objectMap, "partnerTopicTypeDisplayName", p.PartnerTopicTypeDisplayName) + populate(objectMap, "partnerTopicTypeName", p.PartnerTopicTypeName) + populate(objectMap, "setupUri", p.SetupURI) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerTopic. +func (p PartnerTopic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerTopicProperties. +func (p PartnerTopicProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activationState", p.ActivationState) + populate(objectMap, "eventTypeInfo", p.EventTypeInfo) + populateTimeRFC3339(objectMap, "expirationTimeIfNotActivatedUtc", p.ExpirationTimeIfNotActivatedUTC) + populate(objectMap, "messageForActivation", p.MessageForActivation) + populate(objectMap, "partnerRegistrationImmutableId", p.PartnerRegistrationImmutableID) + populate(objectMap, "partnerTopicFriendlyDescription", p.PartnerTopicFriendlyDescription) + populate(objectMap, "provisioningState", p.ProvisioningState) + populate(objectMap, "source", p.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerTopicProperties. +func (p *PartnerTopicProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "activationState": + err = unpopulate(val, "ActivationState", &p.ActivationState) + delete(rawMsg, key) + case "eventTypeInfo": + err = unpopulate(val, "EventTypeInfo", &p.EventTypeInfo) + delete(rawMsg, key) + case "expirationTimeIfNotActivatedUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeIfNotActivatedUTC", &p.ExpirationTimeIfNotActivatedUTC) + delete(rawMsg, key) + case "messageForActivation": + err = unpopulate(val, "MessageForActivation", &p.MessageForActivation) + delete(rawMsg, key) + case "partnerRegistrationImmutableId": + err = unpopulate(val, "PartnerRegistrationImmutableID", &p.PartnerRegistrationImmutableID) + delete(rawMsg, key) + case "partnerTopicFriendlyDescription": + err = unpopulate(val, "PartnerTopicFriendlyDescription", &p.PartnerTopicFriendlyDescription) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &p.Source) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PartnerTopicUpdateParameters. +func (p PartnerTopicUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", p.Identity) + populate(objectMap, "tags", p.Tags) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1028,6 +1594,41 @@ func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type ResourceMoveChangeHistory. +func (r ResourceMoveChangeHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureSubscriptionId", r.AzureSubscriptionID) + populateTimeRFC3339(objectMap, "changedTimeUtc", r.ChangedTimeUTC) + populate(objectMap, "resourceGroupName", r.ResourceGroupName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveChangeHistory. +func (r *ResourceMoveChangeHistory) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureSubscriptionId": + err = unpopulate(val, "AzureSubscriptionID", &r.AzureSubscriptionID) + delete(rawMsg, key) + case "changedTimeUtc": + err = unpopulateTimeRFC3339(val, "ChangedTimeUTC", &r.ChangedTimeUTC) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &r.ResourceGroupName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ServiceBusQueueEventSubscriptionDestination. func (s ServiceBusQueueEventSubscriptionDestination) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -1601,11 +2202,14 @@ func (s SystemTopicUpdateParameters) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type Topic. func (t Topic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "extendedLocation", t.ExtendedLocation) populate(objectMap, "id", t.ID) populate(objectMap, "identity", t.Identity) + populate(objectMap, "kind", t.Kind) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) + populate(objectMap, "sku", t.SKU) populate(objectMap, "systemData", t.SystemData) populate(objectMap, "tags", t.Tags) populate(objectMap, "type", t.Type) @@ -1615,6 +2219,7 @@ func (t Topic) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type TopicProperties. func (t TopicProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "dataResidencyBoundary", t.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", t.DisableLocalAuth) populate(objectMap, "endpoint", t.Endpoint) populate(objectMap, "inboundIpRules", t.InboundIPRules) @@ -1636,6 +2241,9 @@ func (t *TopicProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "dataResidencyBoundary": + err = unpopulate(val, "DataResidencyBoundary", &t.DataResidencyBoundary) + delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &t.DisableLocalAuth) delete(rawMsg, key) @@ -1688,6 +2296,7 @@ func (t TopicTypeProperties) MarshalJSON() ([]byte, error) { // MarshalJSON implements the json.Marshaller interface for type TopicUpdateParameterProperties. func (t TopicUpdateParameterProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "dataResidencyBoundary", t.DataResidencyBoundary) populate(objectMap, "disableLocalAuth", t.DisableLocalAuth) populate(objectMap, "inboundIpRules", t.InboundIPRules) populate(objectMap, "publicNetworkAccess", t.PublicNetworkAccess) @@ -1699,6 +2308,7 @@ func (t TopicUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "identity", t.Identity) populate(objectMap, "properties", t.Properties) + populate(objectMap, "sku", t.SKU) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } @@ -1796,6 +2406,123 @@ func (w *WebHookEventSubscriptionDestinationProperties) UnmarshalJSON(data []byt return nil } +// MarshalJSON implements the json.Marshaller interface for type WebhookPartnerDestinationInfo. +func (w WebhookPartnerDestinationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "azureSubscriptionId", w.AzureSubscriptionID) + populate(objectMap, "endpointServiceContext", w.EndpointServiceContext) + objectMap["endpointType"] = PartnerEndpointTypeWebHook + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "resourceGroupName", w.ResourceGroupName) + populate(objectMap, "resourceMoveChangeHistory", w.ResourceMoveChangeHistory) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPartnerDestinationInfo. +func (w *WebhookPartnerDestinationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureSubscriptionId": + err = unpopulate(val, "AzureSubscriptionID", &w.AzureSubscriptionID) + delete(rawMsg, key) + case "endpointServiceContext": + err = unpopulate(val, "EndpointServiceContext", &w.EndpointServiceContext) + delete(rawMsg, key) + case "endpointType": + err = unpopulate(val, "EndpointType", &w.EndpointType) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &w.ResourceGroupName) + delete(rawMsg, key) + case "resourceMoveChangeHistory": + err = unpopulate(val, "ResourceMoveChangeHistory", &w.ResourceMoveChangeHistory) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebhookPartnerDestinationProperties. +func (w WebhookPartnerDestinationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientAuthentication", w.ClientAuthentication) + populate(objectMap, "endpointBaseUrl", w.EndpointBaseURL) + populate(objectMap, "endpointUrl", w.EndpointURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookPartnerDestinationProperties. +func (w *WebhookPartnerDestinationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAuthentication": + w.ClientAuthentication, err = unmarshalPartnerClientAuthenticationClassification(val) + delete(rawMsg, key) + case "endpointBaseUrl": + err = unpopulate(val, "EndpointBaseURL", &w.EndpointBaseURL) + delete(rawMsg, key) + case "endpointUrl": + err = unpopulate(val, "EndpointURL", &w.EndpointURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WebhookUpdatePartnerDestinationInfo. +func (w WebhookUpdatePartnerDestinationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["endpointType"] = PartnerEndpointTypeWebHook + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WebhookUpdatePartnerDestinationInfo. +func (w *WebhookUpdatePartnerDestinationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endpointType": + err = unpopulate(val, "EndpointType", &w.EndpointType) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + func populate(m map[string]interface{}, k string, v interface{}) { if v == nil { return diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_operations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_operations_client.go index bad1c4fd517c..87f912a6f03e 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_operations_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the available operations supported by the Microsoft.EventGrid resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -82,7 +82,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerconfigurations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerconfigurations_client.go new file mode 100644 index 000000000000..228caf1bf6d5 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerconfigurations_client.go @@ -0,0 +1,515 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// PartnerConfigurationsClient contains the methods for the PartnerConfigurations group. +// Don't use this type directly, use NewPartnerConfigurationsClient() instead. +type PartnerConfigurationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPartnerConfigurationsClient creates a new instance of PartnerConfigurationsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPartnerConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerConfigurationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PartnerConfigurationsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// AuthorizePartner - Authorize a single partner either by partner registration immutable Id or by partner name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerInfo - The information of the partner to be authorized. +// options - PartnerConfigurationsClientAuthorizePartnerOptions contains the optional parameters for the PartnerConfigurationsClient.AuthorizePartner +// method. +func (client *PartnerConfigurationsClient) AuthorizePartner(ctx context.Context, resourceGroupName string, partnerInfo Partner, options *PartnerConfigurationsClientAuthorizePartnerOptions) (PartnerConfigurationsClientAuthorizePartnerResponse, error) { + req, err := client.authorizePartnerCreateRequest(ctx, resourceGroupName, partnerInfo, options) + if err != nil { + return PartnerConfigurationsClientAuthorizePartnerResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerConfigurationsClientAuthorizePartnerResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerConfigurationsClientAuthorizePartnerResponse{}, runtime.NewResponseError(resp) + } + return client.authorizePartnerHandleResponse(resp) +} + +// authorizePartnerCreateRequest creates the AuthorizePartner request. +func (client *PartnerConfigurationsClient) authorizePartnerCreateRequest(ctx context.Context, resourceGroupName string, partnerInfo Partner, options *PartnerConfigurationsClientAuthorizePartnerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/authorizePartner" + 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)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerInfo) +} + +// authorizePartnerHandleResponse handles the AuthorizePartner response. +func (client *PartnerConfigurationsClient) authorizePartnerHandleResponse(resp *http.Response) (PartnerConfigurationsClientAuthorizePartnerResponse, error) { + result := PartnerConfigurationsClientAuthorizePartnerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerConfiguration); err != nil { + return PartnerConfigurationsClientAuthorizePartnerResponse{}, err + } + return result, nil +} + +// BeginCreateOrUpdate - Synchronously creates or updates a partner configuration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerConfigurationInfo - Partner configuration information. +// options - PartnerConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerConfigurationsClient.BeginCreateOrUpdate +// method. +func (client *PartnerConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, partnerConfigurationInfo PartnerConfiguration, options *PartnerConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PartnerConfigurationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, partnerConfigurationInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerConfigurationsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Synchronously creates or updates a partner configuration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerConfigurationInfo PartnerConfiguration, options *PartnerConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerConfigurationInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerConfigurationInfo PartnerConfiguration, options *PartnerConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerConfigurationInfo) +} + +// BeginDelete - Delete existing partner configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// options - PartnerConfigurationsClientBeginDeleteOptions contains the optional parameters for the PartnerConfigurationsClient.BeginDelete +// method. +func (client *PartnerConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientBeginDeleteOptions) (*runtime.Poller[PartnerConfigurationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerConfigurationsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerConfigurationsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete existing partner configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of a partner configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// options - PartnerConfigurationsClientGetOptions contains the optional parameters for the PartnerConfigurationsClient.Get +// method. +func (client *PartnerConfigurationsClient) Get(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientGetOptions) (PartnerConfigurationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, options) + if err != nil { + return PartnerConfigurationsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerConfigurationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PartnerConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PartnerConfigurationsClient) getHandleResponse(resp *http.Response) (PartnerConfigurationsClientGetResponse, error) { + result := PartnerConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerConfiguration); err != nil { + return PartnerConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the partner configurations under a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// options - PartnerConfigurationsClientListByResourceGroupOptions contains the optional parameters for the PartnerConfigurationsClient.ListByResourceGroup +// method. +func (client *PartnerConfigurationsClient) NewListByResourceGroupPager(resourceGroupName string, options *PartnerConfigurationsClientListByResourceGroupOptions) *runtime.Pager[PartnerConfigurationsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerConfigurationsClientListByResourceGroupResponse]{ + More: func(page PartnerConfigurationsClientListByResourceGroupResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PartnerConfigurationsClientListByResourceGroupResponse) (PartnerConfigurationsClientListByResourceGroupResponse, error) { + req, err := client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + if err != nil { + return PartnerConfigurationsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerConfigurationsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerConfigurationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PartnerConfigurationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerConfigurationsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *PartnerConfigurationsClient) listByResourceGroupHandleResponse(resp *http.Response) (PartnerConfigurationsClientListByResourceGroupResponse, error) { + result := PartnerConfigurationsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerConfigurationsListResult); err != nil { + return PartnerConfigurationsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the partner configurations under an Azure subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// options - PartnerConfigurationsClientListBySubscriptionOptions contains the optional parameters for the PartnerConfigurationsClient.ListBySubscription +// method. +func (client *PartnerConfigurationsClient) NewListBySubscriptionPager(options *PartnerConfigurationsClientListBySubscriptionOptions) *runtime.Pager[PartnerConfigurationsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerConfigurationsClientListBySubscriptionResponse]{ + More: func(page PartnerConfigurationsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerConfigurationsClientListBySubscriptionResponse) (PartnerConfigurationsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerConfigurationsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerConfigurationsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerConfigurationsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PartnerConfigurationsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PartnerConfigurationsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerConfigurations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PartnerConfigurationsClient) listBySubscriptionHandleResponse(resp *http.Response) (PartnerConfigurationsClientListBySubscriptionResponse, error) { + result := PartnerConfigurationsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerConfigurationsListResult); err != nil { + return PartnerConfigurationsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// UnauthorizePartner - Unauthorize a single partner either by partner registration immutable Id or by partner name. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerInfo - The information of the partner to be unauthorized. +// options - PartnerConfigurationsClientUnauthorizePartnerOptions contains the optional parameters for the PartnerConfigurationsClient.UnauthorizePartner +// method. +func (client *PartnerConfigurationsClient) UnauthorizePartner(ctx context.Context, resourceGroupName string, partnerInfo Partner, options *PartnerConfigurationsClientUnauthorizePartnerOptions) (PartnerConfigurationsClientUnauthorizePartnerResponse, error) { + req, err := client.unauthorizePartnerCreateRequest(ctx, resourceGroupName, partnerInfo, options) + if err != nil { + return PartnerConfigurationsClientUnauthorizePartnerResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerConfigurationsClientUnauthorizePartnerResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerConfigurationsClientUnauthorizePartnerResponse{}, runtime.NewResponseError(resp) + } + return client.unauthorizePartnerHandleResponse(resp) +} + +// unauthorizePartnerCreateRequest creates the UnauthorizePartner request. +func (client *PartnerConfigurationsClient) unauthorizePartnerCreateRequest(ctx context.Context, resourceGroupName string, partnerInfo Partner, options *PartnerConfigurationsClientUnauthorizePartnerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default/unauthorizePartner" + 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)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerInfo) +} + +// unauthorizePartnerHandleResponse handles the UnauthorizePartner response. +func (client *PartnerConfigurationsClient) unauthorizePartnerHandleResponse(resp *http.Response) (PartnerConfigurationsClientUnauthorizePartnerResponse, error) { + result := PartnerConfigurationsClientUnauthorizePartnerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerConfiguration); err != nil { + return PartnerConfigurationsClientUnauthorizePartnerResponse{}, err + } + return result, nil +} + +// BeginUpdate - Synchronously updates a partner configuration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerConfigurationUpdateParameters - Partner configuration update information. +// options - PartnerConfigurationsClientBeginUpdateOptions contains the optional parameters for the PartnerConfigurationsClient.BeginUpdate +// method. +func (client *PartnerConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, partnerConfigurationUpdateParameters PartnerConfigurationUpdateParameters, options *PartnerConfigurationsClientBeginUpdateOptions) (*runtime.Poller[PartnerConfigurationsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, partnerConfigurationUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerConfigurationsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerConfigurationsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Synchronously updates a partner configuration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerConfigurationsClient) update(ctx context.Context, resourceGroupName string, partnerConfigurationUpdateParameters PartnerConfigurationUpdateParameters, options *PartnerConfigurationsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerConfigurationUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PartnerConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerConfigurationUpdateParameters PartnerConfigurationUpdateParameters, options *PartnerConfigurationsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerConfigurations/default" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerConfigurationUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerdestinations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerdestinations_client.go new file mode 100644 index 000000000000..42bbb0166553 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerdestinations_client.go @@ -0,0 +1,485 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// PartnerDestinationsClient contains the methods for the PartnerDestinations group. +// Don't use this type directly, use NewPartnerDestinationsClient() instead. +type PartnerDestinationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPartnerDestinationsClient creates a new instance of PartnerDestinationsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPartnerDestinationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerDestinationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PartnerDestinationsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Activate - Activate a newly created partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerDestinationName - Name of the partner destination. +// options - PartnerDestinationsClientActivateOptions contains the optional parameters for the PartnerDestinationsClient.Activate +// method. +func (client *PartnerDestinationsClient) Activate(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientActivateOptions) (PartnerDestinationsClientActivateResponse, error) { + req, err := client.activateCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientActivateResponse{}, runtime.NewResponseError(resp) + } + return client.activateHandleResponse(resp) +} + +// activateCreateRequest creates the Activate request. +func (client *PartnerDestinationsClient) activateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientActivateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}/activate" + 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 partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// activateHandleResponse handles the Activate response. +func (client *PartnerDestinationsClient) activateHandleResponse(resp *http.Response) (PartnerDestinationsClientActivateResponse, error) { + result := PartnerDestinationsClientActivateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestination); err != nil { + return PartnerDestinationsClientActivateResponse{}, err + } + return result, nil +} + +// CreateOrUpdate - Asynchronously creates a new partner destination with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerDestinationName - Name of the partner destination. +// partnerDestination - Partner destination create information. +// options - PartnerDestinationsClientCreateOrUpdateOptions contains the optional parameters for the PartnerDestinationsClient.CreateOrUpdate +// method. +func (client *PartnerDestinationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination PartnerDestination, options *PartnerDestinationsClientCreateOrUpdateOptions) (PartnerDestinationsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerDestinationName, partnerDestination, options) + if err != nil { + return PartnerDestinationsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerDestinationsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return PartnerDestinationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerDestinationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestination PartnerDestination, options *PartnerDestinationsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + 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 partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerDestination) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *PartnerDestinationsClient) createOrUpdateHandleResponse(resp *http.Response) (PartnerDestinationsClientCreateOrUpdateResponse, error) { + result := PartnerDestinationsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestination); err != nil { + return PartnerDestinationsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// BeginDelete - Delete existing partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerDestinationName - Name of the partner destination. +// options - PartnerDestinationsClientBeginDeleteOptions contains the optional parameters for the PartnerDestinationsClient.BeginDelete +// method. +func (client *PartnerDestinationsClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientBeginDeleteOptions) (*runtime.Poller[PartnerDestinationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerDestinationsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerDestinationsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete existing partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerDestinationsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerDestinationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + 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 partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of a partner destination. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerDestinationName - Name of the partner destination. +// options - PartnerDestinationsClientGetOptions contains the optional parameters for the PartnerDestinationsClient.Get method. +func (client *PartnerDestinationsClient) Get(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientGetOptions) (PartnerDestinationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerDestinationName, options) + if err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PartnerDestinationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, options *PartnerDestinationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + 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 partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PartnerDestinationsClient) getHandleResponse(resp *http.Response) (PartnerDestinationsClientGetResponse, error) { + result := PartnerDestinationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestination); err != nil { + return PartnerDestinationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the partner destinations under a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// options - PartnerDestinationsClientListByResourceGroupOptions contains the optional parameters for the PartnerDestinationsClient.ListByResourceGroup +// method. +func (client *PartnerDestinationsClient) NewListByResourceGroupPager(resourceGroupName string, options *PartnerDestinationsClientListByResourceGroupOptions) *runtime.Pager[PartnerDestinationsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerDestinationsClientListByResourceGroupResponse]{ + More: func(page PartnerDestinationsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerDestinationsClientListByResourceGroupResponse) (PartnerDestinationsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerDestinationsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerDestinationsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PartnerDestinationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerDestinationsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *PartnerDestinationsClient) listByResourceGroupHandleResponse(resp *http.Response) (PartnerDestinationsClientListByResourceGroupResponse, error) { + result := PartnerDestinationsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestinationsListResult); err != nil { + return PartnerDestinationsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the partner destinations under an Azure subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// options - PartnerDestinationsClientListBySubscriptionOptions contains the optional parameters for the PartnerDestinationsClient.ListBySubscription +// method. +func (client *PartnerDestinationsClient) NewListBySubscriptionPager(options *PartnerDestinationsClientListBySubscriptionOptions) *runtime.Pager[PartnerDestinationsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerDestinationsClientListBySubscriptionResponse]{ + More: func(page PartnerDestinationsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerDestinationsClientListBySubscriptionResponse) (PartnerDestinationsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerDestinationsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerDestinationsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerDestinationsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PartnerDestinationsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PartnerDestinationsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerDestinations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PartnerDestinationsClient) listBySubscriptionHandleResponse(resp *http.Response) (PartnerDestinationsClientListBySubscriptionResponse, error) { + result := PartnerDestinationsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestinationsListResult); err != nil { + return PartnerDestinationsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Update - Asynchronously updates a partner destination with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerDestinationName - Name of the partner destination. +// partnerDestinationUpdateParameters - Partner destination update information. +// options - PartnerDestinationsClientUpdateOptions contains the optional parameters for the PartnerDestinationsClient.Update +// method. +func (client *PartnerDestinationsClient) Update(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters PartnerDestinationUpdateParameters, options *PartnerDestinationsClientUpdateOptions) (PartnerDestinationsClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerDestinationName, partnerDestinationUpdateParameters, options) + if err != nil { + return PartnerDestinationsClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerDestinationsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return PartnerDestinationsClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *PartnerDestinationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerDestinationName string, partnerDestinationUpdateParameters PartnerDestinationUpdateParameters, options *PartnerDestinationsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerDestinations/{partnerDestinationName}" + 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 partnerDestinationName == "" { + return nil, errors.New("parameter partnerDestinationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerDestinationName}", url.PathEscape(partnerDestinationName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerDestinationUpdateParameters) +} + +// updateHandleResponse handles the Update response. +func (client *PartnerDestinationsClient) updateHandleResponse(resp *http.Response) (PartnerDestinationsClientUpdateResponse, error) { + result := PartnerDestinationsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerDestination); err != nil { + return PartnerDestinationsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnernamespaces_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnernamespaces_client.go new file mode 100644 index 000000000000..9a7bf069075b --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnernamespaces_client.go @@ -0,0 +1,555 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// PartnerNamespacesClient contains the methods for the PartnerNamespaces group. +// Don't use this type directly, use NewPartnerNamespacesClient() instead. +type PartnerNamespacesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPartnerNamespacesClient creates a new instance of PartnerNamespacesClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPartnerNamespacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerNamespacesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PartnerNamespacesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Asynchronously creates a new partner namespace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// partnerNamespaceInfo - PartnerNamespace information. +// options - PartnerNamespacesClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerNamespacesClient.BeginCreateOrUpdate +// method. +func (client *PartnerNamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceInfo PartnerNamespace, options *PartnerNamespacesClientBeginCreateOrUpdateOptions) (*runtime.Poller[PartnerNamespacesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, partnerNamespaceName, partnerNamespaceInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerNamespacesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerNamespacesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Asynchronously creates a new partner namespace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerNamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceInfo PartnerNamespace, options *PartnerNamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerNamespaceName, partnerNamespaceInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerNamespacesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceInfo PartnerNamespace, options *PartnerNamespacesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerNamespaceInfo) +} + +// BeginDelete - Delete existing partner namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// options - PartnerNamespacesClientBeginDeleteOptions contains the optional parameters for the PartnerNamespacesClient.BeginDelete +// method. +func (client *PartnerNamespacesClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientBeginDeleteOptions) (*runtime.Poller[PartnerNamespacesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerNamespaceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerNamespacesClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerNamespacesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete existing partner namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerNamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerNamespaceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerNamespacesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of a partner namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// options - PartnerNamespacesClientGetOptions contains the optional parameters for the PartnerNamespacesClient.Get method. +func (client *PartnerNamespacesClient) Get(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientGetOptions) (PartnerNamespacesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerNamespaceName, options) + if err != nil { + return PartnerNamespacesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerNamespacesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerNamespacesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PartnerNamespacesClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PartnerNamespacesClient) getHandleResponse(resp *http.Response) (PartnerNamespacesClientGetResponse, error) { + result := PartnerNamespacesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerNamespace); err != nil { + return PartnerNamespacesClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the partner namespaces under a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// options - PartnerNamespacesClientListByResourceGroupOptions contains the optional parameters for the PartnerNamespacesClient.ListByResourceGroup +// method. +func (client *PartnerNamespacesClient) NewListByResourceGroupPager(resourceGroupName string, options *PartnerNamespacesClientListByResourceGroupOptions) *runtime.Pager[PartnerNamespacesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerNamespacesClientListByResourceGroupResponse]{ + More: func(page PartnerNamespacesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerNamespacesClientListByResourceGroupResponse) (PartnerNamespacesClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerNamespacesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerNamespacesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerNamespacesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PartnerNamespacesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerNamespacesClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *PartnerNamespacesClient) listByResourceGroupHandleResponse(resp *http.Response) (PartnerNamespacesClientListByResourceGroupResponse, error) { + result := PartnerNamespacesClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerNamespacesListResult); err != nil { + return PartnerNamespacesClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the partner namespaces under an Azure subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// options - PartnerNamespacesClientListBySubscriptionOptions contains the optional parameters for the PartnerNamespacesClient.ListBySubscription +// method. +func (client *PartnerNamespacesClient) NewListBySubscriptionPager(options *PartnerNamespacesClientListBySubscriptionOptions) *runtime.Pager[PartnerNamespacesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerNamespacesClientListBySubscriptionResponse]{ + More: func(page PartnerNamespacesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerNamespacesClientListBySubscriptionResponse) (PartnerNamespacesClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerNamespacesClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerNamespacesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerNamespacesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PartnerNamespacesClient) listBySubscriptionCreateRequest(ctx context.Context, options *PartnerNamespacesClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerNamespaces" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PartnerNamespacesClient) listBySubscriptionHandleResponse(resp *http.Response) (PartnerNamespacesClientListBySubscriptionResponse, error) { + result := PartnerNamespacesClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerNamespacesListResult); err != nil { + return PartnerNamespacesClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// ListSharedAccessKeys - List the two keys used to publish to a partner namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// options - PartnerNamespacesClientListSharedAccessKeysOptions contains the optional parameters for the PartnerNamespacesClient.ListSharedAccessKeys +// method. +func (client *PartnerNamespacesClient) ListSharedAccessKeys(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientListSharedAccessKeysOptions) (PartnerNamespacesClientListSharedAccessKeysResponse, error) { + req, err := client.listSharedAccessKeysCreateRequest(ctx, resourceGroupName, partnerNamespaceName, options) + if err != nil { + return PartnerNamespacesClientListSharedAccessKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerNamespacesClientListSharedAccessKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerNamespacesClientListSharedAccessKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listSharedAccessKeysHandleResponse(resp) +} + +// listSharedAccessKeysCreateRequest creates the ListSharedAccessKeys request. +func (client *PartnerNamespacesClient) listSharedAccessKeysCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, options *PartnerNamespacesClientListSharedAccessKeysOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/listKeys" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listSharedAccessKeysHandleResponse handles the ListSharedAccessKeys response. +func (client *PartnerNamespacesClient) listSharedAccessKeysHandleResponse(resp *http.Response) (PartnerNamespacesClientListSharedAccessKeysResponse, error) { + result := PartnerNamespacesClientListSharedAccessKeysResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerNamespaceSharedAccessKeys); err != nil { + return PartnerNamespacesClientListSharedAccessKeysResponse{}, err + } + return result, nil +} + +// RegenerateKey - Regenerate a shared access key for a partner namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// regenerateKeyRequest - Request body to regenerate key. +// options - PartnerNamespacesClientRegenerateKeyOptions contains the optional parameters for the PartnerNamespacesClient.RegenerateKey +// method. +func (client *PartnerNamespacesClient) RegenerateKey(ctx context.Context, resourceGroupName string, partnerNamespaceName string, regenerateKeyRequest PartnerNamespaceRegenerateKeyRequest, options *PartnerNamespacesClientRegenerateKeyOptions) (PartnerNamespacesClientRegenerateKeyResponse, error) { + req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, partnerNamespaceName, regenerateKeyRequest, options) + if err != nil { + return PartnerNamespacesClientRegenerateKeyResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerNamespacesClientRegenerateKeyResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerNamespacesClientRegenerateKeyResponse{}, runtime.NewResponseError(resp) + } + return client.regenerateKeyHandleResponse(resp) +} + +// regenerateKeyCreateRequest creates the RegenerateKey request. +func (client *PartnerNamespacesClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, regenerateKeyRequest PartnerNamespaceRegenerateKeyRequest, options *PartnerNamespacesClientRegenerateKeyOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}/regenerateKey" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) +} + +// regenerateKeyHandleResponse handles the RegenerateKey response. +func (client *PartnerNamespacesClient) regenerateKeyHandleResponse(resp *http.Response) (PartnerNamespacesClientRegenerateKeyResponse, error) { + result := PartnerNamespacesClientRegenerateKeyResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerNamespaceSharedAccessKeys); err != nil { + return PartnerNamespacesClientRegenerateKeyResponse{}, err + } + return result, nil +} + +// BeginUpdate - Asynchronously updates a partner namespace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerNamespaceName - Name of the partner namespace. +// partnerNamespaceUpdateParameters - Partner namespace update information. +// options - PartnerNamespacesClientBeginUpdateOptions contains the optional parameters for the PartnerNamespacesClient.BeginUpdate +// method. +func (client *PartnerNamespacesClient) BeginUpdate(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceUpdateParameters PartnerNamespaceUpdateParameters, options *PartnerNamespacesClientBeginUpdateOptions) (*runtime.Poller[PartnerNamespacesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerNamespacesClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerNamespacesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Asynchronously updates a partner namespace with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerNamespacesClient) update(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceUpdateParameters PartnerNamespaceUpdateParameters, options *PartnerNamespacesClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerNamespaceName, partnerNamespaceUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PartnerNamespacesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerNamespaceName string, partnerNamespaceUpdateParameters PartnerNamespaceUpdateParameters, options *PartnerNamespacesClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerNamespaces/{partnerNamespaceName}" + 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 partnerNamespaceName == "" { + return nil, errors.New("parameter partnerNamespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerNamespaceName}", url.PathEscape(partnerNamespaceName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerNamespaceUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerregistrations_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerregistrations_client.go new file mode 100644 index 000000000000..a42fd17869a4 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnerregistrations_client.go @@ -0,0 +1,441 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// PartnerRegistrationsClient contains the methods for the PartnerRegistrations group. +// Don't use this type directly, use NewPartnerRegistrationsClient() instead. +type PartnerRegistrationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPartnerRegistrationsClient creates a new instance of PartnerRegistrationsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPartnerRegistrationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerRegistrationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PartnerRegistrationsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates a new partner registration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerRegistrationName - Name of the partner registration. +// partnerRegistrationInfo - PartnerRegistration information. +// options - PartnerRegistrationsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerRegistrationsClient.BeginCreateOrUpdate +// method. +func (client *PartnerRegistrationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationInfo PartnerRegistration, options *PartnerRegistrationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PartnerRegistrationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, partnerRegistrationName, partnerRegistrationInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerRegistrationsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerRegistrationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates a new partner registration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerRegistrationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationInfo PartnerRegistration, options *PartnerRegistrationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerRegistrationName, partnerRegistrationInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerRegistrationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationInfo PartnerRegistration, options *PartnerRegistrationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + 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 partnerRegistrationName == "" { + return nil, errors.New("parameter partnerRegistrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerRegistrationName}", url.PathEscape(partnerRegistrationName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerRegistrationInfo) +} + +// BeginDelete - Deletes a partner registration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerRegistrationName - Name of the partner registration. +// options - PartnerRegistrationsClientBeginDeleteOptions contains the optional parameters for the PartnerRegistrationsClient.BeginDelete +// method. +func (client *PartnerRegistrationsClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerRegistrationName string, options *PartnerRegistrationsClientBeginDeleteOptions) (*runtime.Poller[PartnerRegistrationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerRegistrationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerRegistrationsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerRegistrationsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes a partner registration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerRegistrationsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerRegistrationName string, options *PartnerRegistrationsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerRegistrationName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerRegistrationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerRegistrationName string, options *PartnerRegistrationsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + 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 partnerRegistrationName == "" { + return nil, errors.New("parameter partnerRegistrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerRegistrationName}", url.PathEscape(partnerRegistrationName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets a partner registration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerRegistrationName - Name of the partner registration. +// options - PartnerRegistrationsClientGetOptions contains the optional parameters for the PartnerRegistrationsClient.Get +// method. +func (client *PartnerRegistrationsClient) Get(ctx context.Context, resourceGroupName string, partnerRegistrationName string, options *PartnerRegistrationsClientGetOptions) (PartnerRegistrationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerRegistrationName, options) + if err != nil { + return PartnerRegistrationsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerRegistrationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerRegistrationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PartnerRegistrationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerRegistrationName string, options *PartnerRegistrationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + 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 partnerRegistrationName == "" { + return nil, errors.New("parameter partnerRegistrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerRegistrationName}", url.PathEscape(partnerRegistrationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PartnerRegistrationsClient) getHandleResponse(resp *http.Response) (PartnerRegistrationsClientGetResponse, error) { + result := PartnerRegistrationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerRegistration); err != nil { + return PartnerRegistrationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the partner registrations under a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// options - PartnerRegistrationsClientListByResourceGroupOptions contains the optional parameters for the PartnerRegistrationsClient.ListByResourceGroup +// method. +func (client *PartnerRegistrationsClient) NewListByResourceGroupPager(resourceGroupName string, options *PartnerRegistrationsClientListByResourceGroupOptions) *runtime.Pager[PartnerRegistrationsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerRegistrationsClientListByResourceGroupResponse]{ + More: func(page PartnerRegistrationsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerRegistrationsClientListByResourceGroupResponse) (PartnerRegistrationsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerRegistrationsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerRegistrationsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerRegistrationsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PartnerRegistrationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerRegistrationsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *PartnerRegistrationsClient) listByResourceGroupHandleResponse(resp *http.Response) (PartnerRegistrationsClientListByResourceGroupResponse, error) { + result := PartnerRegistrationsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerRegistrationsListResult); err != nil { + return PartnerRegistrationsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the partner registrations under an Azure subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// options - PartnerRegistrationsClientListBySubscriptionOptions contains the optional parameters for the PartnerRegistrationsClient.ListBySubscription +// method. +func (client *PartnerRegistrationsClient) NewListBySubscriptionPager(options *PartnerRegistrationsClientListBySubscriptionOptions) *runtime.Pager[PartnerRegistrationsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerRegistrationsClientListBySubscriptionResponse]{ + More: func(page PartnerRegistrationsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerRegistrationsClientListBySubscriptionResponse) (PartnerRegistrationsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerRegistrationsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerRegistrationsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerRegistrationsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PartnerRegistrationsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PartnerRegistrationsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerRegistrations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PartnerRegistrationsClient) listBySubscriptionHandleResponse(resp *http.Response) (PartnerRegistrationsClientListBySubscriptionResponse, error) { + result := PartnerRegistrationsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerRegistrationsListResult); err != nil { + return PartnerRegistrationsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates a partner registration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerRegistrationName - Name of the partner registration. +// partnerRegistrationUpdateParameters - Partner registration update information. +// options - PartnerRegistrationsClientBeginUpdateOptions contains the optional parameters for the PartnerRegistrationsClient.BeginUpdate +// method. +func (client *PartnerRegistrationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationUpdateParameters PartnerRegistrationUpdateParameters, options *PartnerRegistrationsClientBeginUpdateOptions) (*runtime.Poller[PartnerRegistrationsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, partnerRegistrationName, partnerRegistrationUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerRegistrationsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerRegistrationsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Updates a partner registration with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerRegistrationsClient) update(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationUpdateParameters PartnerRegistrationUpdateParameters, options *PartnerRegistrationsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerRegistrationName, partnerRegistrationUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PartnerRegistrationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerRegistrationName string, partnerRegistrationUpdateParameters PartnerRegistrationUpdateParameters, options *PartnerRegistrationsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerRegistrations/{partnerRegistrationName}" + 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 partnerRegistrationName == "" { + return nil, errors.New("parameter partnerRegistrationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerRegistrationName}", url.PathEscape(partnerRegistrationName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerRegistrationUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnertopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnertopiceventsubscriptions_client.go new file mode 100644 index 000000000000..1458e3482b4c --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnertopiceventsubscriptions_client.go @@ -0,0 +1,532 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// PartnerTopicEventSubscriptionsClient contains the methods for the PartnerTopicEventSubscriptions group. +// Don't use this type directly, use NewPartnerTopicEventSubscriptionsClient() instead. +type PartnerTopicEventSubscriptionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPartnerTopicEventSubscriptionsClient creates a new instance of PartnerTopicEventSubscriptionsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPartnerTopicEventSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerTopicEventSubscriptionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PartnerTopicEventSubscriptionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +// Existing event subscriptions will be updated with this API. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// eventSubscriptionInfo - Event subscription properties containing the destination and filter information. +// options - PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +func (client *PartnerTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PartnerTopicEventSubscriptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerTopicEventSubscriptionsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerTopicEventSubscriptionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Asynchronously creates or updates an event subscription of a partner topic with the specified parameters. +// Existing event subscriptions will be updated with this API. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerTopicEventSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *PartnerTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) +} + +// BeginDelete - Delete an existing event subscription of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - PartnerTopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.BeginDelete +// method. +func (client *PartnerTopicEventSubscriptionsClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[PartnerTopicEventSubscriptionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerTopicEventSubscriptionsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerTopicEventSubscriptionsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete an existing event subscription of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerTopicEventSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of an event subscription of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be found. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - PartnerTopicEventSubscriptionsClientGetOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.Get +// method. +func (client *PartnerTopicEventSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientGetOptions) (PartnerTopicEventSubscriptionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, options) + if err != nil { + return PartnerTopicEventSubscriptionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicEventSubscriptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicEventSubscriptionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PartnerTopicEventSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PartnerTopicEventSubscriptionsClient) getHandleResponse(resp *http.Response) (PartnerTopicEventSubscriptionsClientGetResponse, error) { + result := PartnerTopicEventSubscriptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscription); err != nil { + return PartnerTopicEventSubscriptionsClientGetResponse{}, err + } + return result, nil +} + +// GetDeliveryAttributes - Get all delivery attributes for an event subscription of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - PartnerTopicEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.GetDeliveryAttributes +// method. +func (client *PartnerTopicEventSubscriptionsClient) GetDeliveryAttributes(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientGetDeliveryAttributesOptions) (PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + req, err := client.getDeliveryAttributesCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, options) + if err != nil { + return PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, runtime.NewResponseError(resp) + } + return client.getDeliveryAttributesHandleResponse(resp) +} + +// getDeliveryAttributesCreateRequest creates the GetDeliveryAttributes request. +func (client *PartnerTopicEventSubscriptionsClient) getDeliveryAttributesCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientGetDeliveryAttributesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getDeliveryAttributesHandleResponse handles the GetDeliveryAttributes response. +func (client *PartnerTopicEventSubscriptionsClient) getDeliveryAttributesHandleResponse(resp *http.Response) (PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + result := PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeliveryAttributeListResult); err != nil { + return PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + return result, nil +} + +// GetFullURL - Get the full endpoint URL for an event subscription of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - PartnerTopicEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.GetFullURL +// method. +func (client *PartnerTopicEventSubscriptionsClient) GetFullURL(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientGetFullURLOptions) (PartnerTopicEventSubscriptionsClientGetFullURLResponse, error) { + req, err := client.getFullURLCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, options) + if err != nil { + return PartnerTopicEventSubscriptionsClientGetFullURLResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicEventSubscriptionsClientGetFullURLResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicEventSubscriptionsClientGetFullURLResponse{}, runtime.NewResponseError(resp) + } + return client.getFullURLHandleResponse(resp) +} + +// getFullURLCreateRequest creates the GetFullURL request. +func (client *PartnerTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, options *PartnerTopicEventSubscriptionsClientGetFullURLOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getFullURLHandleResponse handles the GetFullURL response. +func (client *PartnerTopicEventSubscriptionsClient) getFullURLHandleResponse(resp *http.Response) (PartnerTopicEventSubscriptionsClientGetFullURLResponse, error) { + result := PartnerTopicEventSubscriptionsClientGetFullURLResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionFullURL); err != nil { + return PartnerTopicEventSubscriptionsClientGetFullURLResponse{}, err + } + return result, nil +} + +// NewListByPartnerTopicPager - List event subscriptions that belong to a specific partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// options - PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.ListByPartnerTopic +// method. +func (client *PartnerTopicEventSubscriptionsClient) NewListByPartnerTopicPager(resourceGroupName string, partnerTopicName string, options *PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions) *runtime.Pager[PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse]{ + More: func(page PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse) (PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByPartnerTopicCreateRequest(ctx, resourceGroupName, partnerTopicName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse{}, runtime.NewResponseError(resp) + } + return client.listByPartnerTopicHandleResponse(resp) + }, + }) +} + +// listByPartnerTopicCreateRequest creates the ListByPartnerTopic request. +func (client *PartnerTopicEventSubscriptionsClient) listByPartnerTopicCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicEventSubscriptionsClientListByPartnerTopicOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByPartnerTopicHandleResponse handles the ListByPartnerTopic response. +func (client *PartnerTopicEventSubscriptionsClient) listByPartnerTopicHandleResponse(resp *http.Response) (PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse, error) { + result := PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionsListResult); err != nil { + return PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update an existing event subscription of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// eventSubscriptionUpdateParameters - Updated event subscription information. +// options - PartnerTopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the PartnerTopicEventSubscriptionsClient.BeginUpdate +// method. +func (client *PartnerTopicEventSubscriptionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *PartnerTopicEventSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[PartnerTopicEventSubscriptionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerTopicEventSubscriptionsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerTopicEventSubscriptionsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update an existing event subscription of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *PartnerTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *PartnerTopicEventSubscriptionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *PartnerTopicEventSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/eventSubscriptions/{eventSubscriptionName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnertopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnertopics_client.go new file mode 100644 index 000000000000..bc86f05033e0 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_partnertopics_client.go @@ -0,0 +1,540 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// PartnerTopicsClient contains the methods for the PartnerTopics group. +// Don't use this type directly, use NewPartnerTopicsClient() instead. +type PartnerTopicsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPartnerTopicsClient creates a new instance of PartnerTopicsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPartnerTopicsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PartnerTopicsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PartnerTopicsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Activate - Activate a newly created partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// options - PartnerTopicsClientActivateOptions contains the optional parameters for the PartnerTopicsClient.Activate method. +func (client *PartnerTopicsClient) Activate(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientActivateOptions) (PartnerTopicsClientActivateResponse, error) { + req, err := client.activateCreateRequest(ctx, resourceGroupName, partnerTopicName, options) + if err != nil { + return PartnerTopicsClientActivateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicsClientActivateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicsClientActivateResponse{}, runtime.NewResponseError(resp) + } + return client.activateHandleResponse(resp) +} + +// activateCreateRequest creates the Activate request. +func (client *PartnerTopicsClient) activateCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientActivateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/activate" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// activateHandleResponse handles the Activate response. +func (client *PartnerTopicsClient) activateHandleResponse(resp *http.Response) (PartnerTopicsClientActivateResponse, error) { + result := PartnerTopicsClientActivateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerTopic); err != nil { + return PartnerTopicsClientActivateResponse{}, err + } + return result, nil +} + +// CreateOrUpdate - Asynchronously creates a new partner topic with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// partnerTopicInfo - Partner Topic information. +// options - PartnerTopicsClientCreateOrUpdateOptions contains the optional parameters for the PartnerTopicsClient.CreateOrUpdate +// method. +func (client *PartnerTopicsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, partnerTopicName string, partnerTopicInfo PartnerTopic, options *PartnerTopicsClientCreateOrUpdateOptions) (PartnerTopicsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, partnerTopicName, partnerTopicInfo, options) + if err != nil { + return PartnerTopicsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return PartnerTopicsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PartnerTopicsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, partnerTopicInfo PartnerTopic, options *PartnerTopicsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerTopicInfo) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *PartnerTopicsClient) createOrUpdateHandleResponse(resp *http.Response) (PartnerTopicsClientCreateOrUpdateResponse, error) { + result := PartnerTopicsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerTopic); err != nil { + return PartnerTopicsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Deactivate - Deactivate specific partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// options - PartnerTopicsClientDeactivateOptions contains the optional parameters for the PartnerTopicsClient.Deactivate +// method. +func (client *PartnerTopicsClient) Deactivate(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientDeactivateOptions) (PartnerTopicsClientDeactivateResponse, error) { + req, err := client.deactivateCreateRequest(ctx, resourceGroupName, partnerTopicName, options) + if err != nil { + return PartnerTopicsClientDeactivateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicsClientDeactivateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicsClientDeactivateResponse{}, runtime.NewResponseError(resp) + } + return client.deactivateHandleResponse(resp) +} + +// deactivateCreateRequest creates the Deactivate request. +func (client *PartnerTopicsClient) deactivateCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientDeactivateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}/deactivate" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// deactivateHandleResponse handles the Deactivate response. +func (client *PartnerTopicsClient) deactivateHandleResponse(resp *http.Response) (PartnerTopicsClientDeactivateResponse, error) { + result := PartnerTopicsClientDeactivateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerTopic); err != nil { + return PartnerTopicsClientDeactivateResponse{}, err + } + return result, nil +} + +// BeginDelete - Delete existing partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// options - PartnerTopicsClientBeginDeleteOptions contains the optional parameters for the PartnerTopicsClient.BeginDelete +// method. +func (client *PartnerTopicsClient) BeginDelete(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientBeginDeleteOptions) (*runtime.Poller[PartnerTopicsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, partnerTopicName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PartnerTopicsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PartnerTopicsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete existing partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *PartnerTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, partnerTopicName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PartnerTopicsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of a partner topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// options - PartnerTopicsClientGetOptions contains the optional parameters for the PartnerTopicsClient.Get method. +func (client *PartnerTopicsClient) Get(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientGetOptions) (PartnerTopicsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, partnerTopicName, options) + if err != nil { + return PartnerTopicsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PartnerTopicsClient) getCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, options *PartnerTopicsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PartnerTopicsClient) getHandleResponse(resp *http.Response) (PartnerTopicsClientGetResponse, error) { + result := PartnerTopicsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerTopic); err != nil { + return PartnerTopicsClientGetResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - List all the partner topics under a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// options - PartnerTopicsClientListByResourceGroupOptions contains the optional parameters for the PartnerTopicsClient.ListByResourceGroup +// method. +func (client *PartnerTopicsClient) NewListByResourceGroupPager(resourceGroupName string, options *PartnerTopicsClientListByResourceGroupOptions) *runtime.Pager[PartnerTopicsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerTopicsClientListByResourceGroupResponse]{ + More: func(page PartnerTopicsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerTopicsClientListByResourceGroupResponse) (PartnerTopicsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerTopicsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *PartnerTopicsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *PartnerTopicsClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *PartnerTopicsClient) listByResourceGroupHandleResponse(resp *http.Response) (PartnerTopicsClientListByResourceGroupResponse, error) { + result := PartnerTopicsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerTopicsListResult); err != nil { + return PartnerTopicsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - List all the partner topics under an Azure subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// options - PartnerTopicsClientListBySubscriptionOptions contains the optional parameters for the PartnerTopicsClient.ListBySubscription +// method. +func (client *PartnerTopicsClient) NewListBySubscriptionPager(options *PartnerTopicsClientListBySubscriptionOptions) *runtime.Pager[PartnerTopicsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[PartnerTopicsClientListBySubscriptionResponse]{ + More: func(page PartnerTopicsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *PartnerTopicsClientListBySubscriptionResponse) (PartnerTopicsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PartnerTopicsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PartnerTopicsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *PartnerTopicsClient) listBySubscriptionCreateRequest(ctx context.Context, options *PartnerTopicsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.EventGrid/partnerTopics" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *PartnerTopicsClient) listBySubscriptionHandleResponse(resp *http.Response) (PartnerTopicsClientListBySubscriptionResponse, error) { + result := PartnerTopicsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerTopicsListResult); err != nil { + return PartnerTopicsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// Update - Asynchronously updates a partner topic with the specified parameters. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// partnerTopicName - Name of the partner topic. +// partnerTopicUpdateParameters - PartnerTopic update information. +// options - PartnerTopicsClientUpdateOptions contains the optional parameters for the PartnerTopicsClient.Update method. +func (client *PartnerTopicsClient) Update(ctx context.Context, resourceGroupName string, partnerTopicName string, partnerTopicUpdateParameters PartnerTopicUpdateParameters, options *PartnerTopicsClientUpdateOptions) (PartnerTopicsClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, partnerTopicName, partnerTopicUpdateParameters, options) + if err != nil { + return PartnerTopicsClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PartnerTopicsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return PartnerTopicsClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *PartnerTopicsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, partnerTopicName string, partnerTopicUpdateParameters PartnerTopicUpdateParameters, options *PartnerTopicsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/partnerTopics/{partnerTopicName}" + 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 partnerTopicName == "" { + return nil, errors.New("parameter partnerTopicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{partnerTopicName}", url.PathEscape(partnerTopicName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, partnerTopicUpdateParameters) +} + +// updateHandleResponse handles the Update response. +func (client *PartnerTopicsClient) updateHandleResponse(resp *http.Response) (PartnerTopicsClientUpdateResponse, error) { + result := PartnerTopicsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PartnerTopic); err != nil { + return PartnerTopicsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_polymorphic_helpers.go index 8a502c1cafb2..2b6401b96c45 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_polymorphic_helpers.go @@ -156,6 +156,8 @@ func unmarshalEventSubscriptionDestinationClassification(rawMsg json.RawMessage) b = &EventHubEventSubscriptionDestination{} case string(EndpointTypeHybridConnection): b = &HybridConnectionEventSubscriptionDestination{} + case string(EndpointTypePartnerDestination): + b = &PartnerEventSubscriptionDestination{} case string(EndpointTypeServiceBusQueue): b = &ServiceBusQueueEventSubscriptionDestination{} case string(EndpointTypeServiceBusTopic): @@ -187,3 +189,57 @@ func unmarshalInputSchemaMappingClassification(rawMsg json.RawMessage) (InputSch } return b, json.Unmarshal(rawMsg, b) } + +func unmarshalPartnerClientAuthenticationClassification(rawMsg json.RawMessage) (PartnerClientAuthenticationClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PartnerClientAuthenticationClassification + switch m["clientAuthenticationType"] { + case string(PartnerClientAuthenticationTypeAzureAD): + b = &AzureADPartnerClientAuthentication{} + default: + b = &PartnerClientAuthentication{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalPartnerDestinationInfoClassification(rawMsg json.RawMessage) (PartnerDestinationInfoClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PartnerDestinationInfoClassification + switch m["endpointType"] { + case string(PartnerEndpointTypeWebHook): + b = &WebhookPartnerDestinationInfo{} + default: + b = &PartnerDestinationInfo{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalPartnerUpdateDestinationInfoClassification(rawMsg json.RawMessage) (PartnerUpdateDestinationInfoClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b PartnerUpdateDestinationInfoClassification + switch m["endpointType"] { + case string(PartnerEndpointTypeWebHook): + b = &WebhookUpdatePartnerDestinationInfo{} + default: + b = &PartnerUpdateDestinationInfo{} + } + return b, json.Unmarshal(rawMsg, b) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privateendpointconnections_client.go index bbd00ca6c1b3..3ef1269c11f7 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privateendpointconnections_client.go @@ -56,16 +56,16 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor return client, nil } -// BeginDelete - Delete a specific private endpoint connection under a topic or domain. +// BeginDelete - Delete a specific private endpoint connection under a topic, domain, or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. -// parentType - The type of the parent resource. This can be either \'topics\' or \'domains\'. -// parentName - The name of the parent resource (namely, either, the topic name or domain name). +// parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. +// parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). // privateEndpointConnectionName - The name of the private endpoint connection connection. // options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. -func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, parentType, parentName, privateEndpointConnectionName, options) if err != nil { @@ -77,10 +77,10 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, } } -// Delete - Delete a specific private endpoint connection under a topic or domain. +// Delete - Delete a specific private endpoint connection under a topic, domain, or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { +// Generated from API version 2021-10-15-preview +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, parentType, parentName, privateEndpointConnectionName, options) if err != nil { return nil, err @@ -96,7 +96,7 @@ func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Cont } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -123,21 +123,21 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } -// Get - Get a specific private endpoint connection under a topic or domain. +// Get - Get a specific private endpoint connection under a topic, domain, or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. -// parentType - The type of the parent resource. This can be either \'topics\' or \'domains\'. -// parentName - The name of the parent resource (namely, either, the topic name or domain name). +// parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. +// parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). // privateEndpointConnectionName - The name of the private endpoint connection connection. // options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. -func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { +func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, parentType, parentName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err @@ -153,7 +153,7 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,15 +195,15 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res return result, nil } -// NewListByResourcePager - Get all private endpoint connections under a topic or domain. +// NewListByResourcePager - Get all private endpoint connections under a topic, domain, or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. -// parentType - The type of the parent resource. This can be either \'topics\' or \'domains\'. -// parentName - The name of the parent resource (namely, either, the topic name or domain name). +// parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. +// parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). // options - PrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByResource // method. -func (client *PrivateEndpointConnectionsClient) NewListByResourcePager(resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, options *PrivateEndpointConnectionsClientListByResourceOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByResourceResponse] { +func (client *PrivateEndpointConnectionsClient) NewListByResourcePager(resourceGroupName string, parentType ParentType, parentName string, options *PrivateEndpointConnectionsClientListByResourceOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByResourceResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByResourceResponse]{ More: func(page PrivateEndpointConnectionsClientListByResourceResponse) bool { return page.NextLink != nil && len(*page.NextLink) > 0 @@ -232,7 +232,7 @@ func (client *PrivateEndpointConnectionsClient) NewListByResourcePager(resourceG } // listByResourceCreateRequest creates the ListByResource request. -func (client *PrivateEndpointConnectionsClient) listByResourceCreateRequest(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, options *PrivateEndpointConnectionsClientListByResourceOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listByResourceCreateRequest(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, options *PrivateEndpointConnectionsClientListByResourceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -255,7 +255,7 @@ func (client *PrivateEndpointConnectionsClient) listByResourceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -276,17 +276,17 @@ func (client *PrivateEndpointConnectionsClient) listByResourceHandleResponse(res return result, nil } -// BeginUpdate - Update a specific private endpoint connection under a topic or domain. +// BeginUpdate - Update a specific private endpoint connection under a topic, domain or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. -// parentType - The type of the parent resource. This can be either \'topics\' or \'domains\'. -// parentName - The name of the parent resource (namely, either, the topic name or domain name). +// parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. +// parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). // privateEndpointConnectionName - The name of the private endpoint connection connection. // privateEndpointConnection - The private endpoint connection object to update. // options - PrivateEndpointConnectionsClientBeginUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginUpdate // method. -func (client *PrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateResponse], error) { +func (client *PrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, options) if err != nil { @@ -298,10 +298,10 @@ func (client *PrivateEndpointConnectionsClient) BeginUpdate(ctx context.Context, } } -// Update - Update a specific private endpoint connection under a topic or domain. +// Update - Update a specific private endpoint connection under a topic, domain or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 -func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { +// Generated from API version 2021-10-15-preview +func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, parentType, parentName, privateEndpointConnectionName, privateEndpointConnection, options) if err != nil { return nil, err @@ -317,7 +317,7 @@ func (client *PrivateEndpointConnectionsClient) update(ctx context.Context, reso } // updateCreateRequest creates the Update request. -func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, parentType PrivateEndpointConnectionsParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, parentType ParentType, parentName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/{parentType}/{parentName}/privateEndpointConnections/{privateEndpointConnectionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -344,7 +344,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateEndpointConnection) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privatelinkresources_client.go index 9a053df53148..475ef3d00ad6 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_privatelinkresources_client.go @@ -58,10 +58,10 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Get properties of a private link resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. -// parentType - The type of the parent resource. This can be either \'topics\' or \'domains\'. -// parentName - The name of the parent resource (namely, either, the topic name or domain name). +// parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. +// parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). // privateLinkResourceName - The name of private link resource. // options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get // method. @@ -108,7 +108,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,12 +123,12 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByResourcePager - List all the private link resources under a topic or domain. +// NewListByResourcePager - List all the private link resources under a topic, domain, or partner namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. -// parentType - The type of the parent resource. This can be either \'topics\' or \'domains\'. -// parentName - The name of the parent resource (namely, either, the topic name or domain name). +// parentType - The type of the parent resource. This can be either \'topics\', \'domains\', or \'partnerNamespaces\'. +// parentName - The name of the parent resource (namely, either, the topic name, domain name, or partner namespace name). // options - PrivateLinkResourcesClientListByResourceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByResource // method. func (client *PrivateLinkResourcesClient) NewListByResourcePager(resourceGroupName string, parentType string, parentName string, options *PrivateLinkResourcesClientListByResourceOptions) *runtime.Pager[PrivateLinkResourcesClientListByResourceResponse] { @@ -183,7 +183,7 @@ func (client *PrivateLinkResourcesClient) listByResourceCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_response_types.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_response_types.go index ae51a31386f7..d1ed1aa0536e 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_response_types.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_response_types.go @@ -8,6 +8,106 @@ package armeventgrid +// ChannelsClientCreateOrUpdateResponse contains the response from method ChannelsClient.CreateOrUpdate. +type ChannelsClientCreateOrUpdateResponse struct { + Channel +} + +// ChannelsClientDeleteResponse contains the response from method ChannelsClient.Delete. +type ChannelsClientDeleteResponse struct { + // placeholder for future response values +} + +// ChannelsClientGetFullURLResponse contains the response from method ChannelsClient.GetFullURL. +type ChannelsClientGetFullURLResponse struct { + EventSubscriptionFullURL +} + +// ChannelsClientGetResponse contains the response from method ChannelsClient.Get. +type ChannelsClientGetResponse struct { + Channel +} + +// ChannelsClientListByPartnerNamespaceResponse contains the response from method ChannelsClient.ListByPartnerNamespace. +type ChannelsClientListByPartnerNamespaceResponse struct { + ChannelsListResult +} + +// ChannelsClientUpdateResponse contains the response from method ChannelsClient.Update. +type ChannelsClientUpdateResponse struct { + // placeholder for future response values +} + +// DomainEventSubscriptionsClientCreateOrUpdateResponse contains the response from method DomainEventSubscriptionsClient.CreateOrUpdate. +type DomainEventSubscriptionsClientCreateOrUpdateResponse struct { + EventSubscription +} + +// DomainEventSubscriptionsClientDeleteResponse contains the response from method DomainEventSubscriptionsClient.Delete. +type DomainEventSubscriptionsClientDeleteResponse struct { + // placeholder for future response values +} + +// DomainEventSubscriptionsClientGetDeliveryAttributesResponse contains the response from method DomainEventSubscriptionsClient.GetDeliveryAttributes. +type DomainEventSubscriptionsClientGetDeliveryAttributesResponse struct { + DeliveryAttributeListResult +} + +// DomainEventSubscriptionsClientGetFullURLResponse contains the response from method DomainEventSubscriptionsClient.GetFullURL. +type DomainEventSubscriptionsClientGetFullURLResponse struct { + EventSubscriptionFullURL +} + +// DomainEventSubscriptionsClientGetResponse contains the response from method DomainEventSubscriptionsClient.Get. +type DomainEventSubscriptionsClientGetResponse struct { + EventSubscription +} + +// DomainEventSubscriptionsClientListResponse contains the response from method DomainEventSubscriptionsClient.List. +type DomainEventSubscriptionsClientListResponse struct { + EventSubscriptionsListResult +} + +// DomainEventSubscriptionsClientUpdateResponse contains the response from method DomainEventSubscriptionsClient.Update. +type DomainEventSubscriptionsClientUpdateResponse struct { + EventSubscription +} + +// DomainTopicEventSubscriptionsClientCreateOrUpdateResponse contains the response from method DomainTopicEventSubscriptionsClient.CreateOrUpdate. +type DomainTopicEventSubscriptionsClientCreateOrUpdateResponse struct { + EventSubscription +} + +// DomainTopicEventSubscriptionsClientDeleteResponse contains the response from method DomainTopicEventSubscriptionsClient.Delete. +type DomainTopicEventSubscriptionsClientDeleteResponse struct { + // placeholder for future response values +} + +// DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse contains the response from method DomainTopicEventSubscriptionsClient.GetDeliveryAttributes. +type DomainTopicEventSubscriptionsClientGetDeliveryAttributesResponse struct { + DeliveryAttributeListResult +} + +// DomainTopicEventSubscriptionsClientGetFullURLResponse contains the response from method DomainTopicEventSubscriptionsClient.GetFullURL. +type DomainTopicEventSubscriptionsClientGetFullURLResponse struct { + EventSubscriptionFullURL +} + +// DomainTopicEventSubscriptionsClientGetResponse contains the response from method DomainTopicEventSubscriptionsClient.Get. +type DomainTopicEventSubscriptionsClientGetResponse struct { + EventSubscription +} + +// DomainTopicEventSubscriptionsClientListResponse contains the response from method DomainTopicEventSubscriptionsClient.List. +type DomainTopicEventSubscriptionsClientListResponse struct { + EventSubscriptionsListResult +} + +// DomainTopicEventSubscriptionsClientUpdateResponse contains the response from method DomainTopicEventSubscriptionsClient.Update. +type DomainTopicEventSubscriptionsClientUpdateResponse struct { + EventSubscription +} + // DomainTopicsClientCreateOrUpdateResponse contains the response from method DomainTopicsClient.CreateOrUpdate. type DomainTopicsClientCreateOrUpdateResponse struct { DomainTopic @@ -68,6 +168,26 @@ type DomainsClientUpdateResponse struct { Domain } +// EventChannelsClientCreateOrUpdateResponse contains the response from method EventChannelsClient.CreateOrUpdate. +type EventChannelsClientCreateOrUpdateResponse struct { + EventChannel +} + +// EventChannelsClientDeleteResponse contains the response from method EventChannelsClient.Delete. +type EventChannelsClientDeleteResponse struct { + // placeholder for future response values +} + +// EventChannelsClientGetResponse contains the response from method EventChannelsClient.Get. +type EventChannelsClientGetResponse struct { + EventChannel +} + +// EventChannelsClientListByPartnerNamespaceResponse contains the response from method EventChannelsClient.ListByPartnerNamespace. +type EventChannelsClientListByPartnerNamespaceResponse struct { + EventChannelsListResult +} + // EventSubscriptionsClientCreateOrUpdateResponse contains the response from method EventSubscriptionsClient.CreateOrUpdate. type EventSubscriptionsClientCreateOrUpdateResponse struct { EventSubscription @@ -158,6 +278,226 @@ type OperationsClientListResponse struct { OperationsListResult } +// PartnerConfigurationsClientAuthorizePartnerResponse contains the response from method PartnerConfigurationsClient.AuthorizePartner. +type PartnerConfigurationsClientAuthorizePartnerResponse struct { + PartnerConfiguration +} + +// PartnerConfigurationsClientCreateOrUpdateResponse contains the response from method PartnerConfigurationsClient.CreateOrUpdate. +type PartnerConfigurationsClientCreateOrUpdateResponse struct { + PartnerConfiguration +} + +// PartnerConfigurationsClientDeleteResponse contains the response from method PartnerConfigurationsClient.Delete. +type PartnerConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// PartnerConfigurationsClientGetResponse contains the response from method PartnerConfigurationsClient.Get. +type PartnerConfigurationsClientGetResponse struct { + PartnerConfiguration +} + +// PartnerConfigurationsClientListByResourceGroupResponse contains the response from method PartnerConfigurationsClient.ListByResourceGroup. +type PartnerConfigurationsClientListByResourceGroupResponse struct { + PartnerConfigurationsListResult +} + +// PartnerConfigurationsClientListBySubscriptionResponse contains the response from method PartnerConfigurationsClient.ListBySubscription. +type PartnerConfigurationsClientListBySubscriptionResponse struct { + PartnerConfigurationsListResult +} + +// PartnerConfigurationsClientUnauthorizePartnerResponse contains the response from method PartnerConfigurationsClient.UnauthorizePartner. +type PartnerConfigurationsClientUnauthorizePartnerResponse struct { + PartnerConfiguration +} + +// PartnerConfigurationsClientUpdateResponse contains the response from method PartnerConfigurationsClient.Update. +type PartnerConfigurationsClientUpdateResponse struct { + PartnerConfiguration +} + +// PartnerDestinationsClientActivateResponse contains the response from method PartnerDestinationsClient.Activate. +type PartnerDestinationsClientActivateResponse struct { + PartnerDestination +} + +// PartnerDestinationsClientCreateOrUpdateResponse contains the response from method PartnerDestinationsClient.CreateOrUpdate. +type PartnerDestinationsClientCreateOrUpdateResponse struct { + PartnerDestination +} + +// PartnerDestinationsClientDeleteResponse contains the response from method PartnerDestinationsClient.Delete. +type PartnerDestinationsClientDeleteResponse struct { + // placeholder for future response values +} + +// PartnerDestinationsClientGetResponse contains the response from method PartnerDestinationsClient.Get. +type PartnerDestinationsClientGetResponse struct { + PartnerDestination +} + +// PartnerDestinationsClientListByResourceGroupResponse contains the response from method PartnerDestinationsClient.ListByResourceGroup. +type PartnerDestinationsClientListByResourceGroupResponse struct { + PartnerDestinationsListResult +} + +// PartnerDestinationsClientListBySubscriptionResponse contains the response from method PartnerDestinationsClient.ListBySubscription. +type PartnerDestinationsClientListBySubscriptionResponse struct { + PartnerDestinationsListResult +} + +// PartnerDestinationsClientUpdateResponse contains the response from method PartnerDestinationsClient.Update. +type PartnerDestinationsClientUpdateResponse struct { + PartnerDestination +} + +// PartnerNamespacesClientCreateOrUpdateResponse contains the response from method PartnerNamespacesClient.CreateOrUpdate. +type PartnerNamespacesClientCreateOrUpdateResponse struct { + PartnerNamespace +} + +// PartnerNamespacesClientDeleteResponse contains the response from method PartnerNamespacesClient.Delete. +type PartnerNamespacesClientDeleteResponse struct { + // placeholder for future response values +} + +// PartnerNamespacesClientGetResponse contains the response from method PartnerNamespacesClient.Get. +type PartnerNamespacesClientGetResponse struct { + PartnerNamespace +} + +// PartnerNamespacesClientListByResourceGroupResponse contains the response from method PartnerNamespacesClient.ListByResourceGroup. +type PartnerNamespacesClientListByResourceGroupResponse struct { + PartnerNamespacesListResult +} + +// PartnerNamespacesClientListBySubscriptionResponse contains the response from method PartnerNamespacesClient.ListBySubscription. +type PartnerNamespacesClientListBySubscriptionResponse struct { + PartnerNamespacesListResult +} + +// PartnerNamespacesClientListSharedAccessKeysResponse contains the response from method PartnerNamespacesClient.ListSharedAccessKeys. +type PartnerNamespacesClientListSharedAccessKeysResponse struct { + PartnerNamespaceSharedAccessKeys +} + +// PartnerNamespacesClientRegenerateKeyResponse contains the response from method PartnerNamespacesClient.RegenerateKey. +type PartnerNamespacesClientRegenerateKeyResponse struct { + PartnerNamespaceSharedAccessKeys +} + +// PartnerNamespacesClientUpdateResponse contains the response from method PartnerNamespacesClient.Update. +type PartnerNamespacesClientUpdateResponse struct { + PartnerNamespace +} + +// PartnerRegistrationsClientCreateOrUpdateResponse contains the response from method PartnerRegistrationsClient.CreateOrUpdate. +type PartnerRegistrationsClientCreateOrUpdateResponse struct { + PartnerRegistration +} + +// PartnerRegistrationsClientDeleteResponse contains the response from method PartnerRegistrationsClient.Delete. +type PartnerRegistrationsClientDeleteResponse struct { + // placeholder for future response values +} + +// PartnerRegistrationsClientGetResponse contains the response from method PartnerRegistrationsClient.Get. +type PartnerRegistrationsClientGetResponse struct { + PartnerRegistration +} + +// PartnerRegistrationsClientListByResourceGroupResponse contains the response from method PartnerRegistrationsClient.ListByResourceGroup. +type PartnerRegistrationsClientListByResourceGroupResponse struct { + PartnerRegistrationsListResult +} + +// PartnerRegistrationsClientListBySubscriptionResponse contains the response from method PartnerRegistrationsClient.ListBySubscription. +type PartnerRegistrationsClientListBySubscriptionResponse struct { + PartnerRegistrationsListResult +} + +// PartnerRegistrationsClientUpdateResponse contains the response from method PartnerRegistrationsClient.Update. +type PartnerRegistrationsClientUpdateResponse struct { + PartnerRegistration +} + +// PartnerTopicEventSubscriptionsClientCreateOrUpdateResponse contains the response from method PartnerTopicEventSubscriptionsClient.CreateOrUpdate. +type PartnerTopicEventSubscriptionsClientCreateOrUpdateResponse struct { + EventSubscription +} + +// PartnerTopicEventSubscriptionsClientDeleteResponse contains the response from method PartnerTopicEventSubscriptionsClient.Delete. +type PartnerTopicEventSubscriptionsClientDeleteResponse struct { + // placeholder for future response values +} + +// PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse contains the response from method PartnerTopicEventSubscriptionsClient.GetDeliveryAttributes. +type PartnerTopicEventSubscriptionsClientGetDeliveryAttributesResponse struct { + DeliveryAttributeListResult +} + +// PartnerTopicEventSubscriptionsClientGetFullURLResponse contains the response from method PartnerTopicEventSubscriptionsClient.GetFullURL. +type PartnerTopicEventSubscriptionsClientGetFullURLResponse struct { + EventSubscriptionFullURL +} + +// PartnerTopicEventSubscriptionsClientGetResponse contains the response from method PartnerTopicEventSubscriptionsClient.Get. +type PartnerTopicEventSubscriptionsClientGetResponse struct { + EventSubscription +} + +// PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse contains the response from method PartnerTopicEventSubscriptionsClient.ListByPartnerTopic. +type PartnerTopicEventSubscriptionsClientListByPartnerTopicResponse struct { + EventSubscriptionsListResult +} + +// PartnerTopicEventSubscriptionsClientUpdateResponse contains the response from method PartnerTopicEventSubscriptionsClient.Update. +type PartnerTopicEventSubscriptionsClientUpdateResponse struct { + EventSubscription +} + +// PartnerTopicsClientActivateResponse contains the response from method PartnerTopicsClient.Activate. +type PartnerTopicsClientActivateResponse struct { + PartnerTopic +} + +// PartnerTopicsClientCreateOrUpdateResponse contains the response from method PartnerTopicsClient.CreateOrUpdate. +type PartnerTopicsClientCreateOrUpdateResponse struct { + PartnerTopic +} + +// PartnerTopicsClientDeactivateResponse contains the response from method PartnerTopicsClient.Deactivate. +type PartnerTopicsClientDeactivateResponse struct { + PartnerTopic +} + +// PartnerTopicsClientDeleteResponse contains the response from method PartnerTopicsClient.Delete. +type PartnerTopicsClientDeleteResponse struct { + // placeholder for future response values +} + +// PartnerTopicsClientGetResponse contains the response from method PartnerTopicsClient.Get. +type PartnerTopicsClientGetResponse struct { + PartnerTopic +} + +// PartnerTopicsClientListByResourceGroupResponse contains the response from method PartnerTopicsClient.ListByResourceGroup. +type PartnerTopicsClientListByResourceGroupResponse struct { + PartnerTopicsListResult +} + +// PartnerTopicsClientListBySubscriptionResponse contains the response from method PartnerTopicsClient.ListBySubscription. +type PartnerTopicsClientListBySubscriptionResponse struct { + PartnerTopicsListResult +} + +// PartnerTopicsClientUpdateResponse contains the response from method PartnerTopicsClient.Update. +type PartnerTopicsClientUpdateResponse struct { + PartnerTopic +} + // PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. type PrivateEndpointConnectionsClientDeleteResponse struct { // placeholder for future response values @@ -253,6 +593,41 @@ type SystemTopicsClientUpdateResponse struct { SystemTopic } +// TopicEventSubscriptionsClientCreateOrUpdateResponse contains the response from method TopicEventSubscriptionsClient.CreateOrUpdate. +type TopicEventSubscriptionsClientCreateOrUpdateResponse struct { + EventSubscription +} + +// TopicEventSubscriptionsClientDeleteResponse contains the response from method TopicEventSubscriptionsClient.Delete. +type TopicEventSubscriptionsClientDeleteResponse struct { + // placeholder for future response values +} + +// TopicEventSubscriptionsClientGetDeliveryAttributesResponse contains the response from method TopicEventSubscriptionsClient.GetDeliveryAttributes. +type TopicEventSubscriptionsClientGetDeliveryAttributesResponse struct { + DeliveryAttributeListResult +} + +// TopicEventSubscriptionsClientGetFullURLResponse contains the response from method TopicEventSubscriptionsClient.GetFullURL. +type TopicEventSubscriptionsClientGetFullURLResponse struct { + EventSubscriptionFullURL +} + +// TopicEventSubscriptionsClientGetResponse contains the response from method TopicEventSubscriptionsClient.Get. +type TopicEventSubscriptionsClientGetResponse struct { + EventSubscription +} + +// TopicEventSubscriptionsClientListResponse contains the response from method TopicEventSubscriptionsClient.List. +type TopicEventSubscriptionsClientListResponse struct { + EventSubscriptionsListResult +} + +// TopicEventSubscriptionsClientUpdateResponse contains the response from method TopicEventSubscriptionsClient.Update. +type TopicEventSubscriptionsClientUpdateResponse struct { + EventSubscription +} + // TopicTypesClientGetResponse contains the response from method TopicTypesClient.Get. type TopicTypesClientGetResponse struct { TopicTypeInfo @@ -312,3 +687,13 @@ type TopicsClientRegenerateKeyResponse struct { type TopicsClientUpdateResponse struct { Topic } + +// VerifiedPartnersClientGetResponse contains the response from method VerifiedPartnersClient.Get. +type VerifiedPartnersClientGetResponse struct { + VerifiedPartner +} + +// VerifiedPartnersClientListResponse contains the response from method VerifiedPartnersClient.List. +type VerifiedPartnersClientListResponse struct { + VerifiedPartnersListResult +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopiceventsubscriptions_client.go index 5d11a37610c2..3f2a9f1db74e 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopiceventsubscriptions_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopiceventsubscriptions_client.go @@ -59,7 +59,7 @@ func NewSystemTopicEventSubscriptionsClient(subscriptionID string, credential az // BeginCreateOrUpdate - Asynchronously creates or updates an event subscription with the specified parameters. Existing event // subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 @@ -82,7 +82,7 @@ func (client *SystemTopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Asynchronously creates or updates an event subscription with the specified parameters. Existing event // subscriptions will be updated with this API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *SystemTopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *SystemTopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionInfo, options) if err != nil { @@ -122,15 +122,15 @@ func (client *SystemTopicEventSubscriptionsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) } -// BeginDelete - Delete an event subscription of a system topic. +// BeginDelete - Delete an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 @@ -149,9 +149,9 @@ func (client *SystemTopicEventSubscriptionsClient) BeginDelete(ctx context.Conte } } -// Delete - Delete an event subscription of a system topic. +// Delete - Delete an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *SystemTopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, options *SystemTopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, systemTopicName, eventSubscriptionName, options) if err != nil { @@ -191,14 +191,14 @@ func (client *SystemTopicEventSubscriptionsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get an event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 @@ -244,7 +244,7 @@ func (client *SystemTopicEventSubscriptionsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -261,7 +261,7 @@ func (client *SystemTopicEventSubscriptionsClient) getHandleResponse(resp *http. // GetDeliveryAttributes - Get all delivery attributes for an event subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 @@ -307,7 +307,7 @@ func (client *SystemTopicEventSubscriptionsClient) getDeliveryAttributesCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *SystemTopicEventSubscriptionsClient) getDeliveryAttributesHandleRe // GetFullURL - Get the full endpoint URL for an event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 @@ -370,7 +370,7 @@ func (client *SystemTopicEventSubscriptionsClient) getFullURLCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,7 +387,7 @@ func (client *SystemTopicEventSubscriptionsClient) getFullURLHandleResponse(resp // NewListBySystemTopicPager - List event subscriptions that belong to a specific system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // options - SystemTopicEventSubscriptionsClientListBySystemTopicOptions contains the optional parameters for the SystemTopicEventSubscriptionsClient.ListBySystemTopic @@ -440,7 +440,7 @@ func (client *SystemTopicEventSubscriptionsClient) listBySystemTopicCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -461,9 +461,9 @@ func (client *SystemTopicEventSubscriptionsClient) listBySystemTopicHandleRespon return result, nil } -// BeginUpdate - Update event subscription of a system topic. +// BeginUpdate - Update an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 @@ -483,9 +483,9 @@ func (client *SystemTopicEventSubscriptionsClient) BeginUpdate(ctx context.Conte } } -// Update - Update event subscription of a system topic. +// Update - Update an existing event subscription of a system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *SystemTopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, systemTopicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *SystemTopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, systemTopicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) if err != nil { @@ -525,7 +525,7 @@ func (client *SystemTopicEventSubscriptionsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopics_client.go index e6e188c2bbbc..afc494b6cd44 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_systemtopics_client.go @@ -58,7 +58,7 @@ func NewSystemTopicsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Asynchronously creates a new system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // systemTopicInfo - System Topic information. @@ -78,7 +78,7 @@ func (client *SystemTopicsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Asynchronously creates a new system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *SystemTopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, systemTopicName string, systemTopicInfo SystemTopic, options *SystemTopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, systemTopicName, systemTopicInfo, options) if err != nil { @@ -114,7 +114,7 @@ func (client *SystemTopicsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, systemTopicInfo) @@ -122,7 +122,7 @@ func (client *SystemTopicsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Delete existing system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // options - SystemTopicsClientBeginDeleteOptions contains the optional parameters for the SystemTopicsClient.BeginDelete @@ -141,7 +141,7 @@ func (client *SystemTopicsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Delete existing system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *SystemTopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, systemTopicName string, options *SystemTopicsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, systemTopicName, options) if err != nil { @@ -177,14 +177,14 @@ func (client *SystemTopicsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get properties of a system topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // options - SystemTopicsClientGetOptions contains the optional parameters for the SystemTopicsClient.Get method. @@ -223,7 +223,7 @@ func (client *SystemTopicsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +240,7 @@ func (client *SystemTopicsClient) getHandleResponse(resp *http.Response) (System // NewListByResourceGroupPager - List all the system topics under a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // options - SystemTopicsClientListByResourceGroupOptions contains the optional parameters for the SystemTopicsClient.ListByResourceGroup // method. @@ -288,7 +288,7 @@ func (client *SystemTopicsClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -311,7 +311,7 @@ func (client *SystemTopicsClient) listByResourceGroupHandleResponse(resp *http.R // NewListBySubscriptionPager - List all the system topics under an Azure subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // options - SystemTopicsClientListBySubscriptionOptions contains the optional parameters for the SystemTopicsClient.ListBySubscription // method. func (client *SystemTopicsClient) NewListBySubscriptionPager(options *SystemTopicsClientListBySubscriptionOptions) *runtime.Pager[SystemTopicsClientListBySubscriptionResponse] { @@ -354,7 +354,7 @@ func (client *SystemTopicsClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -377,7 +377,7 @@ func (client *SystemTopicsClient) listBySubscriptionHandleResponse(resp *http.Re // BeginUpdate - Asynchronously updates a system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // systemTopicName - Name of the system topic. // systemTopicUpdateParameters - SystemTopic update information. @@ -397,7 +397,7 @@ func (client *SystemTopicsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Asynchronously updates a system topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *SystemTopicsClient) update(ctx context.Context, resourceGroupName string, systemTopicName string, systemTopicUpdateParameters SystemTopicUpdateParameters, options *SystemTopicsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, systemTopicName, systemTopicUpdateParameters, options) if err != nil { @@ -433,7 +433,7 @@ func (client *SystemTopicsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, systemTopicUpdateParameters) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topiceventsubscriptions_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topiceventsubscriptions_client.go new file mode 100644 index 000000000000..c885c1e1eca5 --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topiceventsubscriptions_client.go @@ -0,0 +1,527 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// TopicEventSubscriptionsClient contains the methods for the TopicEventSubscriptions group. +// Don't use this type directly, use NewTopicEventSubscriptionsClient() instead. +type TopicEventSubscriptionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewTopicEventSubscriptionsClient creates a new instance of TopicEventSubscriptionsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewTopicEventSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TopicEventSubscriptionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &TopicEventSubscriptionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription to be created. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// eventSubscriptionInfo - Event subscription properties containing the destination and filter information. +// options - TopicEventSubscriptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the TopicEventSubscriptionsClient.BeginCreateOrUpdate +// method. +func (client *TopicEventSubscriptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *TopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[TopicEventSubscriptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[TopicEventSubscriptionsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[TopicEventSubscriptionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Asynchronously creates a new event subscription or updates an existing event subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *TopicEventSubscriptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *TopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, eventSubscriptionInfo, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *TopicEventSubscriptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionInfo EventSubscription, options *TopicEventSubscriptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionInfo) +} + +// BeginDelete - Delete an existing event subscription for a topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// topicName - Name of the topic. +// eventSubscriptionName - Name of the event subscription to be deleted. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - TopicEventSubscriptionsClientBeginDeleteOptions contains the optional parameters for the TopicEventSubscriptionsClient.BeginDelete +// method. +func (client *TopicEventSubscriptionsClient) BeginDelete(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientBeginDeleteOptions) (*runtime.Poller[TopicEventSubscriptionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, topicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[TopicEventSubscriptionsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[TopicEventSubscriptionsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete an existing event subscription for a topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *TopicEventSubscriptionsClient) deleteOperation(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *TopicEventSubscriptionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Get properties of an event subscription of a topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// topicName - Name of the partner topic. +// eventSubscriptionName - Name of the event subscription to be found. Event subscription names must be between 3 and 100 +// characters in length and use alphanumeric letters only. +// options - TopicEventSubscriptionsClientGetOptions contains the optional parameters for the TopicEventSubscriptionsClient.Get +// method. +func (client *TopicEventSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientGetOptions) (TopicEventSubscriptionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, options) + if err != nil { + return TopicEventSubscriptionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TopicEventSubscriptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TopicEventSubscriptionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *TopicEventSubscriptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *TopicEventSubscriptionsClient) getHandleResponse(resp *http.Response) (TopicEventSubscriptionsClientGetResponse, error) { + result := TopicEventSubscriptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscription); err != nil { + return TopicEventSubscriptionsClientGetResponse{}, err + } + return result, nil +} + +// GetDeliveryAttributes - Get all delivery attributes for an event subscription for topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription. +// options - TopicEventSubscriptionsClientGetDeliveryAttributesOptions contains the optional parameters for the TopicEventSubscriptionsClient.GetDeliveryAttributes +// method. +func (client *TopicEventSubscriptionsClient) GetDeliveryAttributes(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientGetDeliveryAttributesOptions) (TopicEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + req, err := client.getDeliveryAttributesCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, options) + if err != nil { + return TopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, runtime.NewResponseError(resp) + } + return client.getDeliveryAttributesHandleResponse(resp) +} + +// getDeliveryAttributesCreateRequest creates the GetDeliveryAttributes request. +func (client *TopicEventSubscriptionsClient) getDeliveryAttributesCreateRequest(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientGetDeliveryAttributesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getDeliveryAttributes" + 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 topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getDeliveryAttributesHandleResponse handles the GetDeliveryAttributes response. +func (client *TopicEventSubscriptionsClient) getDeliveryAttributesHandleResponse(resp *http.Response) (TopicEventSubscriptionsClientGetDeliveryAttributesResponse, error) { + result := TopicEventSubscriptionsClientGetDeliveryAttributesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DeliveryAttributeListResult); err != nil { + return TopicEventSubscriptionsClientGetDeliveryAttributesResponse{}, err + } + return result, nil +} + +// GetFullURL - Get the full endpoint URL for an event subscription for topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// topicName - Name of the domain topic. +// eventSubscriptionName - Name of the event subscription. +// options - TopicEventSubscriptionsClientGetFullURLOptions contains the optional parameters for the TopicEventSubscriptionsClient.GetFullURL +// method. +func (client *TopicEventSubscriptionsClient) GetFullURL(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientGetFullURLOptions) (TopicEventSubscriptionsClientGetFullURLResponse, error) { + req, err := client.getFullURLCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, options) + if err != nil { + return TopicEventSubscriptionsClientGetFullURLResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TopicEventSubscriptionsClientGetFullURLResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TopicEventSubscriptionsClientGetFullURLResponse{}, runtime.NewResponseError(resp) + } + return client.getFullURLHandleResponse(resp) +} + +// getFullURLCreateRequest creates the GetFullURL request. +func (client *TopicEventSubscriptionsClient) getFullURLCreateRequest(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, options *TopicEventSubscriptionsClientGetFullURLOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}/getFullUrl" + 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 topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + 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-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getFullURLHandleResponse handles the GetFullURL response. +func (client *TopicEventSubscriptionsClient) getFullURLHandleResponse(resp *http.Response) (TopicEventSubscriptionsClientGetFullURLResponse, error) { + result := TopicEventSubscriptionsClientGetFullURLResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionFullURL); err != nil { + return TopicEventSubscriptionsClientGetFullURLResponse{}, err + } + return result, nil +} + +// NewListPager - List all event subscriptions that have been created for a specific topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// topicName - Name of the topic. +// options - TopicEventSubscriptionsClientListOptions contains the optional parameters for the TopicEventSubscriptionsClient.List +// method. +func (client *TopicEventSubscriptionsClient) NewListPager(resourceGroupName string, topicName string, options *TopicEventSubscriptionsClientListOptions) *runtime.Pager[TopicEventSubscriptionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[TopicEventSubscriptionsClientListResponse]{ + More: func(page TopicEventSubscriptionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *TopicEventSubscriptionsClientListResponse) (TopicEventSubscriptionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, topicName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return TopicEventSubscriptionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TopicEventSubscriptionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TopicEventSubscriptionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *TopicEventSubscriptionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, topicName string, options *TopicEventSubscriptionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions" + 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 topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *TopicEventSubscriptionsClient) listHandleResponse(resp *http.Response) (TopicEventSubscriptionsClientListResponse, error) { + result := TopicEventSubscriptionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EventSubscriptionsListResult); err != nil { + return TopicEventSubscriptionsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Update an existing event subscription for a topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// resourceGroupName - The name of the resource group within the user's subscription. +// topicName - Name of the domain. +// eventSubscriptionName - Name of the event subscription to be updated. +// eventSubscriptionUpdateParameters - Updated event subscription information. +// options - TopicEventSubscriptionsClientBeginUpdateOptions contains the optional parameters for the TopicEventSubscriptionsClient.BeginUpdate +// method. +func (client *TopicEventSubscriptionsClient) BeginUpdate(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *TopicEventSubscriptionsClientBeginUpdateOptions) (*runtime.Poller[TopicEventSubscriptionsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[TopicEventSubscriptionsClientUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[TopicEventSubscriptionsClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update an existing event subscription for a topic. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +func (client *TopicEventSubscriptionsClient) update(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *TopicEventSubscriptionsClientBeginUpdateOptions) (*http.Response, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, topicName, eventSubscriptionName, eventSubscriptionUpdateParameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusCreated) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// updateCreateRequest creates the Update request. +func (client *TopicEventSubscriptionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, topicName string, eventSubscriptionName string, eventSubscriptionUpdateParameters EventSubscriptionUpdateParameters, options *TopicEventSubscriptionsClientBeginUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventGrid/topics/{topicName}/eventSubscriptions/{eventSubscriptionName}" + 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 topicName == "" { + return nil, errors.New("parameter topicName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{topicName}", url.PathEscape(topicName)) + if eventSubscriptionName == "" { + return nil, errors.New("parameter eventSubscriptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{eventSubscriptionName}", url.PathEscape(eventSubscriptionName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, eventSubscriptionUpdateParameters) +} diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topics_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topics_client.go index e03695242304..1a26668ec36f 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topics_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topics_client.go @@ -58,7 +58,7 @@ func NewTopicsClient(subscriptionID string, credential azcore.TokenCredential, o // BeginCreateOrUpdate - Asynchronously creates a new topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // topicName - Name of the topic. // topicInfo - Topic information. @@ -78,7 +78,7 @@ func (client *TopicsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Asynchronously creates a new topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *TopicsClient) createOrUpdate(ctx context.Context, resourceGroupName string, topicName string, topicInfo Topic, options *TopicsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, topicName, topicInfo, options) if err != nil { @@ -114,7 +114,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, topicInfo) @@ -122,7 +122,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res // BeginDelete - Delete existing topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // topicName - Name of the topic. // options - TopicsClientBeginDeleteOptions contains the optional parameters for the TopicsClient.BeginDelete method. @@ -140,7 +140,7 @@ func (client *TopicsClient) BeginDelete(ctx context.Context, resourceGroupName s // Delete - Delete existing topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *TopicsClient) deleteOperation(ctx context.Context, resourceGroupName string, topicName string, options *TopicsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, topicName, options) if err != nil { @@ -176,14 +176,14 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Get properties of a topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // topicName - Name of the topic. // options - TopicsClientGetOptions contains the optional parameters for the TopicsClient.Get method. @@ -222,7 +222,7 @@ func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +239,7 @@ func (client *TopicsClient) getHandleResponse(resp *http.Response) (TopicsClient // NewListByResourceGroupPager - List all the topics under a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // options - TopicsClientListByResourceGroupOptions contains the optional parameters for the TopicsClient.ListByResourceGroup // method. @@ -287,7 +287,7 @@ func (client *TopicsClient) listByResourceGroupCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -310,7 +310,7 @@ func (client *TopicsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - List all the topics under an Azure subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // options - TopicsClientListBySubscriptionOptions contains the optional parameters for the TopicsClient.ListBySubscription // method. func (client *TopicsClient) NewListBySubscriptionPager(options *TopicsClientListBySubscriptionOptions) *runtime.Pager[TopicsClientListBySubscriptionResponse] { @@ -353,7 +353,7 @@ func (client *TopicsClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -376,7 +376,7 @@ func (client *TopicsClient) listBySubscriptionHandleResponse(resp *http.Response // NewListEventTypesPager - List event types for a topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // providerNamespace - Namespace of the provider of the topic. // resourceTypeName - Name of the topic type. @@ -432,7 +432,7 @@ func (client *TopicsClient) listEventTypesCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -449,7 +449,7 @@ func (client *TopicsClient) listEventTypesHandleResponse(resp *http.Response) (T // ListSharedAccessKeys - List the two keys used to publish to a topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // topicName - Name of the topic. // options - TopicsClientListSharedAccessKeysOptions contains the optional parameters for the TopicsClient.ListSharedAccessKeys @@ -489,7 +489,7 @@ func (client *TopicsClient) listSharedAccessKeysCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -506,7 +506,7 @@ func (client *TopicsClient) listSharedAccessKeysHandleResponse(resp *http.Respon // BeginRegenerateKey - Regenerate a shared access key for a topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // topicName - Name of the topic. // regenerateKeyRequest - Request body to regenerate key. @@ -526,7 +526,7 @@ func (client *TopicsClient) BeginRegenerateKey(ctx context.Context, resourceGrou // RegenerateKey - Regenerate a shared access key for a topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *TopicsClient) regenerateKey(ctx context.Context, resourceGroupName string, topicName string, regenerateKeyRequest TopicRegenerateKeyRequest, options *TopicsClientBeginRegenerateKeyOptions) (*http.Response, error) { req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, topicName, regenerateKeyRequest, options) if err != nil { @@ -536,7 +536,7 @@ func (client *TopicsClient) regenerateKey(ctx context.Context, resourceGroupName if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -562,7 +562,7 @@ func (client *TopicsClient) regenerateKeyCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, regenerateKeyRequest) @@ -570,7 +570,7 @@ func (client *TopicsClient) regenerateKeyCreateRequest(ctx context.Context, reso // BeginUpdate - Asynchronously updates a topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // resourceGroupName - The name of the resource group within the user's subscription. // topicName - Name of the topic. // topicUpdateParameters - Topic update information. @@ -589,7 +589,7 @@ func (client *TopicsClient) BeginUpdate(ctx context.Context, resourceGroupName s // Update - Asynchronously updates a topic with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview func (client *TopicsClient) update(ctx context.Context, resourceGroupName string, topicName string, topicUpdateParameters TopicUpdateParameters, options *TopicsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, topicName, topicUpdateParameters, options) if err != nil { @@ -625,7 +625,7 @@ func (client *TopicsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, topicUpdateParameters) diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topictypes_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topictypes_client.go index 08152cdabcad..a837c7a2638a 100644 --- a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topictypes_client.go +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_topictypes_client.go @@ -53,7 +53,7 @@ func NewTopicTypesClient(credential azcore.TokenCredential, options *arm.ClientO // Get - Get information about a topic type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // topicTypeName - Name of the topic type. // options - TopicTypesClientGetOptions contains the optional parameters for the TopicTypesClient.Get method. func (client *TopicTypesClient) Get(ctx context.Context, topicTypeName string, options *TopicTypesClientGetOptions) (TopicTypesClientGetResponse, error) { @@ -83,7 +83,7 @@ func (client *TopicTypesClient) getCreateRequest(ctx context.Context, topicTypeN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -100,7 +100,7 @@ func (client *TopicTypesClient) getHandleResponse(resp *http.Response) (TopicTyp // NewListPager - List all registered topic types. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // options - TopicTypesClientListOptions contains the optional parameters for the TopicTypesClient.List method. func (client *TopicTypesClient) NewListPager(options *TopicTypesClientListOptions) *runtime.Pager[TopicTypesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TopicTypesClientListResponse]{ @@ -132,7 +132,7 @@ func (client *TopicTypesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -149,7 +149,7 @@ func (client *TopicTypesClient) listHandleResponse(resp *http.Response) (TopicTy // NewListEventTypesPager - List event types for a topic type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-12-01 +// Generated from API version 2021-10-15-preview // topicTypeName - Name of the topic type. // options - TopicTypesClientListEventTypesOptions contains the optional parameters for the TopicTypesClient.ListEventTypes // method. @@ -187,7 +187,7 @@ func (client *TopicTypesClient) listEventTypesCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-12-01") + reqQP.Set("api-version", "2021-10-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_verifiedpartners_client.go b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_verifiedpartners_client.go new file mode 100644 index 000000000000..ee60b5584f7e --- /dev/null +++ b/sdk/resourcemanager/eventgrid/armeventgrid/zz_generated_verifiedpartners_client.go @@ -0,0 +1,161 @@ +//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 armeventgrid + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// VerifiedPartnersClient contains the methods for the VerifiedPartners group. +// Don't use this type directly, use NewVerifiedPartnersClient() instead. +type VerifiedPartnersClient struct { + host string + pl runtime.Pipeline +} + +// NewVerifiedPartnersClient creates a new instance of VerifiedPartnersClient with the specified values. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewVerifiedPartnersClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*VerifiedPartnersClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &VerifiedPartnersClient{ + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Get properties of a verified partner. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// verifiedPartnerName - Name of the verified partner. +// options - VerifiedPartnersClientGetOptions contains the optional parameters for the VerifiedPartnersClient.Get method. +func (client *VerifiedPartnersClient) Get(ctx context.Context, verifiedPartnerName string, options *VerifiedPartnersClientGetOptions) (VerifiedPartnersClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, verifiedPartnerName, options) + if err != nil { + return VerifiedPartnersClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VerifiedPartnersClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VerifiedPartnersClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VerifiedPartnersClient) getCreateRequest(ctx context.Context, verifiedPartnerName string, options *VerifiedPartnersClientGetOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.EventGrid/verifiedPartners/{verifiedPartnerName}" + if verifiedPartnerName == "" { + return nil, errors.New("parameter verifiedPartnerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{verifiedPartnerName}", url.PathEscape(verifiedPartnerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VerifiedPartnersClient) getHandleResponse(resp *http.Response) (VerifiedPartnersClientGetResponse, error) { + result := VerifiedPartnersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VerifiedPartner); err != nil { + return VerifiedPartnersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get a list of all verified partners. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-10-15-preview +// options - VerifiedPartnersClientListOptions contains the optional parameters for the VerifiedPartnersClient.List method. +func (client *VerifiedPartnersClient) NewListPager(options *VerifiedPartnersClientListOptions) *runtime.Pager[VerifiedPartnersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[VerifiedPartnersClientListResponse]{ + More: func(page VerifiedPartnersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VerifiedPartnersClientListResponse) (VerifiedPartnersClientListResponse, 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 VerifiedPartnersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VerifiedPartnersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VerifiedPartnersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *VerifiedPartnersClient) listCreateRequest(ctx context.Context, options *VerifiedPartnersClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.EventGrid/verifiedPartners" + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-10-15-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *VerifiedPartnersClient) listHandleResponse(resp *http.Response) (VerifiedPartnersClientListResponse, error) { + result := VerifiedPartnersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VerifiedPartnersListResult); err != nil { + return VerifiedPartnersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md b/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md index a428cbb4b1b3..d3637d1b369e 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md +++ b/sdk/resourcemanager/eventhub/armeventhub/CHANGELOG.md @@ -1,5 +1,88 @@ # Release History +## 1.1.0-beta.1 (2022-05-19) +### Features Added + +- New const `ResourceAssociationAccessModeLearningMode` +- New const `MetricIDIncomingMessages` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateAccepted` +- New const `PublicNetworkAccessSecuredByPerimeter` +- New const `ResourceAssociationAccessModeNoAssociationMode` +- New const `ApplicationGroupPolicyTypeThrottlingPolicy` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateCanceled` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded` +- New const `PublicNetworkAccessFlagSecuredByPerimeter` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateFailed` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateDeleted` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateInvalidResponse` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateUnknown` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateCreating` +- New const `MetricIDOutgoingBytes` +- New const `NspAccessRuleDirectionInbound` +- New const `MetricIDIncomingBytes` +- New const `PublicNetworkAccessEnabled` +- New const `NspAccessRuleDirectionOutbound` +- New const `TLSVersionOne2` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateUpdating` +- New const `PublicNetworkAccessDisabled` +- New const `TLSVersionOne1` +- New const `ResourceAssociationAccessModeEnforcedMode` +- New const `TLSVersionOne0` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateSucceededWithIssues` +- New const `MetricIDOutgoingMessages` +- New const `ResourceAssociationAccessModeUnspecifiedMode` +- New const `NetworkSecurityPerimeterConfigurationProvisioningStateDeleting` +- New const `ResourceAssociationAccessModeAuditMode` +- New function `PossibleTLSVersionValues() []TLSVersion` +- New function `NetworkSecurityPerimeterConfigurationProperties.MarshalJSON() ([]byte, error)` +- New function `*ThrottlingPolicy.GetApplicationGroupPolicy() *ApplicationGroupPolicy` +- New function `*ThrottlingPolicy.UnmarshalJSON([]byte) error` +- New function `PossibleMetricIDValues() []MetricID` +- New function `NetworkSecurityPerimeterConfigurationPropertiesProfile.MarshalJSON() ([]byte, error)` +- New function `ThrottlingPolicy.MarshalJSON() ([]byte, error)` +- New function `PossibleApplicationGroupPolicyTypeValues() []ApplicationGroupPolicyType` +- New function `*ApplicationGroupPolicy.GetApplicationGroupPolicy() *ApplicationGroupPolicy` +- New function `NspAccessRuleProperties.MarshalJSON() ([]byte, error)` +- New function `*ApplicationGroupProperties.UnmarshalJSON([]byte) error` +- New function `ApplicationGroupProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleResourceAssociationAccessModeValues() []ResourceAssociationAccessMode` +- New function `PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues() []NetworkSecurityPerimeterConfigurationProvisioningState` +- New function `PossibleNspAccessRuleDirectionValues() []NspAccessRuleDirection` +- New function `PossiblePublicNetworkAccessValues() []PublicNetworkAccess` +- New function `NetworkSecurityPerimeterConfiguration.MarshalJSON() ([]byte, error)` +- New struct `ApplicationGroup` +- New struct `ApplicationGroupClientCreateOrUpdateApplicationGroupOptions` +- New struct `ApplicationGroupClientCreateOrUpdateApplicationGroupResponse` +- New struct `ApplicationGroupClientDeleteOptions` +- New struct `ApplicationGroupClientDeleteResponse` +- New struct `ApplicationGroupClientGetOptions` +- New struct `ApplicationGroupClientGetResponse` +- New struct `ApplicationGroupClientListByNamespaceOptions` +- New struct `ApplicationGroupClientListByNamespaceResponse` +- New struct `ApplicationGroupListResult` +- New struct `ApplicationGroupPolicy` +- New struct `ApplicationGroupProperties` +- New struct `NetworkSecurityPerimeter` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationClientListOptions` +- New struct `NetworkSecurityPerimeterConfigurationClientListResponse` +- New struct `NetworkSecurityPerimeterConfigurationList` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `NetworkSecurityPerimeterConfigurationPropertiesProfile` +- New struct `NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation` +- New struct `NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions` +- New struct `NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse` +- New struct `NspAccessRule` +- New struct `NspAccessRuleProperties` +- New struct `NspAccessRulePropertiesSubscriptionsItem` +- New struct `ProvisioningIssue` +- New struct `ProvisioningIssueProperties` +- New struct `ThrottlingPolicy` +- New field `SupportsScaling` in struct `ClusterProperties` +- New field `PublicNetworkAccess` in struct `EHNamespaceProperties` +- New field `MinimumTLSVersion` in struct `EHNamespaceProperties` + + ## 1.0.0 (2022-05-16) ### Breaking Changes diff --git a/sdk/resourcemanager/eventhub/armeventhub/autorest.md b/sdk/resourcemanager/eventhub/armeventhub/autorest.md index 3a51e155ed1b..a73f0437e485 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/autorest.md +++ b/sdk/resourcemanager/eventhub/armeventhub/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-2021-11 require: -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/eventhub/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/eventhub/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/eventhub/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/eventhub/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_applicationgroup_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_applicationgroup_client_test.go new file mode 100644 index 000000000000..823fff537561 --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_applicationgroup_client_test.go @@ -0,0 +1,136 @@ +//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 armeventhub_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/eventhub/armeventhub" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupListByNamespace.json +func ExampleApplicationGroupClient_NewListByNamespacePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByNamespacePager("contosotest", + "contoso-ua-test-eh-system-1", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupCreate.json +func ExampleApplicationGroupClient_CreateOrUpdateApplicationGroup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdateApplicationGroup(ctx, + "contosotest", + "contoso-ua-test-eh-system-1", + "appGroup1", + armeventhub.ApplicationGroup{ + Properties: &armeventhub.ApplicationGroupProperties{ + ClientAppGroupIdentifier: to.Ptr("SASKeyName=KeyName"), + IsEnabled: to.Ptr(true), + Policies: []armeventhub.ApplicationGroupPolicyClassification{ + &armeventhub.ThrottlingPolicy{ + Name: to.Ptr("ThrottlingPolicy1"), + Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), + MetricID: to.Ptr(armeventhub.MetricIDIncomingMessages), + RateLimitThreshold: to.Ptr[int64](7912), + }, + &armeventhub.ThrottlingPolicy{ + Name: to.Ptr("ThrottlingPolicy2"), + Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), + MetricID: to.Ptr(armeventhub.MetricIDIncomingBytes), + RateLimitThreshold: to.Ptr[int64](3951729), + }, + &armeventhub.ThrottlingPolicy{ + Name: to.Ptr("ThrottlingPolicy3"), + Type: to.Ptr(armeventhub.ApplicationGroupPolicyTypeThrottlingPolicy), + MetricID: to.Ptr(armeventhub.MetricIDOutgoingBytes), + RateLimitThreshold: to.Ptr[int64](245175), + }}, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupDelete.json +func ExampleApplicationGroupClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "contosotest", + "contoso-ua-test-eh-system-1", + "appGroup1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ApplicationGroup/ApplicationGroupGet.json +func ExampleApplicationGroupClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewApplicationGroupClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "contosotest", + "contoso-ua-test-eh-system-1", + "appGroup1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go index 02874d776c2d..e5d326140cc9 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_clusters_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListAvailableClustersGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ListAvailableClustersGet.json func ExampleClustersClient_ListAvailableClusterRegion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -37,7 +37,7 @@ func ExampleClustersClient_ListAvailableClusterRegion() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClustersListBySubscription.json func ExampleClustersClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,7 +61,7 @@ func ExampleClustersClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClustersListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClustersListByResourceGroup.json func ExampleClustersClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,7 +86,7 @@ func ExampleClustersClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterGet.json func ExampleClustersClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -108,7 +108,7 @@ func ExampleClustersClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPut.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterPut.json func ExampleClustersClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleClustersClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterPatch.json func ExampleClustersClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -178,7 +178,7 @@ func ExampleClustersClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterDelete.json func ExampleClustersClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -202,7 +202,7 @@ func ExampleClustersClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ListNamespacesInClusterGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ListNamespacesInClusterGet.json func ExampleClustersClient_ListNamespaces() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go index 5feb4e99260f..2c0b527eff7f 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_configuration_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterQuotaConfigurationPatch.json func ExampleConfigurationClient_Patch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleConfigurationClient_Patch() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/Clusters/ClusterQuotaConfigurationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/Clusters/ClusterQuotaConfigurationGet.json func ExampleConfigurationClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go index fa6bc347dde7..f4b3da324337 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_consumergroups_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupCreate.json func ExampleConsumerGroupsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleConsumerGroupsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupDelete.json func ExampleConsumerGroupsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleConsumerGroupsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupGet.json func ExampleConsumerGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -92,7 +92,7 @@ func ExampleConsumerGroupsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/ConsumerGroup/EHConsumerGroupListByEventHub.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/ConsumerGroup/EHConsumerGroupListByEventHub.json func ExampleConsumerGroupsClient_NewListByEventHubPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go index bd0ce39628c9..966dbed6ad54 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_disasterrecoveryconfigs_client_test.go @@ -17,7 +17,82 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListAll.json +func ExampleDisasterRecoveryConfigsClient_NewListAuthorizationRulesPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListAuthorizationRulesPager("exampleResourceGroup", + "sdk-Namespace-9080", + "sdk-DisasterRecovery-4047", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleGet.json +func ExampleDisasterRecoveryConfigsClient_GetAuthorizationRule() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetAuthorizationRule(ctx, + "exampleResourceGroup", + "sdk-Namespace-9080", + "sdk-DisasterRecovery-4879", + "sdk-Authrules-4879", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListKey.json +func ExampleDisasterRecoveryConfigsClient_ListKeys() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.ListKeys(ctx, + "exampleResourceGroup", + "sdk-Namespace-2702", + "sdk-DisasterRecovery-4047", + "sdk-Authrules-1746", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasCheckNameAvailability.json func ExampleDisasterRecoveryConfigsClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +117,7 @@ func ExampleDisasterRecoveryConfigsClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasList.json func ExampleDisasterRecoveryConfigsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +143,7 @@ func ExampleDisasterRecoveryConfigsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasCreate.json func ExampleDisasterRecoveryConfigsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +171,7 @@ func ExampleDisasterRecoveryConfigsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasDelete.json func ExampleDisasterRecoveryConfigsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -117,7 +192,7 @@ func ExampleDisasterRecoveryConfigsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasGet.json func ExampleDisasterRecoveryConfigsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -140,7 +215,7 @@ func ExampleDisasterRecoveryConfigsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasBreakPairing.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasBreakPairing.json func ExampleDisasterRecoveryConfigsClient_BreakPairing() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +236,7 @@ func ExampleDisasterRecoveryConfigsClient_BreakPairing() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasFailOver.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/EHAliasFailOver.json func ExampleDisasterRecoveryConfigsClient_FailOver() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -181,78 +256,3 @@ func ExampleDisasterRecoveryConfigsClient_FailOver() { log.Fatalf("failed to finish the request: %v", err) } } - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListAll.json -func ExampleDisasterRecoveryConfigsClient_NewListAuthorizationRulesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAuthorizationRulesPager("exampleResourceGroup", - "sdk-Namespace-9080", - "sdk-DisasterRecovery-4047", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleGet.json -func ExampleDisasterRecoveryConfigsClient_GetAuthorizationRule() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetAuthorizationRule(ctx, - "exampleResourceGroup", - "sdk-Namespace-9080", - "sdk-DisasterRecovery-4879", - "sdk-Authrules-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/disasterRecoveryConfigs/EHAliasAuthorizationRuleListKey.json -func ExampleDisasterRecoveryConfigsClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armeventhub.NewDisasterRecoveryConfigsClient("exampleSubscriptionId", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "exampleResourceGroup", - "sdk-Namespace-2702", - "sdk-DisasterRecovery-4047", - "sdk-Authrules-1746", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go index 0a437e8e7d0a..ef6adfef497c 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_eventhubs_client_test.go @@ -17,22 +17,21 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubListByNameSpace.json -func ExampleEventHubsClient_NewListByNamespacePager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleListAll.json +func ExampleEventHubsClient_NewListAuthorizationRulesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) + client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListByNamespacePager("Default-NotificationHubs-AustraliaEast", - "sdk-Namespace-5357", - &armeventhub.EventHubsClientListByNamespaceOptions{Skip: nil, - Top: nil, - }) + pager := client.NewListAuthorizationRulesPager("ArunMonocle", + "sdk-Namespace-960", + "sdk-EventHub-532", + nil) for pager.More() { nextResult, err := pager.NextPage(ctx) if err != nil { @@ -45,8 +44,8 @@ func ExampleEventHubsClient_NewListByNamespacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubCreate.json -func ExampleEventHubsClient_CreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleCreate.json +func ExampleEventHubsClient_CreateOrUpdateAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -56,29 +55,16 @@ func ExampleEventHubsClient_CreateOrUpdate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdate(ctx, - "Default-NotificationHubs-AustraliaEast", - "sdk-Namespace-5357", - "sdk-EventHub-6547", - armeventhub.Eventhub{ - Properties: &armeventhub.Properties{ - CaptureDescription: &armeventhub.CaptureDescription{ - Destination: &armeventhub.Destination{ - Name: to.Ptr("EventHubArchive.AzureBlockBlob"), - Properties: &armeventhub.DestinationProperties{ - ArchiveNameFormat: to.Ptr("{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"), - BlobContainer: to.Ptr("container"), - StorageAccountResourceID: to.Ptr("/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/arjunteststorage"), - }, - }, - Enabled: to.Ptr(true), - Encoding: to.Ptr(armeventhub.EncodingCaptureDescriptionAvro), - IntervalInSeconds: to.Ptr[int32](120), - SizeLimitInBytes: to.Ptr[int32](10485763), - }, - MessageRetentionInDays: to.Ptr[int64](4), - PartitionCount: to.Ptr[int64](4), - Status: to.Ptr(armeventhub.EntityStatusActive), + res, err := client.CreateOrUpdateAuthorizationRule(ctx, + "ArunMonocle", + "sdk-Namespace-960", + "sdk-EventHub-532", + "sdk-Authrules-2513", + armeventhub.AuthorizationRule{ + Properties: &armeventhub.AuthorizationRuleProperties{ + Rights: []*armeventhub.AccessRights{ + to.Ptr(armeventhub.AccessRightsListen), + to.Ptr(armeventhub.AccessRightsSend)}, }, }, nil) @@ -89,8 +75,8 @@ func ExampleEventHubsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubDelete.json -func ExampleEventHubsClient_Delete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleGet.json +func ExampleEventHubsClient_GetAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -100,41 +86,43 @@ func ExampleEventHubsClient_Delete() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Delete(ctx, + res, err := client.GetAuthorizationRule(ctx, "ArunMonocle", - "sdk-Namespace-5357", - "sdk-EventHub-6547", + "sdk-Namespace-960", + "sdk-EventHub-532", + "sdk-Authrules-2513", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + // TODO: use response item + _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubGet.json -func ExampleEventHubsClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleDelete.json +func ExampleEventHubsClient_DeleteAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) + client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "Default-NotificationHubs-AustraliaEast", - "sdk-Namespace-716", - "sdk-EventHub-10", + _, err = client.DeleteAuthorizationRule(ctx, + "ArunMonocle", + "sdk-Namespace-960", + "sdk-EventHub-532", + "sdk-Authrules-2513", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item - _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListAll.json -func ExampleEventHubsClient_NewListAuthorizationRulesPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleListKey.json +func ExampleEventHubsClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -144,24 +132,21 @@ func ExampleEventHubsClient_NewListAuthorizationRulesPager() { if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListAuthorizationRulesPager("ArunMonocle", - "sdk-Namespace-960", + res, err := client.ListKeys(ctx, + "ArunMonocle", + "sdk-namespace-960", "sdk-EventHub-532", + "sdk-Authrules-2513", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } + if err != nil { + log.Fatalf("failed to finish the request: %v", err) } + // TODO: use response item + _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleCreate.json -func ExampleEventHubsClient_CreateOrUpdateAuthorizationRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubAuthorizationRuleRegenerateKey.json +func ExampleEventHubsClient_RegenerateKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -171,17 +156,13 @@ func ExampleEventHubsClient_CreateOrUpdateAuthorizationRule() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.CreateOrUpdateAuthorizationRule(ctx, + res, err := client.RegenerateKeys(ctx, "ArunMonocle", - "sdk-Namespace-960", + "sdk-namespace-960", "sdk-EventHub-532", - "sdk-Authrules-2513", - armeventhub.AuthorizationRule{ - Properties: &armeventhub.AuthorizationRuleProperties{ - Rights: []*armeventhub.AccessRights{ - to.Ptr(armeventhub.AccessRightsListen), - to.Ptr(armeventhub.AccessRightsSend)}, - }, + "sdk-Authrules-1534", + armeventhub.RegenerateAccessKeyParameters{ + KeyType: to.Ptr(armeventhub.KeyTypePrimaryKey), }, nil) if err != nil { @@ -191,32 +172,36 @@ func ExampleEventHubsClient_CreateOrUpdateAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleGet.json -func ExampleEventHubsClient_GetAuthorizationRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubListByNameSpace.json +func ExampleEventHubsClient_NewListByNamespacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) + client, err := armeventhub.NewEventHubsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.GetAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-2513", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) + pager := client.NewListByNamespacePager("Default-NotificationHubs-AustraliaEast", + "sdk-Namespace-5357", + &armeventhub.EventHubsClientListByNamespaceOptions{Skip: nil, + Top: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - // TODO: use response item - _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleDelete.json -func ExampleEventHubsClient_DeleteAuthorizationRule() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubCreate.json +func ExampleEventHubsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -226,19 +211,41 @@ func ExampleEventHubsClient_DeleteAuthorizationRule() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.DeleteAuthorizationRule(ctx, - "ArunMonocle", - "sdk-Namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-2513", + res, err := client.CreateOrUpdate(ctx, + "Default-NotificationHubs-AustraliaEast", + "sdk-Namespace-5357", + "sdk-EventHub-6547", + armeventhub.Eventhub{ + Properties: &armeventhub.Properties{ + CaptureDescription: &armeventhub.CaptureDescription{ + Destination: &armeventhub.Destination{ + Name: to.Ptr("EventHubArchive.AzureBlockBlob"), + Properties: &armeventhub.DestinationProperties{ + ArchiveNameFormat: to.Ptr("{Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}"), + BlobContainer: to.Ptr("container"), + StorageAccountResourceID: to.Ptr("/subscriptions/e2f361f0-3b27-4503-a9cc-21cfba380093/resourceGroups/Default-Storage-SouthCentralUS/providers/Microsoft.ClassicStorage/storageAccounts/arjunteststorage"), + }, + }, + Enabled: to.Ptr(true), + Encoding: to.Ptr(armeventhub.EncodingCaptureDescriptionAvro), + IntervalInSeconds: to.Ptr[int32](120), + SizeLimitInBytes: to.Ptr[int32](10485763), + }, + MessageRetentionInDays: to.Ptr[int64](4), + PartitionCount: to.Ptr[int64](4), + Status: to.Ptr(armeventhub.EntityStatusActive), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + // TODO: use response item + _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleListKey.json -func ExampleEventHubsClient_ListKeys() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubDelete.json +func ExampleEventHubsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -248,38 +255,31 @@ func ExampleEventHubsClient_ListKeys() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListKeys(ctx, + _, err = client.Delete(ctx, "ArunMonocle", - "sdk-namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-2513", + "sdk-Namespace-5357", + "sdk-EventHub-6547", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item - _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EventHubs/EHEventHubAuthorizationRuleRegenerateKey.json -func ExampleEventHubsClient_RegenerateKeys() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EventHubs/EHEventHubGet.json +func ExampleEventHubsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armeventhub.NewEventHubsClient("5f750a97-50d9-4e36-8081-c9ee4c0210d4", cred, nil) + client, err := armeventhub.NewEventHubsClient("e2f361f0-3b27-4503-a9cc-21cfba380093", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.RegenerateKeys(ctx, - "ArunMonocle", - "sdk-namespace-960", - "sdk-EventHub-532", - "sdk-Authrules-1534", - armeventhub.RegenerateAccessKeyParameters{ - KeyType: to.Ptr(armeventhub.KeyTypePrimaryKey), - }, + res, err := client.Get(ctx, + "Default-NotificationHubs-AustraliaEast", + "sdk-Namespace-716", + "sdk-EventHub-10", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go index 3e0071a21693..de50310deb14 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_namespaces_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceList.json func ExampleNamespacesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleNamespacesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceListByResourceGroup.json func ExampleNamespacesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleNamespacesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceCreate.json func ExampleNamespacesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleNamespacesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceDelete.json func ExampleNamespacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -140,7 +140,7 @@ func ExampleNamespacesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceGet.json func ExampleNamespacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -162,7 +162,7 @@ func ExampleNamespacesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceUpdate.json func ExampleNamespacesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -193,7 +193,7 @@ func ExampleNamespacesClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetCreate.json func ExampleNamespacesClient_CreateOrUpdateNetworkRuleSet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -260,7 +260,7 @@ func ExampleNamespacesClient_CreateOrUpdateNetworkRuleSet() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetGet.json func ExampleNamespacesClient_GetNetworkRuleSet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -282,7 +282,7 @@ func ExampleNamespacesClient_GetNetworkRuleSet() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/EHNetworkRuleSetList.json func ExampleNamespacesClient_ListNetworkRuleSet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -304,7 +304,7 @@ func ExampleNamespacesClient_ListNetworkRuleSet() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleListAll.json func ExampleNamespacesClient_NewListAuthorizationRulesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -330,7 +330,7 @@ func ExampleNamespacesClient_NewListAuthorizationRulesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleCreate.json func ExampleNamespacesClient_CreateOrUpdateAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -360,7 +360,7 @@ func ExampleNamespacesClient_CreateOrUpdateAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleDelete.json func ExampleNamespacesClient_DeleteAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -381,7 +381,7 @@ func ExampleNamespacesClient_DeleteAuthorizationRule() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleGet.json func ExampleNamespacesClient_GetAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -404,7 +404,7 @@ func ExampleNamespacesClient_GetAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleListKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleListKey.json func ExampleNamespacesClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -427,7 +427,7 @@ func ExampleNamespacesClient_ListKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceAuthorizationRuleRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceAuthorizationRuleRegenerateKey.json func ExampleNamespacesClient_RegenerateKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -453,7 +453,7 @@ func ExampleNamespacesClient_RegenerateKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/EHNameSpaceCheckNameAvailability.json func ExampleNamespacesClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfiguration_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfiguration_client_test.go new file mode 100644 index 000000000000..2c092514b9a1 --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfiguration_client_test.go @@ -0,0 +1,39 @@ +//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 armeventhub_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/NetworkSecurityPerimeterConfigurationList.json +func ExampleNetworkSecurityPerimeterConfigurationClient_List() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewNetworkSecurityPerimeterConfigurationClient("subID", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.List(ctx, + "SDK-EventHub-4794", + "sdk-Namespace-5828", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfigurations_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfigurations_client_test.go new file mode 100644 index 000000000000..cf74c62c0e0e --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_networksecurityperimeterconfigurations_client_test.go @@ -0,0 +1,42 @@ +//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 armeventhub_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/NetworkSecurityPerimeterConfigurationReconcile.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginCreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armeventhub.NewNetworkSecurityPerimeterConfigurationsClient("subID", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginCreateOrUpdate(ctx, + "SDK-EventHub-4794", + "sdk-Namespace-5828", + "resourceAssociation1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go index 1d9f126ca0ba..ad199ca761c1 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/EHOperations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/EHOperations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go index 40c357752ad9..1acf5905e225 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionList.json func ExamplePrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionCreate.json func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -78,7 +78,7 @@ func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionDelete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go index 8003a54add29..e2982659c80d 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_privatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/NameSpaces/PrivateLinkResourcesGet.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go index 22d5dc5d5d5c..f628d69c18d1 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go +++ b/sdk/resourcemanager/eventhub/armeventhub/ze_generated_example_schemaregistry_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/eventhub/armeventhub" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryListByNamespace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryListByNamespace.json func ExampleSchemaRegistryClient_NewListByNamespacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleSchemaRegistryClient_NewListByNamespacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryCreate.json func ExampleSchemaRegistryClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleSchemaRegistryClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryDelete.json func ExampleSchemaRegistryClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleSchemaRegistryClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2021-11-01/examples/SchemaRegistry/SchemaRegistryGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/eventhub/resource-manager/Microsoft.EventHub/preview/2022-01-01-preview/examples/SchemaRegistry/SchemaRegistryGet.json func ExampleSchemaRegistryClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_applicationgroup_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_applicationgroup_client.go new file mode 100644 index 000000000000..051216016155 --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_applicationgroup_client.go @@ -0,0 +1,302 @@ +//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 armeventhub + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// ApplicationGroupClient contains the methods for the ApplicationGroup group. +// Don't use this type directly, use NewApplicationGroupClient() instead. +type ApplicationGroupClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewApplicationGroupClient creates a new instance of ApplicationGroupClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewApplicationGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGroupClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &ApplicationGroupClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdateApplicationGroup - Creates or updates an ApplicationGroup for a Namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// resourceGroupName - Name of the resource group within the azure subscription. +// namespaceName - The Namespace name +// applicationGroupName - The Application Group name +// parameters - The ApplicationGroup. +// options - ApplicationGroupClientCreateOrUpdateApplicationGroupOptions contains the optional parameters for the ApplicationGroupClient.CreateOrUpdateApplicationGroup +// method. +func (client *ApplicationGroupClient) CreateOrUpdateApplicationGroup(ctx context.Context, resourceGroupName string, namespaceName string, applicationGroupName string, parameters ApplicationGroup, options *ApplicationGroupClientCreateOrUpdateApplicationGroupOptions) (ApplicationGroupClientCreateOrUpdateApplicationGroupResponse, error) { + req, err := client.createOrUpdateApplicationGroupCreateRequest(ctx, resourceGroupName, namespaceName, applicationGroupName, parameters, options) + if err != nil { + return ApplicationGroupClientCreateOrUpdateApplicationGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ApplicationGroupClientCreateOrUpdateApplicationGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGroupClientCreateOrUpdateApplicationGroupResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateApplicationGroupHandleResponse(resp) +} + +// createOrUpdateApplicationGroupCreateRequest creates the CreateOrUpdateApplicationGroup request. +func (client *ApplicationGroupClient) createOrUpdateApplicationGroupCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, applicationGroupName string, parameters ApplicationGroup, options *ApplicationGroupClientCreateOrUpdateApplicationGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if applicationGroupName == "" { + return nil, errors.New("parameter applicationGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGroupName}", url.PathEscape(applicationGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateApplicationGroupHandleResponse handles the CreateOrUpdateApplicationGroup response. +func (client *ApplicationGroupClient) createOrUpdateApplicationGroupHandleResponse(resp *http.Response) (ApplicationGroupClientCreateOrUpdateApplicationGroupResponse, error) { + result := ApplicationGroupClientCreateOrUpdateApplicationGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroup); err != nil { + return ApplicationGroupClientCreateOrUpdateApplicationGroupResponse{}, err + } + return result, nil +} + +// Delete - Deletes an ApplicationGroup for a Namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// resourceGroupName - Name of the resource group within the azure subscription. +// namespaceName - The Namespace name +// applicationGroupName - The Application Group name +// options - ApplicationGroupClientDeleteOptions contains the optional parameters for the ApplicationGroupClient.Delete method. +func (client *ApplicationGroupClient) Delete(ctx context.Context, resourceGroupName string, namespaceName string, applicationGroupName string, options *ApplicationGroupClientDeleteOptions) (ApplicationGroupClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, applicationGroupName, options) + if err != nil { + return ApplicationGroupClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ApplicationGroupClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ApplicationGroupClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ApplicationGroupClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ApplicationGroupClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, applicationGroupName string, options *ApplicationGroupClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if applicationGroupName == "" { + return nil, errors.New("parameter applicationGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGroupName}", url.PathEscape(applicationGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets an ApplicationGroup for a Namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// resourceGroupName - Name of the resource group within the azure subscription. +// namespaceName - The Namespace name +// applicationGroupName - The Application Group name +// options - ApplicationGroupClientGetOptions contains the optional parameters for the ApplicationGroupClient.Get method. +func (client *ApplicationGroupClient) Get(ctx context.Context, resourceGroupName string, namespaceName string, applicationGroupName string, options *ApplicationGroupClientGetOptions) (ApplicationGroupClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, namespaceName, applicationGroupName, options) + if err != nil { + return ApplicationGroupClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ApplicationGroupClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGroupClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ApplicationGroupClient) getCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, applicationGroupName string, options *ApplicationGroupClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups/{applicationGroupName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if applicationGroupName == "" { + return nil, errors.New("parameter applicationGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{applicationGroupName}", url.PathEscape(applicationGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ApplicationGroupClient) getHandleResponse(resp *http.Response) (ApplicationGroupClientGetResponse, error) { + result := ApplicationGroupClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroup); err != nil { + return ApplicationGroupClientGetResponse{}, err + } + return result, nil +} + +// NewListByNamespacePager - Gets a list of application groups for a Namespace. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// resourceGroupName - Name of the resource group within the azure subscription. +// namespaceName - The Namespace name +// options - ApplicationGroupClientListByNamespaceOptions contains the optional parameters for the ApplicationGroupClient.ListByNamespace +// method. +func (client *ApplicationGroupClient) NewListByNamespacePager(resourceGroupName string, namespaceName string, options *ApplicationGroupClientListByNamespaceOptions) *runtime.Pager[ApplicationGroupClientListByNamespaceResponse] { + return runtime.NewPager(runtime.PagingHandler[ApplicationGroupClientListByNamespaceResponse]{ + More: func(page ApplicationGroupClientListByNamespaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ApplicationGroupClientListByNamespaceResponse) (ApplicationGroupClientListByNamespaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByNamespaceCreateRequest(ctx, resourceGroupName, namespaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationGroupClientListByNamespaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ApplicationGroupClientListByNamespaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGroupClientListByNamespaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByNamespaceHandleResponse(resp) + }, + }) +} + +// listByNamespaceCreateRequest creates the ListByNamespace request. +func (client *ApplicationGroupClient) listByNamespaceCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *ApplicationGroupClientListByNamespaceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/applicationGroups" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByNamespaceHandleResponse handles the ListByNamespace response. +func (client *ApplicationGroupClient) listByNamespaceHandleResponse(resp *http.Response) (ApplicationGroupClientListByNamespaceResponse, error) { + result := ApplicationGroupClientListByNamespaceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroupListResult); err != nil { + return ApplicationGroupClientListByNamespaceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_clusters_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_clusters_client.go index 4aae0318de93..12163e3b558b 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_clusters_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_clusters_client.go @@ -57,7 +57,7 @@ func NewClustersClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates an instance of an Event Hubs Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // parameters - Parameters for creating a eventhub cluster resource. @@ -77,7 +77,7 @@ func (client *ClustersClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Creates or updates an instance of an Event Hubs Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *ClustersClient) createOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -113,7 +113,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *ClustersClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Deletes an existing Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ClustersClientBeginDeleteOptions contains the optional parameters for the ClustersClient.BeginDelete method. @@ -139,7 +139,7 @@ func (client *ClustersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *ClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, clusterName, options) if err != nil { @@ -175,7 +175,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +183,7 @@ func (client *ClustersClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the resource description of the specified Event Hubs Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ClustersClientGetOptions contains the optional parameters for the ClustersClient.Get method. @@ -222,7 +222,7 @@ func (client *ClustersClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,7 +239,7 @@ func (client *ClustersClient) getHandleResponse(resp *http.Response) (ClustersCl // ListAvailableClusterRegion - List the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // options - ClustersClientListAvailableClusterRegionOptions contains the optional parameters for the ClustersClient.ListAvailableClusterRegion // method. func (client *ClustersClient) ListAvailableClusterRegion(ctx context.Context, options *ClustersClientListAvailableClusterRegionOptions) (ClustersClientListAvailableClusterRegionResponse, error) { @@ -269,7 +269,7 @@ func (client *ClustersClient) listAvailableClusterRegionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -286,7 +286,7 @@ func (client *ClustersClient) listAvailableClusterRegionHandleResponse(resp *htt // NewListByResourceGroupPager - Lists the available Event Hubs Clusters within an ARM resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // options - ClustersClientListByResourceGroupOptions contains the optional parameters for the ClustersClient.ListByResourceGroup // method. @@ -334,7 +334,7 @@ func (client *ClustersClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -351,7 +351,7 @@ func (client *ClustersClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Lists the available Event Hubs Clusters within an ARM resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // options - ClustersClientListBySubscriptionOptions contains the optional parameters for the ClustersClient.ListBySubscription // method. func (client *ClustersClient) NewListBySubscriptionPager(options *ClustersClientListBySubscriptionOptions) *runtime.Pager[ClustersClientListBySubscriptionResponse] { @@ -394,7 +394,7 @@ func (client *ClustersClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -411,7 +411,7 @@ func (client *ClustersClient) listBySubscriptionHandleResponse(resp *http.Respon // ListNamespaces - List all Event Hubs Namespace IDs in an Event Hubs Dedicated Cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ClustersClientListNamespacesOptions contains the optional parameters for the ClustersClient.ListNamespaces method. @@ -450,7 +450,7 @@ func (client *ClustersClient) listNamespacesCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -467,7 +467,7 @@ func (client *ClustersClient) listNamespacesHandleResponse(resp *http.Response) // BeginUpdate - Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // parameters - The properties of the Event Hubs Cluster which should be updated. @@ -486,7 +486,7 @@ func (client *ClustersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Modifies mutable properties on the Event Hubs Cluster. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *ClustersClient) update(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) if err != nil { @@ -522,7 +522,7 @@ func (client *ClustersClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_configuration_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_configuration_client.go index c8afdb5c8be8..b39285c96412 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_configuration_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_configuration_client.go @@ -58,7 +58,7 @@ func NewConfigurationClient(subscriptionID string, credential azcore.TokenCreden // Get - Get all Event Hubs Cluster settings - a collection of key/value pairs which represent the quotas and settings imposed // on the cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // options - ConfigurationClientGetOptions contains the optional parameters for the ConfigurationClient.Get method. @@ -97,7 +97,7 @@ func (client *ConfigurationClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *ConfigurationClient) getHandleResponse(resp *http.Response) (Confi // Patch - Replace all specified Event Hubs Cluster settings with those contained in the request body. Leaves the settings // not specified in the request body unmodified. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // clusterName - The name of the Event Hubs Cluster. // parameters - Parameters for creating an Event Hubs Cluster resource. @@ -155,7 +155,7 @@ func (client *ConfigurationClient) patchCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go index 7f684879438f..460e9b20c186 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_constants.go @@ -10,7 +10,7 @@ package armeventhub const ( moduleName = "armeventhub" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) type AccessRights string @@ -30,6 +30,20 @@ func PossibleAccessRightsValues() []AccessRights { } } +// ApplicationGroupPolicyType - Application Group Policy types +type ApplicationGroupPolicyType string + +const ( + ApplicationGroupPolicyTypeThrottlingPolicy ApplicationGroupPolicyType = "ThrottlingPolicy" +) + +// PossibleApplicationGroupPolicyTypeValues returns the possible values for the ApplicationGroupPolicyType const type. +func PossibleApplicationGroupPolicyTypeValues() []ApplicationGroupPolicyType { + return []ApplicationGroupPolicyType{ + ApplicationGroupPolicyTypeThrottlingPolicy, + } +} + // ClusterSKUName - Name of this SKU. type ClusterSKUName string @@ -187,6 +201,27 @@ func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { } } +// MetricID - Metric Id on which the throttle limit should be set, MetricId can be discovered by hovering over Metric in the +// Metrics section of Event Hub Namespace inside Azure Portal +type MetricID string + +const ( + MetricIDIncomingBytes MetricID = "IncomingBytes" + MetricIDIncomingMessages MetricID = "IncomingMessages" + MetricIDOutgoingBytes MetricID = "OutgoingBytes" + MetricIDOutgoingMessages MetricID = "OutgoingMessages" +) + +// PossibleMetricIDValues returns the possible values for the MetricID const type. +func PossibleMetricIDValues() []MetricID { + return []MetricID{ + MetricIDIncomingBytes, + MetricIDIncomingMessages, + MetricIDOutgoingBytes, + MetricIDOutgoingMessages, + } +} + // NetworkRuleIPAction - The IP Filter Action type NetworkRuleIPAction string @@ -201,6 +236,56 @@ func PossibleNetworkRuleIPActionValues() []NetworkRuleIPAction { } } +// NetworkSecurityPerimeterConfigurationProvisioningState - Provisioning state of NetworkSecurityPerimeter configuration propagation +type NetworkSecurityPerimeterConfigurationProvisioningState string + +const ( + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted NetworkSecurityPerimeterConfigurationProvisioningState = "Accepted" + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled NetworkSecurityPerimeterConfigurationProvisioningState = "Canceled" + NetworkSecurityPerimeterConfigurationProvisioningStateCreating NetworkSecurityPerimeterConfigurationProvisioningState = "Creating" + NetworkSecurityPerimeterConfigurationProvisioningStateDeleted NetworkSecurityPerimeterConfigurationProvisioningState = "Deleted" + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting NetworkSecurityPerimeterConfigurationProvisioningState = "Deleting" + NetworkSecurityPerimeterConfigurationProvisioningStateFailed NetworkSecurityPerimeterConfigurationProvisioningState = "Failed" + NetworkSecurityPerimeterConfigurationProvisioningStateInvalidResponse NetworkSecurityPerimeterConfigurationProvisioningState = "InvalidResponse" + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded NetworkSecurityPerimeterConfigurationProvisioningState = "Succeeded" + NetworkSecurityPerimeterConfigurationProvisioningStateSucceededWithIssues NetworkSecurityPerimeterConfigurationProvisioningState = "SucceededWithIssues" + NetworkSecurityPerimeterConfigurationProvisioningStateUnknown NetworkSecurityPerimeterConfigurationProvisioningState = "Unknown" + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating NetworkSecurityPerimeterConfigurationProvisioningState = "Updating" +) + +// PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues returns the possible values for the NetworkSecurityPerimeterConfigurationProvisioningState const type. +func PossibleNetworkSecurityPerimeterConfigurationProvisioningStateValues() []NetworkSecurityPerimeterConfigurationProvisioningState { + return []NetworkSecurityPerimeterConfigurationProvisioningState{ + NetworkSecurityPerimeterConfigurationProvisioningStateAccepted, + NetworkSecurityPerimeterConfigurationProvisioningStateCanceled, + NetworkSecurityPerimeterConfigurationProvisioningStateCreating, + NetworkSecurityPerimeterConfigurationProvisioningStateDeleted, + NetworkSecurityPerimeterConfigurationProvisioningStateDeleting, + NetworkSecurityPerimeterConfigurationProvisioningStateFailed, + NetworkSecurityPerimeterConfigurationProvisioningStateInvalidResponse, + NetworkSecurityPerimeterConfigurationProvisioningStateSucceeded, + NetworkSecurityPerimeterConfigurationProvisioningStateSucceededWithIssues, + NetworkSecurityPerimeterConfigurationProvisioningStateUnknown, + NetworkSecurityPerimeterConfigurationProvisioningStateUpdating, + } +} + +// NspAccessRuleDirection - Direction of Access Rule +type NspAccessRuleDirection string + +const ( + NspAccessRuleDirectionInbound NspAccessRuleDirection = "Inbound" + NspAccessRuleDirectionOutbound NspAccessRuleDirection = "Outbound" +) + +// PossibleNspAccessRuleDirectionValues returns the possible values for the NspAccessRuleDirection const type. +func PossibleNspAccessRuleDirectionValues() []NspAccessRuleDirection { + return []NspAccessRuleDirection{ + NspAccessRuleDirectionInbound, + NspAccessRuleDirectionOutbound, + } +} + // PrivateLinkConnectionStatus - Status of the connection. type PrivateLinkConnectionStatus string @@ -240,12 +325,33 @@ func PossibleProvisioningStateDRValues() []ProvisioningStateDR { } } -// PublicNetworkAccessFlag - This determines if traffic is allowed over public network. By default it is enabled. +// PublicNetworkAccess - This determines if traffic is allowed over public network. By default it is enabled. +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, + } +} + +// PublicNetworkAccessFlag - This determines if traffic is allowed over public network. By default it is enabled. If value +// is SecuredByPerimeter then Inbound and Outbound communication is controlled by the network security +// perimeter and profile's access rules. type PublicNetworkAccessFlag string const ( - PublicNetworkAccessFlagDisabled PublicNetworkAccessFlag = "Disabled" - PublicNetworkAccessFlagEnabled PublicNetworkAccessFlag = "Enabled" + PublicNetworkAccessFlagDisabled PublicNetworkAccessFlag = "Disabled" + PublicNetworkAccessFlagEnabled PublicNetworkAccessFlag = "Enabled" + PublicNetworkAccessFlagSecuredByPerimeter PublicNetworkAccessFlag = "SecuredByPerimeter" ) // PossiblePublicNetworkAccessFlagValues returns the possible values for the PublicNetworkAccessFlag const type. @@ -253,6 +359,29 @@ func PossiblePublicNetworkAccessFlagValues() []PublicNetworkAccessFlag { return []PublicNetworkAccessFlag{ PublicNetworkAccessFlagDisabled, PublicNetworkAccessFlagEnabled, + PublicNetworkAccessFlagSecuredByPerimeter, + } +} + +// ResourceAssociationAccessMode - Access Mode of the resource association +type ResourceAssociationAccessMode string + +const ( + ResourceAssociationAccessModeAuditMode ResourceAssociationAccessMode = "AuditMode" + ResourceAssociationAccessModeEnforcedMode ResourceAssociationAccessMode = "EnforcedMode" + ResourceAssociationAccessModeLearningMode ResourceAssociationAccessMode = "LearningMode" + ResourceAssociationAccessModeNoAssociationMode ResourceAssociationAccessMode = "NoAssociationMode" + ResourceAssociationAccessModeUnspecifiedMode ResourceAssociationAccessMode = "UnspecifiedMode" +) + +// PossibleResourceAssociationAccessModeValues returns the possible values for the ResourceAssociationAccessMode const type. +func PossibleResourceAssociationAccessModeValues() []ResourceAssociationAccessMode { + return []ResourceAssociationAccessMode{ + ResourceAssociationAccessModeAuditMode, + ResourceAssociationAccessModeEnforcedMode, + ResourceAssociationAccessModeLearningMode, + ResourceAssociationAccessModeNoAssociationMode, + ResourceAssociationAccessModeUnspecifiedMode, } } @@ -342,6 +471,24 @@ func PossibleSchemaTypeValues() []SchemaType { } } +// TLSVersion - The minimum TLS version for the cluster to support, e.g. '1.2' +type TLSVersion string + +const ( + TLSVersionOne0 TLSVersion = "1.0" + TLSVersionOne1 TLSVersion = "1.1" + TLSVersionOne2 TLSVersion = "1.2" +) + +// PossibleTLSVersionValues returns the possible values for the TLSVersion const type. +func PossibleTLSVersionValues() []TLSVersion { + return []TLSVersion{ + TLSVersionOne0, + TLSVersionOne1, + TLSVersionOne2, + } +} + // UnavailableReason - Specifies the reason for the unavailability of the service. type UnavailableReason string diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_consumergroups_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_consumergroups_client.go index 47cca060dd2b..d9de3ccb9441 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_consumergroups_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_consumergroups_client.go @@ -58,7 +58,7 @@ func NewConsumerGroupsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or updates an Event Hubs consumer group as a nested resource within a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -109,7 +109,7 @@ func (client *ConsumerGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,7 +126,7 @@ func (client *ConsumerGroupsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes a consumer group from the specified Event Hub and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -175,7 +175,7 @@ func (client *ConsumerGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +183,7 @@ func (client *ConsumerGroupsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a description for the specified consumer group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -232,7 +232,7 @@ func (client *ConsumerGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *ConsumerGroupsClient) getHandleResponse(resp *http.Response) (Cons // NewListByEventHubPager - Gets all the consumer groups in a Namespace. An empty feed is returned if no consumer group exists // in the Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -308,7 +308,7 @@ func (client *ConsumerGroupsClient) listByEventHubCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_disasterrecoveryconfigs_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_disasterrecoveryconfigs_client.go index 8b7409e6b043..df4fa7dee341 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_disasterrecoveryconfigs_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_disasterrecoveryconfigs_client.go @@ -57,7 +57,7 @@ func NewDisasterRecoveryConfigsClient(subscriptionID string, credential azcore.T // BreakPairing - This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -102,7 +102,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte // CheckNameAvailability - Check the give Namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - Parameters to check availability of the given Alias name @@ -151,7 +151,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -168,7 +168,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityHandleResponse // CreateOrUpdate - Creates or updates a new Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -214,7 +214,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -231,7 +231,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateHandleResponse(resp * // Delete - Deletes an Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -276,7 +276,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con // FailOver - Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -329,7 +329,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,7 +337,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C // Get - Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -382,7 +382,7 @@ func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -399,7 +399,7 @@ func (client *DisasterRecoveryConfigsClient) getHandleResponse(resp *http.Respon // GetAuthorizationRule - Gets an AuthorizationRule for a Namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -449,7 +449,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -466,7 +466,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleHandleResponse( // NewListPager - Gets all Alias(Disaster Recovery configurations) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.List @@ -519,7 +519,7 @@ func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -536,7 +536,7 @@ func (client *DisasterRecoveryConfigsClient) listHandleResponse(resp *http.Respo // NewListAuthorizationRulesPager - Gets a list of authorization rules for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -594,7 +594,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -611,7 +611,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesHandleRespons // ListKeys - Gets the primary and secondary connection strings for the Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // alias - The Disaster Recovery configuration name @@ -661,7 +661,7 @@ func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_eventhubs_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_eventhubs_client.go index ab27fe6c6dc1..2a346ef646af 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_eventhubs_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_eventhubs_client.go @@ -58,7 +58,7 @@ func NewEventHubsClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates a new Event Hub as a nested resource within a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -104,7 +104,7 @@ func (client *EventHubsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +122,7 @@ func (client *EventHubsClient) createOrUpdateHandleResponse(resp *http.Response) // CreateOrUpdateAuthorizationRule - Creates or updates an AuthorizationRule for the specified Event Hub. Creation/update // of the AuthorizationRule will take a few seconds to take effect. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -173,7 +173,7 @@ func (client *EventHubsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -190,7 +190,7 @@ func (client *EventHubsClient) createOrUpdateAuthorizationRuleHandleResponse(res // Delete - Deletes an Event Hub from the specified Namespace and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -234,7 +234,7 @@ func (client *EventHubsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +242,7 @@ func (client *EventHubsClient) deleteCreateRequest(ctx context.Context, resource // DeleteAuthorizationRule - Deletes an Event Hub AuthorizationRule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -292,7 +292,7 @@ func (client *EventHubsClient) deleteAuthorizationRuleCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -300,7 +300,7 @@ func (client *EventHubsClient) deleteAuthorizationRuleCreateRequest(ctx context. // Get - Gets an Event Hubs description for the specified Event Hub. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -344,7 +344,7 @@ func (client *EventHubsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -361,7 +361,7 @@ func (client *EventHubsClient) getHandleResponse(resp *http.Response) (EventHubs // GetAuthorizationRule - Gets an AuthorizationRule for an Event Hub by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -411,7 +411,7 @@ func (client *EventHubsClient) getAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,7 +428,7 @@ func (client *EventHubsClient) getAuthorizationRuleHandleResponse(resp *http.Res // NewListAuthorizationRulesPager - Gets the authorization rules for an Event Hub. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -486,7 +486,7 @@ func (client *EventHubsClient) listAuthorizationRulesCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -503,7 +503,7 @@ func (client *EventHubsClient) listAuthorizationRulesHandleResponse(resp *http.R // NewListByNamespacePager - Gets all the Event Hubs in a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - EventHubsClientListByNamespaceOptions contains the optional parameters for the EventHubsClient.ListByNamespace @@ -556,7 +556,7 @@ func (client *EventHubsClient) listByNamespaceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -579,7 +579,7 @@ func (client *EventHubsClient) listByNamespaceHandleResponse(resp *http.Response // ListKeys - Gets the ACS and SAS connection strings for the Event Hub. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -628,7 +628,7 @@ func (client *EventHubsClient) listKeysCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -645,7 +645,7 @@ func (client *EventHubsClient) listKeysHandleResponse(resp *http.Response) (Even // RegenerateKeys - Regenerates the ACS and SAS connection strings for the Event Hub. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // eventHubName - The Event Hub name @@ -696,7 +696,7 @@ func (client *EventHubsClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go index 254ed286e997..c083af1b7d73 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models.go @@ -34,6 +34,92 @@ type AccessKeys struct { SecondaryKey *string `json:"secondaryKey,omitempty" azure:"ro"` } +// ApplicationGroup - The Application Group object +type ApplicationGroup struct { + Properties *ApplicationGroupProperties `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 geo-location where the resource lives + Location *string `json:"location,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.EventHub/Namespaces" or "Microsoft.EventHub/Namespaces/EventHubs" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ApplicationGroupClientCreateOrUpdateApplicationGroupOptions contains the optional parameters for the ApplicationGroupClient.CreateOrUpdateApplicationGroup +// method. +type ApplicationGroupClientCreateOrUpdateApplicationGroupOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGroupClientDeleteOptions contains the optional parameters for the ApplicationGroupClient.Delete method. +type ApplicationGroupClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGroupClientGetOptions contains the optional parameters for the ApplicationGroupClient.Get method. +type ApplicationGroupClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGroupClientListByNamespaceOptions contains the optional parameters for the ApplicationGroupClient.ListByNamespace +// method. +type ApplicationGroupClientListByNamespaceOptions struct { + // placeholder for future optional parameters +} + +// ApplicationGroupListResult - The response from the List Application Groups operation. +type ApplicationGroupListResult struct { + // Result of the List Application Groups operation. + Value []*ApplicationGroup `json:"value,omitempty"` + + // READ-ONLY; Link to the next set of results. Not empty if Value contains an incomplete list of Authorization Rules + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// ApplicationGroupPolicyClassification provides polymorphic access to related types. +// Call the interface's GetApplicationGroupPolicy() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ApplicationGroupPolicy, *ThrottlingPolicy +type ApplicationGroupPolicyClassification interface { + // GetApplicationGroupPolicy returns the ApplicationGroupPolicy content of the underlying type. + GetApplicationGroupPolicy() *ApplicationGroupPolicy +} + +// ApplicationGroupPolicy - Properties of the Application Group policy +type ApplicationGroupPolicy struct { + // REQUIRED; The Name of this policy + Name *string `json:"name,omitempty"` + + // REQUIRED; Application Group Policy types + Type *ApplicationGroupPolicyType `json:"type,omitempty"` +} + +// GetApplicationGroupPolicy implements the ApplicationGroupPolicyClassification interface for type ApplicationGroupPolicy. +func (a *ApplicationGroupPolicy) GetApplicationGroupPolicy() *ApplicationGroupPolicy { return a } + +type ApplicationGroupProperties struct { + // REQUIRED; The Unique identifier for application group.Supports SAS(SASKeyName=KeyName) or AAD(AADAppID=Guid) + ClientAppGroupIdentifier *string `json:"clientAppGroupIdentifier,omitempty"` + + // Determines if Application Group is allowed to create connection with namespace or not. Once the isEnabled is set to false, + // all the existing connections of application group gets dropped and no new + // connections will be allowed + IsEnabled *bool `json:"isEnabled,omitempty"` + + // List of group policies that define the behavior of application group. The policies can support resource governance scenarios + // such as limiting ingress or egress traffic. + Policies []ApplicationGroupPolicyClassification `json:"policies,omitempty"` +} + // ArmDisasterRecovery - Single item in List or Get Alias(Disaster Recovery configuration) operation type ArmDisasterRecovery struct { // Properties required to the Create Or Update Alias(Disaster Recovery configurations) @@ -211,6 +297,9 @@ type ClusterListResult struct { // ClusterProperties - Event Hubs Cluster properties supplied in responses in List or Get operations. type ClusterProperties struct { + // A value that indicates whether Scaling is Supported. + SupportsScaling *bool `json:"supportsScaling,omitempty"` + // READ-ONLY; The UTC time when the Event Hubs Cluster was created. CreatedAt *string `json:"createdAt,omitempty" azure:"ro"` @@ -539,9 +628,15 @@ type EHNamespaceProperties struct { // AutoInflateEnabled = true) MaximumThroughputUnits *int32 `json:"maximumThroughputUnits,omitempty"` + // The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTLSVersion *TLSVersion `json:"minimumTlsVersion,omitempty"` + // List of private endpoint connections. PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // Enabling this property creates a Standard Event Hubs Namespace in regions supported availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` @@ -875,7 +970,9 @@ type NetworkRuleSetProperties struct { // List of IpRules IPRules []*NWRuleSetIPRules `json:"ipRules,omitempty"` - // This determines if traffic is allowed over public network. By default it is enabled. + // This determines if traffic is allowed over public network. By default it is enabled. If value is SecuredByPerimeter then + // Inbound and Outbound communication is controlled by the network security + // perimeter and profile's access rules. PublicNetworkAccess *PublicNetworkAccessFlag `json:"publicNetworkAccess,omitempty"` // Value that indicates whether Trusted Service Access is Enabled or not. @@ -885,6 +982,136 @@ type NetworkRuleSetProperties struct { VirtualNetworkRules []*NWRuleSetVirtualNetworkRules `json:"virtualNetworkRules,omitempty"` } +// NetworkSecurityPerimeter related information +type NetworkSecurityPerimeter struct { + // Fully qualified identifier of the resource + ID *string `json:"id,omitempty"` + + // Location of the resource + Location *string `json:"location,omitempty"` + + // Guid of the resource + PerimeterGUID *string `json:"perimeterGuid,omitempty"` +} + +// NetworkSecurityPerimeterConfiguration - Network Security Perimeter related configurations of a given namespace +type NetworkSecurityPerimeterConfiguration struct { + // Resource location. + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,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; Properties of the Network Security Perimeter Configuration + Properties *NetworkSecurityPerimeterConfigurationProperties `json:"properties,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"` +} + +// NetworkSecurityPerimeterConfigurationClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationClient.List +// method. +type NetworkSecurityPerimeterConfigurationClientListOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationList - Result of the List NetworkSecurityPerimeterConfiguration operation. +type NetworkSecurityPerimeterConfigurationList struct { + // READ-ONLY; A collection of NetworkSecurityPerimeterConfigurations + Value []*NetworkSecurityPerimeterConfiguration `json:"value,omitempty" azure:"ro"` +} + +// NetworkSecurityPerimeterConfigurationProperties - Properties of NetworkSecurityPerimeterConfiguration +type NetworkSecurityPerimeterConfigurationProperties struct { + // List of Provisioning Issues if any + ProvisioningIssues []*ProvisioningIssue `json:"provisioningIssues,omitempty"` + + // Provisioning state of NetworkSecurityPerimeter configuration propagation + ProvisioningState *NetworkSecurityPerimeterConfigurationProvisioningState `json:"provisioningState,omitempty"` + + // READ-ONLY; NetworkSecurityPerimeter related information + NetworkSecurityPerimeter *NetworkSecurityPerimeter `json:"networkSecurityPerimeter,omitempty" azure:"ro"` + + // READ-ONLY; Information about current network profile + Profile *NetworkSecurityPerimeterConfigurationPropertiesProfile `json:"profile,omitempty" azure:"ro"` + + // READ-ONLY; Information about resource association + ResourceAssociation *NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation `json:"resourceAssociation,omitempty" azure:"ro"` +} + +// NetworkSecurityPerimeterConfigurationPropertiesProfile - Information about current network profile +type NetworkSecurityPerimeterConfigurationPropertiesProfile struct { + // List of Access Rules + AccessRules []*NspAccessRule `json:"accessRules,omitempty"` + + // Current access rules version + AccessRulesVersion *string `json:"accessRulesVersion,omitempty"` + + // Name of the resource + Name *string `json:"name,omitempty"` +} + +// NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation - Information about resource association +type NetworkSecurityPerimeterConfigurationPropertiesResourceAssociation struct { + // Access Mode of the resource association + AccessMode *ResourceAssociationAccessMode `json:"accessMode,omitempty"` + + // Name of the resource association + Name *string `json:"name,omitempty"` +} + +// NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginCreateOrUpdate +// method. +type NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NspAccessRule - Information of Access Rule in Network Profile +type NspAccessRule struct { + // Fully qualified identifier of the resource + ID *string `json:"id,omitempty"` + + // Name of the resource + Name *string `json:"name,omitempty"` + + // Type of the resource + Type *string `json:"type,omitempty"` + + // READ-ONLY; Properties of Access Rule + Properties *NspAccessRuleProperties `json:"properties,omitempty" azure:"ro"` +} + +// NspAccessRuleProperties - Properties of Access Rule +type NspAccessRuleProperties struct { + // Address prefixes in the CIDR format for inbound rules + AddressPrefixes []*string `json:"addressPrefixes,omitempty"` + + // Direction of Access Rule + Direction *NspAccessRuleDirection `json:"direction,omitempty"` + + // Subscriptions for inbound rules + Subscriptions []*NspAccessRulePropertiesSubscriptionsItem `json:"subscriptions,omitempty"` + + // READ-ONLY; FQDN for outbound rules + FullyQualifiedDomainNames []*string `json:"fullyQualifiedDomainNames,omitempty" azure:"ro"` + + // READ-ONLY; NetworkSecurityPerimeters for inbound rules + NetworkSecurityPerimeters []*NetworkSecurityPerimeter `json:"networkSecurityPerimeters,omitempty" azure:"ro"` +} + +// NspAccessRulePropertiesSubscriptionsItem - Subscription for inbound rule +type NspAccessRulePropertiesSubscriptionsItem struct { + // Fully qualified identifier of subscription + ID *string `json:"id,omitempty"` +} + // Operation - A Event Hub REST API operation type Operation struct { // Display of the operation @@ -1071,6 +1298,24 @@ type Properties struct { UpdatedAt *time.Time `json:"updatedAt,omitempty" azure:"ro"` } +// ProvisioningIssue - Describes Provisioning issue for given NetworkSecurityPerimeterConfiguration +type ProvisioningIssue struct { + // Name of the issue + Name *string `json:"name,omitempty"` + + // READ-ONLY; Properties of Provisioning Issue + Properties *ProvisioningIssueProperties `json:"properties,omitempty" azure:"ro"` +} + +// ProvisioningIssueProperties - Properties of Provisioning Issue +type ProvisioningIssueProperties struct { + // Description of the issue + Description *string `json:"description,omitempty"` + + // Type of Issue + IssueType *string `json:"issueType,omitempty"` +} + // ProxyResource - Common fields that are returned in the response for all Azure Resource Manager resources type ProxyResource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -1220,6 +1465,30 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } +// ThrottlingPolicy - Properties of the throttling policy +type ThrottlingPolicy struct { + // REQUIRED; Metric Id on which the throttle limit should be set, MetricId can be discovered by hovering over Metric in the + // Metrics section of Event Hub Namespace inside Azure Portal + MetricID *MetricID `json:"metricId,omitempty"` + + // REQUIRED; The Name of this policy + Name *string `json:"name,omitempty"` + + // REQUIRED; The Threshold limit above which the application group will be throttled.Rate limit is always per second. + RateLimitThreshold *int64 `json:"rateLimitThreshold,omitempty"` + + // REQUIRED; Application Group Policy types + Type *ApplicationGroupPolicyType `json:"type,omitempty"` +} + +// GetApplicationGroupPolicy implements the ApplicationGroupPolicyClassification interface for type ThrottlingPolicy. +func (t *ThrottlingPolicy) GetApplicationGroupPolicy() *ApplicationGroupPolicy { + return &ApplicationGroupPolicy{ + Name: t.Name, + Type: t.Type, + } +} + // TrackedResource - Definition of resource. type TrackedResource struct { // Resource location. diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go index e09cbf6a330b..ef09a0cf8653 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_models_serde.go @@ -15,6 +15,41 @@ import ( "reflect" ) +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupProperties. +func (a ApplicationGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "clientAppGroupIdentifier", a.ClientAppGroupIdentifier) + populate(objectMap, "isEnabled", a.IsEnabled) + populate(objectMap, "policies", a.Policies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationGroupProperties. +func (a *ApplicationGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientAppGroupIdentifier": + err = unpopulate(val, "ClientAppGroupIdentifier", &a.ClientAppGroupIdentifier) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &a.IsEnabled) + delete(rawMsg, key) + case "policies": + a.Policies, err = unmarshalApplicationGroupPolicyClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AuthorizationRuleProperties. func (a AuthorizationRuleProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -105,8 +140,10 @@ func (e EHNamespaceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "kafkaEnabled", e.KafkaEnabled) populate(objectMap, "maximumThroughputUnits", e.MaximumThroughputUnits) populate(objectMap, "metricId", e.MetricID) + populate(objectMap, "minimumTlsVersion", e.MinimumTLSVersion) populate(objectMap, "privateEndpointConnections", e.PrivateEndpointConnections) populate(objectMap, "provisioningState", e.ProvisioningState) + populate(objectMap, "publicNetworkAccess", e.PublicNetworkAccess) populate(objectMap, "serviceBusEndpoint", e.ServiceBusEndpoint) populate(objectMap, "status", e.Status) populateTimeRFC3339(objectMap, "updatedAt", e.UpdatedAt) @@ -150,12 +187,18 @@ func (e *EHNamespaceProperties) UnmarshalJSON(data []byte) error { case "metricId": err = unpopulate(val, "MetricID", &e.MetricID) delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &e.MinimumTLSVersion) + delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &e.PrivateEndpointConnections) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &e.ProvisioningState) delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &e.PublicNetworkAccess) + delete(rawMsg, key) case "serviceBusEndpoint": err = unpopulate(val, "ServiceBusEndpoint", &e.ServiceBusEndpoint) delete(rawMsg, key) @@ -206,6 +249,49 @@ func (n NetworkRuleSetProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "networkSecurityPerimeter", n.NetworkSecurityPerimeter) + populate(objectMap, "profile", n.Profile) + populate(objectMap, "provisioningIssues", n.ProvisioningIssues) + populate(objectMap, "provisioningState", n.ProvisioningState) + populate(objectMap, "resourceAssociation", n.ResourceAssociation) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationPropertiesProfile. +func (n NetworkSecurityPerimeterConfigurationPropertiesProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NspAccessRuleProperties. +func (n NspAccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "addressPrefixes", n.AddressPrefixes) + populate(objectMap, "direction", n.Direction) + populate(objectMap, "fullyQualifiedDomainNames", n.FullyQualifiedDomainNames) + populate(objectMap, "networkSecurityPerimeters", n.NetworkSecurityPerimeters) + populate(objectMap, "subscriptions", n.Subscriptions) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type Properties. func (p Properties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -351,6 +437,45 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ThrottlingPolicy. +func (t ThrottlingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "metricId", t.MetricID) + populate(objectMap, "name", t.Name) + populate(objectMap, "rateLimitThreshold", t.RateLimitThreshold) + objectMap["type"] = ApplicationGroupPolicyTypeThrottlingPolicy + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ThrottlingPolicy. +func (t *ThrottlingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metricId": + err = unpopulate(val, "MetricID", &t.MetricID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "rateLimitThreshold": + err = unpopulate(val, "RateLimitThreshold", &t.RateLimitThreshold) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go index 6c23f1c4220b..d5b46558c06d 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_namespaces_client.go @@ -57,7 +57,7 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Check the give Namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // parameters - Parameters to check availability of the given Namespace name // options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability // method. @@ -88,7 +88,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -106,7 +106,7 @@ func (client *NamespacesClient) checkNameAvailabilityHandleResponse(resp *http.R // BeginCreateOrUpdate - Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This // operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - Parameters for creating a namespace resource. @@ -127,7 +127,7 @@ func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation // is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters EHNamespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { @@ -163,7 +163,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -171,7 +171,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, // CreateOrUpdateAuthorizationRule - Creates or updates an AuthorizationRule for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -217,7 +217,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -234,7 +234,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleHandleResponse(re // CreateOrUpdateNetworkRuleSet - Create or update NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - The Namespace IpFilterRule. @@ -275,7 +275,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -292,7 +292,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetHandleResponse(resp // BeginDelete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. @@ -310,7 +310,7 @@ func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { @@ -346,7 +346,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc // DeleteAuthorizationRule - Deletes an AuthorizationRule for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -399,7 +399,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,7 +407,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context // Get - Gets the description of the specified namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientGetOptions contains the optional parameters for the NamespacesClient.Get method. @@ -446,7 +446,7 @@ func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -463,7 +463,7 @@ func (client *NamespacesClient) getHandleResponse(resp *http.Response) (Namespac // GetAuthorizationRule - Gets an AuthorizationRule for a Namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -508,7 +508,7 @@ func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -525,7 +525,7 @@ func (client *NamespacesClient) getAuthorizationRuleHandleResponse(resp *http.Re // GetNetworkRuleSet - Gets NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientGetNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.GetNetworkRuleSet @@ -565,7 +565,7 @@ func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +582,7 @@ func (client *NamespacesClient) getNetworkRuleSetHandleResponse(resp *http.Respo // NewListPager - Lists all the available Namespaces within a subscription, irrespective of the resource groups. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.List method. func (client *NamespacesClient) NewListPager(options *NamespacesClientListOptions) *runtime.Pager[NamespacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListResponse]{ @@ -624,7 +624,7 @@ func (client *NamespacesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -641,7 +641,7 @@ func (client *NamespacesClient) listHandleResponse(resp *http.Response) (Namespa // NewListAuthorizationRulesPager - Gets a list of authorization rules for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.ListAuthorizationRules @@ -694,7 +694,7 @@ func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -711,7 +711,7 @@ func (client *NamespacesClient) listAuthorizationRulesHandleResponse(resp *http. // NewListByResourceGroupPager - Lists the available Namespaces within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // options - NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.ListByResourceGroup // method. @@ -759,7 +759,7 @@ func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -776,7 +776,7 @@ func (client *NamespacesClient) listByResourceGroupHandleResponse(resp *http.Res // ListKeys - Gets the primary and secondary connection strings for the Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -820,7 +820,7 @@ func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -837,7 +837,7 @@ func (client *NamespacesClient) listKeysHandleResponse(resp *http.Response) (Nam // ListNetworkRuleSet - Gets NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - NamespacesClientListNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.ListNetworkRuleSet @@ -877,7 +877,7 @@ func (client *NamespacesClient) listNetworkRuleSetCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -894,7 +894,7 @@ func (client *NamespacesClient) listNetworkRuleSetHandleResponse(resp *http.Resp // RegenerateKeys - Regenerates the primary or secondary connection strings for the specified Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // authorizationRuleName - The authorization rule name. @@ -940,7 +940,7 @@ func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -958,7 +958,7 @@ func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response // Update - Creates or updates a namespace. Once created, this namespace's resource manifest is immutable. This operation // is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // parameters - Parameters for updating a namespace resource. @@ -998,7 +998,7 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfiguration_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfiguration_client.go new file mode 100644 index 000000000000..94b210998642 --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfiguration_client.go @@ -0,0 +1,113 @@ +//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 armeventhub + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationClient contains the methods for the NetworkSecurityPerimeterConfiguration group. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationClient() instead. +type NetworkSecurityPerimeterConfigurationClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewNetworkSecurityPerimeterConfigurationClient creates a new instance of NetworkSecurityPerimeterConfigurationClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &NetworkSecurityPerimeterConfigurationClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// List - Gets list of current NetworkSecurityPerimeterConfiguration for Namespace +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// resourceGroupName - Name of the resource group within the azure subscription. +// namespaceName - The Namespace name +// options - NetworkSecurityPerimeterConfigurationClientListOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationClient.List +// method. +func (client *NetworkSecurityPerimeterConfigurationClient) List(ctx context.Context, resourceGroupName string, namespaceName string, options *NetworkSecurityPerimeterConfigurationClientListOptions) (NetworkSecurityPerimeterConfigurationClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, namespaceName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return NetworkSecurityPerimeterConfigurationClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *NetworkSecurityPerimeterConfigurationClient) listCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, options *NetworkSecurityPerimeterConfigurationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *NetworkSecurityPerimeterConfigurationClient) listHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationClientListResponse, error) { + result := NetworkSecurityPerimeterConfigurationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationList); err != nil { + return NetworkSecurityPerimeterConfigurationClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..7f08e9db0b97 --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_networksecurityperimeterconfigurations_client.go @@ -0,0 +1,124 @@ +//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 armeventhub + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// NetworkSecurityPerimeterConfigurationsClient contains the methods for the NetworkSecurityPerimeterConfigurations group. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead. +type NetworkSecurityPerimeterConfigurationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Refreshes any information about the association. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// resourceGroupName - Name of the resource group within the azure subscription. +// namespaceName - The Namespace name +// resourceAssociationName - The ResourceAssociation Name +// options - NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the +// NetworkSecurityPerimeterConfigurationsClient.BeginCreateOrUpdate method. +func (client *NetworkSecurityPerimeterConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, namespaceName, resourceAssociationName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Refreshes any information about the association. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +func (client *NetworkSecurityPerimeterConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, resourceAssociationName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *NetworkSecurityPerimeterConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, namespaceName string, resourceAssociationName string, options *NetworkSecurityPerimeterConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/namespaces/{namespaceName}/networkSecurityPerimeterConfigurations/{resourceAssociationName}/reconcile" + 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 namespaceName == "" { + return nil, errors.New("parameter namespaceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{namespaceName}", url.PathEscape(namespaceName)) + if resourceAssociationName == "" { + return nil, errors.New("parameter resourceAssociationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceAssociationName}", url.PathEscape(resourceAssociationName)) + 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-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_operations_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_operations_client.go index c2ee07ca65c6..340692126fe0 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_operations_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Event Hub REST API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_polymorphic_helpers.go new file mode 100644 index 000000000000..685728d00e21 --- /dev/null +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_polymorphic_helpers.go @@ -0,0 +1,48 @@ +//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 armeventhub + +import "encoding/json" + +func unmarshalApplicationGroupPolicyClassification(rawMsg json.RawMessage) (ApplicationGroupPolicyClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ApplicationGroupPolicyClassification + switch m["type"] { + case string(ApplicationGroupPolicyTypeThrottlingPolicy): + b = &ThrottlingPolicy{} + default: + b = &ApplicationGroupPolicy{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalApplicationGroupPolicyClassificationArray(rawMsg json.RawMessage) ([]ApplicationGroupPolicyClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]ApplicationGroupPolicyClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalApplicationGroupPolicyClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privateendpointconnections_client.go index 4e132a61bbae..caaf1ea1d962 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privateendpointconnections_client.go @@ -57,7 +57,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates or updates PrivateEndpointConnections of service namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -103,7 +103,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res // BeginDelete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -140,7 +140,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) if err != nil { @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +188,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a description for the specified Private Endpoint Connection name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -233,7 +233,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - Gets the available PrivateEndpointConnections within a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -303,7 +303,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privatelinkresources_client.go index 5b776b879617..76bc28bc79ff 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_privatelinkresources_client.go @@ -57,7 +57,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets lists of resources that supports Privatelinks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get @@ -97,7 +97,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go index 83ac6f1506a9..93a45fd591f9 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_response_types.go @@ -8,6 +8,26 @@ package armeventhub +// ApplicationGroupClientCreateOrUpdateApplicationGroupResponse contains the response from method ApplicationGroupClient.CreateOrUpdateApplicationGroup. +type ApplicationGroupClientCreateOrUpdateApplicationGroupResponse struct { + ApplicationGroup +} + +// ApplicationGroupClientDeleteResponse contains the response from method ApplicationGroupClient.Delete. +type ApplicationGroupClientDeleteResponse struct { + // placeholder for future response values +} + +// ApplicationGroupClientGetResponse contains the response from method ApplicationGroupClient.Get. +type ApplicationGroupClientGetResponse struct { + ApplicationGroup +} + +// ApplicationGroupClientListByNamespaceResponse contains the response from method ApplicationGroupClient.ListByNamespace. +type ApplicationGroupClientListByNamespaceResponse struct { + ApplicationGroupListResult +} + // ClustersClientCreateOrUpdateResponse contains the response from method ClustersClient.CreateOrUpdate. type ClustersClientCreateOrUpdateResponse struct { Cluster @@ -258,6 +278,16 @@ type NamespacesClientUpdateResponse struct { EHNamespace } +// NetworkSecurityPerimeterConfigurationClientListResponse contains the response from method NetworkSecurityPerimeterConfigurationClient.List. +type NetworkSecurityPerimeterConfigurationClientListResponse struct { + NetworkSecurityPerimeterConfigurationList +} + +// NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.CreateOrUpdate. +type NetworkSecurityPerimeterConfigurationsClientCreateOrUpdateResponse struct { + // placeholder for future response values +} + // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { OperationListResult diff --git a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_schemaregistry_client.go b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_schemaregistry_client.go index d032f491ec68..bc4e7d1e1931 100644 --- a/sdk/resourcemanager/eventhub/armeventhub/zz_generated_schemaregistry_client.go +++ b/sdk/resourcemanager/eventhub/armeventhub/zz_generated_schemaregistry_client.go @@ -58,7 +58,7 @@ func NewSchemaRegistryClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // schemaGroupName - The Schema Group name @@ -104,7 +104,7 @@ func (client *SchemaRegistryClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *SchemaRegistryClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // schemaGroupName - The Schema Group name @@ -165,7 +165,7 @@ func (client *SchemaRegistryClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -173,7 +173,7 @@ func (client *SchemaRegistryClient) deleteCreateRequest(ctx context.Context, res // Get - // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // schemaGroupName - The Schema Group name @@ -217,7 +217,7 @@ func (client *SchemaRegistryClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *SchemaRegistryClient) getHandleResponse(resp *http.Response) (Sche // NewListByNamespacePager - Gets all the Schema Groups in a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the resource group within the azure subscription. // namespaceName - The Namespace name // options - SchemaRegistryClientListByNamespaceOptions contains the optional parameters for the SchemaRegistryClient.ListByNamespace @@ -287,7 +287,7 @@ func (client *SchemaRegistryClient) listByNamespaceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md b/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md index 38cfe4b2239d..3c83f65b8e43 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +## 1.1.0-beta.1 (2022-05-19) +### Features Added + +- New struct `FhirServiceImportConfiguration` +- New struct `ServiceImportConfigurationInfo` +- New field `ImportConfiguration` in struct `ServicesProperties` +- New field `ImportConfiguration` in struct `FhirServiceProperties` + + ## 1.0.0 (2022-05-18) ### Breaking Changes diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md b/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md index 7d42589be4aa..f41623548429 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/autorest.md @@ -4,11 +4,10 @@ ``` yaml azure-arm: true -tag: package-2021-11 require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/healthcareapis/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/healthcareapis/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/healthcareapis/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_dicomservices_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_dicomservices_client_test.go index 0d7f603ae1a2..8a4ccc65a554 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_dicomservices_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_dicomservices_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/dicomservices/DicomServices_List.json func ExampleDicomServicesClient_NewListByWorkspacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleDicomServicesClient_NewListByWorkspacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/dicomservices/DicomServices_Get.json func ExampleDicomServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleDicomServicesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/dicomservices/DicomServices_Create.json func ExampleDicomServicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleDicomServicesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/dicomservices/DicomServices_Patch.json func ExampleDicomServicesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -129,7 +129,7 @@ func ExampleDicomServicesClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/dicomservices/DicomServices_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/dicomservices/DicomServices_Delete.json func ExampleDicomServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirdestinations_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirdestinations_client_test.go index 47cea798c59c..6b49c84aed31 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirdestinations_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirdestinations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_fhirdestination_List.json func ExampleFhirDestinationsClient_NewListByIotConnectorPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirservices_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirservices_client_test.go index d6851a96dd6d..464da0a3d656 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirservices_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_fhirservices_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/fhirservices/FhirServices_List.json func ExampleFhirServicesClient_NewListByWorkspacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleFhirServicesClient_NewListByWorkspacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/fhirservices/FhirServices_Get.json func ExampleFhirServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleFhirServicesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/fhirservices/FhirServices_Create.json func ExampleFhirServicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -127,6 +127,11 @@ func ExampleFhirServicesClient_BeginCreateOrUpdate() { ExportConfiguration: &armhealthcareapis.FhirServiceExportConfiguration{ StorageAccountName: to.Ptr("existingStorageAccount"), }, + ImportConfiguration: &armhealthcareapis.FhirServiceImportConfiguration{ + Enabled: to.Ptr(false), + InitialImportMode: to.Ptr(false), + IntegrationDataStore: to.Ptr("existingStorageAccount"), + }, }, }, nil) @@ -141,7 +146,7 @@ func ExampleFhirServicesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/fhirservices/FhirServices_Patch.json func ExampleFhirServicesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -173,7 +178,7 @@ func ExampleFhirServicesClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/fhirservices/FhirServices_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/fhirservices/FhirServices_Delete.json func ExampleFhirServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectorfhirdestination_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectorfhirdestination_client_test.go index 6f91e3eddbae..42965f00c2dd 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectorfhirdestination_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectorfhirdestination_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_fhirdestination_Get.json func ExampleIotConnectorFhirDestinationClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleIotConnectorFhirDestinationClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_fhirdestination_Create.json func ExampleIotConnectorFhirDestinationClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleIotConnectorFhirDestinationClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_fhirdestination_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_fhirdestination_Delete.json func ExampleIotConnectorFhirDestinationClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectors_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectors_client_test.go index 21eb263f1bdd..de9354040adc 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectors_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_iotconnectors_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_List.json func ExampleIotConnectorsClient_NewListByWorkspacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleIotConnectorsClient_NewListByWorkspacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_Get.json func ExampleIotConnectorsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleIotConnectorsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_Create.json func ExampleIotConnectorsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -134,7 +134,7 @@ func ExampleIotConnectorsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_Patch.json func ExampleIotConnectorsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -171,7 +171,7 @@ func ExampleIotConnectorsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/iotconnectors/iotconnector_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/iotconnectors/iotconnector_Delete.json func ExampleIotConnectorsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operationresults_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operationresults_client_test.go index ac4bfa8092de..782a0eff31a9 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operationresults_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operationresults_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationResultsGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/OperationResultsGet.json func ExampleOperationResultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operations_client_test.go index 0971c8164744..90fd86419730 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/OperationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/OperationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privateendpointconnections_client_test.go index 855305ae0978..aa55f5692ec4 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListPrivateEndpointConnections.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceListPrivateEndpointConnections.json func ExamplePrivateEndpointConnectionsClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListByServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGetPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceGetPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreatePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceCreatePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDeletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceDeletePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privatelinkresources_client_test.go index 6fe6976539ea..24780d5e0f6e 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_privatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourcesListByService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/PrivateLinkResourcesListByService.json func ExamplePrivateLinkResourcesClient_ListByService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -38,7 +38,7 @@ func ExamplePrivateLinkResourcesClient_ListByService() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/PrivateLinkResourceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/PrivateLinkResourceGet.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_services_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_services_client_test.go index aef4bda22d48..ba3dd268bc76 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_services_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_services_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceGet.json func ExampleServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleServicesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceCreate.json func ExampleServicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -111,7 +111,7 @@ func ExampleServicesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServicePatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServicePatch.json func ExampleServicesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -143,7 +143,7 @@ func ExampleServicesClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceDelete.json func ExampleServicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -167,7 +167,7 @@ func ExampleServicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceList.json func ExampleServicesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -191,7 +191,7 @@ func ExampleServicesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/legacy/ServiceListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/legacy/ServiceListByResourceGroup.json func ExampleServicesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -216,7 +216,7 @@ func ExampleServicesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/CheckNameAvailabilityPost.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/CheckNameAvailabilityPost.json func ExampleServicesClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivateendpointconnections_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivateendpointconnections_client_test.go index 3261f9c42f13..02f833faa906 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivateendpointconnections_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceListPrivateEndpointConnections.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/privatelink/WorkspaceListPrivateEndpointConnections.json func ExampleWorkspacePrivateEndpointConnectionsClient_NewListByWorkspacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleWorkspacePrivateEndpointConnectionsClient_NewListByWorkspacePager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/privatelink/WorkspaceGetPrivateEndpointConnection.json func ExampleWorkspacePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleWorkspacePrivateEndpointConnectionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/privatelink/WorkspaceCreatePrivateEndpointConnection.json func ExampleWorkspacePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleWorkspacePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/privatelink/WorkspaceDeletePrivateEndpointConnection.json func ExampleWorkspacePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivatelinkresources_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivatelinkresources_client_test.go index fa38210d0130..f2052ad84cca 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivatelinkresources_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaceprivatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/PrivateLinkResourcesListByWorkspace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/privatelink/PrivateLinkResourcesListByWorkspace.json func ExampleWorkspacePrivateLinkResourcesClient_NewListByWorkspacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleWorkspacePrivateLinkResourcesClient_NewListByWorkspacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/privatelink/WorkspacePrivateLinkResourceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/privatelink/WorkspacePrivateLinkResourceGet.json func ExampleWorkspacePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaces_client_test.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaces_client_test.go index 210f3fabe3fb..1a5431436979 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaces_client_test.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/ze_generated_example_workspaces_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/healthcareapis/armhealthcareapis" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/workspaces/Workspaces_ListBySubscription.json func ExampleWorkspacesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleWorkspacesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/workspaces/Workspaces_ListByResourceGroup.json func ExampleWorkspacesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleWorkspacesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/workspaces/Workspaces_Get.json func ExampleWorkspacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -88,7 +88,7 @@ func ExampleWorkspacesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/workspaces/Workspaces_Create.json func ExampleWorkspacesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,7 +118,7 @@ func ExampleWorkspacesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Patch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/workspaces/Workspaces_Patch.json func ExampleWorkspacesClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -149,7 +149,7 @@ func ExampleWorkspacesClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/stable/2021-11-01/examples/workspaces/Workspaces_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/healthcareapis/resource-manager/Microsoft.HealthcareApis/preview/2022-01-31-preview/examples/workspaces/Workspaces_Delete.json func ExampleWorkspacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_constants.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_constants.go index 5fa58edafb6b..430c20dd3618 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_constants.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_constants.go @@ -10,7 +10,7 @@ package armhealthcareapis const ( moduleName = "armhealthcareapis" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_dicomservices_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_dicomservices_client.go index 6dd20d32afac..503c41969062 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_dicomservices_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_dicomservices_client.go @@ -56,7 +56,7 @@ func NewDicomServicesClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates a DICOM Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // dicomServiceName - The name of DICOM Service resource. @@ -77,7 +77,7 @@ func (client *DicomServicesClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a DICOM Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *DicomServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dicomServiceName string, dicomservice DicomService, options *DicomServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, dicomServiceName, dicomservice, options) if err != nil { @@ -117,7 +117,7 @@ func (client *DicomServicesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dicomservice) @@ -125,7 +125,7 @@ func (client *DicomServicesClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes a DICOM Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // dicomServiceName - The name of DICOM Service resource. // workspaceName - The name of workspace resource. @@ -145,7 +145,7 @@ func (client *DicomServicesClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes a DICOM Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *DicomServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string, options *DicomServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, dicomServiceName, workspaceName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *DicomServicesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *DicomServicesClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the properties of the specified DICOM Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // dicomServiceName - The name of DICOM Service resource. @@ -237,7 +237,7 @@ func (client *DicomServicesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *DicomServicesClient) getHandleResponse(resp *http.Response) (Dicom // NewListByWorkspacePager - Lists all DICOM Services for the given workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // options - DicomServicesClientListByWorkspaceOptions contains the optional parameters for the DicomServicesClient.ListByWorkspace @@ -307,7 +307,7 @@ func (client *DicomServicesClient) listByWorkspaceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *DicomServicesClient) listByWorkspaceHandleResponse(resp *http.Resp // BeginUpdate - Patch DICOM Service details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // dicomServiceName - The name of DICOM Service resource. // workspaceName - The name of workspace resource. @@ -345,7 +345,7 @@ func (client *DicomServicesClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Patch DICOM Service details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *DicomServicesClient) update(ctx context.Context, resourceGroupName string, dicomServiceName string, workspaceName string, dicomservicePatchResource DicomServicePatchResource, options *DicomServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, dicomServiceName, workspaceName, dicomservicePatchResource, options) if err != nil { @@ -385,7 +385,7 @@ func (client *DicomServicesClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dicomservicePatchResource) diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirdestinations_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirdestinations_client.go index 8e51c3bb2464..d1808beace1e 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirdestinations_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirdestinations_client.go @@ -56,7 +56,7 @@ func NewFhirDestinationsClient(subscriptionID string, credential azcore.TokenCre // NewListByIotConnectorPager - Lists all FHIR destinations for the given IoT Connector // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // iotConnectorName - The name of IoT Connector resource. @@ -114,7 +114,7 @@ func (client *FhirDestinationsClient) listByIotConnectorCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirservices_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirservices_client.go index bd30520313e2..1cfeebbfd5aa 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirservices_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_fhirservices_client.go @@ -56,7 +56,7 @@ func NewFhirServicesClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates a FHIR Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // fhirServiceName - The name of FHIR Service resource. @@ -77,7 +77,7 @@ func (client *FhirServicesClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates a FHIR Service resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *FhirServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, fhirServiceName string, fhirservice FhirService, options *FhirServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, fhirServiceName, fhirservice, options) if err != nil { @@ -117,7 +117,7 @@ func (client *FhirServicesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, fhirservice) @@ -125,7 +125,7 @@ func (client *FhirServicesClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes a FHIR Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // fhirServiceName - The name of FHIR Service resource. // workspaceName - The name of workspace resource. @@ -145,7 +145,7 @@ func (client *FhirServicesClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a FHIR Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *FhirServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string, options *FhirServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, fhirServiceName, workspaceName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *FhirServicesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *FhirServicesClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the properties of the specified FHIR Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // fhirServiceName - The name of FHIR Service resource. @@ -237,7 +237,7 @@ func (client *FhirServicesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *FhirServicesClient) getHandleResponse(resp *http.Response) (FhirSe // NewListByWorkspacePager - Lists all FHIR Services for the given workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // options - FhirServicesClientListByWorkspaceOptions contains the optional parameters for the FhirServicesClient.ListByWorkspace @@ -307,7 +307,7 @@ func (client *FhirServicesClient) listByWorkspaceCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *FhirServicesClient) listByWorkspaceHandleResponse(resp *http.Respo // BeginUpdate - Patch FHIR Service details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // fhirServiceName - The name of FHIR Service resource. // workspaceName - The name of workspace resource. @@ -345,7 +345,7 @@ func (client *FhirServicesClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Patch FHIR Service details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *FhirServicesClient) update(ctx context.Context, resourceGroupName string, fhirServiceName string, workspaceName string, fhirservicePatchResource FhirServicePatchResource, options *FhirServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, fhirServiceName, workspaceName, fhirservicePatchResource, options) if err != nil { @@ -385,7 +385,7 @@ func (client *FhirServicesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, fhirservicePatchResource) diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectorfhirdestination_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectorfhirdestination_client.go index 881c1dd76146..a1031cff78a2 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectorfhirdestination_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectorfhirdestination_client.go @@ -56,7 +56,7 @@ func NewIotConnectorFhirDestinationClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates an IoT Connector FHIR destination resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // iotConnectorName - The name of IoT Connector resource. @@ -78,7 +78,7 @@ func (client *IotConnectorFhirDestinationClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates an IoT Connector FHIR destination resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *IotConnectorFhirDestinationClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string, iotFhirDestination IotFhirDestination, options *IotConnectorFhirDestinationClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, iotFhirDestination, options) if err != nil { @@ -122,7 +122,7 @@ func (client *IotConnectorFhirDestinationClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, iotFhirDestination) @@ -130,7 +130,7 @@ func (client *IotConnectorFhirDestinationClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes an IoT Connector FHIR destination. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // iotConnectorName - The name of IoT Connector resource. @@ -151,7 +151,7 @@ func (client *IotConnectorFhirDestinationClient) BeginDelete(ctx context.Context // Delete - Deletes an IoT Connector FHIR destination. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *IotConnectorFhirDestinationClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, fhirDestinationName string, options *IotConnectorFhirDestinationClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, fhirDestinationName, options) if err != nil { @@ -195,7 +195,7 @@ func (client *IotConnectorFhirDestinationClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +203,7 @@ func (client *IotConnectorFhirDestinationClient) deleteCreateRequest(ctx context // Get - Gets the properties of the specified Iot Connector FHIR destination. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // iotConnectorName - The name of IoT Connector resource. @@ -253,7 +253,7 @@ func (client *IotConnectorFhirDestinationClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectors_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectors_client.go index ae5f692bc4c3..7a8efd7cebe3 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectors_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_iotconnectors_client.go @@ -56,7 +56,7 @@ func NewIotConnectorsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates an IoT Connector resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // iotConnectorName - The name of IoT Connector resource. @@ -77,7 +77,7 @@ func (client *IotConnectorsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates an IoT Connector resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *IotConnectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, iotConnectorName string, iotConnector IotConnector, options *IotConnectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, iotConnectorName, iotConnector, options) if err != nil { @@ -117,7 +117,7 @@ func (client *IotConnectorsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, iotConnector) @@ -125,7 +125,7 @@ func (client *IotConnectorsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // iotConnectorName - The name of IoT Connector resource. // workspaceName - The name of workspace resource. @@ -145,7 +145,7 @@ func (client *IotConnectorsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *IotConnectorsClient) deleteOperation(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string, options *IotConnectorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, iotConnectorName, workspaceName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *IotConnectorsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *IotConnectorsClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the properties of the specified IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // iotConnectorName - The name of IoT Connector resource. @@ -237,7 +237,7 @@ func (client *IotConnectorsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,7 +254,7 @@ func (client *IotConnectorsClient) getHandleResponse(resp *http.Response) (IotCo // NewListByWorkspacePager - Lists all IoT Connectors for the given workspace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // options - IotConnectorsClientListByWorkspaceOptions contains the optional parameters for the IotConnectorsClient.ListByWorkspace @@ -307,7 +307,7 @@ func (client *IotConnectorsClient) listByWorkspaceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,7 +324,7 @@ func (client *IotConnectorsClient) listByWorkspaceHandleResponse(resp *http.Resp // BeginUpdate - Patch an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // iotConnectorName - The name of IoT Connector resource. // workspaceName - The name of workspace resource. @@ -345,7 +345,7 @@ func (client *IotConnectorsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Patch an IoT Connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *IotConnectorsClient) update(ctx context.Context, resourceGroupName string, iotConnectorName string, workspaceName string, iotConnectorPatchResource IotConnectorPatchResource, options *IotConnectorsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, iotConnectorName, workspaceName, iotConnectorPatchResource, options) if err != nil { @@ -385,7 +385,7 @@ func (client *IotConnectorsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, iotConnectorPatchResource) diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models.go index ba8b2f42aac9..6164d84ee47e 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models.go @@ -247,6 +247,18 @@ type FhirServiceExportConfiguration struct { StorageAccountName *string `json:"storageAccountName,omitempty"` } +// FhirServiceImportConfiguration - Import operation configuration information +type FhirServiceImportConfiguration struct { + // If the import operation is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // If the FHIR service is in InitialImportMode. + InitialImportMode *bool `json:"initialImportMode,omitempty"` + + // The name of the default integration storage account. + IntegrationDataStore *string `json:"integrationDataStore,omitempty"` +} + // FhirServicePatchResource - FhirService patch properties type FhirServicePatchResource struct { // Setting indicating whether the service has a managed identity associated with it. @@ -273,6 +285,9 @@ type FhirServiceProperties struct { // Fhir Service export configuration. ExportConfiguration *FhirServiceExportConfiguration `json:"exportConfiguration,omitempty"` + // Fhir Service import configuration. + ImportConfiguration *FhirServiceImportConfiguration `json:"importConfiguration,omitempty"` + // Control permission for data plane traffic coming from public networks while private endpoint is enabled. PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` @@ -928,6 +943,18 @@ type ServiceExportConfigurationInfo struct { StorageAccountName *string `json:"storageAccountName,omitempty"` } +// ServiceImportConfigurationInfo - Import operation configuration information +type ServiceImportConfigurationInfo struct { + // If the import operation is enabled. + Enabled *bool `json:"enabled,omitempty"` + + // If the FHIR service is in InitialImportMode. + InitialImportMode *bool `json:"initialImportMode,omitempty"` + + // The name of the default integration storage account. + IntegrationDataStore *string `json:"integrationDataStore,omitempty"` +} + // ServiceManagedIdentity - Managed service identity (system assigned and/or user assigned identities) type ServiceManagedIdentity struct { // Setting indicating whether the service has a managed identity associated with it. @@ -1097,6 +1124,9 @@ type ServicesProperties struct { // The settings for the export operation of the service instance. ExportConfiguration *ServiceExportConfigurationInfo `json:"exportConfiguration,omitempty"` + // The settings for the import operation of the service instance. + ImportConfiguration *ServiceImportConfigurationInfo `json:"importConfiguration,omitempty"` + // The list of private endpoint connections that are set up for this resource. PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models_serde.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models_serde.go index 3a2a274d9922..9da9a647d247 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models_serde.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_models_serde.go @@ -109,6 +109,7 @@ func (f FhirServiceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "corsConfiguration", f.CorsConfiguration) populate(objectMap, "eventState", f.EventState) populate(objectMap, "exportConfiguration", f.ExportConfiguration) + populate(objectMap, "importConfiguration", f.ImportConfiguration) populate(objectMap, "privateEndpointConnections", f.PrivateEndpointConnections) populate(objectMap, "provisioningState", f.ProvisioningState) populate(objectMap, "publicNetworkAccess", f.PublicNetworkAccess) @@ -225,6 +226,7 @@ func (s ServicesProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "corsConfiguration", s.CorsConfiguration) populate(objectMap, "cosmosDbConfiguration", s.CosmosDbConfiguration) populate(objectMap, "exportConfiguration", s.ExportConfiguration) + populate(objectMap, "importConfiguration", s.ImportConfiguration) populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operationresults_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operationresults_client.go index 0ee3db5e2b8e..ec3da211ee5f 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operationresults_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operationresults_client.go @@ -56,7 +56,7 @@ func NewOperationResultsClient(subscriptionID string, credential azcore.TokenCre // Get - Get the operation result for a long running operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // locationName - The location of the operation. // operationResultID - The ID of the operation result to get. // options - OperationResultsClientGetOptions contains the optional parameters for the OperationResultsClient.Get method. @@ -95,7 +95,7 @@ func (client *OperationResultsClient) getCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operations_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operations_client.go index 95801674fa46..6e678031be9e 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operations_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available operations supported by Microsoft Healthcare resource provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privateendpointconnections_client.go index f52e66204a65..b618989699ac 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privateendpointconnections_client.go @@ -56,7 +56,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Update the state of the specified private endpoint connection associated with the service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -77,7 +77,7 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Update the state of the specified private endpoint connection associated with the service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, properties, options) if err != nil { @@ -117,7 +117,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) @@ -125,7 +125,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -145,7 +145,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -238,7 +238,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByServicePager - Lists all private endpoint connections for a service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // options - PrivateEndpointConnectionsClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByService @@ -302,7 +302,7 @@ func (client *PrivateEndpointConnectionsClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privatelinkresources_client.go index c4e2d330fe3c..44a2f8296b8f 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_privatelinkresources_client.go @@ -56,7 +56,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource that need to be created for a service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // groupName - The name of the private link resource group. @@ -101,7 +101,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +118,7 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // ListByService - Gets the private link resources that need to be created for a service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // options - PrivateLinkResourcesClientListByServiceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByService @@ -158,7 +158,7 @@ func (client *PrivateLinkResourcesClient) listByServiceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_services_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_services_client.go index 3225bb958819..9d409d723b1e 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_services_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_services_client.go @@ -56,7 +56,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Check if a service instance name is available. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // checkNameAvailabilityInputs - Set the name parameter in the CheckNameAvailabilityParameters structure to the name of the // service instance to check. // options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability @@ -88,7 +88,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, checkNameAvailabilityInputs) @@ -105,7 +105,7 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // BeginCreateOrUpdate - Create or update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // serviceDescription - The service instance metadata. @@ -125,7 +125,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // CreateOrUpdate - Create or update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, serviceDescription ServicesDescription, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, serviceDescription, options) if err != nil { @@ -161,7 +161,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, serviceDescription) @@ -169,7 +169,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // BeginDelete - Delete a service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // options - ServicesClientBeginDeleteOptions contains the optional parameters for the ServicesClient.BeginDelete method. @@ -187,7 +187,7 @@ func (client *ServicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Delete a service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *ServicesClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *ServicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -223,7 +223,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -231,7 +231,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Get the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. @@ -270,7 +270,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -287,7 +287,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListPager - Get all the service instances in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // options - ServicesClientListOptions contains the optional parameters for the ServicesClient.List method. func (client *ServicesClient) NewListPager(options *ServicesClientListOptions) *runtime.Pager[ServicesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServicesClientListResponse]{ @@ -329,7 +329,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, options *Se return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesC // NewListByResourceGroupPager - Get all the service instances in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.ListByResourceGroup // method. @@ -394,7 +394,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -411,7 +411,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // BeginUpdate - Update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // resourceName - The name of the service instance. // servicePatchDescription - The service instance metadata and security metadata. @@ -430,7 +430,7 @@ func (client *ServicesClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Update the metadata of a service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *ServicesClient) update(ctx context.Context, resourceGroupName string, resourceName string, servicePatchDescription ServicesPatchDescription, options *ServicesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, servicePatchDescription, options) if err != nil { @@ -466,7 +466,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, servicePatchDescription) diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivateendpointconnections_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivateendpointconnections_client.go index 2f27a78fd22e..e29515060d73 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivateendpointconnections_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivateendpointconnections_client.go @@ -56,7 +56,7 @@ func NewWorkspacePrivateEndpointConnectionsClient(subscriptionID string, credent // BeginCreateOrUpdate - Update the state of the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -77,7 +77,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Update the state of the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *WorkspacePrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnectionDescription, options *WorkspacePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties, options) if err != nil { @@ -117,7 +117,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) @@ -125,7 +125,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) createOrUpdateCreateReq // BeginDelete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -145,7 +145,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) BeginDelete(ctx context // Delete - Deletes a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *WorkspacePrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, options *WorkspacePrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, options) if err != nil { @@ -185,7 +185,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) deleteCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,7 +193,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) deleteCreateRequest(ctx // Get - Gets the specified private endpoint connection associated with the workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource @@ -238,7 +238,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,7 +255,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) getHandleResponse(resp // NewListByWorkspacePager - Lists all private endpoint connections for a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // options - WorkspacePrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateEndpointConnectionsClient.ListByWorkspace @@ -302,7 +302,7 @@ func (client *WorkspacePrivateEndpointConnectionsClient) listByWorkspaceCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivatelinkresources_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivatelinkresources_client.go index d8fc493de9bf..59ae9ee9492a 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivatelinkresources_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaceprivatelinkresources_client.go @@ -56,7 +56,7 @@ func NewWorkspacePrivateLinkResourcesClient(subscriptionID string, credential az // Get - Gets a private link resource that need to be created for a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // groupName - The name of the private link resource group. @@ -101,7 +101,7 @@ func (client *WorkspacePrivateLinkResourcesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +118,7 @@ func (client *WorkspacePrivateLinkResourcesClient) getHandleResponse(resp *http. // NewListByWorkspacePager - Gets the private link resources that need to be created for a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // options - WorkspacePrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the WorkspacePrivateLinkResourcesClient.ListByWorkspace @@ -165,7 +165,7 @@ func (client *WorkspacePrivateLinkResourcesClient) listByWorkspaceCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaces_client.go b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaces_client.go index d2b9667f3b80..897a45f8ceef 100644 --- a/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaces_client.go +++ b/sdk/resourcemanager/healthcareapis/armhealthcareapis/zz_generated_workspaces_client.go @@ -56,7 +56,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a workspace resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // workspace - The parameters for creating or updating a healthcare workspace. @@ -76,7 +76,7 @@ func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a workspace resource with the specified parameters. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, workspace, options) if err != nil { @@ -112,7 +112,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workspace) @@ -120,7 +120,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a specified workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // options - WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. @@ -138,7 +138,7 @@ func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a specified workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *WorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { @@ -174,7 +174,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the properties of the specified workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. @@ -221,7 +221,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,7 +238,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListByResourceGroupPager - Lists all the available workspaces under the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup // method. @@ -286,7 +286,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -303,7 +303,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // NewListBySubscriptionPager - Lists all the available workspaces under the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.ListBySubscription // method. func (client *WorkspacesClient) NewListBySubscriptionPager(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { @@ -346,7 +346,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -363,7 +363,7 @@ func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Resp // BeginUpdate - Patch workspace details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview // resourceGroupName - The name of the resource group that contains the service instance. // workspaceName - The name of workspace resource. // workspacePatchResource - The parameters for updating a specified workspace. @@ -382,7 +382,7 @@ func (client *WorkspacesClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Patch workspace details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-31-preview func (client *WorkspacesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, workspacePatchResource WorkspacePatchResource, options *WorkspacesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, workspacePatchResource, options) if err != nil { @@ -418,7 +418,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-31-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, workspacePatchResource) diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md index 77f0b213eb1e..3cb6591b2135 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/CHANGELOG.md @@ -1,5 +1,43 @@ # Release History +## 2.0.0-beta.1 (2022-05-19) +### Breaking Changes + +- Struct `OperationList` has been removed +- Field `OperationList` of struct `OperationsClientListResponse` has been removed + +### Features Added + +- New const `HTTPMethodPatch` +- New const `OriginUserSystem` +- New const `HTTPMethodDelete` +- New const `OriginUser` +- New const `ActionTypeInternal` +- New const `HTTPMethodPost` +- New const `HTTPMethodPut` +- New const `HTTPMethodGet` +- New const `HTTPMethodUnknown` +- New const `OriginSystem` +- New function `PossibleHTTPMethodValues() []HTTPMethod` +- New function `*SKUCredential.UnmarshalJSON([]byte) error` +- New function `*VendorSKUsClient.ListCredential(context.Context, string, string, *VendorSKUsClientListCredentialOptions) (VendorSKUsClientListCredentialResponse, error)` +- New function `PossibleActionTypeValues() []ActionType` +- New function `PossibleOriginValues() []Origin` +- New function `*NetworkFunctionsClient.BeginExecuteRequest(context.Context, string, string, ExecuteRequestParameters, *NetworkFunctionsClientBeginExecuteRequestOptions) (*runtime.Poller[NetworkFunctionsClientExecuteRequestResponse], error)` +- New struct `ExecuteRequestParameters` +- New struct `NetworkFunctionsClientBeginExecuteRequestOptions` +- New struct `NetworkFunctionsClientExecuteRequestResponse` +- New struct `OperationListResult` +- New struct `RequestMetadata` +- New struct `SKUCredential` +- New struct `VendorSKUsClientListCredentialOptions` +- New struct `VendorSKUsClientListCredentialResponse` +- New field `IsDataAction` in struct `Operation` +- New field `Origin` in struct `Operation` +- New field `ActionType` in struct `Operation` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` + + ## 1.0.0 (2022-05-18) ### Breaking Changes diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md index ac856393aa33..3c9e22ca6881 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/autorest.md @@ -4,11 +4,10 @@ ``` yaml azure-arm: true -tag: package-2021-05-01 require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/hybridnetwork/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/hybridnetwork/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/hybridnetwork/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_devices_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_devices_client_test.go index e6917d26c7aa..ac776f3df7b7 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_devices_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_devices_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/DeviceDelete.json func ExampleDevicesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleDevicesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/DeviceGet.json func ExampleDevicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleDevicesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/DeviceCreate.json func ExampleDevicesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleDevicesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/DeviceUpdateTags.json func ExampleDevicesClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -126,7 +126,7 @@ func ExampleDevicesClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/DeviceListBySubscription.json func ExampleDevicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,7 +150,7 @@ func ExampleDevicesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/DeviceListByResourceGroup.json func ExampleDevicesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -175,7 +175,7 @@ func ExampleDevicesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/DeviceListRegistrationKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/DeviceListRegistrationKey.json func ExampleDevicesClient_ListRegistrationKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctions_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctions_client_test.go index 3d98f9d77739..6e7ac580fc43 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctions_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctions_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionDelete.json func ExampleNetworkFunctionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleNetworkFunctionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionGet.json func ExampleNetworkFunctionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleNetworkFunctionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionCreate.json func ExampleNetworkFunctionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,7 +133,7 @@ func ExampleNetworkFunctionsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionUpdateTags.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionUpdateTags.json func ExampleNetworkFunctionsClient_UpdateTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +161,7 @@ func ExampleNetworkFunctionsClient_UpdateTags() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionListBySubscription.json func ExampleNetworkFunctionsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -185,7 +185,7 @@ func ExampleNetworkFunctionsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionListByResourceGroup.json func ExampleNetworkFunctionsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -209,3 +209,36 @@ func ExampleNetworkFunctionsClient_NewListByResourceGroupPager() { } } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionsExecuteRequest.json +func ExampleNetworkFunctionsClient_BeginExecuteRequest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armhybridnetwork.NewNetworkFunctionsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginExecuteRequest(ctx, + "rg", + "testNetworkfunction", + armhybridnetwork.ExecuteRequestParameters{ + RequestMetadata: &armhybridnetwork.RequestMetadata{ + APIVersion: to.Ptr("apiVersionQueryString"), + HTTPMethod: to.Ptr(armhybridnetwork.HTTPMethodPost), + RelativePath: to.Ptr("/simProfiles/testSimProfile"), + SerializedBody: to.Ptr("{\"subscriptionProfile\":\"ChantestSubscription15\",\"permanentKey\":\"00112233445566778899AABBCCDDEEFF\",\"opcOperatorCode\":\"63bfa50ee6523365ff14c1f45f88737d\",\"staticIpAddresses\":{\"internet\":{\"ipv4Addr\":\"198.51.100.1\",\"ipv6Prefix\":\"2001:db8:abcd:12::0/64\"},\"another_network\":{\"ipv6Prefix\":\"2001:111:cdef:22::0/64\"}}}"), + }, + ServiceEndpoint: to.Ptr("serviceEndpoint"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendors_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendors_client_test.go index 5c59b7d0284d..9572dfa656c1 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendors_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendors_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionVendorAndSkuListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionVendorAndSkuListBySubscription.json func ExampleNetworkFunctionVendorsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendorskus_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendorskus_client_test.go index 94121115ec52..1afbc0b76a30 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendorskus_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_networkfunctionvendorskus_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/NetworkFunctionSkuListByVendor.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/NetworkFunctionSkuListByVendor.json func ExampleNetworkFunctionVendorSKUsClient_NewListByVendorPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_operations_client_test.go index dcf6b358335e..2ab86b793cd1 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/GetOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/GetOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_roleinstances_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_roleinstances_client_test.go index 2c6b1b5fd298..5e65f177afd8 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_roleinstances_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_roleinstances_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/RoleInstanceStart.json func ExampleRoleInstancesClient_BeginStart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleRoleInstancesClient_BeginStart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceStop.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/RoleInstanceStop.json func ExampleRoleInstancesClient_BeginStop() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleRoleInstancesClient_BeginStop() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceRestart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/RoleInstanceRestart.json func ExampleRoleInstancesClient_BeginRestart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleRoleInstancesClient_BeginRestart() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/RoleInstanceGet.json func ExampleRoleInstancesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,7 +118,7 @@ func ExampleRoleInstancesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/RoleInstanceListByVendorNetworkFunction.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/RoleInstanceListByVendorNetworkFunction.json func ExampleRoleInstancesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendornetworkfunctions_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendornetworkfunctions_client_test.go index 980363a7afa4..c17642a2a58a 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendornetworkfunctions_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendornetworkfunctions_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorNfGet.json func ExampleVendorNetworkFunctionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleVendorNetworkFunctionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorNfCreate.json func ExampleVendorNetworkFunctionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,7 +118,7 @@ func ExampleVendorNetworkFunctionsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorNfListByVendor.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorNfListByVendor.json func ExampleVendorNetworkFunctionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendors_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendors_client_test.go index 4b5701decd5f..cfb09d2bf918 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendors_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendors_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorDelete.json func ExampleVendorsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleVendorsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorGet.json func ExampleVendorsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExampleVendorsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorCreate.json func ExampleVendorsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -85,7 +85,7 @@ func ExampleVendorsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorListBySubscription.json func ExampleVendorsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskupreview_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskupreview_client_test.go index 92a2e72666b7..44f95f4abd86 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskupreview_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskupreview_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewListBySku.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuPreviewListBySku.json func ExampleVendorSKUPreviewClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleVendorSKUPreviewClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuPreviewCreate.json func ExampleVendorSKUPreviewClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -70,7 +70,7 @@ func ExampleVendorSKUPreviewClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuPreviewGet.json func ExampleVendorSKUPreviewClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -93,7 +93,7 @@ func ExampleVendorSKUPreviewClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuPreviewDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuPreviewDelete.json func ExampleVendorSKUPreviewClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskus_client_test.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskus_client_test.go index 45858dacc801..3d0014b0503b 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskus_client_test.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/ze_generated_example_vendorskus_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/hybridnetwork/armhybridnetwork" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuDelete.json func ExampleVendorSKUsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleVendorSKUsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuGet.json func ExampleVendorSKUsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -63,7 +63,7 @@ func ExampleVendorSKUsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuCreate.json func ExampleVendorSKUsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,7 +154,8 @@ func ExampleVendorSKUsClient_BeginCreateOrUpdate() { VirtualMachineSize: to.Ptr(armhybridnetwork.VirtualMachineSizeTypesStandardD3V2), }}, }, - Preview: to.Ptr(true), + NetworkFunctionType: to.Ptr(armhybridnetwork.NetworkFunctionTypeVirtualNetworkFunction), + Preview: to.Ptr(true), }, }, nil) @@ -169,7 +170,7 @@ func ExampleVendorSKUsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/examples/VendorSkuListByVendor.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuListByVendor.json func ExampleVendorSKUsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -193,3 +194,25 @@ func ExampleVendorSKUsClient_NewListPager() { } } } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/preview/2022-01-01-preview/examples/VendorSkuListCredential.json +func ExampleVendorSKUsClient_ListCredential() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armhybridnetwork.NewVendorSKUsClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.ListCredential(ctx, + "TestVendor", + "TestSku", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_constants.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_constants.go index a3a297fcad3e..4b53d0e7992e 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_constants.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_constants.go @@ -10,9 +10,23 @@ package armhybridnetwork const ( moduleName = "armhybridnetwork" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +type ActionType string + +const ( + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns the possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ + ActionTypeInternal, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -65,6 +79,30 @@ func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { } } +// HTTPMethod - The http method of the request. +type HTTPMethod string + +const ( + HTTPMethodDelete HTTPMethod = "Delete" + HTTPMethodGet HTTPMethod = "Get" + HTTPMethodPatch HTTPMethod = "Patch" + HTTPMethodPost HTTPMethod = "Post" + HTTPMethodPut HTTPMethod = "Put" + HTTPMethodUnknown HTTPMethod = "Unknown" +) + +// PossibleHTTPMethodValues returns the possible values for the HTTPMethod const type. +func PossibleHTTPMethodValues() []HTTPMethod { + return []HTTPMethod{ + HTTPMethodDelete, + HTTPMethodGet, + HTTPMethodPatch, + HTTPMethodPost, + HTTPMethodPut, + HTTPMethodUnknown, + } +} + // IPAllocationMethod - IP address allocation method. type IPAllocationMethod string @@ -173,6 +211,25 @@ func PossibleOperationalStateValues() []OperationalState { } } +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + // ProvisioningState - The current provisioning state. type ProvisioningState string diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_devices_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_devices_client.go index 6879f923d04a..5c7b22768bda 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_devices_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_devices_client.go @@ -56,7 +56,7 @@ func NewDevicesClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates a device. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // deviceName - Resource name for the device resource. // parameters - Parameters supplied to the create or update device operation. @@ -78,7 +78,7 @@ func (client *DevicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates or updates a device. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *DevicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, deviceName string, parameters Device, options *DevicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, deviceName, parameters, options) if err != nil { @@ -114,7 +114,7 @@ func (client *DevicesClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +122,7 @@ func (client *DevicesClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Deletes the specified device. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // deviceName - The name of the device resource. // options - DevicesClientBeginDeleteOptions contains the optional parameters for the DevicesClient.BeginDelete method. @@ -142,7 +142,7 @@ func (client *DevicesClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes the specified device. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *DevicesClient) deleteOperation(ctx context.Context, resourceGroupName string, deviceName string, options *DevicesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, deviceName, options) if err != nil { @@ -178,7 +178,7 @@ func (client *DevicesClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +186,7 @@ func (client *DevicesClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets information about the specified device. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // deviceName - The name of the device resource. // options - DevicesClientGetOptions contains the optional parameters for the DevicesClient.Get method. @@ -225,7 +225,7 @@ func (client *DevicesClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,7 +242,7 @@ func (client *DevicesClient) getHandleResponse(resp *http.Response) (DevicesClie // NewListByResourceGroupPager - Lists all the device resource in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - DevicesClientListByResourceGroupOptions contains the optional parameters for the DevicesClient.ListByResourceGroup // method. @@ -290,7 +290,7 @@ func (client *DevicesClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,7 +307,7 @@ func (client *DevicesClient) listByResourceGroupHandleResponse(resp *http.Respon // NewListBySubscriptionPager - Lists all the devices in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // options - DevicesClientListBySubscriptionOptions contains the optional parameters for the DevicesClient.ListBySubscription // method. func (client *DevicesClient) NewListBySubscriptionPager(options *DevicesClientListBySubscriptionOptions) *runtime.Pager[DevicesClientListBySubscriptionResponse] { @@ -350,7 +350,7 @@ func (client *DevicesClient) listBySubscriptionCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -367,7 +367,7 @@ func (client *DevicesClient) listBySubscriptionHandleResponse(resp *http.Respons // ListRegistrationKey - List the registration key for the device. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // deviceName - The name of the device resource. // options - DevicesClientListRegistrationKeyOptions contains the optional parameters for the DevicesClient.ListRegistrationKey @@ -407,7 +407,7 @@ func (client *DevicesClient) listRegistrationKeyCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -424,7 +424,7 @@ func (client *DevicesClient) listRegistrationKeyHandleResponse(resp *http.Respon // UpdateTags - Updates device tags. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // deviceName - The name of the device resource. // parameters - Parameters supplied to the update device tags operation. @@ -464,7 +464,7 @@ func (client *DevicesClient) updateTagsCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models.go index e4cb8c187cd5..f440d9c2ede9 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models.go @@ -196,6 +196,15 @@ type ErrorResponse struct { Error *ErrorDetail `json:"error,omitempty"` } +// ExecuteRequestParameters - Payload for execute request post call. +type ExecuteRequestParameters struct { + // REQUIRED; The request metadata. + RequestMetadata *RequestMetadata `json:"requestMetadata,omitempty"` + + // REQUIRED; The endpoint of service to call. + ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` +} + // ImageReference - The image reference properties. type ImageReference struct { // Specifies in decimal numbers, the exact version of image used to create the virtual machine. @@ -465,6 +474,13 @@ type NetworkFunctionsClientBeginDeleteOptions struct { ResumeToken string } +// NetworkFunctionsClientBeginExecuteRequestOptions contains the optional parameters for the NetworkFunctionsClient.BeginExecuteRequest +// method. +type NetworkFunctionsClientBeginExecuteRequestOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // NetworkFunctionsClientGetOptions contains the optional parameters for the NetworkFunctionsClient.Get method. type NetworkFunctionsClientGetOptions struct { // placeholder for future optional parameters @@ -523,36 +539,52 @@ type NetworkInterfaceIPConfiguration struct { Subnet *string `json:"subnet,omitempty"` } -// Operation - Object that describes a single Microsoft.HybridNetwork operation. +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // READ-ONLY; The object that represents the operation. - Display *OperationDisplay `json:"display,omitempty" azure:"ro"` + // Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType `json:"actionType,omitempty" azure:"ro"` + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool `json:"isDataAction,omitempty" azure:"ro"` - // READ-ONLY; Operation name: {provider}/{resource}/{operation}. + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin `json:"origin,omitempty" azure:"ro"` } -// OperationDisplay - The object that represents the operation. +// OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { - // Description of the operation. - Description *string `json:"description,omitempty"` + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty" azure:"ro"` - // Operation type: Read, write, delete, etc. - Operation *string `json:"operation,omitempty"` + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty" azure:"ro"` - // Service provider: Microsoft.HybridNetwork. - Provider *string `json:"provider,omitempty"` + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". + Provider *string `json:"provider,omitempty" azure:"ro"` - // Resource on which the operation is performed: Registration definition, registration assignment, etc. - Resource *string `json:"resource,omitempty"` + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". + Resource *string `json:"resource,omitempty" azure:"ro"` } -// OperationList - A list of the operations. -type OperationList struct { - // READ-ONLY; The URL to get the next set of results. +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // READ-ONLY; A list of Microsoft.HybridNetwork operations. + // READ-ONLY; List of operations supported by the resource provider Value []*Operation `json:"value,omitempty" azure:"ro"` } @@ -663,6 +695,21 @@ type ProxyResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// RequestMetadata - Request metadata of execute request post call payload. +type RequestMetadata struct { + // REQUIRED; The http method of the request. + HTTPMethod *HTTPMethod `json:"httpMethod,omitempty"` + + // REQUIRED; The relative path of the request. + RelativePath *string `json:"relativePath,omitempty"` + + // REQUIRED; The serialized body of the request. + SerializedBody *string `json:"serializedBody,omitempty"` + + // The api version of the request. + APIVersion *string `json:"apiVersion,omitempty"` +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -730,6 +777,24 @@ type RoleInstancesClientListOptions struct { // placeholder for future optional parameters } +// SKUCredential - The Sku credential definition. +type SKUCredential struct { + // The Acr server url + AcrServerURL *string `json:"acrServerUrl,omitempty"` + + // The credential value. + AcrToken *string `json:"acrToken,omitempty"` + + // The UTC time when credential will expire. + Expiry *time.Time `json:"expiry,omitempty"` + + // The repositories that could be accessed using the current credential. + Repositories []*string `json:"repositories,omitempty"` + + // The username of the sku credential. + Username *string `json:"username,omitempty"` +} + // SKUOverview - The network function sku overview. type SKUOverview struct { // The vendor sku name. @@ -1026,6 +1091,11 @@ type VendorSKUsClientGetOptions struct { // placeholder for future optional parameters } +// VendorSKUsClientListCredentialOptions contains the optional parameters for the VendorSKUsClient.ListCredential method. +type VendorSKUsClientListCredentialOptions struct { + // placeholder for future optional parameters +} + // VendorSKUsClientListOptions contains the optional parameters for the VendorSKUsClient.List method. type VendorSKUsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models_serde.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models_serde.go index 73dfc9ec9adc..6a1f88754bc7 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models_serde.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_models_serde.go @@ -214,6 +214,38 @@ func (n NetworkInterfaceIPConfiguration) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCredential. +func (s *SKUCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "acrServerUrl": + err = unpopulate(val, "AcrServerURL", &s.AcrServerURL) + delete(rawMsg, key) + case "acrToken": + err = unpopulate(val, "AcrToken", &s.AcrToken) + delete(rawMsg, key) + case "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &s.Expiry) + delete(rawMsg, key) + case "repositories": + err = unpopulate(val, "Repositories", &s.Repositories) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &s.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SSHConfiguration. func (s SSHConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctions_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctions_client.go index c0f47abb9973..06e4d89ef35c 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctions_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctions_client.go @@ -57,7 +57,7 @@ func NewNetworkFunctionsClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a network function resource. This operation can take up to 6 hours to complete. // This is expected service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // networkFunctionName - Resource name for the network function resource. // parameters - Parameters supplied in the body to the create or update network function operation. @@ -80,7 +80,7 @@ func (client *NetworkFunctionsClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a network function resource. This operation can take up to 6 hours to complete. This // is expected service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *NetworkFunctionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters NetworkFunction, options *NetworkFunctionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, networkFunctionName, parameters, options) if err != nil { @@ -116,7 +116,7 @@ func (client *NetworkFunctionsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,7 +125,7 @@ func (client *NetworkFunctionsClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is // expected service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // networkFunctionName - The name of the network function. // options - NetworkFunctionsClientBeginDeleteOptions contains the optional parameters for the NetworkFunctionsClient.BeginDelete @@ -147,7 +147,7 @@ func (client *NetworkFunctionsClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the specified network function resource. This operation can take up to 1 hour to complete. This is expected // service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *NetworkFunctionsClient) deleteOperation(ctx context.Context, resourceGroupName string, networkFunctionName string, options *NetworkFunctionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, networkFunctionName, options) if err != nil { @@ -183,15 +183,81 @@ func (client *NetworkFunctionsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } +// BeginExecuteRequest - Execute a request to services on a network function. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// networkFunctionName - The name of the network function. +// parameters - Payload for execute request post call. +// options - NetworkFunctionsClientBeginExecuteRequestOptions contains the optional parameters for the NetworkFunctionsClient.BeginExecuteRequest +// method. +func (client *NetworkFunctionsClient) BeginExecuteRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters ExecuteRequestParameters, options *NetworkFunctionsClientBeginExecuteRequestOptions) (*runtime.Poller[NetworkFunctionsClientExecuteRequestResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.executeRequest(ctx, resourceGroupName, networkFunctionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[NetworkFunctionsClientExecuteRequestResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[NetworkFunctionsClientExecuteRequestResponse](options.ResumeToken, client.pl, nil) + } +} + +// ExecuteRequest - Execute a request to services on a network function. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +func (client *NetworkFunctionsClient) executeRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters ExecuteRequestParameters, options *NetworkFunctionsClientBeginExecuteRequestOptions) (*http.Response, error) { + req, err := client.executeRequestCreateRequest(ctx, resourceGroupName, networkFunctionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// executeRequestCreateRequest creates the ExecuteRequest request. +func (client *NetworkFunctionsClient) executeRequestCreateRequest(ctx context.Context, resourceGroupName string, networkFunctionName string, parameters ExecuteRequestParameters, options *NetworkFunctionsClientBeginExecuteRequestOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridNetwork/networkFunctions/{networkFunctionName}/executeRequest" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if networkFunctionName == "" { + return nil, errors.New("parameter networkFunctionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{networkFunctionName}", url.PathEscape(networkFunctionName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + // Get - Gets information about the specified network function resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // networkFunctionName - The name of the network function resource. // options - NetworkFunctionsClientGetOptions contains the optional parameters for the NetworkFunctionsClient.Get method. @@ -230,7 +296,7 @@ func (client *NetworkFunctionsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,7 +313,7 @@ func (client *NetworkFunctionsClient) getHandleResponse(resp *http.Response) (Ne // NewListByResourceGroupPager - Lists all the network function resources in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - NetworkFunctionsClientListByResourceGroupOptions contains the optional parameters for the NetworkFunctionsClient.ListByResourceGroup // method. @@ -295,7 +361,7 @@ func (client *NetworkFunctionsClient) listByResourceGroupCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,7 +378,7 @@ func (client *NetworkFunctionsClient) listByResourceGroupHandleResponse(resp *ht // NewListBySubscriptionPager - Lists all the network functions in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // options - NetworkFunctionsClientListBySubscriptionOptions contains the optional parameters for the NetworkFunctionsClient.ListBySubscription // method. func (client *NetworkFunctionsClient) NewListBySubscriptionPager(options *NetworkFunctionsClientListBySubscriptionOptions) *runtime.Pager[NetworkFunctionsClientListBySubscriptionResponse] { @@ -355,7 +421,7 @@ func (client *NetworkFunctionsClient) listBySubscriptionCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,7 +438,7 @@ func (client *NetworkFunctionsClient) listBySubscriptionHandleResponse(resp *htt // UpdateTags - Updates the tags for the network function resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // networkFunctionName - Resource name for the network function resource. // parameters - Parameters supplied to the update network function tags operation. @@ -413,7 +479,7 @@ func (client *NetworkFunctionsClient) updateTagsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendors_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendors_client.go index 672df8828804..5a7a09894608 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendors_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendors_client.go @@ -56,7 +56,7 @@ func NewNetworkFunctionVendorsClient(subscriptionID string, credential azcore.To // NewListPager - Lists all the available vendor and sku information. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // options - NetworkFunctionVendorsClientListOptions contains the optional parameters for the NetworkFunctionVendorsClient.List // method. func (client *NetworkFunctionVendorsClient) NewListPager(options *NetworkFunctionVendorsClientListOptions) *runtime.Pager[NetworkFunctionVendorsClientListResponse] { @@ -99,7 +99,7 @@ func (client *NetworkFunctionVendorsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendorskus_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendorskus_client.go index 4310f2d7c592..8696a1f02754 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendorskus_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_networkfunctionvendorskus_client.go @@ -56,7 +56,7 @@ func NewNetworkFunctionVendorSKUsClient(subscriptionID string, credential azcore // NewListBySKUPager - Lists information about network function vendor sku details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the network function vendor. // vendorSKUName - The name of the network function sku. // options - NetworkFunctionVendorSKUsClientListBySKUOptions contains the optional parameters for the NetworkFunctionVendorSKUsClient.ListBySKU @@ -109,7 +109,7 @@ func (client *NetworkFunctionVendorSKUsClient) listBySKUCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *NetworkFunctionVendorSKUsClient) listBySKUHandleResponse(resp *htt // NewListByVendorPager - Lists all network function vendor sku details in a vendor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the network function vendor. // options - NetworkFunctionVendorSKUsClientListByVendorOptions contains the optional parameters for the NetworkFunctionVendorSKUsClient.ListByVendor // method. @@ -174,7 +174,7 @@ func (client *NetworkFunctionVendorSKUsClient) listByVendorCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_operations_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_operations_client.go index bf9c958ce6e7..e4e5bcf62f30 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_operations_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Gets a list of the operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -97,7 +97,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{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_response_types.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_response_types.go index 70cec0cfb80d..36dfb6a7f3f9 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_response_types.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_response_types.go @@ -68,6 +68,11 @@ type NetworkFunctionsClientDeleteResponse struct { // placeholder for future response values } +// NetworkFunctionsClientExecuteRequestResponse contains the response from method NetworkFunctionsClient.ExecuteRequest. +type NetworkFunctionsClientExecuteRequestResponse struct { + // placeholder for future response values +} + // NetworkFunctionsClientGetResponse contains the response from method NetworkFunctionsClient.Get. type NetworkFunctionsClientGetResponse struct { NetworkFunction @@ -90,7 +95,7 @@ type NetworkFunctionsClientUpdateTagsResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationList + OperationListResult } // RoleInstancesClientGetResponse contains the response from method RoleInstancesClient.Get. @@ -168,6 +173,11 @@ type VendorSKUsClientGetResponse struct { VendorSKU } +// VendorSKUsClientListCredentialResponse contains the response from method VendorSKUsClient.ListCredential. +type VendorSKUsClientListCredentialResponse struct { + SKUCredential +} + // VendorSKUsClientListResponse contains the response from method VendorSKUsClient.List. type VendorSKUsClientListResponse struct { VendorSKUListResult diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_roleinstances_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_roleinstances_client.go index 753d819526b8..ab75f8a40dd5 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_roleinstances_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_roleinstances_client.go @@ -56,7 +56,7 @@ func NewRoleInstancesClient(subscriptionID string, credential azcore.TokenCreden // Get - Gets the information of role instance of vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by customer. // vendorName - The name of the vendor. // serviceKey - The GUID for the vendor network function. @@ -105,7 +105,7 @@ func (client *RoleInstancesClient) getCreateRequest(ctx context.Context, locatio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,7 +122,7 @@ func (client *RoleInstancesClient) getHandleResponse(resp *http.Response) (RoleI // NewListPager - Lists the information of role instances of vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by customer. // vendorName - The name of the vendor. // serviceKey - The GUID for the vendor network function. @@ -179,7 +179,7 @@ func (client *RoleInstancesClient) listCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +196,7 @@ func (client *RoleInstancesClient) listHandleResponse(resp *http.Response) (Role // BeginRestart - Restarts a role instance of a vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by customer. // vendorName - The name of the vendor. // serviceKey - The GUID for the vendor network function. @@ -219,7 +219,7 @@ func (client *RoleInstancesClient) BeginRestart(ctx context.Context, locationNam // Restart - Restarts a role instance of a vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *RoleInstancesClient) restart(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginRestartOptions) (*http.Response, error) { req, err := client.restartCreateRequest(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) if err != nil { @@ -263,7 +263,7 @@ func (client *RoleInstancesClient) restartCreateRequest(ctx context.Context, loc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *RoleInstancesClient) restartCreateRequest(ctx context.Context, loc // BeginStart - Starts a role instance of a vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by customer. // vendorName - The name of the vendor. // serviceKey - The GUID for the vendor network function. @@ -294,7 +294,7 @@ func (client *RoleInstancesClient) BeginStart(ctx context.Context, locationName // Start - Starts a role instance of a vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *RoleInstancesClient) start(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStartOptions) (*http.Response, error) { req, err := client.startCreateRequest(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) if err != nil { @@ -338,7 +338,7 @@ func (client *RoleInstancesClient) startCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *RoleInstancesClient) startCreateRequest(ctx context.Context, locat // BeginStop - Powers off (stop) a role instance of a vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by customer. // vendorName - The name of the vendor. // serviceKey - The GUID for the vendor network function. @@ -368,7 +368,7 @@ func (client *RoleInstancesClient) BeginStop(ctx context.Context, locationName s // Stop - Powers off (stop) a role instance of a vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *RoleInstancesClient) stop(ctx context.Context, locationName string, vendorName string, serviceKey string, roleInstanceName string, options *RoleInstancesClientBeginStopOptions) (*http.Response, error) { req, err := client.stopCreateRequest(ctx, locationName, vendorName, serviceKey, roleInstanceName, options) if err != nil { @@ -412,7 +412,7 @@ func (client *RoleInstancesClient) stopCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendornetworkfunctions_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendornetworkfunctions_client.go index a4482f83e37d..d9aaedb78735 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendornetworkfunctions_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendornetworkfunctions_client.go @@ -57,7 +57,7 @@ func NewVendorNetworkFunctionsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a vendor network function. This operation can take up to 6 hours to complete. // This is expected service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by the customer. // vendorName - The name of the vendor. // serviceKey - The GUID for the vendor network function. @@ -81,7 +81,7 @@ func (client *VendorNetworkFunctionsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a vendor network function. This operation can take up to 6 hours to complete. This // is expected service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *VendorNetworkFunctionsClient) createOrUpdate(ctx context.Context, locationName string, vendorName string, serviceKey string, parameters VendorNetworkFunction, options *VendorNetworkFunctionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, locationName, vendorName, serviceKey, parameters, options) if err != nil { @@ -121,7 +121,7 @@ func (client *VendorNetworkFunctionsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -129,7 +129,7 @@ func (client *VendorNetworkFunctionsClient) createOrUpdateCreateRequest(ctx cont // Get - Gets information about the specified vendor network function. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by the customer. // vendorName - The name of the vendor. // serviceKey - The GUID for the vendor network function. @@ -174,7 +174,7 @@ func (client *VendorNetworkFunctionsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,7 +191,7 @@ func (client *VendorNetworkFunctionsClient) getHandleResponse(resp *http.Respons // NewListPager - Lists all the vendor network function sub resources in an Azure region, filtered by skuType, skuName, vendorProvisioningState. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // locationName - The Azure region where the network function resource was created by the customer. // vendorName - The name of the vendor. // options - VendorNetworkFunctionsClientListOptions contains the optional parameters for the VendorNetworkFunctionsClient.List @@ -247,7 +247,7 @@ func (client *VendorNetworkFunctionsClient) listCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendors_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendors_client.go index 596fde31bde2..0fab7e6f4e37 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendors_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendors_client.go @@ -56,7 +56,7 @@ func NewVendorsClient(subscriptionID string, credential azcore.TokenCredential, // BeginCreateOrUpdate - Creates or updates a vendor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // options - VendorsClientBeginCreateOrUpdateOptions contains the optional parameters for the VendorsClient.BeginCreateOrUpdate // method. @@ -76,7 +76,7 @@ func (client *VendorsClient) BeginCreateOrUpdate(ctx context.Context, vendorName // CreateOrUpdate - Creates or updates a vendor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *VendorsClient) createOrUpdate(ctx context.Context, vendorName string, options *VendorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, vendorName, options) if err != nil { @@ -108,7 +108,7 @@ func (client *VendorsClient) createOrUpdateCreateRequest(ctx context.Context, ve return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -119,7 +119,7 @@ func (client *VendorsClient) createOrUpdateCreateRequest(ctx context.Context, ve // BeginDelete - Deletes the specified vendor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // options - VendorsClientBeginDeleteOptions contains the optional parameters for the VendorsClient.BeginDelete method. func (client *VendorsClient) BeginDelete(ctx context.Context, vendorName string, options *VendorsClientBeginDeleteOptions) (*runtime.Poller[VendorsClientDeleteResponse], error) { @@ -138,7 +138,7 @@ func (client *VendorsClient) BeginDelete(ctx context.Context, vendorName string, // Delete - Deletes the specified vendor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *VendorsClient) deleteOperation(ctx context.Context, vendorName string, options *VendorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, vendorName, options) if err != nil { @@ -170,7 +170,7 @@ func (client *VendorsClient) deleteCreateRequest(ctx context.Context, vendorName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *VendorsClient) deleteCreateRequest(ctx context.Context, vendorName // Get - Gets information about the specified vendor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // options - VendorsClientGetOptions contains the optional parameters for the VendorsClient.Get method. func (client *VendorsClient) Get(ctx context.Context, vendorName string, options *VendorsClientGetOptions) (VendorsClientGetResponse, error) { @@ -212,7 +212,7 @@ func (client *VendorsClient) getCreateRequest(ctx context.Context, vendorName st return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -229,7 +229,7 @@ func (client *VendorsClient) getHandleResponse(resp *http.Response) (VendorsClie // NewListBySubscriptionPager - Lists all the vendors in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // options - VendorsClientListBySubscriptionOptions contains the optional parameters for the VendorsClient.ListBySubscription // method. func (client *VendorsClient) NewListBySubscriptionPager(options *VendorsClientListBySubscriptionOptions) *runtime.Pager[VendorsClientListBySubscriptionResponse] { @@ -272,7 +272,7 @@ func (client *VendorsClient) listBySubscriptionCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskupreview_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskupreview_client.go index fbd25ede8caf..05ebd6edd32a 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskupreview_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskupreview_client.go @@ -56,7 +56,7 @@ func NewVendorSKUPreviewClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates preview information of a vendor sku. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // skuName - The name of the vendor sku. // previewSubscription - Preview subscription ID. @@ -79,7 +79,7 @@ func (client *VendorSKUPreviewClient) BeginCreateOrUpdate(ctx context.Context, v // CreateOrUpdate - Creates or updates preview information of a vendor sku. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *VendorSKUPreviewClient) createOrUpdate(ctx context.Context, vendorName string, skuName string, previewSubscription string, parameters PreviewSubscription, options *VendorSKUPreviewClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, vendorName, skuName, previewSubscription, parameters, options) if err != nil { @@ -119,7 +119,7 @@ func (client *VendorSKUPreviewClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -127,7 +127,7 @@ func (client *VendorSKUPreviewClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the preview information of a vendor sku. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // skuName - The name of the vendor sku. // previewSubscription - Preview subscription ID. @@ -149,7 +149,7 @@ func (client *VendorSKUPreviewClient) BeginDelete(ctx context.Context, vendorNam // Delete - Deletes the preview information of a vendor sku. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *VendorSKUPreviewClient) deleteOperation(ctx context.Context, vendorName string, skuName string, previewSubscription string, options *VendorSKUPreviewClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, vendorName, skuName, previewSubscription, options) if err != nil { @@ -189,7 +189,7 @@ func (client *VendorSKUPreviewClient) deleteCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,7 +197,7 @@ func (client *VendorSKUPreviewClient) deleteCreateRequest(ctx context.Context, v // Get - Gets the preview information of a vendor sku. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // skuName - The name of the vendor sku. // previewSubscription - Preview subscription ID. @@ -241,7 +241,7 @@ func (client *VendorSKUPreviewClient) getCreateRequest(ctx context.Context, vend return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,7 +258,7 @@ func (client *VendorSKUPreviewClient) getHandleResponse(resp *http.Response) (Ve // NewListPager - Lists all the preview information of a vendor sku. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // skuName - The name of the sku. // options - VendorSKUPreviewClientListOptions contains the optional parameters for the VendorSKUPreviewClient.List method. @@ -310,7 +310,7 @@ func (client *VendorSKUPreviewClient) listCreateRequest(ctx context.Context, ven return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskus_client.go b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskus_client.go index a8a9a38d3405..38922e94aaa7 100644 --- a/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskus_client.go +++ b/sdk/resourcemanager/hybridnetwork/armhybridnetwork/zz_generated_vendorskus_client.go @@ -57,7 +57,7 @@ func NewVendorSKUsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service // behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // skuName - The name of the sku. // parameters - Parameters supplied to the create or update sku operation. @@ -80,7 +80,7 @@ func (client *VendorSKUsClient) BeginCreateOrUpdate(ctx context.Context, vendorN // CreateOrUpdate - Creates or updates a sku. This operation can take up to 2 hours to complete. This is expected service // behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *VendorSKUsClient) createOrUpdate(ctx context.Context, vendorName string, skuName string, parameters VendorSKU, options *VendorSKUsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, vendorName, skuName, parameters, options) if err != nil { @@ -116,7 +116,7 @@ func (client *VendorSKUsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -124,7 +124,7 @@ func (client *VendorSKUsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // skuName - The name of the sku. // options - VendorSKUsClientBeginDeleteOptions contains the optional parameters for the VendorSKUsClient.BeginDelete method. @@ -144,7 +144,7 @@ func (client *VendorSKUsClient) BeginDelete(ctx context.Context, vendorName stri // Delete - Deletes the specified sku. This operation can take up to 2 hours to complete. This is expected service behavior. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview func (client *VendorSKUsClient) deleteOperation(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, vendorName, skuName, options) if err != nil { @@ -180,7 +180,7 @@ func (client *VendorSKUsClient) deleteCreateRequest(ctx context.Context, vendorN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +188,7 @@ func (client *VendorSKUsClient) deleteCreateRequest(ctx context.Context, vendorN // Get - Gets information about the specified sku. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // skuName - The name of the sku. // options - VendorSKUsClientGetOptions contains the optional parameters for the VendorSKUsClient.Get method. @@ -227,7 +227,7 @@ func (client *VendorSKUsClient) getCreateRequest(ctx context.Context, vendorName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,7 +244,7 @@ func (client *VendorSKUsClient) getHandleResponse(resp *http.Response) (VendorSK // NewListPager - Lists all the skus of a vendor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2022-01-01-preview // vendorName - The name of the vendor. // options - VendorSKUsClientListOptions contains the optional parameters for the VendorSKUsClient.List method. func (client *VendorSKUsClient) NewListPager(vendorName string, options *VendorSKUsClientListOptions) *runtime.Pager[VendorSKUsClientListResponse] { @@ -291,7 +291,7 @@ func (client *VendorSKUsClient) listCreateRequest(ctx context.Context, vendorNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,3 +305,60 @@ func (client *VendorSKUsClient) listHandleResponse(resp *http.Response) (VendorS } return result, nil } + +// ListCredential - Generate credentials for publishing SKU images. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-01-01-preview +// vendorName - The name of the vendor. +// skuName - The name of the sku. +// options - VendorSKUsClientListCredentialOptions contains the optional parameters for the VendorSKUsClient.ListCredential +// method. +func (client *VendorSKUsClient) ListCredential(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientListCredentialOptions) (VendorSKUsClientListCredentialResponse, error) { + req, err := client.listCredentialCreateRequest(ctx, vendorName, skuName, options) + if err != nil { + return VendorSKUsClientListCredentialResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VendorSKUsClientListCredentialResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VendorSKUsClientListCredentialResponse{}, runtime.NewResponseError(resp) + } + return client.listCredentialHandleResponse(resp) +} + +// listCredentialCreateRequest creates the ListCredential request. +func (client *VendorSKUsClient) listCredentialCreateRequest(ctx context.Context, vendorName string, skuName string, options *VendorSKUsClientListCredentialOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.HybridNetwork/vendors/{vendorName}/vendorSkus/{skuName}/listCredential" + if vendorName == "" { + return nil, errors.New("parameter vendorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vendorName}", url.PathEscape(vendorName)) + if skuName == "" { + return nil, errors.New("parameter skuName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{skuName}", url.PathEscape(skuName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + 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-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listCredentialHandleResponse handles the ListCredential response. +func (client *VendorSKUsClient) listCredentialHandleResponse(resp *http.Response) (VendorSKUsClientListCredentialResponse, error) { + result := VendorSKUsClientListCredentialResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SKUCredential); err != nil { + return VendorSKUsClientListCredentialResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/CHANGELOG.md b/sdk/resourcemanager/iotcentral/armiotcentral/CHANGELOG.md index a91b74cdf6d2..e04292757edd 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/CHANGELOG.md +++ b/sdk/resourcemanager/iotcentral/armiotcentral/CHANGELOG.md @@ -1,5 +1,88 @@ # Release History +## 2.0.0-beta.1 (2022-05-19) +### Breaking Changes + +- Function `Resource.MarshalJSON` has been removed +- Struct `CloudError` has been removed +- Struct `CloudErrorBody` has been removed +- Field `App` of struct `AppsClientUpdateResponse` has been removed +- Field `Location` of struct `Resource` has been removed +- Field `Tags` of struct `Resource` has been removed + +### Features Added + +- New const `PrivateEndpointServiceConnectionStatusRejected` +- New const `CreatedByTypeApplication` +- New const `CreatedByTypeKey` +- New const `PublicNetworkAccessDisabled` +- New const `NetworkActionDeny` +- New const `ProvisioningStateCanceled` +- New const `ProvisioningStateDeleting` +- New const `PrivateEndpointServiceConnectionStatusApproved` +- New const `CreatedByTypeManagedIdentity` +- New const `PrivateEndpointConnectionProvisioningStateDeleting` +- New const `ProvisioningStateCreating` +- New const `PrivateEndpointConnectionProvisioningStateSucceeded` +- New const `ProvisioningStateFailed` +- New const `NetworkActionAllow` +- New const `IPRuleActionAllow` +- New const `CreatedByTypeUser` +- New const `ProvisioningStateSucceeded` +- New const `PublicNetworkAccessEnabled` +- New const `PrivateEndpointConnectionProvisioningStateCreating` +- New const `PrivateEndpointConnectionProvisioningStateFailed` +- New const `ProvisioningStateUpdating` +- New const `PrivateEndpointServiceConnectionStatusPending` +- New function `PrivateLinkResourceProperties.MarshalJSON() ([]byte, error)` +- New function `AppProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleNetworkActionValues() []NetworkAction` +- New function `PossibleIPRuleActionValues() []IPRuleAction` +- New function `PossibleProvisioningStateValues() []ProvisioningState` +- New function `PrivateEndpointConnectionProperties.MarshalJSON() ([]byte, error)` +- New function `PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState` +- New function `*SystemData.UnmarshalJSON([]byte) error` +- New function `PossiblePublicNetworkAccessValues() []PublicNetworkAccess` +- New function `PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus` +- New function `SystemData.MarshalJSON() ([]byte, error)` +- New function `TrackedResource.MarshalJSON() ([]byte, error)` +- New function `NetworkRuleSets.MarshalJSON() ([]byte, error)` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New struct `ErrorAdditionalInfo` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- New struct `NetworkRuleSetIPRule` +- New struct `NetworkRuleSets` +- New struct `PrivateEndpoint` +- New struct `PrivateEndpointConnection` +- New struct `PrivateEndpointConnectionListResult` +- New struct `PrivateEndpointConnectionProperties` +- New struct `PrivateEndpointConnectionsClientBeginCreateOptions` +- New struct `PrivateEndpointConnectionsClientBeginDeleteOptions` +- New struct `PrivateEndpointConnectionsClientCreateResponse` +- New struct `PrivateEndpointConnectionsClientDeleteResponse` +- New struct `PrivateEndpointConnectionsClientGetOptions` +- New struct `PrivateEndpointConnectionsClientGetResponse` +- New struct `PrivateEndpointConnectionsClientListOptions` +- New struct `PrivateEndpointConnectionsClientListResponse` +- New struct `PrivateLinkResource` +- New struct `PrivateLinkResourceListResult` +- New struct `PrivateLinkResourceProperties` +- New struct `PrivateLinkServiceConnectionState` +- New struct `PrivateLinksClientGetOptions` +- New struct `PrivateLinksClientGetResponse` +- New struct `PrivateLinksClientListOptions` +- New struct `PrivateLinksClientListResponse` +- New struct `SystemData` +- New struct `TrackedResource` +- New field `SystemData` in struct `App` +- New field `SystemData` in struct `Resource` +- New field `NetworkRuleSets` in struct `AppProperties` +- New field `ProvisioningState` in struct `AppProperties` +- New field `PublicNetworkAccess` in struct `AppProperties` +- New field `PrivateEndpointConnections` in struct `AppProperties` + + ## 1.0.0 (2022-05-18) ### Breaking Changes diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/autorest.md b/sdk/resourcemanager/iotcentral/armiotcentral/autorest.md index 2f3d92cb012d..896ec94836db 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/autorest.md +++ b/sdk/resourcemanager/iotcentral/armiotcentral/autorest.md @@ -4,11 +4,10 @@ ``` yaml azure-arm: true -tag: package-2021-06 require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/iotcentral/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/iotcentral/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/iotcentral/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/iotcentral/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_apps_client_test.go b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_apps_client_test.go index 9bd3af0f8cb1..ee88b3fd88c3 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_apps_client_test.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_apps_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotcentral/armiotcentral" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Get.json func ExampleAppsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleAppsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CreateOrUpdate.json func ExampleAppsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -79,7 +79,7 @@ func ExampleAppsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Update.json func ExampleAppsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,15 +105,13 @@ func ExampleAppsClient_BeginUpdate() { if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) + _, err = poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } - // TODO: use response item - _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Delete.json func ExampleAppsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +135,7 @@ func ExampleAppsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_ListBySubscription.json func ExampleAppsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +159,7 @@ func ExampleAppsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_ListByResourceGroup.json func ExampleAppsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -186,7 +184,7 @@ func ExampleAppsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CheckNameAvailability.json func ExampleAppsClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -210,7 +208,7 @@ func ExampleAppsClient_CheckNameAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CheckSubdomainAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_CheckSubdomainAvailability.json func ExampleAppsClient_CheckSubdomainAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -234,7 +232,7 @@ func ExampleAppsClient_CheckSubdomainAvailability() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Templates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Apps_Templates.json func ExampleAppsClient_NewListTemplatesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_operations_client_test.go index 06de4ed6ac0f..269bea852c55 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotcentral/armiotcentral" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Operations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildservicebuilder_client_test.go b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_privateendpointconnections_client_test.go similarity index 53% rename from sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildservicebuilder_client_test.go rename to sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_privateendpointconnections_client_test.go index d0444fc43efe..65ca9d636fdd 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildservicebuilder_client_test.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_privateendpointconnections_client_test.go @@ -6,7 +6,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armappplatform_test +package armiotcentral_test import ( "context" @@ -14,25 +14,24 @@ import ( "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/appplatform/armappplatform" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotcentral/armiotcentral" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_Get.json -func ExampleBuildServiceBuilderClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Get.json +func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBuildServiceBuilderClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armiotcentral.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "default", - "mybuilder", + "resRg", + "myIoTCentralApp", + "myIoTCentralAppEndpoint", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -41,35 +40,27 @@ func ExampleBuildServiceBuilderClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_CreateOrUpdate.json -func ExampleBuildServiceBuilderClient_BeginCreateOrUpdate() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Update.json +func ExamplePrivateEndpointConnectionsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBuildServiceBuilderClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armiotcentral.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginCreateOrUpdate(ctx, - "myResourceGroup", - "myservice", - "default", - "mybuilder", - armappplatform.BuilderResource{ - Properties: &armappplatform.BuilderProperties{ - BuildpackGroups: []*armappplatform.BuildpacksGroupProperties{ - { - Name: to.Ptr("mix"), - Buildpacks: []*armappplatform.BuildpackProperties{ - { - ID: to.Ptr("tanzu-buildpacks/java-azure"), - }}, - }}, - Stack: &armappplatform.StackProperties{ - ID: to.Ptr("io.buildpacks.stacks.bionic"), - Version: to.Ptr("base"), + poller, err := client.BeginCreate(ctx, + "resRg", + "myIoTCentralApp", + "myIoTCentralAppEndpoint", + armiotcentral.PrivateEndpointConnection{ + Properties: &armiotcentral.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armiotcentral.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Auto-approved"), + ActionsRequired: to.Ptr("None"), + Status: to.Ptr(armiotcentral.PrivateEndpointServiceConnectionStatusApproved), }, }, }, @@ -85,22 +76,21 @@ func ExampleBuildServiceBuilderClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_Delete.json -func ExampleBuildServiceBuilderClient_BeginDelete() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_Delete.json +func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBuildServiceBuilderClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armiotcentral.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := client.BeginDelete(ctx, - "myResourceGroup", - "myservice", - "default", - "mybuilder", + "resRg", + "myIoTCentralApp", + "myIoTCentralAppEndpoint", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -111,20 +101,19 @@ func ExampleBuildServiceBuilderClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceBuilder_List.json -func ExampleBuildServiceBuilderClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateEndpointConnections_List.json +func ExamplePrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBuildServiceBuilderClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armiotcentral.NewPrivateEndpointConnectionsClient("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", - "myservice", - "default", + pager := client.NewListPager("resRg", + "myIoTCentralApp", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_privatelinks_client_test.go b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_privatelinks_client_test.go new file mode 100644 index 000000000000..3368482355c6 --- /dev/null +++ b/sdk/resourcemanager/iotcentral/armiotcentral/ze_generated_example_privatelinks_client_test.go @@ -0,0 +1,66 @@ +//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 armiotcentral_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/iotcentral/armiotcentral" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateLinks_Get.json +func ExamplePrivateLinksClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armiotcentral.NewPrivateLinksClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "resRg", + "myIoTCentralApp", + "iotApp", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/iotcentral/resource-manager/Microsoft.IoTCentral/preview/2021-11-01-preview/examples/PrivateLinks_List.json +func ExamplePrivateLinksClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armiotcentral.NewPrivateLinksClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("resRg", + "myIoTCentralApp", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_apps_client.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_apps_client.go index 6cd559be38da..8fd46c214742 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_apps_client.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_apps_client.go @@ -56,7 +56,7 @@ func NewAppsClient(subscriptionID string, credential azcore.TokenCredential, opt // CheckNameAvailability - Check if an IoT Central application name is available. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // operationInputs - Set the name parameter in the OperationInputs structure to the name of the IoT Central application to // check. // options - AppsClientCheckNameAvailabilityOptions contains the optional parameters for the AppsClient.CheckNameAvailability @@ -88,7 +88,7 @@ func (client *AppsClient) checkNameAvailabilityCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, operationInputs) @@ -105,7 +105,7 @@ func (client *AppsClient) checkNameAvailabilityHandleResponse(resp *http.Respons // CheckSubdomainAvailability - Check if an IoT Central application subdomain is available. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // operationInputs - Set the name parameter in the OperationInputs structure to the subdomain of the IoT Central application // to check. // options - AppsClientCheckSubdomainAvailabilityOptions contains the optional parameters for the AppsClient.CheckSubdomainAvailability @@ -137,7 +137,7 @@ func (client *AppsClient) checkSubdomainAvailabilityCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, operationInputs) @@ -156,7 +156,7 @@ func (client *AppsClient) checkSubdomainAvailabilityHandleResponse(resp *http.Re // is to retrieve the IoT Central application metadata and security metadata, and then combine them // with the modified values in a new body to update the IoT Central application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group that contains the IoT Central application. // resourceName - The ARM resource name of the IoT Central application. // app - The IoT Central application metadata and security metadata. @@ -178,7 +178,7 @@ func (client *AppsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroup // to retrieve the IoT Central application metadata and security metadata, and then combine them // with the modified values in a new body to update the IoT Central application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview func (client *AppsClient) createOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, app App, options *AppsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceName, app, options) if err != nil { @@ -188,7 +188,7 @@ func (client *AppsClient) createOrUpdate(ctx context.Context, resourceGroupName if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -214,7 +214,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, app) @@ -222,7 +222,7 @@ func (client *AppsClient) createOrUpdateCreateRequest(ctx context.Context, resou // BeginDelete - Delete an IoT Central application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group that contains the IoT Central application. // resourceName - The ARM resource name of the IoT Central application. // options - AppsClientBeginDeleteOptions contains the optional parameters for the AppsClient.BeginDelete method. @@ -240,7 +240,7 @@ func (client *AppsClient) BeginDelete(ctx context.Context, resourceGroupName str // Delete - Delete an IoT Central application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview func (client *AppsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, options *AppsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, options) if err != nil { @@ -250,7 +250,7 @@ func (client *AppsClient) deleteOperation(ctx context.Context, resourceGroupName if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -276,7 +276,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *AppsClient) deleteCreateRequest(ctx context.Context, resourceGroup // Get - Get the metadata of an IoT Central application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group that contains the IoT Central application. // resourceName - The ARM resource name of the IoT Central application. // options - AppsClientGetOptions contains the optional parameters for the AppsClient.Get method. @@ -323,7 +323,7 @@ func (client *AppsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -340,7 +340,7 @@ func (client *AppsClient) getHandleResponse(resp *http.Response) (AppsClientGetR // NewListByResourceGroupPager - Get all the IoT Central Applications in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group that contains the IoT Central application. // options - AppsClientListByResourceGroupOptions contains the optional parameters for the AppsClient.ListByResourceGroup // method. @@ -388,7 +388,7 @@ func (client *AppsClient) listByResourceGroupCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -405,7 +405,7 @@ func (client *AppsClient) listByResourceGroupHandleResponse(resp *http.Response) // NewListBySubscriptionPager - Get all IoT Central Applications in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // options - AppsClientListBySubscriptionOptions contains the optional parameters for the AppsClient.ListBySubscription method. func (client *AppsClient) NewListBySubscriptionPager(options *AppsClientListBySubscriptionOptions) *runtime.Pager[AppsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[AppsClientListBySubscriptionResponse]{ @@ -447,7 +447,7 @@ func (client *AppsClient) listBySubscriptionCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -464,7 +464,7 @@ func (client *AppsClient) listBySubscriptionHandleResponse(resp *http.Response) // NewListTemplatesPager - Get all available application templates. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // options - AppsClientListTemplatesOptions contains the optional parameters for the AppsClient.ListTemplates method. func (client *AppsClient) NewListTemplatesPager(options *AppsClientListTemplatesOptions) *runtime.Pager[AppsClientListTemplatesResponse] { return runtime.NewPager(runtime.PagingHandler[AppsClientListTemplatesResponse]{ @@ -506,7 +506,7 @@ func (client *AppsClient) listTemplatesCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -523,7 +523,7 @@ func (client *AppsClient) listTemplatesHandleResponse(resp *http.Response) (Apps // BeginUpdate - Update the metadata of an IoT Central application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group that contains the IoT Central application. // resourceName - The ARM resource name of the IoT Central application. // appPatch - The IoT Central application metadata and security metadata. @@ -542,7 +542,7 @@ func (client *AppsClient) BeginUpdate(ctx context.Context, resourceGroupName str // Update - Update the metadata of an IoT Central application. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview func (client *AppsClient) update(ctx context.Context, resourceGroupName string, resourceName string, appPatch AppPatch, options *AppsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, resourceName, appPatch, options) if err != nil { @@ -552,7 +552,7 @@ func (client *AppsClient) update(ctx context.Context, resourceGroupName string, if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusAccepted) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -578,7 +578,7 @@ func (client *AppsClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, appPatch) diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_constants.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_constants.go index 8d3e51368805..77ae025c8e2f 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_constants.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_constants.go @@ -10,7 +10,7 @@ package armiotcentral const ( moduleName = "armiotcentral" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // AppSKU - The name of the SKU. @@ -47,6 +47,134 @@ func PossibleAppStateValues() []AppState { } } +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// IPRuleAction - The network action for the IP mask. +type IPRuleAction string + +const ( + IPRuleActionAllow IPRuleAction = "Allow" +) + +// PossibleIPRuleActionValues returns the possible values for the IPRuleAction const type. +func PossibleIPRuleActionValues() []IPRuleAction { + return []IPRuleAction{ + IPRuleActionAllow, + } +} + +// NetworkAction - Whether to allow or deny network traffic. +type NetworkAction string + +const ( + NetworkActionAllow NetworkAction = "Allow" + NetworkActionDeny NetworkAction = "Deny" +) + +// PossibleNetworkActionValues returns the possible values for the NetworkAction const type. +func PossibleNetworkActionValues() []NetworkAction { + return []NetworkAction{ + NetworkActionAllow, + NetworkActionDeny, + } +} + +// PrivateEndpointConnectionProvisioningState - The current provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns the possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{ + PrivateEndpointConnectionProvisioningStateCreating, + PrivateEndpointConnectionProvisioningStateDeleting, + PrivateEndpointConnectionProvisioningStateFailed, + PrivateEndpointConnectionProvisioningStateSucceeded, + } +} + +// PrivateEndpointServiceConnectionStatus - The private endpoint connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns the possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{ + PrivateEndpointServiceConnectionStatusApproved, + PrivateEndpointServiceConnectionStatusPending, + PrivateEndpointServiceConnectionStatusRejected, + } +} + +// ProvisioningState - The provisioning state of the application. +type ProvisioningState string + +const ( + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ + ProvisioningStateCanceled, + ProvisioningStateCreating, + ProvisioningStateDeleting, + ProvisioningStateFailed, + ProvisioningStateSucceeded, + ProvisioningStateUpdating, + } +} + +// PublicNetworkAccess - Whether requests from the public network are allowed. +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + } +} + // SystemAssignedServiceIdentityType - Type of managed service identity (either system assigned, or none). type SystemAssignedServiceIdentityType string diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models.go index b35c6ae8182a..963f497f9315 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models.go @@ -8,9 +8,11 @@ package armiotcentral +import "time" + // App - The IoT Central application. type App struct { - // REQUIRED; The resource location. + // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` // REQUIRED; A valid instance SKU. @@ -22,16 +24,19 @@ type App struct { // The common properties of an IoT Central application. Properties *AppProperties `json:"properties,omitempty"` - // The resource tags. + // Resource tags. Tags map[string]*string `json:"tags,omitempty"` - // READ-ONLY; The ARM resource identifier. + // 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 ARM resource name. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The resource type. + // 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"` } @@ -76,6 +81,12 @@ type AppProperties struct { // The display name of the application. DisplayName *string `json:"displayName,omitempty"` + // Network Rule Set Properties of this IoT Central application. + NetworkRuleSets *NetworkRuleSets `json:"networkRuleSets,omitempty"` + + // Whether requests from the public network are allowed. + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // The subdomain of the application. Subdomain *string `json:"subdomain,omitempty"` @@ -87,6 +98,12 @@ type AppProperties struct { // READ-ONLY; The ID of the application. ApplicationID *string `json:"applicationId,omitempty" azure:"ro"` + // READ-ONLY; Private endpoint connections created on this IoT Central application. + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` + + // READ-ONLY; The provisioning state of the application. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` + // READ-ONLY; The current state of the application. State *AppState `json:"state,omitempty" azure:"ro"` } @@ -191,27 +208,67 @@ type AppsClientListTemplatesOptions struct { // placeholder for future optional parameters } -// CloudError - Error details. -type CloudError struct { - // Error response body. - Error *CloudErrorBody `json:"error,omitempty"` +// ErrorAdditionalInfo - The resource management error additional info. +type ErrorAdditionalInfo struct { + // READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty" azure:"ro"` + + // READ-ONLY; The additional info type. + Type *string `json:"type,omitempty" azure:"ro"` } -// CloudErrorBody - Details of error response. -type CloudErrorBody struct { - // A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty"` +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` // READ-ONLY; The error code. Code *string `json:"code,omitempty" azure:"ro"` + // READ-ONLY; The error details. + Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + // READ-ONLY; The error message. Message *string `json:"message,omitempty" azure:"ro"` - // READ-ONLY; The target of the particular error. + // READ-ONLY; The error target. Target *string `json:"target,omitempty" azure:"ro"` } +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// NetworkRuleSetIPRule - An object for an IP range that will be allowed access. +type NetworkRuleSetIPRule struct { + // The readable name of the IP rule. + FilterName *string `json:"filterName,omitempty"` + + // The CIDR block defining the IP range. + IPMask *string `json:"ipMask,omitempty"` + + // READ-ONLY; The network action for the IP mask. + Action *IPRuleAction `json:"action,omitempty" azure:"ro"` +} + +// NetworkRuleSets - Network Rule Set Properties of this IoT Central application. +type NetworkRuleSets struct { + // Whether these rules apply for device connectivity to IoT Hub and Device Provisioning service associated with this application. + ApplyToDevices *bool `json:"applyToDevices,omitempty"` + + // Whether these rules apply for connectivity via IoT Central web portal and APIs. + ApplyToIoTCentral *bool `json:"applyToIoTCentral,omitempty"` + + // The default network action to apply. + DefaultAction *NetworkAction `json:"defaultAction,omitempty"` + + // List of IP rules. + IPRules []*NetworkRuleSetIPRule `json:"ipRules,omitempty"` +} + // Operation - IoT Central REST API operation type Operation struct { // The object that represents the operation. @@ -266,21 +323,148 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } -// Resource - The common properties of an ARM resource. -type Resource struct { - // REQUIRED; The resource location. - Location *string `json:"location,omitempty"` +// PrivateEndpoint - The private endpoint resource. +type PrivateEndpoint struct { + // READ-ONLY; The ARM identifier for private endpoint. + ID *string `json:"id,omitempty" azure:"ro"` +} - // The resource tags. - Tags map[string]*string `json:"tags,omitempty"` +// PrivateEndpointConnection - The private endpoint connection resource. +type PrivateEndpointConnection struct { + // Resource properties. + Properties *PrivateEndpointConnectionProperties `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"` +} + +// PrivateEndpointConnectionListResult - List of private endpoint connections associated with the specified resource. +type PrivateEndpointConnectionListResult struct { + // Array of private endpoint connections. + Value []*PrivateEndpointConnection `json:"value,omitempty"` +} + +// PrivateEndpointConnectionProperties - Properties of the private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // REQUIRED; A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + + // The private endpoint resource. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + + // READ-ONLY; The group ids for the private endpoint resource. + GroupIDs []*string `json:"groupIds,omitempty" azure:"ro"` + + // READ-ONLY; The provisioning state of the private endpoint connection resource. + ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// PrivateEndpointConnectionsClientBeginCreateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreate +// method. +type PrivateEndpointConnectionsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +type PrivateEndpointConnectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +type PrivateEndpointConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. +type PrivateEndpointConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateLinkResource - A private link resource. +type PrivateLinkResource struct { + // Resource properties. + Properties *PrivateLinkResourceProperties `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"` +} + +// PrivateLinkResourceListResult - A list of private link resources. +type PrivateLinkResourceListResult struct { + // Array of private link resources + Value []*PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties - Properties of a private link resource. +type PrivateLinkResourceProperties struct { + // The private link resource private link DNS zone name. + RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` + + // READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty" azure:"ro"` + + // READ-ONLY; The private link resource required member names. + RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` +} + +// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer +// and provider. +type PrivateLinkServiceConnectionState struct { + // A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` + + // The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + + // Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} + +// PrivateLinksClientGetOptions contains the optional parameters for the PrivateLinksClient.Get method. +type PrivateLinksClientGetOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; The ARM resource identifier. +// PrivateLinksClientListOptions contains the optional parameters for the PrivateLinksClient.List method. +type PrivateLinksClientListOptions struct { + // placeholder for future optional parameters +} + +// Resource - Common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // 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 ARM resource name. + // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The resource type. + // 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"` } @@ -296,3 +480,46 @@ type SystemAssignedServiceIdentity struct { // READ-ONLY; The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. TenantID *string `json:"tenantId,omitempty" azure:"ro"` } + +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + +// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' +// and a 'location' +type TrackedResource struct { + // REQUIRED; The geo-location where the resource lives + Location *string `json:"location,omitempty"` + + // Resource tags. + Tags map[string]*string `json:"tags,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"` +} diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models_serde.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models_serde.go index 7523d5f00318..5bc4cedf0cdf 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models_serde.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_models_serde.go @@ -10,6 +10,7 @@ package armiotcentral import ( "encoding/json" + "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "reflect" ) @@ -23,6 +24,7 @@ func (a App) MarshalJSON() ([]byte, error) { populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) populate(objectMap, "tags", a.Tags) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) @@ -38,14 +40,106 @@ func (a AppPatch) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AppProperties. +func (a AppProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) + populate(objectMap, "applicationId", a.ApplicationID) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "networkRuleSets", a.NetworkRuleSets) + populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) + populate(objectMap, "state", a.State) + populate(objectMap, "subdomain", a.Subdomain) + populate(objectMap, "template", a.Template) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkRuleSets. +func (n NetworkRuleSets) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applyToDevices", n.ApplyToDevices) + populate(objectMap, "applyToIoTCentral", n.ApplyToIoTCentral) + populate(objectMap, "defaultAction", n.DefaultAction) + populate(objectMap, "ipRules", n.IPRules) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } @@ -58,3 +152,13 @@ func populate(m map[string]interface{}, k string, v interface{}) { m[k] = v } } + +func unpopulate(data json.RawMessage, fn string, v interface{}) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_operations_client.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_operations_client.go index 9865b5e3f3e5..4987bb133142 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_operations_client.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available IoT Central Resource Provider operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-11-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_privateendpointconnections_client.go new file mode 100644 index 000000000000..28548c59dff1 --- /dev/null +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_privateendpointconnections_client.go @@ -0,0 +1,318 @@ +//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 armiotcentral + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. +// Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead. +type PrivateEndpointConnectionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. +// subscriptionID - The subscription identifier. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PrivateEndpointConnectionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreate - Update a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// resourceGroupName - The name of the resource group that contains the IoT Central application. +// resourceName - The ARM resource name of the IoT Central application. +// privateEndpointConnectionName - The private endpoint connection name. +// privateEndpointConnection - The private endpoint connection metadata. +// options - PrivateEndpointConnectionsClientBeginCreateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreate +// method. +func (client *PrivateEndpointConnectionsClient) BeginCreate(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PrivateEndpointConnectionsClientCreateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Create - Update a private endpoint connection. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +func (client *PrivateEndpointConnectionsClient) create(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOptions) (*http.Response, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createCreateRequest creates the Create request. +func (client *PrivateEndpointConnectionsClient) createCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, privateEndpointConnection) +} + +// BeginDelete - Deletes a private endpoint connection from the IoT Central Application. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// resourceGroupName - The name of the resource group that contains the IoT Central application. +// resourceName - The ARM resource name of the IoT Central application. +// privateEndpointConnectionName - The private endpoint connection name. +// options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[PrivateEndpointConnectionsClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes a private endpoint connection from the IoT Central Application. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the metadata of a private endpoint connection for the IoT Central Application. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// resourceGroupName - The name of the resource group that contains the IoT Central application. +// resourceName - The ARM resource name of the IoT Central application. +// privateEndpointConnectionName - The private endpoint connection name. +// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. +func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if privateEndpointConnectionName == "" { + return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { + result := PrivateEndpointConnectionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { + return PrivateEndpointConnectionsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get all private endpoint connections of a IoT Central Application. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// resourceGroupName - The name of the resource group that contains the IoT Central application. +// resourceName - The ARM resource name of the IoT Central application. +// options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List +// method. +func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{ + More: func(page PrivateEndpointConnectionsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName}/privateEndpointConnections" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListResponse, error) { + result := PrivateEndpointConnectionsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { + return PrivateEndpointConnectionsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_privatelinks_client.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_privatelinks_client.go new file mode 100644 index 000000000000..ea3316a4225e --- /dev/null +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_privatelinks_client.go @@ -0,0 +1,179 @@ +//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 armiotcentral + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// PrivateLinksClient contains the methods for the PrivateLinks group. +// Don't use this type directly, use NewPrivateLinksClient() instead. +type PrivateLinksClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPrivateLinksClient creates a new instance of PrivateLinksClient with the specified values. +// subscriptionID - The subscription identifier. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewPrivateLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinksClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &PrivateLinksClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Get a private link resource of a IoT Central Application. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// resourceGroupName - The name of the resource group that contains the IoT Central application. +// resourceName - The ARM resource name of the IoT Central application. +// groupID - The private link resource name. +// options - PrivateLinksClientGetOptions contains the optional parameters for the PrivateLinksClient.Get method. +func (client *PrivateLinksClient) Get(ctx context.Context, resourceGroupName string, resourceName string, groupID string, options *PrivateLinksClientGetOptions) (PrivateLinksClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, resourceName, groupID, options) + if err != nil { + return PrivateLinksClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinksClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinksClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PrivateLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, groupID string, options *PrivateLinksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName}/privateLinkResources/{groupId}" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if groupID == "" { + return nil, errors.New("parameter groupID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupId}", url.PathEscape(groupID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PrivateLinksClient) getHandleResponse(resp *http.Response) (PrivateLinksClientGetResponse, error) { + result := PrivateLinksClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResource); err != nil { + return PrivateLinksClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get all private link resources of a IoT Central Application. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-11-01-preview +// resourceGroupName - The name of the resource group that contains the IoT Central application. +// resourceName - The ARM resource name of the IoT Central application. +// options - PrivateLinksClientListOptions contains the optional parameters for the PrivateLinksClient.List method. +func (client *PrivateLinksClient) NewListPager(resourceGroupName string, resourceName string, options *PrivateLinksClientListOptions) *runtime.Pager[PrivateLinksClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[PrivateLinksClientListResponse]{ + More: func(page PrivateLinksClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateLinksClientListResponse) (PrivateLinksClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, resourceName, options) + if err != nil { + return PrivateLinksClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinksClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinksClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *PrivateLinksClient) listCreateRequest(ctx context.Context, resourceGroupName string, resourceName string, options *PrivateLinksClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTCentral/iotApps/{resourceName}/privateLinkResources" + 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 resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *PrivateLinksClient) listHandleResponse(resp *http.Response) (PrivateLinksClientListResponse, error) { + result := PrivateLinksClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { + return PrivateLinksClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_response_types.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_response_types.go index 1243ece2fb2a..acc0a7d2c3d4 100644 --- a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_response_types.go +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_response_types.go @@ -50,10 +50,40 @@ type AppsClientListTemplatesResponse struct { // AppsClientUpdateResponse contains the response from method AppsClient.Update. type AppsClientUpdateResponse struct { - App + // placeholder for future response values } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { OperationListResult } + +// PrivateEndpointConnectionsClientCreateResponse contains the response from method PrivateEndpointConnectionsClient.Create. +type PrivateEndpointConnectionsClientCreateResponse struct { + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. +type PrivateEndpointConnectionsClientDeleteResponse struct { + // placeholder for future response values +} + +// PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. +type PrivateEndpointConnectionsClientGetResponse struct { + PrivateEndpointConnection +} + +// PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.List. +type PrivateEndpointConnectionsClientListResponse struct { + PrivateEndpointConnectionListResult +} + +// PrivateLinksClientGetResponse contains the response from method PrivateLinksClient.Get. +type PrivateLinksClientGetResponse struct { + PrivateLinkResource +} + +// PrivateLinksClientListResponse contains the response from method PrivateLinksClient.List. +type PrivateLinksClientListResponse struct { + PrivateLinkResourceListResult +} diff --git a/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_time_rfc3339.go b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_time_rfc3339.go new file mode 100644 index 000000000000..154e9586cb2a --- /dev/null +++ b/sdk/resourcemanager/iotcentral/armiotcentral/zz_generated_time_rfc3339.go @@ -0,0 +1,86 @@ +//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 armiotcentral + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +const ( + utcLayoutJSON = `"2006-01-02T15:04:05.999999999"` + utcLayout = "2006-01-02T15:04:05.999999999" + rfc3339JSON = `"` + time.RFC3339Nano + `"` +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(Z|z|\+|-)(\d+:\d+)*"*$`) + +type timeRFC3339 time.Time + +func (t timeRFC3339) MarshalJSON() (json []byte, err error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t timeRFC3339) MarshalText() (text []byte, err error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *timeRFC3339) UnmarshalJSON(data []byte) error { + layout := utcLayoutJSON + if tzOffsetRegex.Match(data) { + layout = rfc3339JSON + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) UnmarshalText(data []byte) (err error) { + layout := utcLayout + if tzOffsetRegex.Match(data) { + layout = time.RFC3339Nano + } + return t.Parse(layout, string(data)) +} + +func (t *timeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = timeRFC3339(p) + return err +} + +func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*timeRFC3339)(t) +} + +func unpopulateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux timeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md b/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md index f9a7861f20a0..0edabff35dd0 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md +++ b/sdk/resourcemanager/keyvault/armkeyvault/CHANGELOG.md @@ -1,5 +1,29 @@ # Release History +## 1.1.0-beta.1 (2022-05-19) +### Features Added + +- New const `KeyRotationPolicyActionTypeNotify` +- New const `JSONWebKeyOperationRelease` +- New const `KeyRotationPolicyActionTypeRotate` +- New const `KeyPermissionsRotate` +- New const `KeyPermissionsRelease` +- New const `KeyPermissionsSetrotationpolicy` +- New const `KeyPermissionsGetrotationpolicy` +- New function `PossibleKeyRotationPolicyActionTypeValues() []KeyRotationPolicyActionType` +- New function `*KeyReleasePolicy.UnmarshalJSON([]byte) error` +- New function `KeyReleasePolicy.MarshalJSON() ([]byte, error)` +- New function `RotationPolicy.MarshalJSON() ([]byte, error)` +- New struct `Action` +- New struct `KeyReleasePolicy` +- New struct `KeyRotationPolicyAttributes` +- New struct `LifetimeAction` +- New struct `RotationPolicy` +- New struct `Trigger` +- New field `ReleasePolicy` in struct `KeyProperties` +- New field `RotationPolicy` in struct `KeyProperties` + + ## 1.0.0 (2022-05-16) ### Breaking Changes diff --git a/sdk/resourcemanager/keyvault/armkeyvault/autorest.md b/sdk/resourcemanager/keyvault/armkeyvault/autorest.md index a930f8d5ad2b..bb4f02c95677 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/autorest.md +++ b/sdk/resourcemanager/keyvault/armkeyvault/autorest.md @@ -4,12 +4,11 @@ ``` yaml azure-arm: true -tag: package-2021-10 require: -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/keyvault/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/0cc5e2efd6ffccf30e80d1e150b488dd87198b94/specification/keyvault/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/keyvault/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/keyvault/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0-beta.1 modelerfour: seal-single-value-enum-by-default: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestKeysClient.json b/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestKeysClient.json index ac899e170d35..8a7a465932e5 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestKeysClient.json +++ b/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestKeysClient.json @@ -9,7 +9,7 @@ "Authorization": "Sanitized", "Content-Length": "21", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armresources/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armresources/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "location": "eastus" @@ -40,7 +40,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3?api-version=2021-11-01-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", @@ -48,7 +48,7 @@ "Authorization": "Sanitized", "Content-Length": "357", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "location": "eastus", @@ -154,13 +154,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -235,13 +235,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -316,7 +316,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3/keys/go-test-key?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3/keys/go-test-key?api-version=2021-11-01-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", @@ -324,7 +324,7 @@ "Authorization": "Sanitized", "Content-Length": "104", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "properties": { @@ -384,14 +384,14 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3/keys/go-test-key?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-3/keys/go-test-key?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -445,7 +445,7 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armresources/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armresources/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, diff --git a/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestSecretsClient.json b/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestSecretsClient.json index 6c7173dbd88d..d994dff75fb7 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestSecretsClient.json +++ b/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestSecretsClient.json @@ -9,7 +9,7 @@ "Authorization": "Sanitized", "Content-Length": "21", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armresources/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armresources/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "location": "eastus" @@ -40,7 +40,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2?api-version=2021-11-01-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", @@ -48,7 +48,7 @@ "Authorization": "Sanitized", "Content-Length": "357", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "location": "eastus", @@ -154,13 +154,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -235,13 +235,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -316,7 +316,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2/secrets/go-test-secret2?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2/secrets/go-test-secret2?api-version=2021-11-01-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", @@ -324,7 +324,7 @@ "Authorization": "Sanitized", "Content-Length": "76", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "properties": { @@ -372,7 +372,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2/secrets/go-test-secret2?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2/secrets/go-test-secret2?api-version=2021-11-01-preview", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", @@ -380,7 +380,7 @@ "Authorization": "Sanitized", "Content-Length": "81", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "properties": { @@ -431,14 +431,14 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2/secrets/go-test-secret2?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-2/secrets/go-test-secret2?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -488,7 +488,7 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armresources/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armresources/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, diff --git a/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestVaultsClient.json b/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestVaultsClient.json index 9ac07deafa58..966c44ada4ee 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestVaultsClient.json +++ b/sdk/resourcemanager/keyvault/armkeyvault/testdata/recordings/TestVaultsClient.json @@ -9,7 +9,7 @@ "Authorization": "Sanitized", "Content-Length": "21", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armresources/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armresources/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "location": "eastus" @@ -40,7 +40,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-11-01-preview", "RequestMethod": "PUT", "RequestHeaders": { "Accept": "application/json", @@ -48,7 +48,7 @@ "Authorization": "Sanitized", "Content-Length": "357", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "location": "eastus", @@ -154,13 +154,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -235,13 +235,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -316,7 +316,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/checkNameAvailability?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/checkNameAvailability?api-version=2021-11-01-preview", "RequestMethod": "POST", "RequestHeaders": { ":method": "POST", @@ -325,7 +325,7 @@ "Authorization": "Sanitized", "Content-Length": "61", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "name": "go-test-vault-1", @@ -359,14 +359,14 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -441,7 +441,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-11-01-preview", "RequestMethod": "PATCH", "RequestHeaders": { "Accept": "application/json", @@ -449,7 +449,7 @@ "Authorization": "Sanitized", "Content-Length": "29", "Content-Type": "application/json", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": { "tags": { @@ -530,13 +530,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/go-sdk-test-rg/providers/Microsoft.KeyVault/vaults/go-test-vault-1?api-version=2021-11-01-preview", "RequestMethod": "DELETE", "RequestHeaders": { "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -560,14 +560,14 @@ "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/deletedVaults/go-test-vault-1?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/deletedVaults/go-test-vault-1?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -607,7 +607,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/deletedVaults/go-test-vault-1/purge?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/deletedVaults/go-test-vault-1/purge?api-version=2021-11-01-preview", "RequestMethod": "POST", "RequestHeaders": { ":method": "POST", @@ -615,7 +615,7 @@ "Accept-Encoding": "gzip", "Authorization": "Sanitized", "Content-Length": "0", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -624,7 +624,7 @@ "Content-Length": "0", "Date": "Mon, 16 May 2022 12:37:56 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -641,13 +641,13 @@ "ResponseBody": null }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -657,7 +657,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:03 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -677,13 +677,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -693,7 +693,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:08 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -713,13 +713,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -729,7 +729,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:14 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -749,13 +749,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -765,7 +765,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:21 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -785,13 +785,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -801,7 +801,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:27 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -821,13 +821,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -837,7 +837,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:32 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -857,13 +857,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -873,7 +873,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:39 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -893,13 +893,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -909,7 +909,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:44 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -929,13 +929,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, @@ -945,7 +945,7 @@ "Content-Type": "application/json; charset=utf-8", "Date": "Mon, 16 May 2022 12:38:49 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "Location": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "Pragma": "no-cache", "Retry-After": "5", "Server": "Microsoft-IIS/10.0", @@ -965,13 +965,13 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-10-01", + "RequestUri": "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.KeyVault/locations/eastus/operationResults/VVR8MDYzNzg4MzAxNDc3NjE5MjY3NXw2RjhDODJDRTQwNTI0OTgyQjFBNUJFMUM5OUNCNTFGNA?api-version=2021-11-01-preview", "RequestMethod": "GET", "RequestHeaders": { ":method": "GET", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armkeyvault/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armkeyvault/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 200, @@ -1008,7 +1008,7 @@ "Accept": "application/json", "Accept-Encoding": "gzip", "Authorization": "Sanitized", - "User-Agent": "azsdk-go-armresources/v1.0.0 (go1.18; Windows_NT)" + "User-Agent": "azsdk-go-armresources/1.1.0-beta.1 (go1.18; Windows_NT)" }, "RequestBody": null, "StatusCode": 202, diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_keys_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_keys_client_test.go index 4fe44bae6e29..ad505511bd51 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_keys_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_keys_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/createKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/createKey.json func ExampleKeysClient_CreateIfNotExist() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleKeysClient_CreateIfNotExist() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/getKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/getKey.json func ExampleKeysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleKeysClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listKeys.json func ExampleKeysClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleKeysClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/getKeyVersion.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/getKeyVersion.json func ExampleKeysClient_GetVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,7 +118,7 @@ func ExampleKeysClient_GetVersion() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listKeyVersions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listKeyVersions.json func ExampleKeysClient_NewListVersionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_managedhsms_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_managedhsms_client_test.go index 7bace9803f68..f33122ece142 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_managedhsms_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_managedhsms_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_CreateOrUpdate.json func ExampleManagedHsmsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleManagedHsmsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_Update.json func ExampleManagedHsmsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExampleManagedHsmsClient_BeginUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_Delete.json func ExampleManagedHsmsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -119,7 +119,7 @@ func ExampleManagedHsmsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_Get.json func ExampleManagedHsmsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -141,7 +141,7 @@ func ExampleManagedHsmsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_ListByResourceGroup.json func ExampleManagedHsmsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -166,7 +166,7 @@ func ExampleManagedHsmsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_ListBySubscription.json func ExampleManagedHsmsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -190,7 +190,7 @@ func ExampleManagedHsmsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/DeletedManagedHsm_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/DeletedManagedHsm_List.json func ExampleManagedHsmsClient_NewListDeletedPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -214,7 +214,7 @@ func ExampleManagedHsmsClient_NewListDeletedPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/DeletedManagedHsm_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/DeletedManagedHsm_Get.json func ExampleManagedHsmsClient_GetDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -236,7 +236,7 @@ func ExampleManagedHsmsClient_GetDeleted() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/DeletedManagedHsm_Purge.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/DeletedManagedHsm_Purge.json func ExampleManagedHsmsClient_BeginPurgeDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivateendpointconnections_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivateendpointconnections_client_test.go index 386b458ddb2c..e27c800bfb77 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivateendpointconnections_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_ListPrivateEndpointConnectionsByResource.json func ExampleMHSMPrivateEndpointConnectionsClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleMHSMPrivateEndpointConnectionsClient_NewListByResourcePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_getPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_getPrivateEndpointConnection.json func ExampleMHSMPrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleMHSMPrivateEndpointConnectionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_putPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_putPrivateEndpointConnection.json func ExampleMHSMPrivateEndpointConnectionsClient_Put() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleMHSMPrivateEndpointConnectionsClient_Put() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_deletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_deletePrivateEndpointConnection.json func ExampleMHSMPrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivatelinkresources_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivatelinkresources_client_test.go index f3b22d876a65..67aeb637875b 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivatelinkresources_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_mhsmprivatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/ManagedHsm_listPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/ManagedHsm_listPrivateLinkResources.json func ExampleMHSMPrivateLinkResourcesClient_ListByMHSMResource() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_operations_client_test.go index 6c9e3e0ee7a2..409fdab2b35e 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privateendpointconnections_client_test.go index c592a1fc504d..b0e5e689daf6 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/getPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/getPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/putPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/putPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Put() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +72,7 @@ func ExamplePrivateEndpointConnectionsClient_Put() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/deletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/deletePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_NewListByResourcePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privatelinkresources_client_test.go index ee3cb9d6fb77..30d91621682d 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_privatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_ListByVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_secrets_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_secrets_client_test.go index e4499025f2e2..c10351dbc1b5 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_secrets_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_secrets_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/createSecret.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/createSecret.json func ExampleSecretsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleSecretsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/updateSecret.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/updateSecret.json func ExampleSecretsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -73,7 +73,7 @@ func ExampleSecretsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/getSecret.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/getSecret.json func ExampleSecretsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -96,7 +96,7 @@ func ExampleSecretsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listSecrets.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listSecrets.json func ExampleSecretsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_vaults_client_test.go b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_vaults_client_test.go index 735a45ede8bc..3ea10603e53d 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_vaults_client_test.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/ze_generated_example_vaults_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/createVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/createVault.json func ExampleVaultsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,7 +105,7 @@ func ExampleVaultsClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/updateVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/updateVault.json func ExampleVaultsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -188,7 +188,7 @@ func ExampleVaultsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/deleteVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/deleteVault.json func ExampleVaultsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -208,7 +208,7 @@ func ExampleVaultsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/getVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/getVault.json func ExampleVaultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -230,7 +230,7 @@ func ExampleVaultsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/updateAccessPoliciesAdd.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/updateAccessPoliciesAdd.json func ExampleVaultsClient_UpdateAccessPolicy() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -270,7 +270,7 @@ func ExampleVaultsClient_UpdateAccessPolicy() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listVaultByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listVaultByResourceGroup.json func ExampleVaultsClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -295,7 +295,7 @@ func ExampleVaultsClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listVaultBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listVaultBySubscription.json func ExampleVaultsClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -319,7 +319,7 @@ func ExampleVaultsClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listDeletedVaults.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listDeletedVaults.json func ExampleVaultsClient_NewListDeletedPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -343,7 +343,7 @@ func ExampleVaultsClient_NewListDeletedPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/getDeletedVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/getDeletedVault.json func ExampleVaultsClient_GetDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -365,7 +365,7 @@ func ExampleVaultsClient_GetDeleted() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/purgeDeletedVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/purgeDeletedVault.json func ExampleVaultsClient_BeginPurgeDeleted() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -389,7 +389,7 @@ func ExampleVaultsClient_BeginPurgeDeleted() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/listVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/listVault.json func ExampleVaultsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -413,7 +413,7 @@ func ExampleVaultsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/stable/2021-10-01/examples/checkVaultNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/keyvault/resource-manager/Microsoft.KeyVault/preview/2021-11-01-preview/examples/checkVaultNameAvailability.json func ExampleVaultsClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_constants.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_constants.go index 7e995b84aa1b..a0d8d142ce87 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_constants.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_constants.go @@ -10,7 +10,7 @@ package armkeyvault const ( moduleName = "armkeyvault" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) type AccessPolicyUpdateKind string @@ -174,6 +174,7 @@ const ( JSONWebKeyOperationDecrypt JSONWebKeyOperation = "decrypt" JSONWebKeyOperationEncrypt JSONWebKeyOperation = "encrypt" JSONWebKeyOperationImport JSONWebKeyOperation = "import" + JSONWebKeyOperationRelease JSONWebKeyOperation = "release" JSONWebKeyOperationSign JSONWebKeyOperation = "sign" JSONWebKeyOperationUnwrapKey JSONWebKeyOperation = "unwrapKey" JSONWebKeyOperationVerify JSONWebKeyOperation = "verify" @@ -186,6 +187,7 @@ func PossibleJSONWebKeyOperationValues() []JSONWebKeyOperation { JSONWebKeyOperationDecrypt, JSONWebKeyOperationEncrypt, JSONWebKeyOperationImport, + JSONWebKeyOperationRelease, JSONWebKeyOperationSign, JSONWebKeyOperationUnwrapKey, JSONWebKeyOperationVerify, @@ -216,23 +218,27 @@ func PossibleJSONWebKeyTypeValues() []JSONWebKeyType { type KeyPermissions string const ( - KeyPermissionsAll KeyPermissions = "all" - KeyPermissionsBackup KeyPermissions = "backup" - KeyPermissionsCreate KeyPermissions = "create" - KeyPermissionsDecrypt KeyPermissions = "decrypt" - KeyPermissionsDelete KeyPermissions = "delete" - KeyPermissionsEncrypt KeyPermissions = "encrypt" - KeyPermissionsGet KeyPermissions = "get" - KeyPermissionsImport KeyPermissions = "import" - KeyPermissionsList KeyPermissions = "list" - KeyPermissionsPurge KeyPermissions = "purge" - KeyPermissionsRecover KeyPermissions = "recover" - KeyPermissionsRestore KeyPermissions = "restore" - KeyPermissionsSign KeyPermissions = "sign" - KeyPermissionsUnwrapKey KeyPermissions = "unwrapKey" - KeyPermissionsUpdate KeyPermissions = "update" - KeyPermissionsVerify KeyPermissions = "verify" - KeyPermissionsWrapKey KeyPermissions = "wrapKey" + KeyPermissionsAll KeyPermissions = "all" + KeyPermissionsBackup KeyPermissions = "backup" + KeyPermissionsCreate KeyPermissions = "create" + KeyPermissionsDecrypt KeyPermissions = "decrypt" + KeyPermissionsDelete KeyPermissions = "delete" + KeyPermissionsEncrypt KeyPermissions = "encrypt" + KeyPermissionsGet KeyPermissions = "get" + KeyPermissionsGetrotationpolicy KeyPermissions = "getrotationpolicy" + KeyPermissionsImport KeyPermissions = "import" + KeyPermissionsList KeyPermissions = "list" + KeyPermissionsPurge KeyPermissions = "purge" + KeyPermissionsRecover KeyPermissions = "recover" + KeyPermissionsRelease KeyPermissions = "release" + KeyPermissionsRestore KeyPermissions = "restore" + KeyPermissionsRotate KeyPermissions = "rotate" + KeyPermissionsSetrotationpolicy KeyPermissions = "setrotationpolicy" + KeyPermissionsSign KeyPermissions = "sign" + KeyPermissionsUnwrapKey KeyPermissions = "unwrapKey" + KeyPermissionsUpdate KeyPermissions = "update" + KeyPermissionsVerify KeyPermissions = "verify" + KeyPermissionsWrapKey KeyPermissions = "wrapKey" ) // PossibleKeyPermissionsValues returns the possible values for the KeyPermissions const type. @@ -245,11 +251,15 @@ func PossibleKeyPermissionsValues() []KeyPermissions { KeyPermissionsDelete, KeyPermissionsEncrypt, KeyPermissionsGet, + KeyPermissionsGetrotationpolicy, KeyPermissionsImport, KeyPermissionsList, KeyPermissionsPurge, KeyPermissionsRecover, + KeyPermissionsRelease, KeyPermissionsRestore, + KeyPermissionsRotate, + KeyPermissionsSetrotationpolicy, KeyPermissionsSign, KeyPermissionsUnwrapKey, KeyPermissionsUpdate, @@ -258,6 +268,22 @@ func PossibleKeyPermissionsValues() []KeyPermissions { } } +// KeyRotationPolicyActionType - The type of action. +type KeyRotationPolicyActionType string + +const ( + KeyRotationPolicyActionTypeRotate KeyRotationPolicyActionType = "rotate" + KeyRotationPolicyActionTypeNotify KeyRotationPolicyActionType = "notify" +) + +// PossibleKeyRotationPolicyActionTypeValues returns the possible values for the KeyRotationPolicyActionType const type. +func PossibleKeyRotationPolicyActionTypeValues() []KeyRotationPolicyActionType { + return []KeyRotationPolicyActionType{ + KeyRotationPolicyActionTypeRotate, + KeyRotationPolicyActionTypeNotify, + } +} + // ManagedHsmSKUFamily - SKU Family of the managed HSM Pool type ManagedHsmSKUFamily string diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_keys_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_keys_client.go index f9f68548bd44..5799f3cbddb9 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_keys_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_keys_client.go @@ -59,7 +59,7 @@ func NewKeysClient(subscriptionID string, credential azcore.TokenCredential, opt // key is returned without any write operations being performed. This API does not create subsequent // versions, and does not update existing keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group which contains the specified key vault. // vaultName - The name of the key vault which contains the key to be created. // keyName - The name of the key to be created. @@ -104,7 +104,7 @@ func (client *KeysClient) createIfNotExistCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,7 +121,7 @@ func (client *KeysClient) createIfNotExistHandleResponse(resp *http.Response) (K // Get - Gets the current version of the specified key from the specified key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group which contains the specified key vault. // vaultName - The name of the vault which contains the key to be retrieved. // keyName - The name of the key to be retrieved. @@ -165,7 +165,7 @@ func (client *KeysClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,7 +182,7 @@ func (client *KeysClient) getHandleResponse(resp *http.Response) (KeysClientGetR // GetVersion - Gets the specified version of the specified key in the specified key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group which contains the specified key vault. // vaultName - The name of the vault which contains the key version to be retrieved. // keyName - The name of the key version to be retrieved. @@ -231,7 +231,7 @@ func (client *KeysClient) getVersionCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *KeysClient) getVersionHandleResponse(resp *http.Response) (KeysCli // NewListPager - Lists the keys in the specified key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group which contains the specified key vault. // vaultName - The name of the vault which contains the keys to be retrieved. // options - KeysClientListOptions contains the optional parameters for the KeysClient.List method. @@ -300,7 +300,7 @@ func (client *KeysClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,7 +317,7 @@ func (client *KeysClient) listHandleResponse(resp *http.Response) (KeysClientLis // NewListVersionsPager - Lists the versions of the specified key in the specified key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the resource group which contains the specified key vault. // vaultName - The name of the vault which contains the key versions to be retrieved. // keyName - The name of the key versions to be retrieved. @@ -374,7 +374,7 @@ func (client *KeysClient) listVersionsCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_managedhsms_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_managedhsms_client.go index 46eaa4b4ee2a..cb2fc5e28deb 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_managedhsms_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_managedhsms_client.go @@ -58,7 +58,7 @@ func NewManagedHsmsClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Create or update a managed HSM Pool in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - Name of the managed HSM Pool // parameters - Parameters to create or update the managed HSM Pool @@ -78,7 +78,7 @@ func (client *ManagedHsmsClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Create or update a managed HSM Pool in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *ManagedHsmsClient) createOrUpdate(ctx context.Context, resourceGroupName string, name string, parameters ManagedHsm, options *ManagedHsmsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, name, parameters, options) if err != nil { @@ -114,7 +114,7 @@ func (client *ManagedHsmsClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,7 +122,7 @@ func (client *ManagedHsmsClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes the specified managed HSM Pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - The name of the managed HSM Pool to delete // options - ManagedHsmsClientBeginDeleteOptions contains the optional parameters for the ManagedHsmsClient.BeginDelete method. @@ -140,7 +140,7 @@ func (client *ManagedHsmsClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes the specified managed HSM Pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *ManagedHsmsClient) deleteOperation(ctx context.Context, resourceGroupName string, name string, options *ManagedHsmsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, options) if err != nil { @@ -176,7 +176,7 @@ func (client *ManagedHsmsClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,7 +184,7 @@ func (client *ManagedHsmsClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the specified managed HSM Pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - The name of the managed HSM Pool. // options - ManagedHsmsClientGetOptions contains the optional parameters for the ManagedHsmsClient.Get method. @@ -223,7 +223,7 @@ func (client *ManagedHsmsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +240,7 @@ func (client *ManagedHsmsClient) getHandleResponse(resp *http.Response) (Managed // GetDeleted - Gets the specified deleted managed HSM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // name - The name of the deleted managed HSM. // location - The location of the deleted managed HSM. // options - ManagedHsmsClientGetDeletedOptions contains the optional parameters for the ManagedHsmsClient.GetDeleted method. @@ -279,7 +279,7 @@ func (client *ManagedHsmsClient) getDeletedCreateRequest(ctx context.Context, na return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,7 +297,7 @@ func (client *ManagedHsmsClient) getDeletedHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - The List operation gets information about the managed HSM Pools associated with the subscription // and within the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // options - ManagedHsmsClientListByResourceGroupOptions contains the optional parameters for the ManagedHsmsClient.ListByResourceGroup // method. @@ -348,7 +348,7 @@ func (client *ManagedHsmsClient) listByResourceGroupCreateRequest(ctx context.Co if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,7 +365,7 @@ func (client *ManagedHsmsClient) listByResourceGroupHandleResponse(resp *http.Re // NewListBySubscriptionPager - The List operation gets information about the managed HSM Pools associated with the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // options - ManagedHsmsClientListBySubscriptionOptions contains the optional parameters for the ManagedHsmsClient.ListBySubscription // method. func (client *ManagedHsmsClient) NewListBySubscriptionPager(options *ManagedHsmsClientListBySubscriptionOptions) *runtime.Pager[ManagedHsmsClientListBySubscriptionResponse] { @@ -411,7 +411,7 @@ func (client *ManagedHsmsClient) listBySubscriptionCreateRequest(ctx context.Con if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,7 +428,7 @@ func (client *ManagedHsmsClient) listBySubscriptionHandleResponse(resp *http.Res // NewListDeletedPager - The List operation gets information about the deleted managed HSMs associated with the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // options - ManagedHsmsClientListDeletedOptions contains the optional parameters for the ManagedHsmsClient.ListDeleted method. func (client *ManagedHsmsClient) NewListDeletedPager(options *ManagedHsmsClientListDeletedOptions) *runtime.Pager[ManagedHsmsClientListDeletedResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedHsmsClientListDeletedResponse]{ @@ -470,7 +470,7 @@ func (client *ManagedHsmsClient) listDeletedCreateRequest(ctx context.Context, o return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -487,7 +487,7 @@ func (client *ManagedHsmsClient) listDeletedHandleResponse(resp *http.Response) // BeginPurgeDeleted - Permanently deletes the specified managed HSM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // name - The name of the soft-deleted managed HSM. // location - The location of the soft-deleted managed HSM. // options - ManagedHsmsClientBeginPurgeDeletedOptions contains the optional parameters for the ManagedHsmsClient.BeginPurgeDeleted @@ -506,7 +506,7 @@ func (client *ManagedHsmsClient) BeginPurgeDeleted(ctx context.Context, name str // PurgeDeleted - Permanently deletes the specified managed HSM. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *ManagedHsmsClient) purgeDeleted(ctx context.Context, name string, location string, options *ManagedHsmsClientBeginPurgeDeletedOptions) (*http.Response, error) { req, err := client.purgeDeletedCreateRequest(ctx, name, location, options) if err != nil { @@ -542,7 +542,7 @@ func (client *ManagedHsmsClient) purgeDeletedCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -550,7 +550,7 @@ func (client *ManagedHsmsClient) purgeDeletedCreateRequest(ctx context.Context, // BeginUpdate - Update a managed HSM Pool in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - Name of the managed HSM Pool // parameters - Parameters to patch the managed HSM Pool @@ -569,7 +569,7 @@ func (client *ManagedHsmsClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - Update a managed HSM Pool in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *ManagedHsmsClient) update(ctx context.Context, resourceGroupName string, name string, parameters ManagedHsm, options *ManagedHsmsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, name, parameters, options) if err != nil { @@ -605,7 +605,7 @@ func (client *ManagedHsmsClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivateendpointconnections_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivateendpointconnections_client.go index e7ab85843942..f161f1d181f6 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivateendpointconnections_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivateendpointconnections_client.go @@ -58,7 +58,7 @@ func NewMHSMPrivateEndpointConnectionsClient(subscriptionID string, credential a // BeginDelete - Deletes the specified private endpoint connection associated with the managed hsm pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - Name of the managed HSM Pool // privateEndpointConnectionName - Name of the private endpoint connection associated with the managed hsm pool. @@ -78,7 +78,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) BeginDelete(ctx context.Cont // Delete - Deletes the specified private endpoint connection associated with the managed hsm pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *MHSMPrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, options *MHSMPrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, name, privateEndpointConnectionName, options) if err != nil { @@ -118,7 +118,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) deleteCreateRequest(ctx cont // Get - Gets the specified private endpoint connection associated with the managed HSM Pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - Name of the managed HSM Pool // privateEndpointConnectionName - Name of the private endpoint connection associated with the managed hsm pool. @@ -171,7 +171,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) getHandleResponse(resp *http // NewListByResourcePager - The List operation gets information about the private endpoint connections associated with the // managed HSM Pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - Name of the managed HSM Pool // options - MHSMPrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the MHSMPrivateEndpointConnectionsClient.ListByResource @@ -242,7 +242,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) listByResourceCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) listByResourceHandleResponse // Put - Updates the specified private endpoint connection associated with the managed hsm pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - Name of the managed HSM Pool // privateEndpointConnectionName - Name of the private endpoint connection associated with the managed hsm pool. @@ -305,7 +305,7 @@ func (client *MHSMPrivateEndpointConnectionsClient) putCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivatelinkresources_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivatelinkresources_client.go index e6579929a021..f90f3d3f732f 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivatelinkresources_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_mhsmprivatelinkresources_client.go @@ -57,7 +57,7 @@ func NewMHSMPrivateLinkResourcesClient(subscriptionID string, credential azcore. // ListByMHSMResource - Gets the private link resources supported for the managed hsm pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the managed HSM pool. // name - Name of the managed HSM Pool // options - MHSMPrivateLinkResourcesClientListByMHSMResourceOptions contains the optional parameters for the MHSMPrivateLinkResourcesClient.ListByMHSMResource @@ -97,7 +97,7 @@ func (client *MHSMPrivateLinkResourcesClient) listByMHSMResourceCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models.go index 6b63115931b1..251559f2b5f2 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models.go @@ -27,6 +27,11 @@ type AccessPolicyEntry struct { ApplicationID *string `json:"applicationId,omitempty"` } +type Action struct { + // The type of action. + Type *KeyRotationPolicyActionType `json:"type,omitempty"` +} + // Attributes - The object attributes managed by the KeyVault service. type Attributes struct { // Determines whether the object is enabled. @@ -273,6 +278,12 @@ type KeyProperties struct { // The type of the key. For valid values, see JsonWebKeyType. Kty *JSONWebKeyType `json:"kty,omitempty"` + // Key release policy in response. It will be used for both output and input. Omitted if empty + ReleasePolicy *KeyReleasePolicy `json:"release_policy,omitempty"` + + // Key rotation policy in response. It will be used for both output and input. Omitted if empty + RotationPolicy *RotationPolicy `json:"rotationPolicy,omitempty"` + // READ-ONLY; The URI to retrieve the current version of the key. KeyURI *string `json:"keyUri,omitempty" azure:"ro"` @@ -280,6 +291,25 @@ type KeyProperties struct { KeyURIWithVersion *string `json:"keyUriWithVersion,omitempty" azure:"ro"` } +type KeyReleasePolicy struct { + // Content type and version of key release policy + ContentType *string `json:"contentType,omitempty"` + + // Blob encoding the policy rules under which the key can be released. + Data []byte `json:"data,omitempty"` +} + +type KeyRotationPolicyAttributes struct { + // The expiration time for the new key version. It should be in ISO8601 format. Eg: 'P90D', 'P1Y'. + ExpiryTime *string `json:"expiryTime,omitempty"` + + // READ-ONLY; Creation time in seconds since 1970-01-01T00:00:00Z. + Created *int64 `json:"created,omitempty" azure:"ro"` + + // READ-ONLY; Last updated time in seconds since 1970-01-01T00:00:00Z. + Updated *int64 `json:"updated,omitempty" azure:"ro"` +} + // KeysClientCreateIfNotExistOptions contains the optional parameters for the KeysClient.CreateIfNotExist method. type KeysClientCreateIfNotExistOptions struct { // placeholder for future optional parameters @@ -305,6 +335,14 @@ type KeysClientListVersionsOptions struct { // placeholder for future optional parameters } +type LifetimeAction struct { + // The action of key rotation policy lifetimeAction. + Action *Action `json:"action,omitempty"` + + // The trigger of key rotation policy lifetimeAction. + Trigger *Trigger `json:"trigger,omitempty"` +} + // LogSpecification - Log specification of operation. type LogSpecification struct { // Blob duration of specification. @@ -967,6 +1005,14 @@ type ResourceListResult struct { Value []*Resource `json:"value,omitempty"` } +type RotationPolicy struct { + // The attributes of key rotation policy. + Attributes *KeyRotationPolicyAttributes `json:"attributes,omitempty"` + + // The lifetimeActions for key rotation action. + LifetimeActions []*LifetimeAction `json:"lifetimeActions,omitempty"` +} + // SKU details type SKU struct { // REQUIRED; SKU family name @@ -1125,6 +1171,15 @@ type SystemData struct { LastModifiedByType *IdentityType `json:"lastModifiedByType,omitempty"` } +type Trigger struct { + // The time duration after key creation to rotate the key. It only applies to rotate. It will be in ISO 8601 duration format. + // Eg: 'P90D', 'P1Y'. + TimeAfterCreate *string `json:"timeAfterCreate,omitempty"` + + // The time duration before key expiring to rotate or notify. It will be in ISO 8601 duration format. Eg: 'P90D', 'P1Y'. + TimeBeforeExpiry *string `json:"timeBeforeExpiry,omitempty"` +} + // Vault - Resource information with extended details. type Vault struct { // REQUIRED; Properties of the vault @@ -1231,9 +1286,9 @@ type VaultPatchProperties struct { // Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) // for authorization of data actions, and the access policies specified in vault - // properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any - // policy stored on Azure Resource Manager will be ignored. If null or not - // specified, the value of this property will not change. + // properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies + // specified in vault properties, and any policy stored on Azure Resource Manager + // will be ignored. If null or not specified, the value of this property will not change. EnableRbacAuthorization *bool `json:"enableRbacAuthorization,omitempty"` // Property to specify whether the 'soft delete' functionality is enabled for this key vault. Once set to true, it cannot @@ -1294,10 +1349,10 @@ type VaultProperties struct { // Property that controls how data actions are authorized. When true, the key vault will use Role Based Access Control (RBAC) // for authorization of data actions, and the access policies specified in vault - // properties will be ignored. When false, the key vault will use the access policies specified in vault properties, and any - // policy stored on Azure Resource Manager will be ignored. If null or not - // specified, the vault is created with the default value of false. Note that management actions are always authorized with - // RBAC. + // properties will be ignored (warning: this is a preview feature). When false, the key vault will use the access policies + // specified in vault properties, and any policy stored on Azure Resource Manager + // will be ignored. If null or not specified, the vault is created with the default value of false. Note that management actions + // are always authorized with RBAC. EnableRbacAuthorization *bool `json:"enableRbacAuthorization,omitempty"` // Property to specify whether the 'soft delete' functionality is enabled for this key vault. If it's not set to any value(true diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models_serde.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models_serde.go index 95d14a8bc14a..711c77411c0a 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models_serde.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_models_serde.go @@ -12,6 +12,7 @@ import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "reflect" ) @@ -158,9 +159,42 @@ func (k KeyProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "keyUri", k.KeyURI) populate(objectMap, "keyUriWithVersion", k.KeyURIWithVersion) populate(objectMap, "kty", k.Kty) + populate(objectMap, "release_policy", k.ReleasePolicy) + populate(objectMap, "rotationPolicy", k.RotationPolicy) return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type KeyReleasePolicy. +func (k KeyReleasePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "contentType", k.ContentType) + populateByteArray(objectMap, "data", k.Data, runtime.Base64URLFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyReleasePolicy. +func (k *KeyReleasePolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentType": + err = unpopulate(val, "ContentType", &k.ContentType) + delete(rawMsg, key) + case "data": + err = runtime.DecodeByteArray(string(val), &k.Data, runtime.Base64URLFormat) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MHSMNetworkRuleSet. func (m MHSMNetworkRuleSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -376,6 +410,14 @@ func (r Resource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type RotationPolicy. +func (r RotationPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attributes", r.Attributes) + populate(objectMap, "lifetimeActions", r.LifetimeActions) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type Secret. func (s Secret) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -570,6 +612,16 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } +func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + func unpopulate(data json.RawMessage, fn string, v interface{}) error { if data == nil { return nil diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_operations_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_operations_client.go index 491d2b4d7d79..c8bc4f50e717 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_operations_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available Key Vault Rest API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privateendpointconnections_client.go index 679f54da3778..2c37f963ce96 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privateendpointconnections_client.go @@ -58,7 +58,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Deletes the specified private endpoint connection associated with the key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the key vault. // vaultName - The name of the key vault. // privateEndpointConnectionName - Name of the private endpoint connection associated with the key vault. @@ -78,7 +78,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified private endpoint connection associated with the key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, vaultName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, vaultName, privateEndpointConnectionName, options) if err != nil { @@ -118,7 +118,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,7 +126,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets the specified private endpoint connection associated with the key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the key vault. // vaultName - The name of the key vault. // privateEndpointConnectionName - Name of the private endpoint connection associated with the key vault. @@ -171,7 +171,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,7 +189,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByResourcePager - The List operation gets information about the private endpoint connections associated with the // vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the key vault. // vaultName - The name of the key vault. // options - PrivateEndpointConnectionsClientListByResourceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByResource @@ -242,7 +242,7 @@ func (client *PrivateEndpointConnectionsClient) listByResourceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *PrivateEndpointConnectionsClient) listByResourceHandleResponse(res // Put - Updates the specified private endpoint connection associated with the key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the key vault. // vaultName - The name of the key vault. // privateEndpointConnectionName - Name of the private endpoint connection associated with the key vault. @@ -305,7 +305,7 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, properties) diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privatelinkresources_client.go index 26b4acbfcfd9..720b74b51223 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_privatelinkresources_client.go @@ -57,7 +57,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // ListByVault - Gets the private link resources supported for the key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - Name of the resource group that contains the key vault. // vaultName - The name of the key vault. // options - PrivateLinkResourcesClientListByVaultOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByVault @@ -97,7 +97,7 @@ func (client *PrivateLinkResourcesClient) listByVaultCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_secrets_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_secrets_client.go index fe357bbbd7c5..ebe2ac8ccd98 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_secrets_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_secrets_client.go @@ -60,7 +60,7 @@ func NewSecretsClient(subscriptionID string, credential azcore.TokenCredential, // internal use in ARM deployments. Users should use the data-plane REST service for interaction // with vault secrets. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // vaultName - Name of the vault // secretName - Name of the secret @@ -105,7 +105,7 @@ func (client *SecretsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -123,7 +123,7 @@ func (client *SecretsClient) createOrUpdateHandleResponse(resp *http.Response) ( // Get - Gets the specified secret. NOTE: This API is intended for internal use in ARM deployments. Users should use the data-plane // REST service for interaction with vault secrets. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // vaultName - The name of the vault. // secretName - The name of the secret. @@ -167,7 +167,7 @@ func (client *SecretsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +186,7 @@ func (client *SecretsClient) getHandleResponse(resp *http.Response) (SecretsClie // use in ARM deployments. Users should use the data-plane REST service for interaction with // vault secrets. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // vaultName - The name of the vault. // options - SecretsClientListOptions contains the optional parameters for the SecretsClient.List method. @@ -241,7 +241,7 @@ func (client *SecretsClient) listCreateRequest(ctx context.Context, resourceGrou if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -259,7 +259,7 @@ func (client *SecretsClient) listHandleResponse(resp *http.Response) (SecretsCli // Update - Update a secret in the specified subscription. NOTE: This API is intended for internal use in ARM deployments. // Users should use the data-plane REST service for interaction with vault secrets. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // vaultName - Name of the vault // secretName - Name of the secret @@ -304,7 +304,7 @@ func (client *SecretsClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_vaults_client.go b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_vaults_client.go index 310e7d09ff55..fbda80eb56c9 100644 --- a/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_vaults_client.go +++ b/sdk/resourcemanager/keyvault/armkeyvault/zz_generated_vaults_client.go @@ -58,7 +58,7 @@ func NewVaultsClient(subscriptionID string, credential azcore.TokenCredential, o // CheckNameAvailability - Checks that the vault name is valid and is not already in use. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // vaultName - The name of the vault. // options - VaultsClientCheckNameAvailabilityOptions contains the optional parameters for the VaultsClient.CheckNameAvailability // method. @@ -89,7 +89,7 @@ func (client *VaultsClient) checkNameAvailabilityCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, vaultName) @@ -106,7 +106,7 @@ func (client *VaultsClient) checkNameAvailabilityHandleResponse(resp *http.Respo // BeginCreateOrUpdate - Create or update a key vault in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the server belongs. // vaultName - Name of the vault // parameters - Parameters to create or update the vault @@ -126,7 +126,7 @@ func (client *VaultsClient) BeginCreateOrUpdate(ctx context.Context, resourceGro // CreateOrUpdate - Create or update a key vault in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *VaultsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, parameters VaultCreateOrUpdateParameters, options *VaultsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, vaultName, parameters, options) if err != nil { @@ -162,7 +162,7 @@ func (client *VaultsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -170,7 +170,7 @@ func (client *VaultsClient) createOrUpdateCreateRequest(ctx context.Context, res // Delete - Deletes the specified Azure key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // vaultName - The name of the vault to delete // options - VaultsClientDeleteOptions contains the optional parameters for the VaultsClient.Delete method. @@ -209,7 +209,7 @@ func (client *VaultsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -217,7 +217,7 @@ func (client *VaultsClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the specified Azure key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // vaultName - The name of the vault. // options - VaultsClientGetOptions contains the optional parameters for the VaultsClient.Get method. @@ -256,7 +256,7 @@ func (client *VaultsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -273,7 +273,7 @@ func (client *VaultsClient) getHandleResponse(resp *http.Response) (VaultsClient // GetDeleted - Gets the deleted Azure key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // vaultName - The name of the vault. // location - The location of the deleted vault. // options - VaultsClientGetDeletedOptions contains the optional parameters for the VaultsClient.GetDeleted method. @@ -312,7 +312,7 @@ func (client *VaultsClient) getDeletedCreateRequest(ctx context.Context, vaultNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -329,7 +329,7 @@ func (client *VaultsClient) getDeletedHandleResponse(resp *http.Response) (Vault // NewListPager - The List operation gets information about the vaults associated with the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // options - VaultsClientListOptions contains the optional parameters for the VaultsClient.List method. func (client *VaultsClient) NewListPager(options *VaultsClientListOptions) *runtime.Pager[VaultsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VaultsClientListResponse]{ @@ -393,7 +393,7 @@ func (client *VaultsClient) listHandleResponse(resp *http.Response) (VaultsClien // NewListByResourceGroupPager - The List operation gets information about the vaults associated with the subscription and // within the specified resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // options - VaultsClientListByResourceGroupOptions contains the optional parameters for the VaultsClient.ListByResourceGroup // method. @@ -444,7 +444,7 @@ func (client *VaultsClient) listByResourceGroupCreateRequest(ctx context.Context if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -461,7 +461,7 @@ func (client *VaultsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListBySubscriptionPager - The List operation gets information about the vaults associated with the subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // options - VaultsClientListBySubscriptionOptions contains the optional parameters for the VaultsClient.ListBySubscription // method. func (client *VaultsClient) NewListBySubscriptionPager(options *VaultsClientListBySubscriptionOptions) *runtime.Pager[VaultsClientListBySubscriptionResponse] { @@ -507,7 +507,7 @@ func (client *VaultsClient) listBySubscriptionCreateRequest(ctx context.Context, if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -524,7 +524,7 @@ func (client *VaultsClient) listBySubscriptionHandleResponse(resp *http.Response // NewListDeletedPager - Gets information about the deleted vaults in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // options - VaultsClientListDeletedOptions contains the optional parameters for the VaultsClient.ListDeleted method. func (client *VaultsClient) NewListDeletedPager(options *VaultsClientListDeletedOptions) *runtime.Pager[VaultsClientListDeletedResponse] { return runtime.NewPager(runtime.PagingHandler[VaultsClientListDeletedResponse]{ @@ -566,7 +566,7 @@ func (client *VaultsClient) listDeletedCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -583,7 +583,7 @@ func (client *VaultsClient) listDeletedHandleResponse(resp *http.Response) (Vaul // BeginPurgeDeleted - Permanently deletes the specified vault. aka Purges the deleted Azure key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // vaultName - The name of the soft-deleted vault. // location - The location of the soft-deleted vault. // options - VaultsClientBeginPurgeDeletedOptions contains the optional parameters for the VaultsClient.BeginPurgeDeleted @@ -602,7 +602,7 @@ func (client *VaultsClient) BeginPurgeDeleted(ctx context.Context, vaultName str // PurgeDeleted - Permanently deletes the specified vault. aka Purges the deleted Azure key vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview func (client *VaultsClient) purgeDeleted(ctx context.Context, vaultName string, location string, options *VaultsClientBeginPurgeDeletedOptions) (*http.Response, error) { req, err := client.purgeDeletedCreateRequest(ctx, vaultName, location, options) if err != nil { @@ -638,7 +638,7 @@ func (client *VaultsClient) purgeDeletedCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -646,7 +646,7 @@ func (client *VaultsClient) purgeDeletedCreateRequest(ctx context.Context, vault // Update - Update a key vault in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the server belongs. // vaultName - Name of the vault // parameters - Parameters to patch the vault @@ -686,7 +686,7 @@ func (client *VaultsClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -703,7 +703,7 @@ func (client *VaultsClient) updateHandleResponse(resp *http.Response) (VaultsCli // UpdateAccessPolicy - Update access policies in a key vault in the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2021-11-01-preview // resourceGroupName - The name of the Resource Group to which the vault belongs. // vaultName - Name of the vault // operationKind - Name of the operation @@ -749,7 +749,7 @@ func (client *VaultsClient) updateAccessPolicyCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2021-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md b/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md index 08a6070a7b46..5a3ead296899 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md +++ b/sdk/resourcemanager/maintenance/armmaintenance/CHANGELOG.md @@ -1,5 +1,35 @@ # Release History +## 1.1.0-beta.1 (2022-05-19) +### Features Added + +- New const `TaskScopeResource` +- New const `RebootOptionsNever` +- New const `RebootOptionsAlways` +- New const `TaskScopeGlobal` +- New const `RebootOptionsIfRequired` +- New function `InputLinuxParameters.MarshalJSON() ([]byte, error)` +- New function `*ConfigurationAssignmentsClient.Get(context.Context, string, string, string, string, string, *ConfigurationAssignmentsClientGetOptions) (ConfigurationAssignmentsClientGetResponse, error)` +- New function `InputWindowsParameters.MarshalJSON() ([]byte, error)` +- New function `TaskProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleRebootOptionsValues() []RebootOptions` +- New function `SoftwareUpdateConfigurationTasks.MarshalJSON() ([]byte, error)` +- New function `PossibleTaskScopeValues() []TaskScope` +- New function `*ConfigurationAssignmentsClient.GetParent(context.Context, string, string, string, string, string, string, string, *ConfigurationAssignmentsClientGetParentOptions) (ConfigurationAssignmentsClientGetParentResponse, error)` +- New struct `ConfigurationAssignmentsClientGetOptions` +- New struct `ConfigurationAssignmentsClientGetParentOptions` +- New struct `ConfigurationAssignmentsClientGetParentResponse` +- New struct `ConfigurationAssignmentsClientGetResponse` +- New struct `ConfigurationAssignmentsWithinSubscriptionClientListOptions` +- New struct `ConfigurationAssignmentsWithinSubscriptionClientListResponse` +- New struct `InputLinuxParameters` +- New struct `InputPatchConfiguration` +- New struct `InputWindowsParameters` +- New struct `SoftwareUpdateConfigurationTasks` +- New struct `TaskProperties` +- New field `InstallPatches` in struct `ConfigurationProperties` + + ## 1.0.0 (2022-05-18) ### Breaking Changes diff --git a/sdk/resourcemanager/maintenance/armmaintenance/autorest.md b/sdk/resourcemanager/maintenance/armmaintenance/autorest.md index 200b1908f06d..5c75f1261d9c 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/autorest.md +++ b/sdk/resourcemanager/maintenance/armmaintenance/autorest.md @@ -4,11 +4,10 @@ ``` yaml azure-arm: true -tag: package-2021-05 require: -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/maintenance/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/d55b8005f05b040b852c15e74a0f3e36494a15e1/specification/maintenance/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/maintenance/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/maintenance/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 1.1.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdateforresourcegroup_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdateforresourcegroup_client_test.go index fe8e5957dd81..c6b0b82a4cb3 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdateforresourcegroup_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdateforresourcegroup_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdatesResourceGroup_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ApplyUpdatesResourceGroup_List.json func ExampleApplyUpdateForResourceGroupClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdates_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdates_client_test.go index 489249cbbd69..89cd8b21d56d 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdates_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_applyupdates_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_GetParent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ApplyUpdates_GetParent.json func ExampleApplyUpdatesClient_GetParent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleApplyUpdatesClient_GetParent() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ApplyUpdates_Get.json func ExampleApplyUpdatesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleApplyUpdatesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_CreateOrUpdateParent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ApplyUpdates_CreateOrUpdateParent.json func ExampleApplyUpdatesClient_CreateOrUpdateParent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -94,7 +94,7 @@ func ExampleApplyUpdatesClient_CreateOrUpdateParent() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ApplyUpdates_CreateOrUpdate.json func ExampleApplyUpdatesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,7 +118,7 @@ func ExampleApplyUpdatesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ApplyUpdates_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ApplyUpdates_List.json func ExampleApplyUpdatesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignments_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignments_client_test.go index 10806f3d57ae..1c7603b624b2 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignments_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignments_client_test.go @@ -17,7 +17,34 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_CreateOrUpdateParent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_GetParent.json +func ExampleConfigurationAssignmentsClient_GetParent() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetParent(ctx, + "examplerg", + "Microsoft.Compute", + "virtualMachineScaleSets", + "smdtest1", + "virtualMachines", + "smdvm1", + "workervmPolicy", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_CreateOrUpdateParent.json func ExampleConfigurationAssignmentsClient_CreateOrUpdateParent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -49,7 +76,7 @@ func ExampleConfigurationAssignmentsClient_CreateOrUpdateParent() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_DeleteParent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_DeleteParent.json func ExampleConfigurationAssignmentsClient_DeleteParent() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,7 +103,32 @@ func ExampleConfigurationAssignmentsClient_DeleteParent() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_Get.json +func ExampleConfigurationAssignmentsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armmaintenance.NewConfigurationAssignmentsClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "examplerg", + "Microsoft.Compute", + "virtualMachineScaleSets", + "smdtest1", + "workervmConfiguration", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_CreateOrUpdate.json func ExampleConfigurationAssignmentsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -106,7 +158,7 @@ func ExampleConfigurationAssignmentsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_Delete.json func ExampleConfigurationAssignmentsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -131,7 +183,7 @@ func ExampleConfigurationAssignmentsClient_Delete() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_ListParent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_ListParent.json func ExampleConfigurationAssignmentsClient_NewListParentPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -161,7 +213,7 @@ func ExampleConfigurationAssignmentsClient_NewListParentPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/ConfigurationAssignments_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignments_List.json func ExampleConfigurationAssignmentsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignmentswithinsubscription_client_test.go similarity index 65% rename from sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_operations_client_test.go rename to sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignmentswithinsubscription_client_test.go index 8af3ebbd2c37..ddf70cbfcab6 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_configurationassignmentswithinsubscription_client_test.go @@ -6,24 +6,24 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armappplatform_test +package armmaintenance_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/Operations_List.json -func ExampleOperationsClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/ConfigurationAssignmentsResultWithinSubscription_List.json +func ExampleConfigurationAssignmentsWithinSubscriptionClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewOperationsClient(cred, nil) + client, err := armmaintenance.NewConfigurationAssignmentsWithinSubscriptionClient("5b4b650e-28b9-4790-b3ab-ddbd88d727c4", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurations_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurations_client_test.go index d7a7d24eba9d..85cb67561311 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurations_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurations_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_GetForResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/MaintenanceConfigurations_GetForResource.json func ExampleConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleConfigurationsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_CreateOrUpdateForResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/MaintenanceConfigurations_CreateOrUpdateForResource.json func ExampleConfigurationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +56,7 @@ func ExampleConfigurationsClient_CreateOrUpdate() { armmaintenance.Configuration{ Location: to.Ptr("westus2"), Properties: &armmaintenance.ConfigurationProperties{ - MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeHost), + MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage), MaintenanceWindow: &armmaintenance.Window{ Duration: to.Ptr("05:00"), ExpirationDateTime: to.Ptr("9999-12-31 00:00"), @@ -76,7 +76,7 @@ func ExampleConfigurationsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_DeleteForResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/MaintenanceConfigurations_DeleteForResource.json func ExampleConfigurationsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -98,7 +98,7 @@ func ExampleConfigurationsClient_Delete() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_UpdateForResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/MaintenanceConfigurations_UpdateForResource.json func ExampleConfigurationsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -115,7 +115,7 @@ func ExampleConfigurationsClient_Update() { armmaintenance.Configuration{ Location: to.Ptr("westus2"), Properties: &armmaintenance.ConfigurationProperties{ - MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeHost), + MaintenanceScope: to.Ptr(armmaintenance.MaintenanceScopeOSImage), MaintenanceWindow: &armmaintenance.Window{ Duration: to.Ptr("05:00"), ExpirationDateTime: to.Ptr("9999-12-31 00:00"), @@ -135,7 +135,7 @@ func ExampleConfigurationsClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/MaintenanceConfigurations_List.json func ExampleConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go index dfe75e38b328..9c2069d32fd4 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_maintenanceconfigurationsforresourcegroup_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/MaintenanceConfigurationsResourceGroup_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/MaintenanceConfigurationsResourceGroup_List.json func ExampleConfigurationsForResourceGroupClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_operations_client_test.go index 9dfcf05254e3..efcbc7bc83d8 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/Operations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/Operations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_publicmaintenanceconfigurations_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_publicmaintenanceconfigurations_client_test.go index ad7830490003..02fe2c5fbbfe 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_publicmaintenanceconfigurations_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_publicmaintenanceconfigurations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/PublicMaintenanceConfigurations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/PublicMaintenanceConfigurations_List.json func ExamplePublicMaintenanceConfigurationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExamplePublicMaintenanceConfigurationsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/PublicMaintenanceConfigurations_GetForResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/PublicMaintenanceConfigurations_GetForResource.json func ExamplePublicMaintenanceConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_updates_client_test.go b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_updates_client_test.go index 501a5075465d..975c2a285bef 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_updates_client_test.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/ze_generated_example_updates_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/maintenance/armmaintenance" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/Updates_ListParent.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/Updates_ListParent.json func ExampleUpdatesClient_NewListParentPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleUpdatesClient_NewListParentPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/stable/2021-05-01/examples/Updates_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/maintenance/resource-manager/Microsoft.Maintenance/preview/2021-09-01-preview/examples/Updates_List.json func ExampleUpdatesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdateforresourcegroup_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdateforresourcegroup_client.go index b5d2c1b1ddd5..2434e0434b26 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdateforresourcegroup_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdateforresourcegroup_client.go @@ -57,7 +57,7 @@ func NewApplyUpdateForResourceGroupClient(subscriptionID string, credential azco // NewListPager - Get Configuration records within a subscription and resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource Group Name // options - ApplyUpdateForResourceGroupClientListOptions contains the optional parameters for the ApplyUpdateForResourceGroupClient.List // method. @@ -99,7 +99,7 @@ func (client *ApplyUpdateForResourceGroupClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdates_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdates_client.go index 2ce3dbf01811..94a4546932c8 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdates_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_applyupdates_client.go @@ -57,7 +57,7 @@ func NewApplyUpdatesClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Apply maintenance updates to resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -107,7 +107,7 @@ func (client *ApplyUpdatesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +124,7 @@ func (client *ApplyUpdatesClient) createOrUpdateHandleResponse(resp *http.Respon // CreateOrUpdateParent - Apply maintenance updates to resource with parent // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -184,7 +184,7 @@ func (client *ApplyUpdatesClient) createOrUpdateParentCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -201,7 +201,7 @@ func (client *ApplyUpdatesClient) createOrUpdateParentHandleResponse(resp *http. // Get - Track maintenance updates to resource // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -255,7 +255,7 @@ func (client *ApplyUpdatesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *ApplyUpdatesClient) getHandleResponse(resp *http.Response) (ApplyU // GetParent - Track maintenance updates to resource with parent // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // resourceParentType - Resource parent type // resourceParentName - Resource parent identifier @@ -336,7 +336,7 @@ func (client *ApplyUpdatesClient) getParentCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -353,7 +353,7 @@ func (client *ApplyUpdatesClient) getParentHandleResponse(resp *http.Response) ( // NewListPager - Get Configuration records within a subscription // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // options - ApplyUpdatesClientListOptions contains the optional parameters for the ApplyUpdatesClient.List method. func (client *ApplyUpdatesClient) NewListPager(options *ApplyUpdatesClientListOptions) *runtime.Pager[ApplyUpdatesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ApplyUpdatesClientListResponse]{ @@ -389,7 +389,7 @@ func (client *ApplyUpdatesClient) listCreateRequest(ctx context.Context, options return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignments_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignments_client.go index c6716ce5a16b..96f3770256ab 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignments_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignments_client.go @@ -57,7 +57,7 @@ func NewConfigurationAssignmentsClient(subscriptionID string, credential azcore. // CreateOrUpdate - Register configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -113,7 +113,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configurationAssignment) @@ -130,7 +130,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateHandleResponse(resp // CreateOrUpdateParent - Register configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -196,7 +196,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateParentCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configurationAssignment) @@ -213,7 +213,7 @@ func (client *ConfigurationAssignmentsClient) createOrUpdateParentHandleResponse // Delete - Unregister configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -268,7 +268,7 @@ func (client *ConfigurationAssignmentsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,7 +285,7 @@ func (client *ConfigurationAssignmentsClient) deleteHandleResponse(resp *http.Re // DeleteParent - Unregister configuration for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -350,7 +350,7 @@ func (client *ConfigurationAssignmentsClient) deleteParentCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,9 +365,163 @@ func (client *ConfigurationAssignmentsClient) deleteParentHandleResponse(resp *h return result, nil } +// Get - Get configuration for resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01-preview +// resourceGroupName - Resource group name +// providerName - Resource provider name +// resourceType - Resource type +// resourceName - Resource identifier +// configurationAssignmentName - Configuration assignment name +// options - ConfigurationAssignmentsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsClient.Get +// method. +func (client *ConfigurationAssignmentsClient) Get(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetOptions) (ConfigurationAssignmentsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName, options) + if err != nil { + return ConfigurationAssignmentsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ConfigurationAssignmentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationAssignmentsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ConfigurationAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, providerName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}" + 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 providerName == "" { + return nil, errors.New("parameter providerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerName}", url.PathEscape(providerName)) + if resourceType == "" { + return nil, errors.New("parameter resourceType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(resourceType)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if configurationAssignmentName == "" { + return nil, errors.New("parameter configurationAssignmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationAssignmentName}", url.PathEscape(configurationAssignmentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ConfigurationAssignmentsClient) getHandleResponse(resp *http.Response) (ConfigurationAssignmentsClientGetResponse, error) { + result := ConfigurationAssignmentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationAssignment); err != nil { + return ConfigurationAssignmentsClientGetResponse{}, err + } + return result, nil +} + +// GetParent - Get configuration for resource. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01-preview +// resourceGroupName - Resource group name +// providerName - Resource provider name +// resourceParentType - Resource parent type +// resourceParentName - Resource parent identifier +// resourceType - Resource type +// resourceName - Resource identifier +// configurationAssignmentName - Configuration assignment name +// options - ConfigurationAssignmentsClientGetParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.GetParent +// method. +func (client *ConfigurationAssignmentsClient) GetParent(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetParentOptions) (ConfigurationAssignmentsClientGetParentResponse, error) { + req, err := client.getParentCreateRequest(ctx, resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName, configurationAssignmentName, options) + if err != nil { + return ConfigurationAssignmentsClientGetParentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ConfigurationAssignmentsClientGetParentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationAssignmentsClientGetParentResponse{}, runtime.NewResponseError(resp) + } + return client.getParentHandleResponse(resp) +} + +// getParentCreateRequest creates the GetParent request. +func (client *ConfigurationAssignmentsClient) getParentCreateRequest(ctx context.Context, resourceGroupName string, providerName string, resourceParentType string, resourceParentName string, resourceType string, resourceName string, configurationAssignmentName string, options *ConfigurationAssignmentsClientGetParentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}" + 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 providerName == "" { + return nil, errors.New("parameter providerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{providerName}", url.PathEscape(providerName)) + if resourceParentType == "" { + return nil, errors.New("parameter resourceParentType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceParentType}", url.PathEscape(resourceParentType)) + if resourceParentName == "" { + return nil, errors.New("parameter resourceParentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceParentName}", url.PathEscape(resourceParentName)) + if resourceType == "" { + return nil, errors.New("parameter resourceType cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(resourceType)) + if resourceName == "" { + return nil, errors.New("parameter resourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) + if configurationAssignmentName == "" { + return nil, errors.New("parameter configurationAssignmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{configurationAssignmentName}", url.PathEscape(configurationAssignmentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getParentHandleResponse handles the GetParent response. +func (client *ConfigurationAssignmentsClient) getParentHandleResponse(resp *http.Response) (ConfigurationAssignmentsClientGetParentResponse, error) { + result := ConfigurationAssignmentsClientGetParentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ConfigurationAssignment); err != nil { + return ConfigurationAssignmentsClientGetParentResponse{}, err + } + return result, nil +} + // NewListPager - List configurationAssignments for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -424,7 +578,7 @@ func (client *ConfigurationAssignmentsClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -441,7 +595,7 @@ func (client *ConfigurationAssignmentsClient) listHandleResponse(resp *http.Resp // NewListParentPager - List configurationAssignments for resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -508,7 +662,7 @@ func (client *ConfigurationAssignmentsClient) listParentCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignmentswithinsubscription_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignmentswithinsubscription_client.go new file mode 100644 index 000000000000..3db900163942 --- /dev/null +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationassignmentswithinsubscription_client.go @@ -0,0 +1,110 @@ +//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 armmaintenance + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// ConfigurationAssignmentsWithinSubscriptionClient contains the methods for the ConfigurationAssignmentsWithinSubscription group. +// Don't use this type directly, use NewConfigurationAssignmentsWithinSubscriptionClient() instead. +type ConfigurationAssignmentsWithinSubscriptionClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewConfigurationAssignmentsWithinSubscriptionClient creates a new instance of ConfigurationAssignmentsWithinSubscriptionClient with the specified values. +// subscriptionID - Subscription credentials that uniquely identify a Microsoft Azure subscription. The subscription ID forms +// part of the URI for every service call. +// credential - used to authorize requests. Usually a credential from azidentity. +// options - pass nil to accept the default values. +func NewConfigurationAssignmentsWithinSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConfigurationAssignmentsWithinSubscriptionClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &ConfigurationAssignmentsWithinSubscriptionClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Get configuration assignment within a subscription +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-09-01-preview +// options - ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.List +// method. +func (client *ConfigurationAssignmentsWithinSubscriptionClient) NewListPager(options *ConfigurationAssignmentsWithinSubscriptionClientListOptions) *runtime.Pager[ConfigurationAssignmentsWithinSubscriptionClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ConfigurationAssignmentsWithinSubscriptionClientListResponse]{ + More: func(page ConfigurationAssignmentsWithinSubscriptionClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *ConfigurationAssignmentsWithinSubscriptionClientListResponse) (ConfigurationAssignmentsWithinSubscriptionClientListResponse, error) { + req, err := client.listCreateRequest(ctx, options) + if err != nil { + return ConfigurationAssignmentsWithinSubscriptionClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ConfigurationAssignmentsWithinSubscriptionClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ConfigurationAssignmentsWithinSubscriptionClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ConfigurationAssignmentsWithinSubscriptionClient) listCreateRequest(ctx context.Context, options *ConfigurationAssignmentsWithinSubscriptionClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Maintenance/configurationAssignments" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ConfigurationAssignmentsWithinSubscriptionClient) listHandleResponse(resp *http.Response) (ConfigurationAssignmentsWithinSubscriptionClientListResponse, error) { + result := ConfigurationAssignmentsWithinSubscriptionClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ListConfigurationAssignmentsResult); err != nil { + return ConfigurationAssignmentsWithinSubscriptionClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurations_client.go index fd07647d569f..3e9d401bb4a7 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurations_client.go @@ -57,7 +57,7 @@ func NewConfigurationsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or Update configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource Group Name // resourceName - Maintenance Configuration Name // configuration - The configuration @@ -98,7 +98,7 @@ func (client *ConfigurationsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configuration) @@ -115,7 +115,7 @@ func (client *ConfigurationsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Delete Configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource Group Name // resourceName - Maintenance Configuration Name // options - ConfigurationsClientDeleteOptions contains the optional parameters for the ConfigurationsClient.Delete method. @@ -154,7 +154,7 @@ func (client *ConfigurationsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *ConfigurationsClient) deleteHandleResponse(resp *http.Response) (C // Get - Get Configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource Group Name // resourceName - Maintenance Configuration Name // options - ConfigurationsClientGetOptions contains the optional parameters for the ConfigurationsClient.Get method. @@ -210,7 +210,7 @@ func (client *ConfigurationsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -227,7 +227,7 @@ func (client *ConfigurationsClient) getHandleResponse(resp *http.Response) (Conf // NewListPager - Get Configuration records within a subscription // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // options - ConfigurationsClientListOptions contains the optional parameters for the ConfigurationsClient.List method. func (client *ConfigurationsClient) NewListPager(options *ConfigurationsClientListOptions) *runtime.Pager[ConfigurationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConfigurationsClientListResponse]{ @@ -263,7 +263,7 @@ func (client *ConfigurationsClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -280,7 +280,7 @@ func (client *ConfigurationsClient) listHandleResponse(resp *http.Response) (Con // Update - Patch configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource Group Name // resourceName - Maintenance Configuration Name // configuration - The configuration @@ -320,7 +320,7 @@ func (client *ConfigurationsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, configuration) diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationsforresourcegroup_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationsforresourcegroup_client.go index b42bd9ce9097..e1e876918dfc 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationsforresourcegroup_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_configurationsforresourcegroup_client.go @@ -57,7 +57,7 @@ func NewConfigurationsForResourceGroupClient(subscriptionID string, credential a // NewListPager - Get Configuration records within a subscription and resource group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource Group Name // options - ConfigurationsForResourceGroupClientListOptions contains the optional parameters for the ConfigurationsForResourceGroupClient.List // method. @@ -99,7 +99,7 @@ func (client *ConfigurationsForResourceGroupClient) listCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_constants.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_constants.go index 31e6ca208ab5..501ba2ba9962 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_constants.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_constants.go @@ -10,7 +10,7 @@ package armmaintenance const ( moduleName = "armmaintenance" - moduleVersion = "v1.0.0" + moduleVersion = "v1.1.0-beta.1" ) // CreatedByType - The type of identity that created the resource. @@ -88,6 +88,41 @@ func PossibleMaintenanceScopeValues() []MaintenanceScope { } } +// RebootOptions - Possible reboot preference as defined by the user based on which it would be decided to reboot the machine +// or not after the patch operation is completed. +type RebootOptions string + +const ( + RebootOptionsAlways RebootOptions = "Always" + RebootOptionsIfRequired RebootOptions = "IfRequired" + RebootOptionsNever RebootOptions = "Never" +) + +// PossibleRebootOptionsValues returns the possible values for the RebootOptions const type. +func PossibleRebootOptionsValues() []RebootOptions { + return []RebootOptions{ + RebootOptionsAlways, + RebootOptionsIfRequired, + RebootOptionsNever, + } +} + +// TaskScope - Global Task execute once when schedule trigger. Resource task execute for each VM. +type TaskScope string + +const ( + TaskScopeGlobal TaskScope = "Global" + TaskScopeResource TaskScope = "Resource" +) + +// PossibleTaskScopeValues returns the possible values for the TaskScope const type. +func PossibleTaskScopeValues() []TaskScope { + return []TaskScope{ + TaskScopeGlobal, + TaskScopeResource, + } +} + // UpdateStatus - The status type UpdateStatus string diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models.go index d5f0e8bb3e31..8a1b68df1132 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models.go @@ -150,6 +150,17 @@ type ConfigurationAssignmentsClientDeleteParentOptions struct { // placeholder for future optional parameters } +// ConfigurationAssignmentsClientGetOptions contains the optional parameters for the ConfigurationAssignmentsClient.Get method. +type ConfigurationAssignmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConfigurationAssignmentsClientGetParentOptions contains the optional parameters for the ConfigurationAssignmentsClient.GetParent +// method. +type ConfigurationAssignmentsClientGetParentOptions struct { + // placeholder for future optional parameters +} + // ConfigurationAssignmentsClientListOptions contains the optional parameters for the ConfigurationAssignmentsClient.List // method. type ConfigurationAssignmentsClientListOptions struct { @@ -162,11 +173,20 @@ type ConfigurationAssignmentsClientListParentOptions struct { // placeholder for future optional parameters } +// ConfigurationAssignmentsWithinSubscriptionClientListOptions contains the optional parameters for the ConfigurationAssignmentsWithinSubscriptionClient.List +// method. +type ConfigurationAssignmentsWithinSubscriptionClientListOptions struct { + // placeholder for future optional parameters +} + // ConfigurationProperties - Properties for maintenance configuration type ConfigurationProperties struct { // Gets or sets extensionProperties of the maintenanceConfiguration ExtensionProperties map[string]*string `json:"extensionProperties,omitempty"` + // The input parameters to be passed to the patch run operation. + InstallPatches *InputPatchConfiguration `json:"installPatches,omitempty"` + // Gets or sets maintenanceScope of the configuration MaintenanceScope *MaintenanceScope `json:"maintenanceScope,omitempty"` @@ -227,6 +247,49 @@ type ErrorDetails struct { Message *string `json:"message,omitempty"` } +// InputLinuxParameters - Input properties for patching a Linux machine. +type InputLinuxParameters struct { + // Classification category of patches to be patched + ClassificationsToInclude []*string `json:"classificationsToInclude,omitempty"` + + // Package names to be excluded for patching. + PackageNameMasksToExclude []*string `json:"packageNameMasksToExclude,omitempty"` + + // Package names to be included for patching. + PackageNameMasksToInclude []*string `json:"packageNameMasksToInclude,omitempty"` +} + +// InputPatchConfiguration - Input configuration for a patch run +type InputPatchConfiguration struct { + // Input parameters specific to patching Linux machine. For Windows machines, do not pass this property. + LinuxParameters *InputLinuxParameters `json:"linuxParameters,omitempty"` + + // Possible reboot preference as defined by the user based on which it would be decided to reboot the machine or not after + // the patch operation is completed. + RebootSetting *RebootOptions `json:"rebootSetting,omitempty"` + + // Tasks information for the Software update configuration. + Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` + + // Input parameters specific to patching a Windows machine. For Linux machines, do not pass this property. + WindowsParameters *InputWindowsParameters `json:"windowsParameters,omitempty"` +} + +// InputWindowsParameters - Input properties for patching a Windows machine. +type InputWindowsParameters struct { + // Classification category of patches to be patched + ClassificationsToInclude []*string `json:"classificationsToInclude,omitempty"` + + // Exclude patches which need reboot + ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` + + // Windows KBID to be excluded for patching. + KbNumbersToExclude []*string `json:"kbNumbersToExclude,omitempty"` + + // Windows KBID to be included for patching. + KbNumbersToInclude []*string `json:"kbNumbersToInclude,omitempty"` +} + // ListApplyUpdate - Response for ApplyUpdate list type ListApplyUpdate struct { // The list of apply updates @@ -322,6 +385,15 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// SoftwareUpdateConfigurationTasks - Task properties of the software update configuration. +type SoftwareUpdateConfigurationTasks struct { + // List of post tasks. e.g. [{'source' :'runbook', 'taskScope': 'Resource', 'parameters': { 'arg1': 'value1'}}] + PostTasks []*TaskProperties `json:"postTasks,omitempty"` + + // List of pre tasks. e.g. [{'source' :'runbook', 'taskScope': 'Global', 'parameters': { 'arg1': 'value1'}}] + PreTasks []*TaskProperties `json:"preTasks,omitempty"` +} + // SystemData - Metadata pertaining to creation and last modification of the resource. type SystemData struct { // The timestamp of resource creation (UTC). @@ -343,6 +415,18 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } +// TaskProperties - Task properties of the software update configuration. +type TaskProperties struct { + // Gets or sets the parameters of the task. + Parameters map[string]*string `json:"parameters,omitempty"` + + // Gets or sets the name of the runbook. + Source *string `json:"source,omitempty"` + + // Global Task execute once when schedule trigger. Resource task execute for each VM. + TaskScope *TaskScope `json:"taskScope,omitempty"` +} + // Update - Maintenance update on a resource type Update struct { // Duration of impact in seconds @@ -398,9 +482,10 @@ type Window struct { // [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: // Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as // integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, - // Second, Third, Fourth, Last)] [Weekday Monday-Sunday]. Monthly schedule examples - // are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month - // Fourth Monday. + // Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of + // days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, + // recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: + // Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6. RecurEvery *string `json:"recurEvery,omitempty"` // Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go index c4ac0ebd5151..61b98d0f3511 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_models_serde.go @@ -67,6 +67,7 @@ func (c Configuration) MarshalJSON() ([]byte, error) { func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "extensionProperties", c.ExtensionProperties) + populate(objectMap, "installPatches", c.InstallPatches) populate(objectMap, "maintenanceScope", c.MaintenanceScope) populate(objectMap, "maintenanceWindow", c.MaintenanceWindow) populate(objectMap, "namespace", c.Namespace) @@ -74,6 +75,33 @@ func (c ConfigurationProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type InputLinuxParameters. +func (i InputLinuxParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) + populate(objectMap, "packageNameMasksToExclude", i.PackageNameMasksToExclude) + populate(objectMap, "packageNameMasksToInclude", i.PackageNameMasksToInclude) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InputWindowsParameters. +func (i InputWindowsParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "classificationsToInclude", i.ClassificationsToInclude) + populate(objectMap, "excludeKbsRequiringReboot", i.ExcludeKbsRequiringReboot) + populate(objectMap, "kbNumbersToExclude", i.KbNumbersToExclude) + populate(objectMap, "kbNumbersToInclude", i.KbNumbersToInclude) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SoftwareUpdateConfigurationTasks. +func (s SoftwareUpdateConfigurationTasks) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "postTasks", s.PostTasks) + populate(objectMap, "preTasks", s.PreTasks) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -121,6 +149,15 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TaskProperties. +func (t TaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "parameters", t.Parameters) + populate(objectMap, "source", t.Source) + populate(objectMap, "taskScope", t.TaskScope) + return json.Marshal(objectMap) +} + // UnmarshalJSON implements the json.Unmarshaller interface for type Update. func (u *Update) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_operations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_operations_client.go index f9288d3b145e..39cef8952f87 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_operations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - List the available operations supported by the Microsoft.Maintenance resource provider // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -82,7 +82,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_publicmaintenanceconfigurations_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_publicmaintenanceconfigurations_client.go index 311ced57af98..f4582ed23c92 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_publicmaintenanceconfigurations_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_publicmaintenanceconfigurations_client.go @@ -57,7 +57,7 @@ func NewPublicMaintenanceConfigurationsClient(subscriptionID string, credential // Get - Get Public Maintenance Configuration record // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceName - Maintenance Configuration Name // options - PublicMaintenanceConfigurationsClientGetOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.Get // method. @@ -92,7 +92,7 @@ func (client *PublicMaintenanceConfigurationsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *PublicMaintenanceConfigurationsClient) getHandleResponse(resp *htt // NewListPager - Get Public Maintenance Configuration records // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // options - PublicMaintenanceConfigurationsClientListOptions contains the optional parameters for the PublicMaintenanceConfigurationsClient.List // method. func (client *PublicMaintenanceConfigurationsClient) NewListPager(options *PublicMaintenanceConfigurationsClientListOptions) *runtime.Pager[PublicMaintenanceConfigurationsClientListResponse] { @@ -146,7 +146,7 @@ func (client *PublicMaintenanceConfigurationsClient) listCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_response_types.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_response_types.go index 44ee807ed596..6155a74c18be 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_response_types.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_response_types.go @@ -58,6 +58,16 @@ type ConfigurationAssignmentsClientDeleteResponse struct { ConfigurationAssignment } +// ConfigurationAssignmentsClientGetParentResponse contains the response from method ConfigurationAssignmentsClient.GetParent. +type ConfigurationAssignmentsClientGetParentResponse struct { + ConfigurationAssignment +} + +// ConfigurationAssignmentsClientGetResponse contains the response from method ConfigurationAssignmentsClient.Get. +type ConfigurationAssignmentsClientGetResponse struct { + ConfigurationAssignment +} + // ConfigurationAssignmentsClientListParentResponse contains the response from method ConfigurationAssignmentsClient.ListParent. type ConfigurationAssignmentsClientListParentResponse struct { ListConfigurationAssignmentsResult @@ -68,6 +78,11 @@ type ConfigurationAssignmentsClientListResponse struct { ListConfigurationAssignmentsResult } +// ConfigurationAssignmentsWithinSubscriptionClientListResponse contains the response from method ConfigurationAssignmentsWithinSubscriptionClient.List. +type ConfigurationAssignmentsWithinSubscriptionClientListResponse struct { + ListConfigurationAssignmentsResult +} + // ConfigurationsClientCreateOrUpdateResponse contains the response from method ConfigurationsClient.CreateOrUpdate. type ConfigurationsClientCreateOrUpdateResponse struct { Configuration diff --git a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_updates_client.go b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_updates_client.go index 6908c3eec44a..be469bb61765 100644 --- a/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_updates_client.go +++ b/sdk/resourcemanager/maintenance/armmaintenance/zz_generated_updates_client.go @@ -57,7 +57,7 @@ func NewUpdatesClient(subscriptionID string, credential azcore.TokenCredential, // NewListPager - Get updates to resources. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceType - Resource type @@ -113,7 +113,7 @@ func (client *UpdatesClient) listCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -130,7 +130,7 @@ func (client *UpdatesClient) listHandleResponse(resp *http.Response) (UpdatesCli // NewListParentPager - Get updates to resources. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01 +// Generated from API version 2021-09-01-preview // resourceGroupName - Resource group name // providerName - Resource provider name // resourceParentType - Resource parent type @@ -196,7 +196,7 @@ func (client *UpdatesClient) listParentCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01") + reqQP.Set("api-version", "2021-09-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md b/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md index a20cacb80db6..ec6cf8dd21cf 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/CHANGELOG.md @@ -1,5 +1,145 @@ # Release History +## 2.0.0-beta.1 (2022-05-19) +### Breaking Changes + +- Function `*TablesClient.Update` has been removed +- Struct `TablesClientUpdateOptions` has been removed +- Field `Etag` of struct `Workspace` has been removed + +### Features Added + +- New const `ProvisioningStateEnumSucceeded` +- New const `ColumnDataTypeHintEnumArmPath` +- New const `TableTypeEnumSearchResults` +- New const `CreatedByTypeManagedIdentity` +- New const `ColumnTypeEnumDateTime` +- New const `TableSubTypeEnumAny` +- New const `ColumnTypeEnumGUID` +- New const `IdentityTypeKey` +- New const `ColumnTypeEnumString` +- New const `TableTypeEnumRestoredLogs` +- New const `SourceEnumCustomer` +- New const `ColumnDataTypeHintEnumGUID` +- New const `IdentityTypeApplication` +- New const `ColumnTypeEnumReal` +- New const `ColumnTypeEnumInt` +- New const `TableSubTypeEnumClassic` +- New const `TableSubTypeEnumDataCollectionRuleBased` +- New const `ColumnDataTypeHintEnumURI` +- New const `ColumnTypeEnumLong` +- New const `CreatedByTypeApplication` +- New const `CreatedByTypeKey` +- New const `ColumnTypeEnumDynamic` +- New const `SourceEnumMicrosoft` +- New const `ColumnTypeEnumBoolean` +- New const `CreatedByTypeUser` +- New const `ColumnDataTypeHintEnumIP` +- New const `ProvisioningStateEnumInProgress` +- New const `TablePlanEnumAnalytics` +- New const `IdentityTypeUser` +- New const `IdentityTypeManagedIdentity` +- New const `TableTypeEnumCustomLog` +- New const `TableTypeEnumMicrosoft` +- New const `TablePlanEnumBasic` +- New const `ProvisioningStateEnumUpdating` +- New function `SystemDataAutoGenerated.MarshalJSON() ([]byte, error)` +- New function `PossibleColumnDataTypeHintEnumValues() []ColumnDataTypeHintEnum` +- New function `*LogAnalyticsQueryPackQueryProperties.UnmarshalJSON([]byte) error` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New function `*SystemDataAutoGenerated.UnmarshalJSON([]byte) error` +- New function `TagsResource.MarshalJSON() ([]byte, error)` +- New function `PossibleProvisioningStateEnumValues() []ProvisioningStateEnum` +- New function `RestoredLogs.MarshalJSON() ([]byte, error)` +- New function `PossibleTablePlanEnumValues() []TablePlanEnum` +- New function `*TablesClient.BeginDelete(context.Context, string, string, string, *TablesClientBeginDeleteOptions) (*runtime.Poller[TablesClientDeleteResponse], error)` +- New function `PossibleTableTypeEnumValues() []TableTypeEnum` +- New function `PossibleSourceEnumValues() []SourceEnum` +- New function `*LogAnalyticsQueryPackProperties.UnmarshalJSON([]byte) error` +- New function `PossibleColumnTypeEnumValues() []ColumnTypeEnum` +- New function `QueryPacksResource.MarshalJSON() ([]byte, error)` +- New function `SearchResults.MarshalJSON() ([]byte, error)` +- New function `*TablesClient.BeginUpdate(context.Context, string, string, string, Table, *TablesClientBeginUpdateOptions) (*runtime.Poller[TablesClientUpdateResponse], error)` +- New function `LogAnalyticsQueryPackQuery.MarshalJSON() ([]byte, error)` +- New function `LogAnalyticsQueryPackQuerySearchPropertiesRelated.MarshalJSON() ([]byte, error)` +- New function `LogAnalyticsQueryPackQuerySearchProperties.MarshalJSON() ([]byte, error)` +- New function `*TablesClient.Migrate(context.Context, string, string, string, *TablesClientMigrateOptions) (TablesClientMigrateResponse, error)` +- New function `PossibleTableSubTypeEnumValues() []TableSubTypeEnum` +- New function `LogAnalyticsQueryPackQueryPropertiesRelated.MarshalJSON() ([]byte, error)` +- New function `*SystemData.UnmarshalJSON([]byte) error` +- New function `LogAnalyticsQueryPackQueryProperties.MarshalJSON() ([]byte, error)` +- New function `*TablesClient.BeginCreateOrUpdate(context.Context, string, string, string, Table, *TablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[TablesClientCreateOrUpdateResponse], error)` +- New function `*SearchResults.UnmarshalJSON([]byte) error` +- New function `*RestoredLogs.UnmarshalJSON([]byte) error` +- New function `LogAnalyticsQueryPackProperties.MarshalJSON() ([]byte, error)` +- New function `SystemData.MarshalJSON() ([]byte, error)` +- New function `Schema.MarshalJSON() ([]byte, error)` +- New function `LogAnalyticsQueryPack.MarshalJSON() ([]byte, error)` +- New struct `AzureResourceProperties` +- New struct `Column` +- New struct `LogAnalyticsQueryPack` +- New struct `LogAnalyticsQueryPackListResult` +- New struct `LogAnalyticsQueryPackProperties` +- New struct `LogAnalyticsQueryPackQuery` +- New struct `LogAnalyticsQueryPackQueryListResult` +- New struct `LogAnalyticsQueryPackQueryProperties` +- New struct `LogAnalyticsQueryPackQueryPropertiesRelated` +- New struct `LogAnalyticsQueryPackQuerySearchProperties` +- New struct `LogAnalyticsQueryPackQuerySearchPropertiesRelated` +- New struct `QueriesClientDeleteOptions` +- New struct `QueriesClientDeleteResponse` +- New struct `QueriesClientGetOptions` +- New struct `QueriesClientGetResponse` +- New struct `QueriesClientListOptions` +- New struct `QueriesClientListResponse` +- New struct `QueriesClientPutOptions` +- New struct `QueriesClientPutResponse` +- New struct `QueriesClientSearchOptions` +- New struct `QueriesClientSearchResponse` +- New struct `QueriesClientUpdateOptions` +- New struct `QueriesClientUpdateResponse` +- New struct `QueryPacksClientCreateOrUpdateOptions` +- New struct `QueryPacksClientCreateOrUpdateResponse` +- New struct `QueryPacksClientDeleteOptions` +- New struct `QueryPacksClientDeleteResponse` +- New struct `QueryPacksClientGetOptions` +- New struct `QueryPacksClientGetResponse` +- New struct `QueryPacksClientListByResourceGroupOptions` +- New struct `QueryPacksClientListByResourceGroupResponse` +- New struct `QueryPacksClientListOptions` +- New struct `QueryPacksClientListResponse` +- New struct `QueryPacksClientUpdateTagsOptions` +- New struct `QueryPacksClientUpdateTagsResponse` +- New struct `QueryPacksResource` +- New struct `RestoredLogs` +- New struct `ResultStatistics` +- New struct `Schema` +- New struct `SearchResults` +- New struct `SystemData` +- New struct `SystemDataAutoGenerated` +- New struct `TablesClientBeginCreateOrUpdateOptions` +- New struct `TablesClientBeginDeleteOptions` +- New struct `TablesClientBeginUpdateOptions` +- New struct `TablesClientCreateOrUpdateResponse` +- New struct `TablesClientDeleteResponse` +- New struct `TablesClientMigrateOptions` +- New struct `TablesClientMigrateResponse` +- New struct `TagsResource` +- New field `DefaultDataCollectionRuleResourceID` in struct `WorkspaceProperties` +- New field `LastPlanModifiedDate` in struct `TableProperties` +- New field `ProvisioningState` in struct `TableProperties` +- New field `ResultStatistics` in struct `TableProperties` +- New field `RestoredLogs` in struct `TableProperties` +- New field `Schema` in struct `TableProperties` +- New field `SearchResults` in struct `TableProperties` +- New field `ArchiveRetentionInDays` in struct `TableProperties` +- New field `Plan` in struct `TableProperties` +- New field `TotalRetentionInDays` in struct `TableProperties` +- New field `SystemData` in struct `Table` +- New field `SystemData` in struct `Workspace` +- New field `ETag` in struct `Workspace` + + ## 1.0.0 (2022-05-17) ### Breaking Changes diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md b/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md index 79f19a847ddb..7fe91b65eed4 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-2021-06 require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/operationalinsights/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/operationalinsights/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/operationalinsights/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/operationalinsights/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_deletedworkspaces_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_deletedworkspaces_client_test.go index 2166007d7c41..f9eeba552b5e 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_deletedworkspaces_client_test.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_deletedworkspaces_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesSubscriptionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesSubscriptionList.json func ExampleDeletedWorkspacesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleDeletedWorkspacesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesListByResourceGroup.json func ExampleDeletedWorkspacesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operations_client_test.go index fe2d654c8e22..6c1b363d1c5a 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-10-01/examples/OperationsListByTenant.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/OperationsListByTenant.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_queries_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_queries_client_test.go new file mode 100644 index 000000000000..523bfa330e4c --- /dev/null +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_queries_client_test.go @@ -0,0 +1,211 @@ +//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 armoperationalinsights_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/operationalinsights/armoperationalinsights" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesList.json +func ExampleQueriesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueriesClient("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("my-resource-group", + "my-querypack", + &armoperationalinsights.QueriesClientListOptions{Top: nil, + IncludeBody: to.Ptr(true), + SkipToken: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesSearch.json +func ExampleQueriesClient_NewSearchPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueriesClient("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewSearchPager("my-resource-group", + "my-querypack", + armoperationalinsights.LogAnalyticsQueryPackQuerySearchProperties{ + Related: &armoperationalinsights.LogAnalyticsQueryPackQuerySearchPropertiesRelated{ + Categories: []*string{ + to.Ptr("other"), + to.Ptr("analytics")}, + }, + Tags: map[string][]*string{ + "my-label": { + to.Ptr("label1")}, + }, + }, + &armoperationalinsights.QueriesClientSearchOptions{Top: to.Ptr[int64](3), + IncludeBody: to.Ptr(true), + SkipToken: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesGet.json +func ExampleQueriesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueriesClient("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "my-resource-group", + "my-querypack", + "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesPut.json +func ExampleQueriesClient_Put() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueriesClient("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Put(ctx, + "my-resource-group", + "my-querypack", + "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + armoperationalinsights.LogAnalyticsQueryPackQuery{ + Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ + Description: to.Ptr("my description"), + Body: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), + DisplayName: to.Ptr("Exceptions - New in the last 24 hours"), + Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ + Categories: []*string{ + to.Ptr("analytics")}, + }, + Tags: map[string][]*string{ + "my-label": { + to.Ptr("label1")}, + "my-other-label": { + to.Ptr("label2")}, + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesUpdate.json +func ExampleQueriesClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueriesClient("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Update(ctx, + "my-resource-group", + "my-querypack", + "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + armoperationalinsights.LogAnalyticsQueryPackQuery{ + Properties: &armoperationalinsights.LogAnalyticsQueryPackQueryProperties{ + Description: to.Ptr("my description"), + Body: to.Ptr("let newExceptionsTimeRange = 1d;\nlet timeRangeToCheckBefore = 7d;\nexceptions\n| where timestamp < ago(timeRangeToCheckBefore)\n| summarize count() by problemId\n| join kind= rightanti (\nexceptions\n| where timestamp >= ago(newExceptionsTimeRange)\n| extend stack = tostring(details[0].rawStack)\n| summarize count(), dcount(user_AuthenticatedId), min(timestamp), max(timestamp), any(stack) by problemId \n) on problemId \n| order by count_ desc\n"), + DisplayName: to.Ptr("Exceptions - New in the last 24 hours"), + Related: &armoperationalinsights.LogAnalyticsQueryPackQueryPropertiesRelated{ + Categories: []*string{ + to.Ptr("analytics")}, + }, + Tags: map[string][]*string{ + "my-label": { + to.Ptr("label1")}, + "my-other-label": { + to.Ptr("label2")}, + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPackQueriesDelete.json +func ExampleQueriesClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueriesClient("86dc51d3-92ed-4d7e-947a-775ea79b4918", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "my-resource-group", + "my-querypack", + "a449f8af-8e64-4b3a-9b16-5a7165ff98c4", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_querypacks_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_querypacks_client_test.go new file mode 100644 index 000000000000..198311f6a873 --- /dev/null +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_querypacks_client_test.go @@ -0,0 +1,163 @@ +//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 armoperationalinsights_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/operationalinsights/armoperationalinsights" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksList.json +func ExampleQueryPacksClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueryPacksClient("86dc51d3-92ed-4d7e-947a-775ea79b4919", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager(nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksListByResourceGroup.json +func ExampleQueryPacksClient_NewListByResourceGroupPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueryPacksClient("86dc51d3-92ed-4d7e-947a-775ea79b4919", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListByResourceGroupPager("my-resource-group", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksDelete.json +func ExampleQueryPacksClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueryPacksClient("86dc51d3-92ed-4d7e-947a-775ea79b4919", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "my-resource-group", + "my-querypack", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksGet.json +func ExampleQueryPacksClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueryPacksClient("86dc51d3-92ed-4d7e-947a-775ea79b4919", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "my-resource-group", + "my-querypack", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksCreate.json +func ExampleQueryPacksClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueryPacksClient("86dc51d3-92ed-4d7e-947a-775ea79b4919", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "my-resource-group", + "my-querypack", + armoperationalinsights.LogAnalyticsQueryPack{ + Location: to.Ptr("South Central US"), + Properties: &armoperationalinsights.LogAnalyticsQueryPackProperties{}, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/QueryPacksUpdateTagsOnly.json +func ExampleQueryPacksClient_UpdateTags() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewQueryPacksClient("subid", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.UpdateTags(ctx, + "my-resource-group", + "my-querypack", + armoperationalinsights.TagsResource{ + Tags: map[string]*string{ + "Tag1": to.Ptr("Value1"), + "Tag2": to.Ptr("Value2"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_tables_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_tables_client_test.go index dc6e117648de..4bcd5bcfcb60 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_tables_client_test.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_tables_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/TablesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesList.json func ExampleTablesClient_NewListByWorkspacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,8 +43,8 @@ func ExampleTablesClient_NewListByWorkspacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/TablesUpdate.json -func ExampleTablesClient_Update() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesUpsert.json +func ExampleTablesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) @@ -54,24 +54,78 @@ func ExampleTablesClient_Update() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Update(ctx, + poller, err := client.BeginCreateOrUpdate(ctx, "oiautorest6685", "oiautorest6685", - "table1", + "AzureNetworkFlow", armoperationalinsights.Table{ Properties: &armoperationalinsights.TableProperties{ - RetentionInDays: to.Ptr[int32](30), + Schema: &armoperationalinsights.Schema{ + Name: to.Ptr("AzureNetworkFlow"), + Columns: []*armoperationalinsights.Column{ + { + Name: to.Ptr("MyNewColumn"), + Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), + }}, + }, + RetentionInDays: to.Ptr[int32](45), + TotalRetentionInDays: to.Ptr[int32](70), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesUpsert.json +func ExampleTablesClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewTablesClient("00000000-0000-0000-0000-00000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginUpdate(ctx, + "oiautorest6685", + "oiautorest6685", + "AzureNetworkFlow", + armoperationalinsights.Table{ + Properties: &armoperationalinsights.TableProperties{ + Schema: &armoperationalinsights.Schema{ + Name: to.Ptr("AzureNetworkFlow"), + Columns: []*armoperationalinsights.Column{ + { + Name: to.Ptr("MyNewColumn"), + Type: to.Ptr(armoperationalinsights.ColumnTypeEnumGUID), + }}, + }, + RetentionInDays: to.Ptr[int32](45), + TotalRetentionInDays: to.Ptr[int32](70), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } // TODO: use response item _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/TablesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesGet.json func ExampleTablesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -85,7 +139,7 @@ func ExampleTablesClient_Get() { res, err := client.Get(ctx, "oiautorest6685", "oiautorest6685", - "table1", + "table1_SRCH", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -93,3 +147,49 @@ func ExampleTablesClient_Get() { // TODO: use response item _ = res } + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesDelete.json +func ExampleTablesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewTablesClient("00000000-0000-0000-0000-00000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, + "oiautorest6685", + "oiautorest6685", + "table1_CL", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/TablesMigrate.json +func ExampleTablesClient_Migrate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armoperationalinsights.NewTablesClient("00000000-0000-0000-0000-00000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Migrate(ctx, + "oiautorest6685", + "oiautorest6685", + "table1_CL", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspaces_client_test.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspaces_client_test.go index 3c5518695cc6..b0020869b14f 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspaces_client_test.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/ze_generated_example_workspaces_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/operationalinsights/armoperationalinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesSubscriptionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesSubscriptionList.json func ExampleWorkspacesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleWorkspacesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesListByResourceGroup.json func ExampleWorkspacesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleWorkspacesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesCreate.json func ExampleWorkspacesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleWorkspacesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesDelete.json func ExampleWorkspacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -128,7 +128,7 @@ func ExampleWorkspacesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesGet.json func ExampleWorkspacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -150,7 +150,7 @@ func ExampleWorkspacesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2021-06-01/examples/WorkspacesUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2021-12-01-preview/examples/WorkspacesUpdate.json func ExampleWorkspacesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_constants.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_constants.go index 262ede17abd8..242e1a7bcd55 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_constants.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_constants.go @@ -10,7 +10,7 @@ package armoperationalinsights const ( moduleName = "armoperationalinsights" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) // BillingType - Configures whether billing will be only on the cluster or each workspace will be billed by its proportional @@ -119,6 +119,78 @@ func PossibleClusterSKUNameEnumValues() []ClusterSKUNameEnum { } } +// ColumnDataTypeHintEnum - Column data type logical hint. +type ColumnDataTypeHintEnum string + +const ( + // ColumnDataTypeHintEnumArmPath - An Azure Resource Model (ARM) path: /subscriptions/{...}/resourceGroups/{...}/providers/Microsoft.{...}/{...}/{...}/{...}... + ColumnDataTypeHintEnumArmPath ColumnDataTypeHintEnum = "armPath" + // ColumnDataTypeHintEnumGUID - A standard 128-bit GUID following the standard shape, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + ColumnDataTypeHintEnumGUID ColumnDataTypeHintEnum = "guid" + // ColumnDataTypeHintEnumIP - A standard V4/V6 ip address following the standard shape, x.x.x.x/y:y:y:y:y:y:y:y + ColumnDataTypeHintEnumIP ColumnDataTypeHintEnum = "ip" + // ColumnDataTypeHintEnumURI - A string that matches the pattern of a URI, for example, scheme://username:password@host:1234/this/is/a/path?k1=v1&k2=v2#fragment + ColumnDataTypeHintEnumURI ColumnDataTypeHintEnum = "uri" +) + +// PossibleColumnDataTypeHintEnumValues returns the possible values for the ColumnDataTypeHintEnum const type. +func PossibleColumnDataTypeHintEnumValues() []ColumnDataTypeHintEnum { + return []ColumnDataTypeHintEnum{ + ColumnDataTypeHintEnumArmPath, + ColumnDataTypeHintEnumGUID, + ColumnDataTypeHintEnumIP, + ColumnDataTypeHintEnumURI, + } +} + +// ColumnTypeEnum - Column data type. +type ColumnTypeEnum string + +const ( + ColumnTypeEnumBoolean ColumnTypeEnum = "boolean" + ColumnTypeEnumDateTime ColumnTypeEnum = "dateTime" + ColumnTypeEnumDynamic ColumnTypeEnum = "dynamic" + ColumnTypeEnumGUID ColumnTypeEnum = "guid" + ColumnTypeEnumInt ColumnTypeEnum = "int" + ColumnTypeEnumLong ColumnTypeEnum = "long" + ColumnTypeEnumReal ColumnTypeEnum = "real" + ColumnTypeEnumString ColumnTypeEnum = "string" +) + +// PossibleColumnTypeEnumValues returns the possible values for the ColumnTypeEnum const type. +func PossibleColumnTypeEnumValues() []ColumnTypeEnum { + return []ColumnTypeEnum{ + ColumnTypeEnumBoolean, + ColumnTypeEnumDateTime, + ColumnTypeEnumDynamic, + ColumnTypeEnumGUID, + ColumnTypeEnumInt, + ColumnTypeEnumLong, + ColumnTypeEnumReal, + ColumnTypeEnumString, + } +} + +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + // DataIngestionStatus - The status of data ingestion for this workspace. type DataIngestionStatus string @@ -247,21 +319,29 @@ func PossibleDataSourceTypeValues() []DataSourceType { } } -// IdentityType - Type of managed service identity. +// IdentityType - The type of identity that creates/modifies resources type IdentityType string const ( - IdentityTypeSystemAssigned IdentityType = "SystemAssigned" - IdentityTypeUserAssigned IdentityType = "UserAssigned" - IdentityTypeNone IdentityType = "None" + IdentityTypeApplication IdentityType = "application" + IdentityTypeKey IdentityType = "key" + IdentityTypeManagedIdentity IdentityType = "managedIdentity" + IdentityTypeNone IdentityType = "None" + IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + IdentityTypeUser IdentityType = "user" + IdentityTypeUserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns the possible values for the IdentityType const type. func PossibleIdentityTypeValues() []IdentityType { return []IdentityType{ + IdentityTypeApplication, + IdentityTypeKey, + IdentityTypeManagedIdentity, + IdentityTypeNone, IdentityTypeSystemAssigned, + IdentityTypeUser, IdentityTypeUserAssigned, - IdentityTypeNone, } } @@ -285,6 +365,29 @@ func PossibleLinkedServiceEntityStatusValues() []LinkedServiceEntityStatus { } } +// ProvisioningStateEnum - Table's current provisioning state. If set to 'updating', indicates a resource lock due to ongoing +// operation, forbidding any update to the table until the ongoing operation is concluded. +type ProvisioningStateEnum string + +const ( + // ProvisioningStateEnumInProgress - Table schema is stable and without changes, table data is being updated. + ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" + // ProvisioningStateEnumSucceeded - Table state is stable and without changes, table is unlocked and open for new updates. + ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" + // ProvisioningStateEnumUpdating - Table schema is still being built and updated, table is currently locked for any changes + // till the procedure is done. + ProvisioningStateEnumUpdating ProvisioningStateEnum = "Updating" +) + +// PossibleProvisioningStateEnumValues returns the possible values for the ProvisioningStateEnum const type. +func PossibleProvisioningStateEnumValues() []ProvisioningStateEnum { + return []ProvisioningStateEnum{ + ProvisioningStateEnumInProgress, + ProvisioningStateEnumSucceeded, + ProvisioningStateEnumUpdating, + } +} + // PublicNetworkAccessType - The network access type for operating on the Log Analytics Workspace. By default it is Enabled type PublicNetworkAccessType string @@ -361,6 +464,25 @@ func PossibleSearchSortEnumValues() []SearchSortEnum { } } +// SourceEnum - Table's creator. +type SourceEnum string + +const ( + // SourceEnumCustomer - Tables created by the owner of the Workspace, and only found in this Workspace. + SourceEnumCustomer SourceEnum = "customer" + // SourceEnumMicrosoft - Tables provisioned by the system, as collected via Diagnostic Settings, the Agents, or any other + // standard data collection means. + SourceEnumMicrosoft SourceEnum = "microsoft" +) + +// PossibleSourceEnumValues returns the possible values for the SourceEnum const type. +func PossibleSourceEnumValues() []SourceEnum { + return []SourceEnum{ + SourceEnumCustomer, + SourceEnumMicrosoft, + } +} + // StorageInsightState - The state of the storage insight connection to the workspace type StorageInsightState string @@ -377,6 +499,73 @@ func PossibleStorageInsightStateValues() []StorageInsightState { } } +// TablePlanEnum - Instruct the system how to handle and charge the logs ingested to this table. +type TablePlanEnum string + +const ( + // TablePlanEnumAnalytics - Logs that allow monitoring and analytics. + TablePlanEnumAnalytics TablePlanEnum = "Analytics" + // TablePlanEnumBasic - Logs that are adjusted to support high volume low value verbose logs. + TablePlanEnumBasic TablePlanEnum = "Basic" +) + +// PossibleTablePlanEnumValues returns the possible values for the TablePlanEnum const type. +func PossibleTablePlanEnumValues() []TablePlanEnum { + return []TablePlanEnum{ + TablePlanEnumAnalytics, + TablePlanEnumBasic, + } +} + +// TableSubTypeEnum - The subtype describes what APIs can be used to interact with the table, and what features are available +// against it. +type TableSubTypeEnum string + +const ( + // TableSubTypeEnumAny - The default subtype with which built-in tables are created. + TableSubTypeEnumAny TableSubTypeEnum = "Any" + // TableSubTypeEnumClassic - Indicates a table created through the Data Collector API or with the custom logs feature of the + // MMA agent, or any table against which Custom Fields were created. + TableSubTypeEnumClassic TableSubTypeEnum = "Classic" + // TableSubTypeEnumDataCollectionRuleBased - A table eligible to have data sent into it via any of the means supported by + // Data Collection Rules: the Data Collection Endpoint API, ingestion-time transformations, or any other mechanism provided + // by Data Collection Rules + TableSubTypeEnumDataCollectionRuleBased TableSubTypeEnum = "DataCollectionRuleBased" +) + +// PossibleTableSubTypeEnumValues returns the possible values for the TableSubTypeEnum const type. +func PossibleTableSubTypeEnumValues() []TableSubTypeEnum { + return []TableSubTypeEnum{ + TableSubTypeEnumAny, + TableSubTypeEnumClassic, + TableSubTypeEnumDataCollectionRuleBased, + } +} + +// TableTypeEnum - Table's creator. +type TableTypeEnum string + +const ( + // TableTypeEnumCustomLog - Custom log table. + TableTypeEnumCustomLog TableTypeEnum = "CustomLog" + // TableTypeEnumMicrosoft - Standard data collected by Azure Monitor. + TableTypeEnumMicrosoft TableTypeEnum = "Microsoft" + // TableTypeEnumRestoredLogs - Restored data. + TableTypeEnumRestoredLogs TableTypeEnum = "RestoredLogs" + // TableTypeEnumSearchResults - Data collected by a search job. + TableTypeEnumSearchResults TableTypeEnum = "SearchResults" +) + +// PossibleTableTypeEnumValues returns the possible values for the TableTypeEnum const type. +func PossibleTableTypeEnumValues() []TableTypeEnum { + return []TableTypeEnum{ + TableTypeEnumCustomLog, + TableTypeEnumMicrosoft, + TableTypeEnumRestoredLogs, + TableTypeEnumSearchResults, + } +} + // Type - The type of the destination resource type Type string diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_deletedworkspaces_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_deletedworkspaces_client.go index 47747192f47b..292131a06e0d 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_deletedworkspaces_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_deletedworkspaces_client.go @@ -56,7 +56,7 @@ func NewDeletedWorkspacesClient(subscriptionID string, credential azcore.TokenCr // NewListPager - Gets recently deleted workspaces in a subscription, available for recovery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // options - DeletedWorkspacesClientListOptions contains the optional parameters for the DeletedWorkspacesClient.List method. func (client *DeletedWorkspacesClient) NewListPager(options *DeletedWorkspacesClientListOptions) *runtime.Pager[DeletedWorkspacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DeletedWorkspacesClientListResponse]{ @@ -92,7 +92,7 @@ func (client *DeletedWorkspacesClient) listCreateRequest(ctx context.Context, op return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,7 +109,7 @@ func (client *DeletedWorkspacesClient) listHandleResponse(resp *http.Response) ( // NewListByResourceGroupPager - Gets recently deleted workspaces in a resource group, available for recovery. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - DeletedWorkspacesClientListByResourceGroupOptions contains the optional parameters for the DeletedWorkspacesClient.ListByResourceGroup // method. @@ -151,7 +151,7 @@ func (client *DeletedWorkspacesClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models.go index 1a267482edc5..a6a012647dc2 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models.go @@ -70,6 +70,21 @@ type AzureEntityResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// AzureResourceProperties - An Azure resource QueryPack-Query object +type AzureResourceProperties struct { + // READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Read only system data + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + // CapacityReservationProperties - The Capacity Reservation properties. type CapacityReservationProperties struct { // READ-ONLY; The last time Sku was updated. @@ -217,6 +232,30 @@ type ClustersClientListOptions struct { // placeholder for future optional parameters } +// Column - Table column. +type Column struct { + // Column data type logical hint. + DataTypeHint *ColumnDataTypeHintEnum `json:"dataTypeHint,omitempty"` + + // Column description. + Description *string `json:"description,omitempty"` + + // Column display name. + DisplayName *string `json:"displayName,omitempty"` + + // Column name. + Name *string `json:"name,omitempty"` + + // Column data type. + Type *ColumnTypeEnum `json:"type,omitempty"` + + // READ-ONLY; Is displayed by default. + IsDefaultDisplay *bool `json:"isDefaultDisplay,omitempty" azure:"ro"` + + // READ-ONLY; Is column hidden. + IsHidden *bool `json:"isHidden,omitempty" azure:"ro"` +} + // CoreSummary - The core summary of a search. type CoreSummary struct { // REQUIRED; The number of documents of a core summary. @@ -589,6 +628,148 @@ type LinkedStorageAccountsResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// LogAnalyticsQueryPack - An Log Analytics QueryPack definition. +type LogAnalyticsQueryPack struct { + // REQUIRED; Resource location + Location *string `json:"location,omitempty"` + + // REQUIRED; Properties that define a Log Analytics QueryPack resource. + Properties *LogAnalyticsQueryPackProperties `json:"properties,omitempty"` + + // Resource tags + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// LogAnalyticsQueryPackListResult - Describes the list of Log Analytics QueryPack resources. +type LogAnalyticsQueryPackListResult struct { + // REQUIRED; List of Log Analytics QueryPack definitions. + Value []*LogAnalyticsQueryPack `json:"value,omitempty"` + + // The URI to get the next set of Log Analytics QueryPack definitions if too many QueryPacks where returned in the result + // set. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogAnalyticsQueryPackProperties - Properties that define a Log Analytics QueryPack resource. +type LogAnalyticsQueryPackProperties struct { + // READ-ONLY; Current state of this QueryPack: whether or not is has been provisioned within the resource group it is defined. + // Users cannot change this value but are able to read from it. Values will include + // Succeeded, Deploying, Canceled, and Failed. + ProvisioningState *string `json:"provisioningState,omitempty" azure:"ro"` + + // READ-ONLY; The unique ID of your application. This field cannot be changed. + QueryPackID *string `json:"queryPackId,omitempty" azure:"ro"` + + // READ-ONLY; Creation Date for the Log Analytics QueryPack, in ISO 8601 format. + TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` + + // READ-ONLY; Last modified date of the Log Analytics QueryPack, in ISO 8601 format. + TimeModified *time.Time `json:"timeModified,omitempty" azure:"ro"` +} + +// LogAnalyticsQueryPackQuery - A Log Analytics QueryPack-Query definition. +type LogAnalyticsQueryPackQuery struct { + // Properties that define an Log Analytics QueryPack-Query resource. + Properties *LogAnalyticsQueryPackQueryProperties `json:"properties,omitempty"` + + // READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Read only system data + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// LogAnalyticsQueryPackQueryListResult - Describes the list of Log Analytics QueryPack-Query resources. +type LogAnalyticsQueryPackQueryListResult struct { + // REQUIRED; List of Log Analytics QueryPack Query definitions. + Value []*LogAnalyticsQueryPackQuery `json:"value,omitempty"` + + // The URI to get the next set of Log Analytics QueryPack definitions if too many QueryPack-Queries where returned in the + // result set. + NextLink *string `json:"nextLink,omitempty"` +} + +// LogAnalyticsQueryPackQueryProperties - Properties that define an Log Analytics QueryPack-Query resource. +type LogAnalyticsQueryPackQueryProperties struct { + // REQUIRED; Body of the query. + Body *string `json:"body,omitempty"` + + // REQUIRED; Unique display name for your query within the Query Pack. + DisplayName *string `json:"displayName,omitempty"` + + // Description of the query. + Description *string `json:"description,omitempty"` + + // Additional properties that can be set for the query. + Properties interface{} `json:"properties,omitempty"` + + // The related metadata items for the function. + Related *LogAnalyticsQueryPackQueryPropertiesRelated `json:"related,omitempty"` + + // Tags associated with the query. + Tags map[string][]*string `json:"tags,omitempty"` + + // READ-ONLY; Object Id of user creating the query. + Author *string `json:"author,omitempty" azure:"ro"` + + // READ-ONLY; The unique ID of your application. This field cannot be changed. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Creation Date for the Log Analytics Query, in ISO 8601 format. + TimeCreated *time.Time `json:"timeCreated,omitempty" azure:"ro"` + + // READ-ONLY; Last modified date of the Log Analytics Query, in ISO 8601 format. + TimeModified *time.Time `json:"timeModified,omitempty" azure:"ro"` +} + +// LogAnalyticsQueryPackQueryPropertiesRelated - The related metadata items for the function. +type LogAnalyticsQueryPackQueryPropertiesRelated struct { + // The related categories for the function. + Categories []*string `json:"categories,omitempty"` + + // The related resource types for the function. + ResourceTypes []*string `json:"resourceTypes,omitempty"` + + // The related Log Analytics solutions for the function. + Solutions []*string `json:"solutions,omitempty"` +} + +// LogAnalyticsQueryPackQuerySearchProperties - Properties that define an Log Analytics QueryPack-Query search properties. +type LogAnalyticsQueryPackQuerySearchProperties struct { + // The related metadata items for the function. + Related *LogAnalyticsQueryPackQuerySearchPropertiesRelated `json:"related,omitempty"` + + // Tags associated with the query. + Tags map[string][]*string `json:"tags,omitempty"` +} + +// LogAnalyticsQueryPackQuerySearchPropertiesRelated - The related metadata items for the function. +type LogAnalyticsQueryPackQuerySearchPropertiesRelated struct { + // The related categories for the function. + Categories []*string `json:"categories,omitempty"` + + // The related resource types for the function. + ResourceTypes []*string `json:"resourceTypes,omitempty"` + + // The related Log Analytics solutions for the function. + Solutions []*string `json:"solutions,omitempty"` +} + // ManagementGroup - A management group that is connected to a workspace type ManagementGroup struct { // The properties of the management group. @@ -722,6 +903,95 @@ type ProxyResource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// QueriesClientDeleteOptions contains the optional parameters for the QueriesClient.Delete method. +type QueriesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// QueriesClientGetOptions contains the optional parameters for the QueriesClient.Get method. +type QueriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// QueriesClientListOptions contains the optional parameters for the QueriesClient.List method. +type QueriesClientListOptions struct { + // Flag indicating whether or not to return the body of each applicable query. If false, only return the query information. + IncludeBody *bool + // Base64 encoded token used to fetch the next page of items. Default is null. + SkipToken *string + // Maximum items returned in page. + Top *int64 +} + +// QueriesClientPutOptions contains the optional parameters for the QueriesClient.Put method. +type QueriesClientPutOptions struct { + // placeholder for future optional parameters +} + +// QueriesClientSearchOptions contains the optional parameters for the QueriesClient.Search method. +type QueriesClientSearchOptions struct { + // Flag indicating whether or not to return the body of each applicable query. If false, only return the query information. + IncludeBody *bool + // Base64 encoded token used to fetch the next page of items. Default is null. + SkipToken *string + // Maximum items returned in page. + Top *int64 +} + +// QueriesClientUpdateOptions contains the optional parameters for the QueriesClient.Update method. +type QueriesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// QueryPacksClientCreateOrUpdateOptions contains the optional parameters for the QueryPacksClient.CreateOrUpdate method. +type QueryPacksClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// QueryPacksClientDeleteOptions contains the optional parameters for the QueryPacksClient.Delete method. +type QueryPacksClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// QueryPacksClientGetOptions contains the optional parameters for the QueryPacksClient.Get method. +type QueryPacksClientGetOptions struct { + // placeholder for future optional parameters +} + +// QueryPacksClientListByResourceGroupOptions contains the optional parameters for the QueryPacksClient.ListByResourceGroup +// method. +type QueryPacksClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// QueryPacksClientListOptions contains the optional parameters for the QueryPacksClient.List method. +type QueryPacksClientListOptions struct { + // placeholder for future optional parameters +} + +// QueryPacksClientUpdateTagsOptions contains the optional parameters for the QueryPacksClient.UpdateTags method. +type QueryPacksClientUpdateTagsOptions struct { + // placeholder for future optional parameters +} + +// QueryPacksResource - An azure resource object +type QueryPacksResource struct { + // REQUIRED; Resource location + Location *string `json:"location,omitempty"` + + // Resource tags + Tags map[string]*string `json:"tags,omitempty"` + + // READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Azure resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -734,6 +1004,27 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// RestoredLogs - Restore parameters. +type RestoredLogs struct { + // The timestamp to end the restore by (UTC). + EndRestoreTime *time.Time `json:"endRestoreTime,omitempty"` + + // The table to restore data from. + SourceTable *string `json:"sourceTable,omitempty"` + + // The timestamp to start the restore from (UTC). + StartRestoreTime *time.Time `json:"startRestoreTime,omitempty"` +} + +// ResultStatistics - Search job execution statistics. +type ResultStatistics struct { + // READ-ONLY; The number of rows that were returned by the search job. + IngestedRecords *int32 `json:"ingestedRecords,omitempty" azure:"ro"` + + // READ-ONLY; Search job completion percentage. + Progress *float32 `json:"progress,omitempty" azure:"ro"` +} + // SavedSearch - Value object for saved search results. type SavedSearch struct { // REQUIRED; The properties of the saved search. @@ -805,6 +1096,49 @@ type SavedSearchesListResult struct { Value []*SavedSearch `json:"value,omitempty"` } +// Schema - Table's schema. +type Schema struct { + // A list of table custom columns. + Columns []*Column `json:"columns,omitempty"` + + // Table description. + Description *string `json:"description,omitempty"` + + // Table display name. + DisplayName *string `json:"displayName,omitempty"` + + // Table name. + Name *string `json:"name,omitempty"` + + // READ-ONLY; Table category. + Categories []*string `json:"categories,omitempty" azure:"ro"` + + // READ-ONLY; Table labels. + Labels []*string `json:"labels,omitempty" azure:"ro"` + + // READ-ONLY; Parameters of the restore operation that initiated this table. + RestoredLogs *RestoredLogs `json:"restoredLogs,omitempty" azure:"ro"` + + // READ-ONLY; Parameters of the search job that initiated this table. + SearchResults *SearchResults `json:"searchResults,omitempty" azure:"ro"` + + // READ-ONLY; List of solutions the table is affiliated with + Solutions []*string `json:"solutions,omitempty" azure:"ro"` + + // READ-ONLY; Table's creator. + Source *SourceEnum `json:"source,omitempty" azure:"ro"` + + // READ-ONLY; A list of table standard columns. + StandardColumns []*Column `json:"standardColumns,omitempty" azure:"ro"` + + // READ-ONLY; The subtype describes what APIs can be used to interact with the table, and what features are available against + // it. + TableSubType *TableSubTypeEnum `json:"tableSubType,omitempty" azure:"ro"` + + // READ-ONLY; Table's creator. + TableType *TableTypeEnum `json:"tableType,omitempty" azure:"ro"` +} + // SchemaClientGetOptions contains the optional parameters for the SchemaClient.Get method. type SchemaClientGetOptions struct { // placeholder for future optional parameters @@ -882,6 +1216,27 @@ type SearchMetadataSchema struct { Version *int32 `json:"version,omitempty"` } +// SearchResults - Parameters of the search job that initiated this table. +type SearchResults struct { + // Search job Description. + Description *string `json:"description,omitempty"` + + // The timestamp to end the search by (UTC) + EndSearchTime *time.Time `json:"endSearchTime,omitempty"` + + // Limit the search job to return up to specified number of rows. + Limit *int32 `json:"limit,omitempty"` + + // Search job query. + Query *string `json:"query,omitempty"` + + // The timestamp to start the search from (UTC) + StartSearchTime *time.Time `json:"startSearchTime,omitempty"` + + // READ-ONLY; The table used in the search job. + SourceTable *string `json:"sourceTable,omitempty" azure:"ro"` +} + // SearchSchemaValue - Value object for schema results. type SearchSchemaValue struct { // REQUIRED; The boolean that indicates whether or not the field is a facet. @@ -1019,9 +1374,51 @@ type StorageInsightStatus struct { Description *string `json:"description,omitempty"` } +// SystemData - Read only system data +type SystemData struct { + // The timestamp of resource creation (UTC) + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // An identifier for the identity that created the resource + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource + CreatedByType *IdentityType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // An identifier for the identity that last modified the resource + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource + LastModifiedByType *IdentityType `json:"lastModifiedByType,omitempty"` +} + +// SystemDataAutoGenerated - Metadata pertaining to creation and last modification of the resource. +type SystemDataAutoGenerated struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time `json:"createdAt,omitempty"` + + // The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + + // The type of identity that created the resource. + CreatedByType *CreatedByType `json:"createdByType,omitempty"` + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time `json:"lastModifiedAt,omitempty"` + + // The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` +} + // Table - Workspace data table definition. type Table struct { - // Table properties. + // Table's properties. Properties *TableProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -1030,15 +1427,63 @@ type Table struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataAutoGenerated `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"` } // TableProperties - Table properties. type TableProperties struct { - // The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace - // retention. + // Instruct the system how to handle and charge the logs ingested to this table. + Plan *TablePlanEnum `json:"plan,omitempty"` + + // Parameters of the restore operation that initiated this table. + RestoredLogs *RestoredLogs `json:"restoredLogs,omitempty"` + + // Search job execution statistics. + ResultStatistics *ResultStatistics `json:"resultStatistics,omitempty"` + + // The table retention in days, between 4 and 730. Setting this property to -1 will default to the workspace retention. RetentionInDays *int32 `json:"retentionInDays,omitempty"` + + // Table schema. + Schema *Schema `json:"schema,omitempty"` + + // Parameters of the search job that initiated this table. + SearchResults *SearchResults `json:"searchResults,omitempty"` + + // The table total retention in days, between 4 and 2555. Setting this property to -1 will default to table retention. + TotalRetentionInDays *int32 `json:"totalRetentionInDays,omitempty"` + + // READ-ONLY; The table data archive retention in days. Calculated as (totalRetentionInDays-retentionInDays) + ArchiveRetentionInDays *int32 `json:"archiveRetentionInDays,omitempty" azure:"ro"` + + // READ-ONLY; The timestamp that table plan was last modified (UTC). + LastPlanModifiedDate *string `json:"lastPlanModifiedDate,omitempty" azure:"ro"` + + // READ-ONLY; Table's current provisioning state. If set to 'updating', indicates a resource lock due to ongoing operation, + // forbidding any update to the table until the ongoing operation is concluded. + ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty" azure:"ro"` +} + +// TablesClientBeginCreateOrUpdateOptions contains the optional parameters for the TablesClient.BeginCreateOrUpdate method. +type TablesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TablesClientBeginDeleteOptions contains the optional parameters for the TablesClient.BeginDelete method. +type TablesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// TablesClientBeginUpdateOptions contains the optional parameters for the TablesClient.BeginUpdate method. +type TablesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // TablesClientGetOptions contains the optional parameters for the TablesClient.Get method. @@ -1051,8 +1496,8 @@ type TablesClientListByWorkspaceOptions struct { // placeholder for future optional parameters } -// TablesClientUpdateOptions contains the optional parameters for the TablesClient.Update method. -type TablesClientUpdateOptions struct { +// TablesClientMigrateOptions contains the optional parameters for the TablesClient.Migrate method. +type TablesClientMigrateOptions struct { // placeholder for future optional parameters } @@ -1071,6 +1516,12 @@ type Tag struct { Value *string `json:"value,omitempty"` } +// TagsResource - A container holding only the Tags for a resource, allowing the user to update the tags on a QueryPack instance. +type TagsResource struct { + // Resource tags + Tags map[string]*string `json:"tags,omitempty"` +} + // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { @@ -1130,8 +1581,8 @@ type Workspace struct { // REQUIRED; The geo-location where the resource lives Location *string `json:"location,omitempty"` - // The etag of the workspace. - Etag *string `json:"etag,omitempty"` + // The ETag of the workspace. + ETag *string `json:"eTag,omitempty"` // Workspace properties. Properties *WorkspaceProperties `json:"properties,omitempty"` @@ -1145,6 +1596,9 @@ type Workspace struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemDataAutoGenerated `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"` } @@ -1223,15 +1677,16 @@ type WorkspacePatch struct { // WorkspaceProperties - Workspace properties. type WorkspaceProperties struct { + // The resource ID of the default Data Collection Rule to use for this workspace. Expected format is - + // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionRules/{dcrName}. + DefaultDataCollectionRuleResourceID *string `json:"defaultDataCollectionRuleResourceId,omitempty"` + // Workspace features. Features *WorkspaceFeatures `json:"features,omitempty"` // Indicates whether customer managed storage is mandatory for query management. ForceCmkForQuery *bool `json:"forceCmkForQuery,omitempty"` - // The provisioning state of the workspace. - ProvisioningState *WorkspaceEntityStatus `json:"provisioningState,omitempty"` - // The network access type for accessing Log Analytics ingestion. PublicNetworkAccessForIngestion *PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"` @@ -1258,6 +1713,9 @@ type WorkspaceProperties struct { // READ-ONLY; List of linked private link scope resources. PrivateLinkScopedResources []*PrivateLinkScopedResource `json:"privateLinkScopedResources,omitempty" azure:"ro"` + + // READ-ONLY; The provisioning state of the workspace. + ProvisioningState *WorkspaceEntityStatus `json:"provisioningState,omitempty" azure:"ro"` } // WorkspacePurgeBody - Describes the body of a purge request for an App Insights Workspace diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go index 4507e731cff7..8e1951de4ec1 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_models_serde.go @@ -109,6 +109,157 @@ func (l LinkedStorageAccountsProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPack. +func (l LogAnalyticsQueryPack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "location", l.Location) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "tags", l.Tags) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackProperties. +func (l LogAnalyticsQueryPackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "provisioningState", l.ProvisioningState) + populate(objectMap, "queryPackId", l.QueryPackID) + populateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) + populateTimeRFC3339(objectMap, "timeModified", l.TimeModified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackProperties. +func (l *LogAnalyticsQueryPackProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &l.ProvisioningState) + delete(rawMsg, key) + case "queryPackId": + err = unpopulate(val, "QueryPackID", &l.QueryPackID) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) + delete(rawMsg, key) + case "timeModified": + err = unpopulateTimeRFC3339(val, "TimeModified", &l.TimeModified) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuery. +func (l LogAnalyticsQueryPackQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "systemData", l.SystemData) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQueryProperties. +func (l LogAnalyticsQueryPackQueryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "author", l.Author) + populate(objectMap, "body", l.Body) + populate(objectMap, "description", l.Description) + populate(objectMap, "displayName", l.DisplayName) + populate(objectMap, "id", l.ID) + populate(objectMap, "properties", &l.Properties) + populate(objectMap, "related", l.Related) + populate(objectMap, "tags", l.Tags) + populateTimeRFC3339(objectMap, "timeCreated", l.TimeCreated) + populateTimeRFC3339(objectMap, "timeModified", l.TimeModified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogAnalyticsQueryPackQueryProperties. +func (l *LogAnalyticsQueryPackQueryProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, "Author", &l.Author) + delete(rawMsg, key) + case "body": + err = unpopulate(val, "Body", &l.Body) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &l.DisplayName) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "related": + err = unpopulate(val, "Related", &l.Related) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &l.Tags) + delete(rawMsg, key) + case "timeCreated": + err = unpopulateTimeRFC3339(val, "TimeCreated", &l.TimeCreated) + delete(rawMsg, key) + case "timeModified": + err = unpopulateTimeRFC3339(val, "TimeModified", &l.TimeModified) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQueryPropertiesRelated. +func (l LogAnalyticsQueryPackQueryPropertiesRelated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "categories", l.Categories) + populate(objectMap, "resourceTypes", l.ResourceTypes) + populate(objectMap, "solutions", l.Solutions) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuerySearchProperties. +func (l LogAnalyticsQueryPackQuerySearchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "related", l.Related) + populate(objectMap, "tags", l.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type LogAnalyticsQueryPackQuerySearchPropertiesRelated. +func (l LogAnalyticsQueryPackQuerySearchPropertiesRelated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "categories", l.Categories) + populate(objectMap, "resourceTypes", l.ResourceTypes) + populate(objectMap, "solutions", l.Solutions) + return json.Marshal(objectMap) +} + // UnmarshalJSON implements the json.Unmarshaller interface for type ManagementGroupProperties. func (m *ManagementGroupProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage @@ -150,6 +301,52 @@ func (m *ManagementGroupProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type QueryPacksResource. +func (q QueryPacksResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", q.ID) + populate(objectMap, "location", q.Location) + populate(objectMap, "name", q.Name) + populate(objectMap, "tags", q.Tags) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RestoredLogs. +func (r RestoredLogs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endRestoreTime", r.EndRestoreTime) + populate(objectMap, "sourceTable", r.SourceTable) + populateTimeRFC3339(objectMap, "startRestoreTime", r.StartRestoreTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoredLogs. +func (r *RestoredLogs) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endRestoreTime": + err = unpopulateTimeRFC3339(val, "EndRestoreTime", &r.EndRestoreTime) + delete(rawMsg, key) + case "sourceTable": + err = unpopulate(val, "SourceTable", &r.SourceTable) + delete(rawMsg, key) + case "startRestoreTime": + err = unpopulateTimeRFC3339(val, "StartRestoreTime", &r.StartRestoreTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SavedSearchProperties. func (s SavedSearchProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -163,6 +360,25 @@ func (s SavedSearchProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type Schema. +func (s Schema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "categories", s.Categories) + populate(objectMap, "columns", s.Columns) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "labels", s.Labels) + populate(objectMap, "name", s.Name) + populate(objectMap, "restoredLogs", s.RestoredLogs) + populate(objectMap, "searchResults", s.SearchResults) + populate(objectMap, "solutions", s.Solutions) + populate(objectMap, "source", s.Source) + populate(objectMap, "standardColumns", s.StandardColumns) + populate(objectMap, "tableSubType", s.TableSubType) + populate(objectMap, "tableType", s.TableType) + return json.Marshal(objectMap) +} + // UnmarshalJSON implements the json.Unmarshaller interface for type SearchMetadata. func (s *SearchMetadata) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage @@ -231,6 +447,53 @@ func (s *SearchMetadata) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SearchResults. +func (s SearchResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populateTimeRFC3339(objectMap, "endSearchTime", s.EndSearchTime) + populate(objectMap, "limit", s.Limit) + populate(objectMap, "query", s.Query) + populate(objectMap, "sourceTable", s.SourceTable) + populateTimeRFC3339(objectMap, "startSearchTime", s.StartSearchTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SearchResults. +func (s *SearchResults) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "endSearchTime": + err = unpopulateTimeRFC3339(val, "EndSearchTime", &s.EndSearchTime) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &s.Query) + delete(rawMsg, key) + case "sourceTable": + err = unpopulate(val, "SourceTable", &s.SourceTable) + delete(rawMsg, key) + case "startSearchTime": + err = unpopulateTimeRFC3339(val, "StartSearchTime", &s.StartSearchTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type StorageInsight. func (s StorageInsight) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -253,16 +516,118 @@ func (s StorageInsightProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// 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 fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemDataAutoGenerated. +func (s SystemDataAutoGenerated) 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 SystemDataAutoGenerated. +func (s *SystemDataAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Table. func (t Table) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", t.ID) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) + populate(objectMap, "systemData", t.SystemData) populate(objectMap, "type", t.Type) return json.Marshal(objectMap) } +// MarshalJSON implements the json.Marshaller interface for type TagsResource. +func (t TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -312,11 +677,12 @@ func (u *UsageMetric) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Workspace. func (w Workspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) + populate(objectMap, "eTag", w.ETag) populate(objectMap, "id", w.ID) populate(objectMap, "location", w.Location) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) + populate(objectMap, "systemData", w.SystemData) populate(objectMap, "tags", w.Tags) populate(objectMap, "type", w.Type) return json.Marshal(objectMap) @@ -397,6 +763,7 @@ func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "createdDate", w.CreatedDate) populate(objectMap, "customerId", w.CustomerID) + populate(objectMap, "defaultDataCollectionRuleResourceId", w.DefaultDataCollectionRuleResourceID) populate(objectMap, "features", w.Features) populate(objectMap, "forceCmkForQuery", w.ForceCmkForQuery) populate(objectMap, "modifiedDate", w.ModifiedDate) diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operations_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operations_client.go index a17e879b6dc0..d2e005a0a504 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operations_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available OperationalInsights Rest API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-10-01 +// Generated from API version 2021-12-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-10-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_queries_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_queries_client.go new file mode 100644 index 000000000000..f0588f691a32 --- /dev/null +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_queries_client.go @@ -0,0 +1,450 @@ +//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 armoperationalinsights + +import ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// QueriesClient contains the methods for the Queries group. +// Don't use this type directly, use NewQueriesClient() instead. +type QueriesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewQueriesClient creates a new instance of QueriesClient with the specified values. +// 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 NewQueriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueriesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &QueriesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Delete - Deletes a specific Query defined within an Log Analytics QueryPack. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// id - The id of a specific query defined in the Log Analytics QueryPack +// options - QueriesClientDeleteOptions contains the optional parameters for the QueriesClient.Delete method. +func (client *QueriesClient) Delete(ctx context.Context, resourceGroupName string, queryPackName string, id string, options *QueriesClientDeleteOptions) (QueriesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, queryPackName, id, options) + if err != nil { + return QueriesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueriesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return QueriesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return QueriesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *QueriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, options *QueriesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" + 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 queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// id - The id of a specific query defined in the Log Analytics QueryPack +// options - QueriesClientGetOptions contains the optional parameters for the QueriesClient.Get method. +func (client *QueriesClient) Get(ctx context.Context, resourceGroupName string, queryPackName string, id string, options *QueriesClientGetOptions) (QueriesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, queryPackName, id, options) + if err != nil { + return QueriesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueriesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *QueriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, options *QueriesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" + 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 queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *QueriesClient) getHandleResponse(resp *http.Response) (QueriesClientGetResponse, error) { + result := QueriesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPackQuery); err != nil { + return QueriesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a list of Queries defined within a Log Analytics QueryPack. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// options - QueriesClientListOptions contains the optional parameters for the QueriesClient.List method. +func (client *QueriesClient) NewListPager(resourceGroupName string, queryPackName string, options *QueriesClientListOptions) *runtime.Pager[QueriesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[QueriesClientListResponse]{ + More: func(page QueriesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *QueriesClientListResponse) (QueriesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, queryPackName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return QueriesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueriesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueriesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *QueriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, options *QueriesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries" + 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 queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) + } + if options != nil && options.IncludeBody != nil { + reqQP.Set("includeBody", strconv.FormatBool(*options.IncludeBody)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *QueriesClient) listHandleResponse(resp *http.Response) (QueriesClientListResponse, error) { + result := QueriesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPackQueryListResult); err != nil { + return QueriesClientListResponse{}, err + } + return result, nil +} + +// Put - Adds or Updates a specific Query within a Log Analytics QueryPack. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// id - The id of a specific query defined in the Log Analytics QueryPack +// queryPayload - Properties that need to be specified to create a new query and add it to a Log Analytics QueryPack. +// options - QueriesClientPutOptions contains the optional parameters for the QueriesClient.Put method. +func (client *QueriesClient) Put(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, options *QueriesClientPutOptions) (QueriesClientPutResponse, error) { + req, err := client.putCreateRequest(ctx, resourceGroupName, queryPackName, id, queryPayload, options) + if err != nil { + return QueriesClientPutResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueriesClientPutResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueriesClientPutResponse{}, runtime.NewResponseError(resp) + } + return client.putHandleResponse(resp) +} + +// putCreateRequest creates the Put request. +func (client *QueriesClient) putCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, options *QueriesClientPutOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" + 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 queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, queryPayload) +} + +// putHandleResponse handles the Put response. +func (client *QueriesClient) putHandleResponse(resp *http.Response) (QueriesClientPutResponse, error) { + result := QueriesClientPutResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPackQuery); err != nil { + return QueriesClientPutResponse{}, err + } + return result, nil +} + +// NewSearchPager - Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// querySearchProperties - Properties by which to search queries in the given Log Analytics QueryPack. +// options - QueriesClientSearchOptions contains the optional parameters for the QueriesClient.Search method. +func (client *QueriesClient) NewSearchPager(resourceGroupName string, queryPackName string, querySearchProperties LogAnalyticsQueryPackQuerySearchProperties, options *QueriesClientSearchOptions) *runtime.Pager[QueriesClientSearchResponse] { + return runtime.NewPager(runtime.PagingHandler[QueriesClientSearchResponse]{ + More: func(page QueriesClientSearchResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *QueriesClientSearchResponse) (QueriesClientSearchResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.searchCreateRequest(ctx, resourceGroupName, queryPackName, querySearchProperties, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return QueriesClientSearchResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueriesClientSearchResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueriesClientSearchResponse{}, runtime.NewResponseError(resp) + } + return client.searchHandleResponse(resp) + }, + }) +} + +// searchCreateRequest creates the Search request. +func (client *QueriesClient) searchCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, querySearchProperties LogAnalyticsQueryPackQuerySearchProperties, options *QueriesClientSearchOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search" + 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 queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + 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", "2019-09-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) + } + if options != nil && options.IncludeBody != nil { + reqQP.Set("includeBody", strconv.FormatBool(*options.IncludeBody)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, querySearchProperties) +} + +// searchHandleResponse handles the Search response. +func (client *QueriesClient) searchHandleResponse(resp *http.Response) (QueriesClientSearchResponse, error) { + result := QueriesClientSearchResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPackQueryListResult); err != nil { + return QueriesClientSearchResponse{}, err + } + return result, nil +} + +// Update - Adds or Updates a specific Query within a Log Analytics QueryPack. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// id - The id of a specific query defined in the Log Analytics QueryPack +// queryPayload - Properties that need to be specified to create a new query and add it to a Log Analytics QueryPack. +// options - QueriesClientUpdateOptions contains the optional parameters for the QueriesClient.Update method. +func (client *QueriesClient) Update(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, options *QueriesClientUpdateOptions) (QueriesClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, queryPackName, id, queryPayload, options) + if err != nil { + return QueriesClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueriesClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueriesClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *QueriesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, id string, queryPayload LogAnalyticsQueryPackQuery, options *QueriesClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}" + 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 queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, queryPayload) +} + +// updateHandleResponse handles the Update response. +func (client *QueriesClient) updateHandleResponse(resp *http.Response) (QueriesClientUpdateResponse, error) { + result := QueriesClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPackQuery); err != nil { + return QueriesClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_querypacks_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_querypacks_client.go new file mode 100644 index 000000000000..2fa7023cca9f --- /dev/null +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_querypacks_client.go @@ -0,0 +1,398 @@ +//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 armoperationalinsights + +import ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// QueryPacksClient contains the methods for the QueryPacks group. +// Don't use this type directly, use NewQueryPacksClient() instead. +type QueryPacksClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewQueryPacksClient creates a new instance of QueryPacksClient with the specified values. +// 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 NewQueryPacksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueryPacksClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &QueryPacksClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates (or updates) a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey +// nor AppId in the Put operation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// logAnalyticsQueryPackPayload - Properties that need to be specified to create or update a Log Analytics QueryPack. +// options - QueryPacksClientCreateOrUpdateOptions contains the optional parameters for the QueryPacksClient.CreateOrUpdate +// method. +func (client *QueryPacksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, queryPackName string, logAnalyticsQueryPackPayload LogAnalyticsQueryPack, options *QueryPacksClientCreateOrUpdateOptions) (QueryPacksClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, queryPackName, logAnalyticsQueryPackPayload, options) + if err != nil { + return QueryPacksClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueryPacksClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueryPacksClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *QueryPacksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, logAnalyticsQueryPackPayload LogAnalyticsQueryPack, options *QueryPacksClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, logAnalyticsQueryPackPayload) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *QueryPacksClient) createOrUpdateHandleResponse(resp *http.Response) (QueryPacksClientCreateOrUpdateResponse, error) { + result := QueryPacksClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPack); err != nil { + return QueryPacksClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes a Log Analytics QueryPack. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// options - QueryPacksClientDeleteOptions contains the optional parameters for the QueryPacksClient.Delete method. +func (client *QueryPacksClient) Delete(ctx context.Context, resourceGroupName string, queryPackName string, options *QueryPacksClientDeleteOptions) (QueryPacksClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, queryPackName, options) + if err != nil { + return QueryPacksClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueryPacksClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return QueryPacksClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return QueryPacksClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *QueryPacksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, options *QueryPacksClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Returns a Log Analytics QueryPack. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// options - QueryPacksClientGetOptions contains the optional parameters for the QueryPacksClient.Get method. +func (client *QueryPacksClient) Get(ctx context.Context, resourceGroupName string, queryPackName string, options *QueryPacksClientGetOptions) (QueryPacksClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, queryPackName, options) + if err != nil { + return QueryPacksClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueryPacksClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueryPacksClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *QueryPacksClient) getCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, options *QueryPacksClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *QueryPacksClient) getHandleResponse(resp *http.Response) (QueryPacksClientGetResponse, error) { + result := QueryPacksClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPack); err != nil { + return QueryPacksClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a list of all Log Analytics QueryPacks within a subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// options - QueryPacksClientListOptions contains the optional parameters for the QueryPacksClient.List method. +func (client *QueryPacksClient) NewListPager(options *QueryPacksClientListOptions) *runtime.Pager[QueryPacksClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[QueryPacksClientListResponse]{ + More: func(page QueryPacksClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *QueryPacksClientListResponse) (QueryPacksClientListResponse, 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 QueryPacksClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueryPacksClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueryPacksClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *QueryPacksClient) listCreateRequest(ctx context.Context, options *QueryPacksClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/queryPacks" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *QueryPacksClient) listHandleResponse(resp *http.Response) (QueryPacksClientListResponse, error) { + result := QueryPacksClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPackListResult); err != nil { + return QueryPacksClientListResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets a list of Log Analytics QueryPacks within a resource group. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// options - QueryPacksClientListByResourceGroupOptions contains the optional parameters for the QueryPacksClient.ListByResourceGroup +// method. +func (client *QueryPacksClient) NewListByResourceGroupPager(resourceGroupName string, options *QueryPacksClientListByResourceGroupOptions) *runtime.Pager[QueryPacksClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[QueryPacksClientListByResourceGroupResponse]{ + More: func(page QueryPacksClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *QueryPacksClientListByResourceGroupResponse) (QueryPacksClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return QueryPacksClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueryPacksClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueryPacksClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *QueryPacksClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *QueryPacksClientListByResourceGroupOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *QueryPacksClient) listByResourceGroupHandleResponse(resp *http.Response) (QueryPacksClientListByResourceGroupResponse, error) { + result := QueryPacksClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPackListResult); err != nil { + return QueryPacksClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// UpdateTags - Updates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2019-09-01 +// resourceGroupName - The name of the resource group. The name is case insensitive. +// queryPackName - The name of the Log Analytics QueryPack resource. +// queryPackTags - Updated tag information to set into the QueryPack instance. +// options - QueryPacksClientUpdateTagsOptions contains the optional parameters for the QueryPacksClient.UpdateTags method. +func (client *QueryPacksClient) UpdateTags(ctx context.Context, resourceGroupName string, queryPackName string, queryPackTags TagsResource, options *QueryPacksClientUpdateTagsOptions) (QueryPacksClientUpdateTagsResponse, error) { + req, err := client.updateTagsCreateRequest(ctx, resourceGroupName, queryPackName, queryPackTags, options) + if err != nil { + return QueryPacksClientUpdateTagsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return QueryPacksClientUpdateTagsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return QueryPacksClientUpdateTagsResponse{}, runtime.NewResponseError(resp) + } + return client.updateTagsHandleResponse(resp) +} + +// updateTagsCreateRequest creates the UpdateTags request. +func (client *QueryPacksClient) updateTagsCreateRequest(ctx context.Context, resourceGroupName string, queryPackName string, queryPackTags TagsResource, options *QueryPacksClientUpdateTagsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if queryPackName == "" { + return nil, errors.New("parameter queryPackName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{queryPackName}", url.PathEscape(queryPackName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2019-09-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, queryPackTags) +} + +// updateTagsHandleResponse handles the UpdateTags response. +func (client *QueryPacksClient) updateTagsHandleResponse(resp *http.Response) (QueryPacksClientUpdateTagsResponse, error) { + result := QueryPacksClientUpdateTagsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.LogAnalyticsQueryPack); err != nil { + return QueryPacksClientUpdateTagsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_response_types.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_response_types.go index 61644fe2cd09..2527d18a69ce 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_response_types.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_response_types.go @@ -170,6 +170,66 @@ type OperationsClientListResponse struct { OperationListResult } +// QueriesClientDeleteResponse contains the response from method QueriesClient.Delete. +type QueriesClientDeleteResponse struct { + // placeholder for future response values +} + +// QueriesClientGetResponse contains the response from method QueriesClient.Get. +type QueriesClientGetResponse struct { + LogAnalyticsQueryPackQuery +} + +// QueriesClientListResponse contains the response from method QueriesClient.List. +type QueriesClientListResponse struct { + LogAnalyticsQueryPackQueryListResult +} + +// QueriesClientPutResponse contains the response from method QueriesClient.Put. +type QueriesClientPutResponse struct { + LogAnalyticsQueryPackQuery +} + +// QueriesClientSearchResponse contains the response from method QueriesClient.Search. +type QueriesClientSearchResponse struct { + LogAnalyticsQueryPackQueryListResult +} + +// QueriesClientUpdateResponse contains the response from method QueriesClient.Update. +type QueriesClientUpdateResponse struct { + LogAnalyticsQueryPackQuery +} + +// QueryPacksClientCreateOrUpdateResponse contains the response from method QueryPacksClient.CreateOrUpdate. +type QueryPacksClientCreateOrUpdateResponse struct { + LogAnalyticsQueryPack +} + +// QueryPacksClientDeleteResponse contains the response from method QueryPacksClient.Delete. +type QueryPacksClientDeleteResponse struct { + // placeholder for future response values +} + +// QueryPacksClientGetResponse contains the response from method QueryPacksClient.Get. +type QueryPacksClientGetResponse struct { + LogAnalyticsQueryPack +} + +// QueryPacksClientListByResourceGroupResponse contains the response from method QueryPacksClient.ListByResourceGroup. +type QueryPacksClientListByResourceGroupResponse struct { + LogAnalyticsQueryPackListResult +} + +// QueryPacksClientListResponse contains the response from method QueryPacksClient.List. +type QueryPacksClientListResponse struct { + LogAnalyticsQueryPackListResult +} + +// QueryPacksClientUpdateTagsResponse contains the response from method QueryPacksClient.UpdateTags. +type QueryPacksClientUpdateTagsResponse struct { + LogAnalyticsQueryPack +} + // SavedSearchesClientCreateOrUpdateResponse contains the response from method SavedSearchesClient.CreateOrUpdate. type SavedSearchesClientCreateOrUpdateResponse struct { SavedSearch @@ -225,6 +285,16 @@ type StorageInsightConfigsClientListByWorkspaceResponse struct { StorageInsightListResult } +// TablesClientCreateOrUpdateResponse contains the response from method TablesClient.CreateOrUpdate. +type TablesClientCreateOrUpdateResponse struct { + Table +} + +// TablesClientDeleteResponse contains the response from method TablesClient.Delete. +type TablesClientDeleteResponse struct { + // placeholder for future response values +} + // TablesClientGetResponse contains the response from method TablesClient.Get. type TablesClientGetResponse struct { Table @@ -235,6 +305,11 @@ type TablesClientListByWorkspaceResponse struct { TablesListResult } +// TablesClientMigrateResponse contains the response from method TablesClient.Migrate. +type TablesClientMigrateResponse struct { + // placeholder for future response values +} + // TablesClientUpdateResponse contains the response from method TablesClient.Update. type TablesClientUpdateResponse struct { Table diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_tables_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_tables_client.go index 238dd0a04978..8ed0ab767aea 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_tables_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_tables_client.go @@ -54,9 +54,149 @@ func NewTablesClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } +// BeginCreateOrUpdate - Update or Create a Log Analytics workspace table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// tableName - The name of the table. +// parameters - The parameters required to update table properties. +// options - TablesClientBeginCreateOrUpdateOptions contains the optional parameters for the TablesClient.BeginCreateOrUpdate +// method. +func (client *TablesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginCreateOrUpdateOptions) (*runtime.Poller[TablesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, workspaceName, tableName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[TablesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[TablesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Update or Create a Log Analytics workspace table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-01-preview +func (client *TablesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, tableName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *TablesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" + 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 tableName == "" { + return nil, errors.New("parameter tableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-12-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Delete a Log Analytics workspace table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// tableName - The name of the table. +// options - TablesClientBeginDeleteOptions contains the optional parameters for the TablesClient.BeginDelete method. +func (client *TablesClient) BeginDelete(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientBeginDeleteOptions) (*runtime.Poller[TablesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, workspaceName, tableName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[TablesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[TablesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete a Log Analytics workspace table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-01-preview +func (client *TablesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, tableName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *TablesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" + 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 tableName == "" { + return nil, errors.New("parameter tableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2021-12-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // Get - Gets a Log Analytics workspace table. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-08-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // tableName - The name of the table. @@ -100,7 +240,7 @@ func (client *TablesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +257,7 @@ func (client *TablesClient) getHandleResponse(resp *http.Response) (TablesClient // NewListByWorkspacePager - Gets all the tables for the specified Log Analytics workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-08-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - TablesClientListByWorkspaceOptions contains the optional parameters for the TablesClient.ListByWorkspace method. @@ -163,7 +303,7 @@ func (client *TablesClient) listByWorkspaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,31 +318,101 @@ func (client *TablesClient) listByWorkspaceHandleResponse(resp *http.Response) ( return result, nil } -// Update - Updates a Log Analytics workspace table properties. +// Migrate - Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of +// Data Collection Rule-based Custom Logs. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-08-01 +// Generated from API version 2021-12-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// tableName - The name of the table. +// options - TablesClientMigrateOptions contains the optional parameters for the TablesClient.Migrate method. +func (client *TablesClient) Migrate(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientMigrateOptions) (TablesClientMigrateResponse, error) { + req, err := client.migrateCreateRequest(ctx, resourceGroupName, workspaceName, tableName, options) + if err != nil { + return TablesClientMigrateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return TablesClientMigrateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return TablesClientMigrateResponse{}, runtime.NewResponseError(resp) + } + return TablesClientMigrateResponse{}, nil +} + +// migrateCreateRequest creates the Migrate request. +func (client *TablesClient) migrateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, options *TablesClientMigrateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate" + 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 tableName == "" { + return nil, errors.New("parameter tableName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{tableName}", url.PathEscape(tableName)) + 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-12-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginUpdate - Update a Log Analytics workspace table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // tableName - The name of the table. // parameters - The parameters required to update table properties. -// options - TablesClientUpdateOptions contains the optional parameters for the TablesClient.Update method. -func (client *TablesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientUpdateOptions) (TablesClientUpdateResponse, error) { +// options - TablesClientBeginUpdateOptions contains the optional parameters for the TablesClient.BeginUpdate method. +func (client *TablesClient) BeginUpdate(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginUpdateOptions) (*runtime.Poller[TablesClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, workspaceName, tableName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[TablesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[TablesClientUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Update - Update a Log Analytics workspace table. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2021-12-01-preview +func (client *TablesClient) update(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, tableName, parameters, options) if err != nil { - return TablesClientUpdateResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return TablesClientUpdateResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TablesClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.updateHandleResponse(resp) + return resp, nil } // updateCreateRequest creates the Update request. -func (client *TablesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientUpdateOptions) (*policy.Request, error) { +func (client *TablesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table, options *TablesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -225,17 +435,8 @@ func (client *TablesClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-08-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } - -// updateHandleResponse handles the Update response. -func (client *TablesClient) updateHandleResponse(resp *http.Response) (TablesClientUpdateResponse, error) { - result := TablesClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Table); err != nil { - return TablesClientUpdateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspaces_client.go b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspaces_client.go index 5e2d1918699a..7d9bc61806ca 100644 --- a/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspaces_client.go +++ b/sdk/resourcemanager/operationalinsights/armoperationalinsights/zz_generated_workspaces_client.go @@ -57,7 +57,7 @@ func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Create or update a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // parameters - The parameters required to create or update a workspace. @@ -77,7 +77,7 @@ func (client *WorkspacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Create or update a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview func (client *WorkspacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace, options *WorkspacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, parameters, options) if err != nil { @@ -113,7 +113,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -123,7 +123,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, // resource group and location. The name is kept for 14 days and cannot be used for // another workspace. To remove the workspace completely and release the name, use the force flag. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - WorkspacesClientBeginDeleteOptions contains the optional parameters for the WorkspacesClient.BeginDelete method. @@ -143,7 +143,7 @@ func (client *WorkspacesClient) BeginDelete(ctx context.Context, resourceGroupNa // resource group and location. The name is kept for 14 days and cannot be used for // another workspace. To remove the workspace completely and release the name, use the force flag. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview func (client *WorkspacesClient) deleteOperation(ctx context.Context, resourceGroupName string, workspaceName string, options *WorkspacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, options) if err != nil { @@ -179,7 +179,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -190,7 +190,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets a workspace instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - WorkspacesClientGetOptions contains the optional parameters for the WorkspacesClient.Get method. @@ -229,7 +229,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +246,7 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // NewListPager - Gets the workspaces in a subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // options - WorkspacesClientListOptions contains the optional parameters for the WorkspacesClient.List method. func (client *WorkspacesClient) NewListPager(options *WorkspacesClientListOptions) *runtime.Pager[WorkspacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[WorkspacesClientListResponse]{ @@ -282,7 +282,7 @@ func (client *WorkspacesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,7 +299,7 @@ func (client *WorkspacesClient) listHandleResponse(resp *http.Response) (Workspa // NewListByResourceGroupPager - Gets workspaces in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup // method. @@ -341,7 +341,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -358,7 +358,7 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // Update - Updates a workspace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-06-01 +// Generated from API version 2021-12-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // parameters - The parameters required to patch a workspace. @@ -398,7 +398,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-06-01") + reqQP.Set("api-version", "2021-12-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md b/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md index a9256155c385..b40da2d08700 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/CHANGELOG.md @@ -1,5 +1,888 @@ # Release History +## 2.0.0-beta.1 (2022-05-19) +### Breaking Changes + +- Type of `AzureResourceEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `MailMessageEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `RegistryValueEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `FileHashEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `MailboxEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `AccountEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `RegistryKeyEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `IPEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `WatchlistProperties.Source` has been changed from `*Source` to `*string` +- Type of `SecurityGroupEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `IncidentEntitiesResultsMetadata.EntityKind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `IoTDeviceEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `HuntingBookmark.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `Entity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `MalwareEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `ProcessEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- 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 `ThreatIntelligenceSortingCriteria.SortOrder` has been changed from `*ThreatIntelligenceSortingOrder` to `*ThreatIntelligenceSortingCriteriaEnum` +- Type of `SubmissionMailEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `FileEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `ThreatIntelligenceInformation.Kind` has been changed from `*ThreatIntelligenceResourceInnerKind` to `*ThreatIntelligenceResourceKindEnum` +- Type of `SecurityAlert.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `ThreatIntelligenceIndicatorModel.Kind` has been changed from `*ThreatIntelligenceResourceInnerKind` to `*ThreatIntelligenceResourceKindEnum` +- Type of `HostEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `CloudApplicationEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `DNSEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `URLEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Type of `IncidentPropertiesAction.Owner` has been changed from `*IncidentOwnerInfoAutoGenerated` to `*IncidentOwnerInfo` +- Type of `MailClusterEntity.Kind` has been changed from `*EntityKindEnum` to `*EntityKind` +- Const `EntityKindEnumBookmark` has been removed +- Const `ThreatIntelligenceResourceInnerKindIndicator` has been removed +- Const `EntityKindEnumAccount` has been removed +- Const `ThreatIntelligenceSortingOrderUnsorted` has been removed +- Const `EntityKindEnumDNSResolution` has been removed +- Const `EntityKindEnumRegistryKey` has been removed +- Const `EntityKindEnumCloudApplication` has been removed +- Const `EntityKindEnumMalware` has been removed +- Const `ThreatIntelligenceSortingOrderAscending` has been removed +- Const `EntityKindEnumMailMessage` has been removed +- Const `EntityKindEnumMailbox` has been removed +- Const `EntityKindEnumURL` has been removed +- Const `EntityKindEnumMailCluster` has been removed +- Const `EntityKindEnumIP` has been removed +- Const `EntityKindEnumAzureResource` has been removed +- Const `EntityKindEnumSubmissionMail` has been removed +- Const `ThreatIntelligenceSortingOrderDescending` has been removed +- Const `EntityKindEnumFileHash` has been removed +- Const `EntityKindEnumProcess` has been removed +- Const `SourceRemoteStorage` has been removed +- Const `EntityKindEnumSecurityGroup` has been removed +- Const `EntityKindEnumHost` has been removed +- Const `EntityKindEnumSecurityAlert` has been removed +- Const `EntityKindEnumIoTDevice` has been removed +- Const `EntityKindEnumFile` has been removed +- Const `EntityKindEnumRegistryValue` has been removed +- Const `SourceLocalFile` has been removed +- Function `PossibleSourceValues` has been removed +- Function `PossibleEntityKindEnumValues` has been removed +- Function `PossibleThreatIntelligenceResourceInnerKindValues` has been removed +- Function `PossibleThreatIntelligenceSortingOrderValues` has been removed +- Struct `IncidentOwnerInfoAutoGenerated` has been removed + +### Features Added + +- New const `SourceTypeLocalFile` +- New const `EntityTypeIP` +- New const `KindLogicAppsCustomConnector` +- New const `EntityItemQueryKindInsight` +- New const `EntityKindRegistryValue` +- New const `VersionV1` +- New const `ProviderNameMicrosoftOperationalInsightsWorkspacesDatasources` +- New const `SettingsStatusFlighting` +- New const `DataConnectorKindOffice365Project` +- New const `ConnectAuthKindAPIKey` +- New const `ProviderNameMicrosoftOperationalInsightsWorkspacesSharedKeys` +- New const `RepoTypeDevOps` +- New const `EntityQueryKindInsight` +- New const `SupportTierPartner` +- New const `EntityKindIP` +- New const `UebaDataSourcesSigninLogs` +- New const `ThreatIntelligenceSortingCriteriaEnumUnsorted` +- New const `KindWatchlistTemplate` +- New const `EntityTypeMailMessage` +- New const `GetInsightsErrorInsight` +- New const `AutomationRulePropertyArrayChangedConditionSupportedChangeTypeAdded` +- New const `DataConnectorKindMicrosoftThreatProtection` +- New const `MicrosoftSecurityProductNameOffice365AdvancedThreatProtection` +- New const `SourceKindLocalWorkspace` +- New const `SettingKindEyesOn` +- New const `RepoTypeGithub` +- New const `SourceKindCommunity` +- New const `DeploymentResultFailed` +- New const `EntityKindRegistryKey` +- New const `KindSolution` +- New const `EntityKindDNSResolution` +- New const `KindAnalyticsRule` +- New const `DeploymentResultSuccess` +- New const `SettingTypeInstructionStepsGroup` +- New const `EntityTypeFile` +- New const `EntityKindAccount` +- New const `ThreatIntelligenceSortingCriteriaEnumDescending` +- New const `SourceKindSolution` +- New const `AlertRuleKindNRT` +- New const `SettingsStatusProduction` +- New const `SettingKindEntityAnalytics` +- New const `SourceTypeRemoteStorage` +- New const `Enum13Activity` +- New const `AttackTacticResourceDevelopment` +- New const `EntityTypeAzureResource` +- New const `EntityTypeProcess` +- New const `OutputTypeString` +- New const `AutomationRulePropertyArrayChangedConditionSupportedArrayTypeLabels` +- New const `EntityTypeHuntingBookmark` +- New const `SupportTierMicrosoft` +- New const `EntityKindSubmissionMail` +- New const `ConditionTypePropertyChanged` +- New const `DataConnectorLicenseStateUnknown` +- New const `EntityTypeSecurityGroup` +- New const `AttackTacticInhibitResponseFunction` +- New const `UebaDataSourcesAuditLogs` +- New const `EntityTypeSecurityAlert` +- New const `EntityKindSecurityAlert` +- New const `DeploymentStateInProgress` +- New const `EntityTypeRegistryKey` +- New const `EntityProvidersAzureActiveDirectory` +- New const `DeploymentStateCanceling` +- New const `KindAutomationRule` +- New const `TriggersWhenUpdated` +- New const `EntityKindAzureResource` +- New const `EntityTypeDNS` +- New const `ThreatIntelligenceSortingCriteriaEnumAscending` +- New const `EntityTimelineKindSecurityAlert` +- New const `EntityKindFileHash` +- New const `EntityTypeIoTDevice` +- New const `DeploymentFetchStatusNotFound` +- New const `SupportTierCommunity` +- New const `EntityKindCloudApplication` +- New const `UebaDataSourcesAzureActivity` +- New const `ConnectAuthKindBasic` +- New const `DataConnectorKindAPIPolling` +- New const `AutomationRulePropertyArrayChangedConditionSupportedArrayTypeTactics` +- New const `DataConnectorKindOfficeIRM` +- New const `EntityQueryKindActivity` +- New const `UebaDataSourcesSecurityEvent` +- New const `DataConnectorKindOfficePowerBI` +- New const `KindInvestigationQuery` +- New const `EntityKindBookmark` +- New const `EntityTypeURL` +- New const `SettingTypeInfoMessage` +- New const `AutomationRulePropertyArrayChangedConditionSupportedArrayTypeAlerts` +- New const `EntityKindIoTDevice` +- New const `EntityKindMalware` +- New const `EntityQueryKindExpansion` +- New const `KindWatchlist` +- New const `CustomEntityQueryKindActivity` +- New const `DeploymentResultCanceled` +- New const `ThreatIntelligenceResourceKindEnumIndicator` +- New const `OutputTypeEntity` +- New const `AlertRuleKindThreatIntelligence` +- New const `EntityTypeMailbox` +- New const `MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection` +- New const `OperatorOR` +- New const `KindPlaybook` +- New const `PollingFrequencyOnceAMinute` +- New const `ProviderNameMicrosoftOperationalInsightsSolutions` +- New const `EntityTimelineKindAnomaly` +- New const `EntityTypeRegistryValue` +- New const `EntityTypeCloudApplication` +- New const `KindHuntingQuery` +- New const `ProviderNameMicrosoftOperationalInsightsWorkspaces` +- New const `KindParser` +- New const `OperatorAND` +- New const `DeploymentStateCompleted` +- New const `EntityTypeSubmissionMail` +- New const `AttackTacticImpairProcessControl` +- New const `SourceKindSourceRepository` +- New const `EntityTimelineKindActivity` +- New const `DataConnectorAuthorizationStateValid` +- New const `AutomationRulePropertyChangedConditionSupportedChangedTypeChangedFrom` +- New const `ProviderNameMicrosoftAadiamDiagnosticSettings` +- New const `ProviderNameMicrosoftAuthorizationPolicyAssignments` +- New const `KindWorkbookTemplate` +- New const `KindDataType` +- New const `KindDataConnector` +- New const `DataConnectorKindAmazonWebServicesS3` +- New const `EntityKindMailbox` +- New const `EntityTimelineKindBookmark` +- New const `EntityTypeMailCluster` +- New const `EntityKindHost` +- New const `KindAnalyticsRuleTemplate` +- New const `DataConnectorKindOfficeATP` +- New const `EntityTypeHost` +- New const `EntityKindURL` +- New const `EntityKindProcess` +- New const `SettingTypeCopyableLabel` +- New const `ConnectAuthKindOAuth2` +- New const `EntityKindMailMessage` +- New const `AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentSeverity` +- New const `DataConnectorKindMicrosoftThreatIntelligence` +- New const `Enum13Expansion` +- New const `AttackTacticReconnaissance` +- New const `PermissionProviderScopeResourceGroup` +- New const `DataConnectorAuthorizationStateInvalid` +- New const `PermissionProviderScopeSubscription` +- New const `DataConnectorKindIOT` +- New const `DeploymentFetchStatusSuccess` +- New const `ContentTypeAnalyticRule` +- New const `KindAzureFunction` +- New const `EntityProvidersActiveDirectory` +- New const `PollingFrequencyOnceADay` +- New const `AutomationRulePropertyChangedConditionSupportedChangedTypeChangedTo` +- New const `KindWorkbook` +- New const `EntityTypeAccount` +- New const `DataConnectorLicenseStateValid` +- New const `KindPlaybookTemplate` +- New const `AutomationRulePropertyArrayChangedConditionSupportedArrayTypeComments` +- New const `DataConnectorKindGenericUI` +- New const `VersionV2` +- New const `OutputTypeDate` +- New const `AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentStatus` +- New const `ContentTypeWorkbook` +- New const `EntityKindSecurityGroup` +- New const `OutputTypeNumber` +- New const `SettingKindUeba` +- New const `AlertRuleKindMLBehaviorAnalytics` +- New const `SettingKindAnomalies` +- New const `EntityTypeFileHash` +- New const `SecurityMLAnalyticsSettingsKindAnomaly` +- New const `EntityKindMailCluster` +- New const `DeploymentStateQueued` +- New const `EntityTypeMalware` +- New const `AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentOwner` +- New const `EntityKindFile` +- New const `ConditionTypePropertyArrayChanged` +- New const `Enum15Activity` +- New const `EntityQueryTemplateKindActivity` +- New const `ConnectivityTypeIsConnectedQuery` +- New const `PermissionProviderScopeWorkspace` +- New const `DataConnectorLicenseStateInvalid` +- New const `DeploymentFetchStatusUnauthorized` +- New const `DataConnectorKindDynamics365` +- New const `PollingFrequencyOnceAnHour` +- New const `DataConnectorKindThreatIntelligenceTaxii` +- New function `ExpansionEntityQuery.MarshalJSON() ([]byte, error)` +- New function `*DataConnectorsCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `MLBehaviorAnalyticsAlertRuleTemplate.MarshalJSON() ([]byte, error)` +- New function `ActivityCustomEntityQuery.MarshalJSON() ([]byte, error)` +- New function `NrtAlertRuleTemplateProperties.MarshalJSON() ([]byte, error)` +- New function `*GetQueriesResponse.UnmarshalJSON([]byte) error` +- New function `*PropertyArrayChangedConditionProperties.GetAutomationRuleCondition() *AutomationRuleCondition` +- New function `Office365ProjectCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `PossibleSecurityMLAnalyticsSettingsKindValues() []SecurityMLAnalyticsSettingsKind` +- New function `SourceControlProperties.MarshalJSON() ([]byte, error)` +- New function `OfficeATPDataConnector.MarshalJSON() ([]byte, error)` +- New function `PossibleKindValues() []Kind` +- New function `*SecurityMLAnalyticsSettingsList.UnmarshalJSON([]byte) error` +- New function `*CodelessUIDataConnector.UnmarshalJSON([]byte) error` +- New function `PropertyArrayChangedConditionProperties.MarshalJSON() ([]byte, error)` +- New function `*ThreatIntelligenceAlertRuleTemplate.GetAlertRuleTemplate() *AlertRuleTemplate` +- New function `CodelessUIDataConnector.MarshalJSON() ([]byte, error)` +- New function `MDATPCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*ProductSettingsClientGetResponse.UnmarshalJSON([]byte) error` +- New function `PossibleEntityQueryTemplateKindValues() []EntityQueryTemplateKind` +- New function `*DataConnectorsClient.Disconnect(context.Context, string, string, string, *DataConnectorsClientDisconnectOptions) (DataConnectorsClientDisconnectResponse, error)` +- New function `*AwsCloudTrailCheckRequirements.UnmarshalJSON([]byte) error` +- New function `MtpCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `PossiblePermissionProviderScopeValues() []PermissionProviderScope` +- New function `PossibleRepoTypeValues() []RepoType` +- New function `FusionSourceSettings.MarshalJSON() ([]byte, error)` +- New function `Deployment.MarshalJSON() ([]byte, error)` +- New function `*MLBehaviorAnalyticsAlertRuleTemplate.GetAlertRuleTemplate() *AlertRuleTemplate` +- New function `AwsS3CheckRequirements.MarshalJSON() ([]byte, error)` +- New function `PossibleCustomEntityQueryKindValues() []CustomEntityQueryKind` +- New function `*SecurityMLAnalyticsSettingsClientGetResponse.UnmarshalJSON([]byte) error` +- New function `SecurityMLAnalyticsSettingsDataSource.MarshalJSON() ([]byte, error)` +- New function `*SecurityAlertTimelineItem.UnmarshalJSON([]byte) error` +- New function `Dynamics365CheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*PropertyChangedConditionProperties.GetAutomationRuleCondition() *AutomationRuleCondition` +- New function `*AADCheckRequirements.UnmarshalJSON([]byte) error` +- New function `TeamProperties.MarshalJSON() ([]byte, error)` +- New function `*OfficeATPDataConnector.UnmarshalJSON([]byte) error` +- New function `PossibleSupportTierValues() []SupportTier` +- New function `*Settings.GetSettings() *Settings` +- New function `AATPCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `ThreatIntelligenceAlertRuleTemplateProperties.MarshalJSON() ([]byte, error)` +- New function `*MSTICheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `ActivityEntityQueryTemplateProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleEnum13Values() []Enum13` +- New function `*AnomalyTimelineItem.UnmarshalJSON([]byte) error` +- New function `AlertRuleTemplateWithMitreProperties.MarshalJSON() ([]byte, error)` +- New function `*EntityTimelineParameters.UnmarshalJSON([]byte) error` +- New function `*AnomalyTimelineItem.GetEntityTimelineItem() *EntityTimelineItem` +- New function `PossibleEntityTimelineKindValues() []EntityTimelineKind` +- New function `ActivityEntityQuery.MarshalJSON() ([]byte, error)` +- New function `*EntityAnalytics.UnmarshalJSON([]byte) error` +- New function `*EntitiesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `PossiblePollingFrequencyValues() []PollingFrequency` +- New function `*SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New function `MetadataPropertiesPatch.MarshalJSON() ([]byte, error)` +- New function `*OfficePowerBICheckRequirements.UnmarshalJSON([]byte) error` +- New function `AwsCloudTrailCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `ConnectivityCriteria.MarshalJSON() ([]byte, error)` +- New function `*Dynamics365CheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `EntityTimelineParameters.MarshalJSON() ([]byte, error)` +- New function `PossibleConnectivityTypeValues() []ConnectivityType` +- New function `Permissions.MarshalJSON() ([]byte, error)` +- New function `*NrtAlertRule.UnmarshalJSON([]byte) error` +- New function `*ActivityCustomEntityQuery.UnmarshalJSON([]byte) error` +- New function `Repository.MarshalJSON() ([]byte, error)` +- New function `EntityAnalyticsProperties.MarshalJSON() ([]byte, error)` +- New function `AwsS3DataConnectorProperties.MarshalJSON() ([]byte, error)` +- New function `ThreatIntelligenceAlertRuleTemplate.MarshalJSON() ([]byte, error)` +- New function `PossibleContentTypeValues() []ContentType` +- New function `*EntityQueryTemplate.GetEntityQueryTemplate() *EntityQueryTemplate` +- New function `AnomalySecurityMLAnalyticsSettings.MarshalJSON() ([]byte, error)` +- New function `*NrtAlertRuleTemplate.UnmarshalJSON([]byte) error` +- New function `EyesOn.MarshalJSON() ([]byte, error)` +- New function `*ActivityEntityQuery.GetEntityQuery() *EntityQuery` +- New function `MSTIDataConnector.MarshalJSON() ([]byte, error)` +- New function `MetadataDependencies.MarshalJSON() ([]byte, error)` +- New function `*PropertyArrayChangedConditionProperties.UnmarshalJSON([]byte) error` +- New function `PossibleAutomationRulePropertyArrayChangedConditionSupportedArrayTypeValues() []AutomationRulePropertyArrayChangedConditionSupportedArrayType` +- New function `*EntityQueryItem.GetEntityQueryItem() *EntityQueryItem` +- New function `Dynamics365DataConnector.MarshalJSON() ([]byte, error)` +- New function `ThreatIntelligenceAlertRuleProperties.MarshalJSON() ([]byte, error)` +- New function `ActivityEntityQueriesProperties.MarshalJSON() ([]byte, error)` +- New function `FusionSubTypeSeverityFilter.MarshalJSON() ([]byte, error)` +- New function `PossibleEntityQueryKindValues() []EntityQueryKind` +- New function `FusionTemplateSubTypeSeverityFilter.MarshalJSON() ([]byte, error)` +- New function `*AnomalySecurityMLAnalyticsSettingsProperties.UnmarshalJSON([]byte) error` +- New function `PossibleThreatIntelligenceSortingCriteriaEnumValues() []ThreatIntelligenceSortingCriteriaEnum` +- New function `UebaProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleDeploymentResultValues() []DeploymentResult` +- New function `*IncidentsClient.RunPlaybook(context.Context, string, string, string, *IncidentsClientRunPlaybookOptions) (IncidentsClientRunPlaybookResponse, error)` +- New function `OfficeATPCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*ExpansionEntityQuery.GetEntityQuery() *EntityQuery` +- New function `*OfficeIRMDataConnector.GetDataConnector() *DataConnector` +- New function `EntityGetInsightsParameters.MarshalJSON() ([]byte, error)` +- New function `MSTICheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*AwsS3CheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `Ueba.MarshalJSON() ([]byte, error)` +- New function `*BookmarkTimelineItem.UnmarshalJSON([]byte) error` +- New function `AADCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*EntityAnalytics.GetSettings() *Settings` +- New function `*OfficeATPCheckRequirements.UnmarshalJSON([]byte) error` +- New function `AutomationRulePropertyValuesChangedCondition.MarshalJSON() ([]byte, error)` +- New function `PossibleSourceTypeValues() []SourceType` +- New function `*MetadataProperties.UnmarshalJSON([]byte) error` +- New function `*AwsS3DataConnector.UnmarshalJSON([]byte) error` +- New function `*EntityList.UnmarshalJSON([]byte) error` +- New function `*ActivityEntityQueryTemplate.UnmarshalJSON([]byte) error` +- New function `*AwsCloudTrailCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `CodelessAPIPollingDataConnector.MarshalJSON() ([]byte, error)` +- New function `*TICheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*MtpCheckRequirements.UnmarshalJSON([]byte) error` +- New function `MetadataProperties.MarshalJSON() ([]byte, error)` +- New function `*EntityQueriesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `PossibleEntityKindValues() []EntityKind` +- New function `BookmarkExpandParameters.MarshalJSON() ([]byte, error)` +- New function `*ActivityTimelineItem.GetEntityTimelineItem() *EntityTimelineItem` +- New function `*MtpCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*AlertRuleTemplateWithMitreProperties.UnmarshalJSON([]byte) error` +- New function `MLBehaviorAnalyticsAlertRuleProperties.MarshalJSON() ([]byte, error)` +- New function `BookmarkEntityMappings.MarshalJSON() ([]byte, error)` +- New function `TiTaxiiDataConnector.MarshalJSON() ([]byte, error)` +- New function `MetadataPatch.MarshalJSON() ([]byte, error)` +- New function `*TiTaxiiDataConnectorProperties.UnmarshalJSON([]byte) error` +- New function `MTPDataConnector.MarshalJSON() ([]byte, error)` +- New function `*ThreatIntelligenceAlertRuleProperties.UnmarshalJSON([]byte) error` +- New function `CodelessUIConnectorConfigPropertiesInstructionStepsItem.MarshalJSON() ([]byte, error)` +- New function `*DataConnectorsClient.Connect(context.Context, string, string, string, DataConnectorConnectBody, *DataConnectorsClientConnectOptions) (DataConnectorsClientConnectResponse, error)` +- New function `PossibleConnectAuthKindValues() []ConnectAuthKind` +- New function `*EntityQueriesClientCreateOrUpdateResponse.UnmarshalJSON([]byte) error` +- New function `NrtAlertRuleTemplate.MarshalJSON() ([]byte, error)` +- New function `PossibleAutomationRulePropertyChangedConditionSupportedPropertyTypeValues() []AutomationRulePropertyChangedConditionSupportedPropertyType` +- New function `*AlertRuleTemplatePropertiesBase.UnmarshalJSON([]byte) error` +- New function `*MSTIDataConnector.UnmarshalJSON([]byte) error` +- New function `*Ueba.UnmarshalJSON([]byte) error` +- New function `*EntityTimelineResponse.UnmarshalJSON([]byte) error` +- New function `*Dynamics365CheckRequirements.UnmarshalJSON([]byte) error` +- New function `CodelessConnectorPollingResponseProperties.MarshalJSON() ([]byte, error)` +- New function `FusionTemplateSourceSetting.MarshalJSON() ([]byte, error)` +- New function `PossibleSettingKindValues() []SettingKind` +- New function `*MLBehaviorAnalyticsAlertRuleTemplate.UnmarshalJSON([]byte) error` +- New function `*MTPDataConnector.UnmarshalJSON([]byte) error` +- New function `*Office365ProjectCheckRequirements.UnmarshalJSON([]byte) error` +- New function `*ActivityCustomEntityQuery.GetCustomEntityQuery() *CustomEntityQuery` +- New function `*InsightQueryItem.UnmarshalJSON([]byte) error` +- New function `*MLBehaviorAnalyticsAlertRule.UnmarshalJSON([]byte) error` +- New function `DataConnectorConnectBody.MarshalJSON() ([]byte, error)` +- New function `PossibleDataConnectorLicenseStateValues() []DataConnectorLicenseState` +- New function `OfficePowerBICheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*NrtAlertRule.GetAlertRule() *AlertRule` +- New function `PossibleEntityTypeValues() []EntityType` +- New function `*BookmarkExpandResponseValue.UnmarshalJSON([]byte) error` +- New function `AlertRuleTemplatePropertiesBase.MarshalJSON() ([]byte, error)` +- New function `*AnomalySecurityMLAnalyticsSettings.UnmarshalJSON([]byte) error` +- New function `ExpansionEntityQueriesProperties.MarshalJSON() ([]byte, error)` +- New function `*EnrichmentDomainWhois.UnmarshalJSON([]byte) error` +- New function `*TiTaxiiCheckRequirements.UnmarshalJSON([]byte) error` +- New function `NrtAlertRule.MarshalJSON() ([]byte, error)` +- New function `*EntityExpandParameters.UnmarshalJSON([]byte) error` +- New function `*CustomEntityQuery.GetCustomEntityQuery() *CustomEntityQuery` +- New function `PossibleGetInsightsErrorValues() []GetInsightsError` +- New function `*AADCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*IoTCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `ThreatIntelligenceAlertRule.MarshalJSON() ([]byte, error)` +- New function `*ThreatIntelligenceAlertRule.UnmarshalJSON([]byte) error` +- New function `*MLBehaviorAnalyticsAlertRule.GetAlertRule() *AlertRule` +- New function `*TiTaxiiCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*OfficeIRMCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*TeamInformation.UnmarshalJSON([]byte) error` +- New function `PossibleAutomationRulePropertyChangedConditionSupportedChangedTypeValues() []AutomationRulePropertyChangedConditionSupportedChangedType` +- New function `*CodelessAPIPollingDataConnector.GetDataConnector() *DataConnector` +- New function `*SecurityAlertTimelineItem.GetEntityTimelineItem() *EntityTimelineItem` +- New function `*OfficePowerBICheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*OfficePowerBIDataConnector.UnmarshalJSON([]byte) error` +- New function `IoTDataConnector.MarshalJSON() ([]byte, error)` +- New function `*Office365ProjectCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*AnomalySecurityMLAnalyticsSettings.GetSecurityMLAnalyticsSetting() *SecurityMLAnalyticsSetting` +- New function `PropertyChangedConditionProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleEntityProvidersValues() []EntityProviders` +- New function `*SecurityMLAnalyticsSetting.GetSecurityMLAnalyticsSetting() *SecurityMLAnalyticsSetting` +- New function `PossibleSourceKindValues() []SourceKind` +- New function `*MSTICheckRequirements.UnmarshalJSON([]byte) error` +- New function `PossibleOperatorValues() []Operator` +- New function `*ActivityEntityQueryTemplate.GetEntityQueryTemplate() *EntityQueryTemplate` +- New function `*OfficeIRMCheckRequirements.UnmarshalJSON([]byte) error` +- New function `CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem.MarshalJSON() ([]byte, error)` +- New function `*ActivityEntityQueriesProperties.UnmarshalJSON([]byte) error` +- New function `PossibleDataConnectorAuthorizationStateValues() []DataConnectorAuthorizationState` +- New function `*Office365ProjectDataConnector.UnmarshalJSON([]byte) error` +- New function `*EntityQueryList.UnmarshalJSON([]byte) error` +- New function `PossibleDeploymentFetchStatusValues() []DeploymentFetchStatus` +- New function `InstructionSteps.MarshalJSON() ([]byte, error)` +- New function `OfficeIRMDataConnector.MarshalJSON() ([]byte, error)` +- New function `OfficeIRMCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*MetadataPropertiesPatch.UnmarshalJSON([]byte) error` +- New function `TiTaxiiDataConnectorProperties.MarshalJSON() ([]byte, error)` +- New function `*EntityQueryTemplatesClientGetResponse.UnmarshalJSON([]byte) error` +- New function `*TiTaxiiDataConnector.UnmarshalJSON([]byte) error` +- New function `*Dynamics365DataConnector.UnmarshalJSON([]byte) error` +- New function `*EntityInsightItemQueryTimeInterval.UnmarshalJSON([]byte) error` +- New function `*NrtAlertRuleTemplateProperties.UnmarshalJSON([]byte) error` +- New function `*NrtAlertRuleProperties.UnmarshalJSON([]byte) error` +- New function `*AwsS3CheckRequirements.UnmarshalJSON([]byte) error` +- New function `ActivityEntityQueryTemplate.MarshalJSON() ([]byte, error)` +- New function `PossibleVersionValues() []Version` +- New function `*MLBehaviorAnalyticsAlertRuleProperties.UnmarshalJSON([]byte) error` +- New function `AwsS3DataConnector.MarshalJSON() ([]byte, error)` +- New function `CodelessUIConnectorConfigProperties.MarshalJSON() ([]byte, error)` +- New function `*CodelessUIDataConnector.GetDataConnector() *DataConnector` +- New function `*MSTIDataConnector.GetDataConnector() *DataConnector` +- New function `*AATPCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*MDATPCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `TiTaxiiCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `PossibleEntityItemQueryKindValues() []EntityItemQueryKind` +- New function `MCASCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*TiTaxiiDataConnector.GetDataConnector() *DataConnector` +- New function `PossibleAutomationRulePropertyArrayChangedConditionSupportedChangeTypeValues() []AutomationRulePropertyArrayChangedConditionSupportedChangeType` +- New function `*EyesOn.GetSettings() *Settings` +- New function `*IoTDataConnector.UnmarshalJSON([]byte) error` +- New function `EntityAnalytics.MarshalJSON() ([]byte, error)` +- New function `*ASCCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*OfficeATPCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*ThreatIntelligenceAlertRuleTemplateProperties.UnmarshalJSON([]byte) error` +- New function `*TICheckRequirements.UnmarshalJSON([]byte) error` +- New function `NrtAlertRuleProperties.MarshalJSON() ([]byte, error)` +- New function `*Office365ProjectDataConnector.GetDataConnector() *DataConnector` +- New function `PossibleDeploymentStateValues() []DeploymentState` +- New function `*Deployment.UnmarshalJSON([]byte) error` +- New function `*IncidentsClient.CreateTeam(context.Context, string, string, string, TeamProperties, *IncidentsClientCreateTeamOptions) (IncidentsClientCreateTeamResponse, error)` +- New function `*SettingList.UnmarshalJSON([]byte) error` +- New function `*EntityQueryTemplateList.UnmarshalJSON([]byte) error` +- New function `PossibleOutputTypeValues() []OutputType` +- New function `TICheckRequirements.MarshalJSON() ([]byte, error)` +- New function `Anomalies.MarshalJSON() ([]byte, error)` +- New function `*AATPCheckRequirements.UnmarshalJSON([]byte) error` +- New function `*MCASCheckRequirements.GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements` +- New function `*OfficeIRMDataConnector.UnmarshalJSON([]byte) error` +- New function `PossibleSettingsStatusValues() []SettingsStatus` +- New function `*EntityExpandResponseValue.UnmarshalJSON([]byte) error` +- New function `*OfficeATPDataConnector.GetDataConnector() *DataConnector` +- New function `PossibleThreatIntelligenceResourceKindEnumValues() []ThreatIntelligenceResourceKindEnum` +- New function `*InsightQueryItem.GetEntityQueryItem() *EntityQueryItem` +- New function `*IoTCheckRequirements.UnmarshalJSON([]byte) error` +- New function `MetadataCategories.MarshalJSON() ([]byte, error)` +- New function `*PropertyChangedConditionProperties.UnmarshalJSON([]byte) error` +- New function `*AwsS3DataConnector.GetDataConnector() *DataConnector` +- New function `MLBehaviorAnalyticsAlertRule.MarshalJSON() ([]byte, error)` +- New function `*Anomalies.GetSettings() *Settings` +- New function `*OfficePowerBIDataConnector.GetDataConnector() *DataConnector` +- New function `*ExpansionEntityQuery.UnmarshalJSON([]byte) error` +- New function `QueryBasedAlertRuleTemplateProperties.MarshalJSON() ([]byte, error)` +- New function `AnomalySecurityMLAnalyticsSettingsProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleProviderNameValues() []ProviderName` +- New function `OfficePowerBIDataConnector.MarshalJSON() ([]byte, error)` +- New function `*Ueba.GetSettings() *Settings` +- New function `PossibleSettingTypeValues() []SettingType` +- New function `*MDATPCheckRequirements.UnmarshalJSON([]byte) error` +- New function `TeamInformation.MarshalJSON() ([]byte, error)` +- New function `MLBehaviorAnalyticsAlertRuleTemplateProperties.MarshalJSON() ([]byte, error)` +- New function `*NrtAlertRuleTemplate.GetAlertRuleTemplate() *AlertRuleTemplate` +- New function `*EntityTimelineItem.GetEntityTimelineItem() *EntityTimelineItem` +- New function `*ActivityTimelineItem.UnmarshalJSON([]byte) error` +- New function `*ThreatIntelligenceAlertRuleTemplate.UnmarshalJSON([]byte) error` +- New function `PossibleEnum15Values() []Enum15` +- New function `*ActivityEntityQuery.UnmarshalJSON([]byte) error` +- New function `*MLBehaviorAnalyticsAlertRuleTemplateProperties.UnmarshalJSON([]byte) error` +- New function `PossibleUebaDataSourcesValues() []UebaDataSources` +- New function `*Dynamics365DataConnector.GetDataConnector() *DataConnector` +- New function `*MTPDataConnector.GetDataConnector() *DataConnector` +- New function `*EyesOn.UnmarshalJSON([]byte) error` +- New function `*MCASCheckRequirements.UnmarshalJSON([]byte) error` +- New function `*EntityGetInsightsParameters.UnmarshalJSON([]byte) error` +- New function `*IoTDataConnector.GetDataConnector() *DataConnector` +- New function `*EntityQuery.GetEntityQuery() *EntityQuery` +- New function `*CodelessAPIPollingDataConnector.UnmarshalJSON([]byte) error` +- New function `*BookmarkExpandParameters.UnmarshalJSON([]byte) error` +- New function `*BookmarkTimelineItem.GetEntityTimelineItem() *EntityTimelineItem` +- New function `*ASCCheckRequirements.UnmarshalJSON([]byte) error` +- New function `Office365ProjectDataConnector.MarshalJSON() ([]byte, error)` +- New function `ASCCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `IoTCheckRequirements.MarshalJSON() ([]byte, error)` +- New function `*Anomalies.UnmarshalJSON([]byte) error` +- New function `EntityExpandParameters.MarshalJSON() ([]byte, error)` +- New function `*ThreatIntelligenceAlertRule.GetAlertRule() *AlertRule` +- New function `*ProductSettingsClientUpdateResponse.UnmarshalJSON([]byte) error` +- New struct `AADCheckRequirements` +- New struct `AADCheckRequirementsProperties` +- New struct `AATPCheckRequirements` +- New struct `AATPCheckRequirementsProperties` +- New struct `APIPollingParameters` +- New struct `ASCCheckRequirements` +- New struct `ASCCheckRequirementsProperties` +- New struct `ActivityCustomEntityQuery` +- New struct `ActivityEntityQueriesProperties` +- New struct `ActivityEntityQueriesPropertiesQueryDefinitions` +- New struct `ActivityEntityQuery` +- New struct `ActivityEntityQueryTemplate` +- New struct `ActivityEntityQueryTemplateProperties` +- New struct `ActivityEntityQueryTemplatePropertiesQueryDefinitions` +- New struct `ActivityTimelineItem` +- New struct `AlertRuleTemplatePropertiesBase` +- New struct `AlertRuleTemplateWithMitreProperties` +- New struct `Anomalies` +- New struct `AnomaliesSettingsProperties` +- New struct `AnomalySecurityMLAnalyticsSettings` +- New struct `AnomalySecurityMLAnalyticsSettingsProperties` +- New struct `AnomalyTimelineItem` +- New struct `AutomationRulePropertyArrayChangedValuesCondition` +- New struct `AutomationRulePropertyValuesChangedCondition` +- New struct `Availability` +- New struct `AwsCloudTrailCheckRequirements` +- New struct `AwsS3CheckRequirements` +- New struct `AwsS3DataConnector` +- New struct `AwsS3DataConnectorDataTypes` +- New struct `AwsS3DataConnectorDataTypesLogs` +- New struct `AwsS3DataConnectorProperties` +- New struct `AzureDevOpsResourceInfo` +- New struct `BookmarkClientExpandOptions` +- New struct `BookmarkClientExpandResponse` +- New struct `BookmarkEntityMappings` +- New struct `BookmarkExpandParameters` +- New struct `BookmarkExpandResponse` +- New struct `BookmarkExpandResponseValue` +- New struct `BookmarkRelationsClientCreateOrUpdateOptions` +- New struct `BookmarkRelationsClientCreateOrUpdateResponse` +- New struct `BookmarkRelationsClientDeleteOptions` +- New struct `BookmarkRelationsClientDeleteResponse` +- New struct `BookmarkRelationsClientGetOptions` +- New struct `BookmarkRelationsClientGetResponse` +- New struct `BookmarkRelationsClientListOptions` +- New struct `BookmarkRelationsClientListResponse` +- New struct `BookmarkTimelineItem` +- New struct `CodelessAPIPollingDataConnector` +- New struct `CodelessConnectorPollingAuthProperties` +- New struct `CodelessConnectorPollingConfigProperties` +- New struct `CodelessConnectorPollingPagingProperties` +- New struct `CodelessConnectorPollingRequestProperties` +- New struct `CodelessConnectorPollingResponseProperties` +- New struct `CodelessParameters` +- New struct `CodelessUIConnectorConfigProperties` +- New struct `CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem` +- New struct `CodelessUIConnectorConfigPropertiesDataTypesItem` +- New struct `CodelessUIConnectorConfigPropertiesGraphQueriesItem` +- New struct `CodelessUIConnectorConfigPropertiesInstructionStepsItem` +- New struct `CodelessUIConnectorConfigPropertiesSampleQueriesItem` +- New struct `CodelessUIDataConnector` +- New struct `ConnectedEntity` +- New struct `ConnectivityCriteria` +- New struct `ConnectorInstructionModelBase` +- New struct `ContentPathMap` +- New struct `CustomEntityQuery` +- New struct `Customs` +- New struct `CustomsPermission` +- New struct `DataConnectorConnectBody` +- New struct `DataConnectorRequirementsState` +- New struct `DataConnectorsCheckRequirements` +- New struct `DataConnectorsCheckRequirementsClientPostOptions` +- New struct `DataConnectorsCheckRequirementsClientPostResponse` +- New struct `DataConnectorsClientConnectOptions` +- New struct `DataConnectorsClientConnectResponse` +- New struct `DataConnectorsClientDisconnectOptions` +- New struct `DataConnectorsClientDisconnectResponse` +- New struct `DataTypeDefinitions` +- New struct `Deployment` +- New struct `DeploymentInfo` +- New struct `DomainWhoisClientGetOptions` +- New struct `DomainWhoisClientGetResponse` +- New struct `Dynamics365CheckRequirements` +- New struct `Dynamics365CheckRequirementsProperties` +- New struct `Dynamics365DataConnector` +- New struct `Dynamics365DataConnectorDataTypes` +- New struct `Dynamics365DataConnectorDataTypesDynamics365CdsActivities` +- New struct `Dynamics365DataConnectorProperties` +- New struct `EnrichmentDomainWhois` +- New struct `EnrichmentDomainWhoisContact` +- New struct `EnrichmentDomainWhoisContacts` +- New struct `EnrichmentDomainWhoisDetails` +- New struct `EnrichmentDomainWhoisRegistrarDetails` +- New struct `EnrichmentIPGeodata` +- New struct `EntitiesClientExpandOptions` +- New struct `EntitiesClientExpandResponse` +- New struct `EntitiesClientGetInsightsOptions` +- New struct `EntitiesClientGetInsightsResponse` +- New struct `EntitiesClientGetOptions` +- New struct `EntitiesClientGetResponse` +- New struct `EntitiesClientListOptions` +- New struct `EntitiesClientListResponse` +- New struct `EntitiesClientQueriesOptions` +- New struct `EntitiesClientQueriesResponse` +- New struct `EntitiesGetTimelineClientListOptions` +- New struct `EntitiesGetTimelineClientListResponse` +- New struct `EntitiesRelationsClientListOptions` +- New struct `EntitiesRelationsClientListResponse` +- New struct `EntityAnalytics` +- New struct `EntityAnalyticsProperties` +- New struct `EntityEdges` +- New struct `EntityExpandParameters` +- New struct `EntityExpandResponse` +- New struct `EntityExpandResponseValue` +- New struct `EntityFieldMapping` +- New struct `EntityGetInsightsParameters` +- New struct `EntityGetInsightsResponse` +- New struct `EntityInsightItem` +- New struct `EntityInsightItemQueryTimeInterval` +- New struct `EntityList` +- New struct `EntityQueriesClientCreateOrUpdateOptions` +- New struct `EntityQueriesClientCreateOrUpdateResponse` +- New struct `EntityQueriesClientDeleteOptions` +- New struct `EntityQueriesClientDeleteResponse` +- New struct `EntityQueriesClientGetOptions` +- New struct `EntityQueriesClientGetResponse` +- New struct `EntityQueriesClientListOptions` +- New struct `EntityQueriesClientListResponse` +- New struct `EntityQuery` +- New struct `EntityQueryItem` +- New struct `EntityQueryItemProperties` +- New struct `EntityQueryItemPropertiesDataTypesItem` +- New struct `EntityQueryList` +- New struct `EntityQueryTemplate` +- New struct `EntityQueryTemplateList` +- New struct `EntityQueryTemplatesClientGetOptions` +- New struct `EntityQueryTemplatesClientGetResponse` +- New struct `EntityQueryTemplatesClientListOptions` +- New struct `EntityQueryTemplatesClientListResponse` +- New struct `EntityRelationsClientGetRelationOptions` +- New struct `EntityRelationsClientGetRelationResponse` +- New struct `EntityTimelineItem` +- New struct `EntityTimelineParameters` +- New struct `EntityTimelineResponse` +- New struct `ExpansionEntityQueriesProperties` +- New struct `ExpansionEntityQuery` +- New struct `ExpansionResultAggregation` +- New struct `ExpansionResultsMetadata` +- New struct `EyesOn` +- New struct `EyesOnSettingsProperties` +- New struct `FusionScenarioExclusionPattern` +- New struct `FusionSourceSettings` +- New struct `FusionSourceSubTypeSetting` +- New struct `FusionSubTypeSeverityFilter` +- New struct `FusionSubTypeSeverityFiltersItem` +- New struct `FusionTemplateSourceSetting` +- New struct `FusionTemplateSourceSubType` +- New struct `FusionTemplateSubTypeSeverityFilter` +- New struct `GetInsightsErrorKind` +- New struct `GetInsightsResultsMetadata` +- New struct `GetQueriesResponse` +- New struct `GitHubResourceInfo` +- New struct `GraphQueries` +- New struct `IPGeodataClientGetOptions` +- New struct `IPGeodataClientGetResponse` +- New struct `IncidentsClientCreateTeamOptions` +- New struct `IncidentsClientCreateTeamResponse` +- New struct `IncidentsClientRunPlaybookOptions` +- New struct `IncidentsClientRunPlaybookResponse` +- New struct `InsightQueryItem` +- New struct `InsightQueryItemProperties` +- New struct `InsightQueryItemPropertiesAdditionalQuery` +- New struct `InsightQueryItemPropertiesDefaultTimeRange` +- New struct `InsightQueryItemPropertiesReferenceTimeRange` +- New struct `InsightQueryItemPropertiesTableQuery` +- New struct `InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem` +- New struct `InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem` +- New struct `InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem` +- New struct `InsightsTableResult` +- New struct `InsightsTableResultColumnsItem` +- New struct `InstructionSteps` +- New struct `InstructionStepsInstructionsItem` +- New struct `IoTCheckRequirements` +- New struct `IoTCheckRequirementsProperties` +- New struct `IoTDataConnector` +- New struct `IoTDataConnectorProperties` +- New struct `LastDataReceivedDataType` +- New struct `MCASCheckRequirements` +- New struct `MCASCheckRequirementsProperties` +- New struct `MDATPCheckRequirements` +- New struct `MDATPCheckRequirementsProperties` +- New struct `MLBehaviorAnalyticsAlertRule` +- New struct `MLBehaviorAnalyticsAlertRuleProperties` +- New struct `MLBehaviorAnalyticsAlertRuleTemplate` +- New struct `MLBehaviorAnalyticsAlertRuleTemplateProperties` +- New struct `MSTICheckRequirements` +- New struct `MSTICheckRequirementsProperties` +- New struct `MSTIDataConnector` +- New struct `MSTIDataConnectorDataTypes` +- New struct `MSTIDataConnectorDataTypesBingSafetyPhishingURL` +- New struct `MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed` +- New struct `MSTIDataConnectorProperties` +- New struct `MTPCheckRequirementsProperties` +- New struct `MTPDataConnector` +- New struct `MTPDataConnectorDataTypes` +- New struct `MTPDataConnectorDataTypesIncidents` +- New struct `MTPDataConnectorProperties` +- New struct `ManualTriggerRequestBody` +- New struct `MetadataAuthor` +- New struct `MetadataCategories` +- New struct `MetadataClientCreateOptions` +- New struct `MetadataClientCreateResponse` +- New struct `MetadataClientDeleteOptions` +- New struct `MetadataClientDeleteResponse` +- New struct `MetadataClientGetOptions` +- New struct `MetadataClientGetResponse` +- New struct `MetadataClientListOptions` +- New struct `MetadataClientListResponse` +- New struct `MetadataClientUpdateOptions` +- New struct `MetadataClientUpdateResponse` +- New struct `MetadataDependencies` +- New struct `MetadataList` +- New struct `MetadataModel` +- New struct `MetadataPatch` +- New struct `MetadataProperties` +- New struct `MetadataPropertiesPatch` +- New struct `MetadataSource` +- New struct `MetadataSupport` +- New struct `MtpCheckRequirements` +- New struct `NrtAlertRule` +- New struct `NrtAlertRuleProperties` +- New struct `NrtAlertRuleTemplate` +- New struct `NrtAlertRuleTemplateProperties` +- New struct `Office365ProjectCheckRequirements` +- New struct `Office365ProjectCheckRequirementsProperties` +- New struct `Office365ProjectConnectorDataTypes` +- New struct `Office365ProjectConnectorDataTypesLogs` +- New struct `Office365ProjectDataConnector` +- New struct `Office365ProjectDataConnectorProperties` +- New struct `OfficeATPCheckRequirements` +- New struct `OfficeATPCheckRequirementsProperties` +- New struct `OfficeATPDataConnector` +- New struct `OfficeATPDataConnectorProperties` +- New struct `OfficeConsent` +- New struct `OfficeConsentList` +- New struct `OfficeConsentProperties` +- New struct `OfficeConsentsClientDeleteOptions` +- New struct `OfficeConsentsClientDeleteResponse` +- New struct `OfficeConsentsClientGetOptions` +- New struct `OfficeConsentsClientGetResponse` +- New struct `OfficeConsentsClientListOptions` +- New struct `OfficeConsentsClientListResponse` +- New struct `OfficeIRMCheckRequirements` +- New struct `OfficeIRMCheckRequirementsProperties` +- New struct `OfficeIRMDataConnector` +- New struct `OfficeIRMDataConnectorProperties` +- New struct `OfficePowerBICheckRequirements` +- New struct `OfficePowerBICheckRequirementsProperties` +- New struct `OfficePowerBIConnectorDataTypes` +- New struct `OfficePowerBIConnectorDataTypesLogs` +- New struct `OfficePowerBIDataConnector` +- New struct `OfficePowerBIDataConnectorProperties` +- New struct `Permissions` +- New struct `PermissionsCustomsItem` +- New struct `PermissionsResourceProviderItem` +- New struct `ProductSettingsClientDeleteOptions` +- New struct `ProductSettingsClientDeleteResponse` +- New struct `ProductSettingsClientGetOptions` +- New struct `ProductSettingsClientGetResponse` +- New struct `ProductSettingsClientListOptions` +- New struct `ProductSettingsClientListResponse` +- New struct `ProductSettingsClientUpdateOptions` +- New struct `ProductSettingsClientUpdateResponse` +- New struct `PropertyArrayChangedConditionProperties` +- New struct `PropertyChangedConditionProperties` +- New struct `QueryBasedAlertRuleTemplateProperties` +- New struct `Repo` +- New struct `RepoList` +- New struct `Repository` +- New struct `RepositoryResourceInfo` +- New struct `RequiredPermissions` +- New struct `ResourceProvider` +- New struct `SampleQueries` +- New struct `SecurityAlertTimelineItem` +- New struct `SecurityMLAnalyticsSetting` +- New struct `SecurityMLAnalyticsSettingsClientCreateOrUpdateOptions` +- New struct `SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse` +- New struct `SecurityMLAnalyticsSettingsClientDeleteOptions` +- New struct `SecurityMLAnalyticsSettingsClientDeleteResponse` +- New struct `SecurityMLAnalyticsSettingsClientGetOptions` +- New struct `SecurityMLAnalyticsSettingsClientGetResponse` +- New struct `SecurityMLAnalyticsSettingsClientListOptions` +- New struct `SecurityMLAnalyticsSettingsClientListResponse` +- New struct `SecurityMLAnalyticsSettingsDataSource` +- New struct `SecurityMLAnalyticsSettingsList` +- New struct `SettingList` +- New struct `Settings` +- New struct `SourceControl` +- New struct `SourceControlClientListRepositoriesOptions` +- New struct `SourceControlClientListRepositoriesResponse` +- New struct `SourceControlList` +- New struct `SourceControlProperties` +- New struct `SourceControlsClientCreateOptions` +- New struct `SourceControlsClientCreateResponse` +- New struct `SourceControlsClientDeleteOptions` +- New struct `SourceControlsClientDeleteResponse` +- New struct `SourceControlsClientGetOptions` +- New struct `SourceControlsClientGetResponse` +- New struct `SourceControlsClientListOptions` +- New struct `SourceControlsClientListResponse` +- New struct `TICheckRequirements` +- New struct `TICheckRequirementsProperties` +- New struct `TeamInformation` +- New struct `TeamProperties` +- New struct `ThreatIntelligenceAlertRule` +- New struct `ThreatIntelligenceAlertRuleProperties` +- New struct `ThreatIntelligenceAlertRuleTemplate` +- New struct `ThreatIntelligenceAlertRuleTemplateProperties` +- New struct `TiTaxiiCheckRequirements` +- New struct `TiTaxiiCheckRequirementsProperties` +- New struct `TiTaxiiDataConnector` +- New struct `TiTaxiiDataConnectorDataTypes` +- New struct `TiTaxiiDataConnectorDataTypesTaxiiClient` +- New struct `TiTaxiiDataConnectorProperties` +- New struct `TimelineAggregation` +- New struct `TimelineError` +- New struct `TimelineResultsMetadata` +- New struct `Ueba` +- New struct `UebaProperties` +- New struct `Webhook` +- New field `Techniques` in struct `ScheduledAlertRuleProperties` +- New field `ProviderIncidentURL` in struct `IncidentAdditionalData` +- New field `Techniques` in struct `IncidentAdditionalData` +- New field `Techniques` in struct `ScheduledAlertRuleTemplateProperties` +- New field `SourceSettings` in struct `FusionAlertRuleTemplateProperties` +- New field `Techniques` in struct `FusionAlertRuleTemplateProperties` +- New field `AzureAsyncOperation` in struct `WatchlistsClientCreateOrUpdateResponse` +- New field `SourceSettings` in struct `FusionAlertRuleProperties` +- New field `Techniques` in struct `FusionAlertRuleProperties` +- New field `ScenarioExclusionPatterns` in struct `FusionAlertRuleProperties` +- New field `TeamInformation` in struct `IncidentProperties` +- New field `ProviderIncidentID` in struct `IncidentProperties` +- New field `ProviderName` in struct `IncidentProperties` +- New field `AzureAsyncOperation` in struct `WatchlistsClientDeleteResponse` +- New field `SourceType` in struct `WatchlistProperties` +- New field `OwnerType` in struct `IncidentOwnerInfo` +- New field `EntityMappings` in struct `BookmarkProperties` +- New field `Tactics` in struct `BookmarkProperties` +- New field `Techniques` in struct `BookmarkProperties` + + ## 1.0.0 (2022-05-17) ### Breaking Changes diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md b/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md index 8e24ca40c633..2a430089abf7 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/autorest.md @@ -4,12 +4,11 @@ ``` yaml azure-arm: true -tag: package-2021-10 require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/securityinsights/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/securityinsights/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/securityinsights/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/securityinsights/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 modelerfour: lenient-model-deduplication: true ``` \ No newline at end of file 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 index f3ddb70f8e78..ca38eaf681c7 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_actions_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_actions_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/actions/GetAllActionsByAlertRule.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/actions/GetAllActionsByAlertRule.json func ExampleActionsClient_NewListByAlertRulePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -44,7 +44,7 @@ func ExampleActionsClient_NewListByAlertRulePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/actions/GetActionOfAlertRuleById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/actions/GetActionOfAlertRuleById.json func ExampleActionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleActionsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/actions/CreateActionOfAlertRule.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/actions/CreateActionOfAlertRule.json func ExampleActionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExampleActionsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/actions/DeleteActionOfAlertRule.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/actions/DeleteActionOfAlertRule.json func ExampleActionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index fcd11324ad4c..ff0e635848f7 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertrules_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertrules_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/alertRules/GetAllAlertRules.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/alertRules/GetAllAlertRules.json func ExampleAlertRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleAlertRulesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/alertRules/GetFusionAlertRule.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/alertRules/GetFusionAlertRule.json func ExampleAlertRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleAlertRulesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/alertRules/CreateFusionAlertRule.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/alertRules/CreateFusionAlertRuleWithFusionScenarioExclusion.json func ExampleAlertRulesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -87,6 +87,233 @@ func ExampleAlertRulesClient_CreateOrUpdate() { Properties: &armsecurityinsights.FusionAlertRuleProperties{ AlertRuleTemplateName: to.Ptr("f71aba3d-28fb-450b-b192-4e76a83015c8"), Enabled: to.Ptr(true), + SourceSettings: []*armsecurityinsights.FusionSourceSettings{ + { + Enabled: to.Ptr(true), + SourceName: to.Ptr("Anomalies"), + }, + { + Enabled: to.Ptr(true), + SourceName: to.Ptr("Alert providers"), + SourceSubTypes: []*armsecurityinsights.FusionSourceSubTypeSetting{ + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Azure Active Directory Identity Protection"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Azure Defender"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Azure Defender for IoT"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Microsoft 365 Defender"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Microsoft Cloud App Security"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Microsoft Defender for Endpoint"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Microsoft Defender for Identity"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Microsoft Defender for Office 365"), + }, + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{ + Filters: []*armsecurityinsights.FusionSubTypeSeverityFiltersItem{ + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityHigh), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityMedium), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityLow), + }, + { + Enabled: to.Ptr(true), + Severity: to.Ptr(armsecurityinsights.AlertSeverityInformational), + }}, + }, + SourceSubTypeName: to.Ptr("Azure Sentinel scheduled analytics rules"), + }}, + }, + { + Enabled: to.Ptr(true), + SourceName: to.Ptr("Raw logs from other sources"), + SourceSubTypes: []*armsecurityinsights.FusionSourceSubTypeSetting{ + { + Enabled: to.Ptr(true), + SeverityFilters: &armsecurityinsights.FusionSubTypeSeverityFilter{}, + SourceSubTypeName: to.Ptr("Palo Alto Networks"), + }}, + }}, }, }, nil) @@ -97,7 +324,7 @@ func ExampleAlertRulesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/alertRules/DeleteAlertRule.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/alertRules/DeleteAlertRule.json func ExampleAlertRulesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index f44af2cb0731..eed9ded7c206 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertruletemplates_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_alertruletemplates_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/alertRuleTemplates/GetAlertRuleTemplates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplates.json func ExampleAlertRuleTemplatesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -42,7 +42,7 @@ func ExampleAlertRuleTemplatesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/alertRuleTemplates/GetAlertRuleTemplateById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/alertRuleTemplates/GetAlertRuleTemplateById.json func ExampleAlertRuleTemplatesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index e7bc167597d3..41121c8ea18b 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_automationrules_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_automationrules_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/automationRules/AutomationRules_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/automationRules/AutomationRules_Get.json func ExampleAutomationRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -39,7 +39,7 @@ func ExampleAutomationRulesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/automationRules/AutomationRules_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/automationRules/AutomationRules_CreateOrUpdate.json func ExampleAutomationRulesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,7 +62,7 @@ func ExampleAutomationRulesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/automationRules/AutomationRules_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/automationRules/AutomationRules_Delete.json func ExampleAutomationRulesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -85,7 +85,7 @@ func ExampleAutomationRulesClient_Delete() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/automationRules/AutomationRules_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/automationRules/AutomationRules_List.json func ExampleAutomationRulesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 new file mode 100644 index 000000000000..b9d37ea2c223 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmark_client_test.go @@ -0,0 +1,48 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewBookmarkClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Expand(ctx, + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + armsecurityinsights.BookmarkExpandParameters{ + EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-01-24T17:21:00.000Z"); return t }()), + ExpansionID: to.Ptr("27f76e63-c41b-480f-bb18-12ad2e011d49"), + StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-25T17:21:00.000Z"); return t }()), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 new file mode 100644 index 000000000000..8403de36e13e --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarkrelations_client_test.go @@ -0,0 +1,124 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/bookmarks/relations/GetAllBookmarkRelations.json +func ExampleBookmarkRelationsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewBookmarkRelationsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + &armsecurityinsights.BookmarkRelationsClientListOptions{Filter: nil, + Orderby: nil, + Top: nil, + SkipToken: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewBookmarkRelationsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewBookmarkRelationsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + armsecurityinsights.Relation{ + Properties: &armsecurityinsights.RelationProperties{ + RelatedResourceID: to.Ptr("/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/incidents/afbd324f-6c48-459c-8710-8d1e1cd03812"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewBookmarkRelationsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "myRg", + "myWorkspace", + "2216d0e1-91e3-4902-89fd-d2df8c535096", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", 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 index 4fe8e88b8366..4d1e92d83aeb 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarks_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_bookmarks_client_test.go @@ -19,7 +19,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/bookmarks/GetBookmarks.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/bookmarks/GetBookmarks.json func ExampleBookmarksClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -45,7 +45,7 @@ func ExampleBookmarksClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/bookmarks/GetBookmarkById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/bookmarks/GetBookmarkById.json func ExampleBookmarksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleBookmarksClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/bookmarks/CreateBookmark.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/bookmarks/CreateBookmark.json func ExampleBookmarksClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,18 +86,31 @@ func ExampleBookmarksClient_CreateOrUpdate() { armsecurityinsights.Bookmark{ Etag: to.Ptr("\"0300bf09-0000-0000-0000-5c37296e0000\""), Properties: &armsecurityinsights.BookmarkProperties{ - Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T13:15:30Z"); return t }()), + Created: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T13:15:30Z"); return t }()), CreatedBy: &armsecurityinsights.UserInfo{ ObjectID: to.Ptr("2046feea-040d-4a46-9e2b-91c2941bfa70"), }, DisplayName: to.Ptr("My bookmark"), + EntityMappings: []*armsecurityinsights.BookmarkEntityMappings{ + { + EntityType: to.Ptr("Account"), + FieldMappings: []*armsecurityinsights.EntityFieldMapping{ + { + Identifier: to.Ptr("Fullname"), + Value: to.Ptr("johndoe@microsoft.com"), + }}, + }}, Labels: []*string{ to.Ptr("Tag1"), to.Ptr("Tag2")}, Notes: to.Ptr("Found a suspicious activity"), Query: to.Ptr("SecurityEvent | where TimeGenerated > ago(1d) and TimeGenerated < ago(2d)"), QueryResult: to.Ptr("Security Event query result"), - Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-01-01T13:15:30Z"); return t }()), + Tactics: []*armsecurityinsights.AttackTactic{ + to.Ptr(armsecurityinsights.AttackTacticExecution)}, + Techniques: []*string{ + to.Ptr("T1609")}, + Updated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T13:15:30Z"); return t }()), UpdatedBy: &armsecurityinsights.UserInfo{ ObjectID: to.Ptr("2046feea-040d-4a46-9e2b-91c2941bfa70"), }, @@ -111,7 +124,7 @@ func ExampleBookmarksClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/bookmarks/DeleteBookmark.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/bookmarks/DeleteBookmark.json func ExampleBookmarksClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index 92da7c052e9e..b6547b9639f0 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectors_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectors_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/dataConnectors/GetDataConnectors.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/dataConnectors/GetDataConnectors.json func ExampleDataConnectorsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleDataConnectorsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/dataConnectors/GetAzureSecurityCenterById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/dataConnectors/GetAPIPolling.json func ExampleDataConnectorsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -57,7 +57,7 @@ func ExampleDataConnectorsClient_Get() { res, err := client.Get(ctx, "myRg", "myWorkspace", - "763f9fa1-c2d3-4fa2-93e9-bccd4899aa12", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -66,7 +66,7 @@ func ExampleDataConnectorsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/dataConnectors/CreateOfficeDataConnetor.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/dataConnectors/CreateAPIPolling.json func ExampleDataConnectorsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -80,23 +80,111 @@ func ExampleDataConnectorsClient_CreateOrUpdate() { res, err := client.CreateOrUpdate(ctx, "myRg", "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", - &armsecurityinsights.OfficeDataConnector{ - Etag: to.Ptr("\"0300bf09-0000-0000-0000-5c37296e0000\""), - Kind: to.Ptr(armsecurityinsights.DataConnectorKindOffice365), - Properties: &armsecurityinsights.OfficeDataConnectorProperties{ - DataTypes: &armsecurityinsights.OfficeDataConnectorDataTypes{ - Exchange: &armsecurityinsights.OfficeDataConnectorDataTypesExchange{ - State: to.Ptr(armsecurityinsights.DataTypeStateEnabled), + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + &armsecurityinsights.CodelessAPIPollingDataConnector{ + Kind: to.Ptr(armsecurityinsights.DataConnectorKindAPIPolling), + Properties: &armsecurityinsights.APIPollingParameters{ + ConnectorUIConfig: &armsecurityinsights.CodelessUIConnectorConfigProperties{ + Availability: &armsecurityinsights.Availability{ + IsPreview: to.Ptr(true), + Status: to.Ptr[int32](1), }, - SharePoint: &armsecurityinsights.OfficeDataConnectorDataTypesSharePoint{ - State: to.Ptr(armsecurityinsights.DataTypeStateEnabled), + ConnectivityCriteria: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem{ + { + Type: to.Ptr(armsecurityinsights.ConnectivityType("SentinelKindsV2")), + Value: []*string{}, + }}, + DataTypes: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesDataTypesItem{ + { + Name: to.Ptr("{{graphQueriesTableName}}"), + LastDataReceivedQuery: to.Ptr("{{graphQueriesTableName}}\n | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)"), + }}, + DescriptionMarkdown: to.Ptr("The GitHub audit log connector provides the capability to ingest GitHub logs into Azure Sentinel. By connecting GitHub audit logs into Azure Sentinel, you can view this data in workbooks, use it to create custom alerts, and improve your investigation process."), + GraphQueries: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesGraphQueriesItem{ + { + BaseQuery: to.Ptr("{{graphQueriesTableName}}"), + Legend: to.Ptr("GitHub audit log events"), + MetricName: to.Ptr("Total events received"), + }}, + GraphQueriesTableName: to.Ptr("GitHubAuditLogPolling_CL"), + InstructionSteps: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesInstructionStepsItem{ + { + Description: to.Ptr("Enable GitHub audit Logs. \n Follow [this](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) to create or find your personal key"), + Instructions: []*armsecurityinsights.InstructionStepsInstructionsItem{ + { + Type: to.Ptr(armsecurityinsights.SettingType("APIKey")), + Parameters: map[string]interface{}{ + "enable": "true", + "userRequestPlaceHoldersInput": []interface{}{ + map[string]interface{}{ + "displayText": "Organization Name", + "placeHolderName": "{{placeHolder1}}", + "placeHolderValue": "", + "requestObjectKey": "apiEndpoint", + }, + }, + }, + }}, + Title: to.Ptr("Connect GitHub Enterprise Audit Log to Azure Sentinel"), + }}, + Permissions: &armsecurityinsights.Permissions{ + Customs: []*armsecurityinsights.PermissionsCustomsItem{ + { + Name: to.Ptr("GitHub API personal token Key"), + Description: to.Ptr("You need access to GitHub personal token, the key should have 'admin:org' scope"), + }}, + ResourceProvider: []*armsecurityinsights.PermissionsResourceProviderItem{ + { + PermissionsDisplayText: to.Ptr("read and write permissions are required."), + Provider: to.Ptr(armsecurityinsights.ProviderNameMicrosoftOperationalInsightsWorkspaces), + ProviderDisplayName: to.Ptr("Workspace"), + RequiredPermissions: &armsecurityinsights.RequiredPermissions{ + Delete: to.Ptr(true), + Read: to.Ptr(true), + Write: to.Ptr(true), + }, + Scope: to.Ptr(armsecurityinsights.PermissionProviderScopeWorkspace), + }}, }, - Teams: &armsecurityinsights.OfficeDataConnectorDataTypesTeams{ - State: to.Ptr(armsecurityinsights.DataTypeStateEnabled), + Publisher: to.Ptr("GitHub"), + SampleQueries: []*armsecurityinsights.CodelessUIConnectorConfigPropertiesSampleQueriesItem{ + { + Description: to.Ptr("All logs"), + Query: to.Ptr("{{graphQueriesTableName}}\n | take 10 "), + }}, + Title: to.Ptr("GitHub Enterprise Audit Log"), + }, + PollingConfig: &armsecurityinsights.CodelessConnectorPollingConfigProperties{ + Auth: &armsecurityinsights.CodelessConnectorPollingAuthProperties{ + APIKeyIdentifier: to.Ptr("token"), + APIKeyName: to.Ptr("Authorization"), + AuthType: to.Ptr("APIKey"), + }, + Paging: &armsecurityinsights.CodelessConnectorPollingPagingProperties{ + PageSizeParaName: to.Ptr("per_page"), + PagingType: to.Ptr("LinkHeader"), + }, + Response: &armsecurityinsights.CodelessConnectorPollingResponseProperties{ + EventsJSONPaths: []*string{ + to.Ptr("$")}, + }, + Request: &armsecurityinsights.CodelessConnectorPollingRequestProperties{ + APIEndpoint: to.Ptr("https://api.github.com/organizations/{{placeHolder1}}/audit-log"), + Headers: map[string]interface{}{ + "Accept": "application/json", + "User-Agent": "Scuba", + }, + HTTPMethod: to.Ptr("Get"), + QueryParameters: map[string]interface{}{ + "phrase": "created:{_QueryWindowStartTime}..{_QueryWindowEndTime}", + }, + QueryTimeFormat: to.Ptr("yyyy-MM-ddTHH:mm:ssZ"), + QueryWindowInMin: to.Ptr[int32](15), + RateLimitQPS: to.Ptr[int32](50), + RetryCount: to.Ptr[int32](2), + TimeoutInSeconds: to.Ptr[int32](60), }, }, - TenantID: to.Ptr("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), }, }, nil) @@ -107,7 +195,7 @@ func ExampleDataConnectorsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/dataConnectors/DeleteOfficeDataConnetor.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/dataConnectors/DeleteAPIPolling.json func ExampleDataConnectorsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -121,7 +209,60 @@ func ExampleDataConnectorsClient_Delete() { _, err = client.Delete(ctx, "myRg", "myWorkspace", - "73e01a99-5cd7-4139-a149-9f2736ff2ab5", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewDataConnectorsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Connect(ctx, + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", + armsecurityinsights.DataConnectorConnectBody{ + APIKey: to.Ptr("123456789"), + Kind: to.Ptr(armsecurityinsights.ConnectAuthKindAPIKey), + RequestConfigUserInputValues: []interface{}{ + map[string]interface{}{ + "displayText": "Organization Name", + "placeHolderName": "{{placeHolder1}}", + "placeHolderValue": "somePlaceHolderValue", + "requestObjectKey": "apiEndpoint", + }}, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewDataConnectorsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Disconnect(ctx, + "myRg", + "myWorkspace", + "316ec55e-7138-4d63-ab18-90c8a60fd1c8", nil) if err != nil { log.Fatalf("failed to finish the request: %v", 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 new file mode 100644 index 000000000000..d958ae195738 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_dataconnectorscheckrequirements_client_test.go @@ -0,0 +1,46 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewDataConnectorsCheckRequirementsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Post(ctx, + "myRg", + "myWorkspace", + &armsecurityinsights.AADCheckRequirements{ + Kind: to.Ptr(armsecurityinsights.DataConnectorKindAzureActiveDirectory), + Properties: &armsecurityinsights.AADCheckRequirementsProperties{ + TenantID: to.Ptr("2070ecc9-b4d5-4ae4-adaa-936fa1954fa8"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 new file mode 100644 index 000000000000..75f26d707f89 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_domainwhois_client_test.go @@ -0,0 +1,39 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewDomainWhoisClient("bd794837-4d29-4647-9105-6339bfdb4e6a", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "microsoft.com", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 new file mode 100644 index 000000000000..6d1f1d907e80 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entities_client_test.go @@ -0,0 +1,151 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/entities/GetEntities.json +func ExampleEntitiesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewEntitiesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntitiesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntitiesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Expand(ctx, + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + armsecurityinsights.EntityExpandParameters{ + EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-26T00:00:00.000Z"); return t }()), + ExpansionID: to.Ptr("a77992f3-25e9-4d01-99a4-5ff606cc410a"), + StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-25T00:00:00.000Z"); return t }()), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntitiesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Queries(ctx, + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + armsecurityinsights.EntityItemQueryKindInsight, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntitiesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetInsights(ctx, + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + armsecurityinsights.EntityGetInsightsParameters{ + AddDefaultExtendedTimeRange: to.Ptr(false), + EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-01T00:00:00.000Z"); return t }()), + InsightQueryIDs: []*string{ + to.Ptr("cae8d0aa-aa45-4d53-8d88-17dd64ffd4e4")}, + StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T00:00:00.000Z"); return t }()), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 new file mode 100644 index 000000000000..7abaabc20c03 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesgettimeline_client_test.go @@ -0,0 +1,48 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntitiesGetTimelineClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.List(ctx, + "myRg", + "myWorkspace", + "e1d3d618-e11f-478b-98e3-bb381539a8e1", + armsecurityinsights.EntityTimelineParameters{ + EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-10-01T00:00:00.000Z"); return t }()), + NumberOfBucket: to.Ptr[int32](4), + StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-01T00:00:00.000Z"); return t }()), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 new file mode 100644 index 000000000000..d1fafe6db1f5 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entitiesrelations_client_test.go @@ -0,0 +1,48 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/entities/relations/GetAllEntityRelations.json +func ExampleEntitiesRelationsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewEntitiesRelationsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + &armsecurityinsights.EntitiesRelationsClientListOptions{Filter: nil, + Orderby: nil, + Top: nil, + SkipToken: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = 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 new file mode 100644 index 000000000000..dd09f31eeabb --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityqueries_client_test.go @@ -0,0 +1,140 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/entityQueries/GetEntityQueries.json +func ExampleEntityQueriesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewEntityQueriesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + &armsecurityinsights.EntityQueriesClientListOptions{Kind: to.Ptr(armsecurityinsights.Enum13Expansion)}) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntityQueriesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntityQueriesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "myRg", + "myWorkspace", + "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + &armsecurityinsights.ActivityCustomEntityQuery{ + Etag: to.Ptr("\"0300bf09-0000-0000-0000-5c37296e0000\""), + Kind: to.Ptr(armsecurityinsights.CustomEntityQueryKindActivity), + Properties: &armsecurityinsights.ActivityEntityQueriesProperties{ + Description: to.Ptr("Account deleted on host"), + Content: to.Ptr("On '{{Computer}}' the account '{{TargetAccount}}' was deleted by '{{AddedBy}}'"), + Enabled: to.Ptr(true), + EntitiesFilter: map[string][]*string{ + "Host_OsFamily": { + to.Ptr("Windows")}, + }, + InputEntityType: to.Ptr(armsecurityinsights.EntityTypeHost), + QueryDefinitions: &armsecurityinsights.ActivityEntityQueriesPropertiesQueryDefinitions{ + Query: to.Ptr("let GetAccountActions = (v_Host_Name:string, v_Host_NTDomain:string, v_Host_DnsDomain:string, v_Host_AzureID:string, v_Host_OMSAgentID:string){\nSecurityEvent\n| where EventID in (4725, 4726, 4767, 4720, 4722, 4723, 4724)\n// parsing for Host to handle variety of conventions coming from data\n| extend Host_HostName = case(\nComputer has '@', tostring(split(Computer, '@')[0]),\nComputer has '\\\\', tostring(split(Computer, '\\\\')[1]),\nComputer has '.', tostring(split(Computer, '.')[0]),\nComputer\n)\n| extend Host_NTDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', tostring(split(Computer, '.')[-2]), \nComputer\n)\n| extend Host_DnsDomain = case(\nComputer has '\\\\', tostring(split(Computer, '\\\\')[0]), \nComputer has '.', strcat_array(array_slice(split(Computer,'.'),-2,-1),'.'), \nComputer\n)\n| where (Host_HostName =~ v_Host_Name and Host_NTDomain =~ v_Host_NTDomain) \nor (Host_HostName =~ v_Host_Name and Host_DnsDomain =~ v_Host_DnsDomain) \nor v_Host_AzureID =~ _ResourceId \nor v_Host_OMSAgentID == SourceComputerId\n| project TimeGenerated, EventID, Activity, Computer, TargetAccount, TargetUserName, TargetDomainName, TargetSid, SubjectUserName, SubjectUserSid, _ResourceId, SourceComputerId\n| extend AddedBy = SubjectUserName\n// Future support for Activities\n| extend timestamp = TimeGenerated, HostCustomEntity = Computer, AccountCustomEntity = TargetAccount\n};\nGetAccountActions('{{Host_HostName}}', '{{Host_NTDomain}}', '{{Host_DnsDomain}}', '{{Host_AzureID}}', '{{Host_OMSAgentID}}')\n \n| where EventID == 4726 "), + }, + RequiredInputFieldsSets: [][]*string{ + { + to.Ptr("Host_HostName"), + to.Ptr("Host_NTDomain")}, + { + to.Ptr("Host_HostName"), + to.Ptr("Host_DnsDomain")}, + { + to.Ptr("Host_AzureID")}, + { + to.Ptr("Host_OMSAgentID")}}, + Title: to.Ptr("An account was deleted on this host"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntityQueriesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "myRg", + "myWorkspace", + "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", 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 new file mode 100644 index 000000000000..e66501d8837d --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityquerytemplates_client_test.go @@ -0,0 +1,67 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/entityQueryTemplates/GetEntityQueryTemplates.json +func ExampleEntityQueryTemplatesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewEntityQueryTemplatesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + &armsecurityinsights.EntityQueryTemplatesClientListOptions{Kind: to.Ptr(armsecurityinsights.Enum15Activity)}) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntityQueryTemplatesClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "07da3cc8-c8ad-4710-a44e-334cdcb7882b", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 new file mode 100644 index 000000000000..4efa314ccced --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_entityrelations_client_test.go @@ -0,0 +1,41 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewEntityRelationsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetRelation(ctx, + "myRg", + "myWorkspace", + "afbd324f-6c48-459c-8710-8d1e1cd03812", + "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 index 40265d7df520..fcd015d97574 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentcomments_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentcomments_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/comments/GetAllIncidentComments.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/comments/GetAllIncidentComments.json func ExampleIncidentCommentsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,7 +48,7 @@ func ExampleIncidentCommentsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/comments/GetIncidentCommentById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/comments/GetIncidentCommentById.json func ExampleIncidentCommentsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +72,7 @@ func ExampleIncidentCommentsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/comments/CreateIncidentComment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/comments/CreateIncidentComment.json func ExampleIncidentCommentsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -101,7 +101,7 @@ func ExampleIncidentCommentsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/comments/DeleteIncidentComment.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/comments/DeleteIncidentComment.json func ExampleIncidentCommentsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index 40fe88e039de..ddf94f3edb95 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentrelations_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidentrelations_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/relations/GetAllIncidentRelations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/relations/GetAllIncidentRelations.json func ExampleIncidentRelationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -48,7 +48,7 @@ func ExampleIncidentRelationsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/relations/GetIncidentRelationByName.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/relations/GetIncidentRelationByName.json func ExampleIncidentRelationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +72,7 @@ func ExampleIncidentRelationsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/relations/CreateIncidentRelation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/relations/CreateIncidentRelation.json func ExampleIncidentRelationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleIncidentRelationsClient_CreateOrUpdate() { "4bb36b7b-26ff-4d1c-9cbe-0d8ab3da0014", armsecurityinsights.Relation{ Properties: &armsecurityinsights.RelationProperties{ - RelatedResourceID: to.Ptr("/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"), + RelatedResourceID: to.Ptr("/subscriptions/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/bookmarks/2216d0e1-91e3-4902-89fd-d2df8c535096"), }, }, nil) @@ -101,7 +101,7 @@ func ExampleIncidentRelationsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/relations/DeleteIncidentRelation.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/relations/DeleteIncidentRelation.json func ExampleIncidentRelationsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index df513884fdf0..385de4c641b6 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidents_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_incidents_client_test.go @@ -19,7 +19,28 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/GetIncidents.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/manualTrigger/Incidents_RunPlaybook.json +func ExampleIncidentsClient_RunPlaybook() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewIncidentsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.RunPlaybook(ctx, + "myRg", + "myWorkspace", + "73e01a99-5cd7-4139-a149-9f2736ff2ar4", + &armsecurityinsights.IncidentsClientRunPlaybookOptions{RequestBody: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/GetIncidents.json func ExampleIncidentsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -49,7 +70,7 @@ func ExampleIncidentsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/GetIncidentById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/GetIncidentById.json func ExampleIncidentsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +93,7 @@ func ExampleIncidentsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/CreateIncident.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/CreateIncident.json func ExampleIncidentsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,7 +133,7 @@ func ExampleIncidentsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/DeleteIncident.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/DeleteIncident.json func ExampleIncidentsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -133,7 +154,34 @@ func ExampleIncidentsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/GetAllIncidentAlerts.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewIncidentsClient("9023f5b5-df22-4313-8fbf-b4b75af8a6d9", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateTeam(ctx, + "ambawolvese5resourcegroup", + "AmbaE5WestCentralUS", + "69a30280-6a4c-4aa7-9af0-5d63f335d600", + armsecurityinsights.TeamProperties{ + TeamDescription: to.Ptr("Team description"), + TeamName: to.Ptr("Team name"), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/GetAllIncidentAlerts.json func ExampleIncidentsClient_ListAlerts() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -156,7 +204,7 @@ func ExampleIncidentsClient_ListAlerts() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/GetAllIncidentBookmarks.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/GetAllIncidentBookmarks.json func ExampleIncidentsClient_ListBookmarks() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -179,7 +227,7 @@ func ExampleIncidentsClient_ListBookmarks() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/incidents/GetAllIncidentEntities.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/incidents/entities/GetAllIncidentEntities.json func ExampleIncidentsClient_ListEntities() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_runtimeversions_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_ipgeodata_client_test.go similarity index 62% rename from sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_runtimeversions_client_test.go rename to sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_ipgeodata_client_test.go index 8cb3312de69e..94cb53996f55 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_runtimeversions_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_ipgeodata_client_test.go @@ -6,28 +6,30 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armappplatform_test +package armsecurityinsights_test import ( "context" "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/appplatform/armappplatform" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/RuntimeVersions_ListRuntimeVersions.json -func ExampleRuntimeVersionsClient_ListRuntimeVersions() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armappplatform.NewRuntimeVersionsClient(cred, nil) + client, err := armsecurityinsights.NewIPGeodataClient("bd794837-4d29-4647-9105-6339bfdb4e6a", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.ListRuntimeVersions(ctx, + res, err := client.Get(ctx, + "myRg", + "1.2.3.4", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) 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 new file mode 100644 index 000000000000..4ad9ccb78b9f --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_metadata_client_test.go @@ -0,0 +1,228 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/metadata/GetAllMetadataOData.json +func ExampleMetadataClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewMetadataClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + &armsecurityinsights.MetadataClientListOptions{Filter: nil, + Orderby: nil, + Top: nil, + Skip: nil, + }) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewMetadataClient("2e1dc338-d04d-4443-b721-037eff4fdcac", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "metadataName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewMetadataClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "myRg", + "myWorkspace", + "metadataName", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewMetadataClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Create(ctx, + "myRg", + "myWorkspace", + "metadataName", + armsecurityinsights.MetadataModel{ + Properties: &armsecurityinsights.MetadataProperties{ + Author: &armsecurityinsights.MetadataAuthor{ + Name: to.Ptr("User Name"), + Email: to.Ptr("email@microsoft.com"), + }, + Categories: &armsecurityinsights.MetadataCategories{ + Domains: []*string{ + to.Ptr("Application"), + to.Ptr("Security – Insider Threat")}, + Verticals: []*string{ + to.Ptr("Healthcare")}, + }, + ContentID: to.Ptr("c00ee137-7475-47c8-9cce-ec6f0f1bedd0"), + ContentSchemaVersion: to.Ptr("2.0"), + CustomVersion: to.Ptr("1.0"), + Dependencies: &armsecurityinsights.MetadataDependencies{ + Criteria: []*armsecurityinsights.MetadataDependencies{ + { + Criteria: []*armsecurityinsights.MetadataDependencies{ + { + Name: to.Ptr("Microsoft Defender for Endpoint"), + ContentID: to.Ptr("045d06d0-ee72-4794-aba4-cf5646e4c756"), + Kind: to.Ptr(armsecurityinsights.KindDataConnector), + }, + { + ContentID: to.Ptr("dbfcb2cc-d782-40ef-8d94-fe7af58a6f2d"), + Kind: to.Ptr(armsecurityinsights.KindDataConnector), + }, + { + ContentID: to.Ptr("de4dca9b-eb37-47d6-a56f-b8b06b261593"), + Kind: to.Ptr(armsecurityinsights.KindDataConnector), + Version: to.Ptr("2.0"), + }}, + Operator: to.Ptr(armsecurityinsights.OperatorOR), + }, + { + ContentID: to.Ptr("31ee11cc-9989-4de8-b176-5e0ef5c4dbab"), + Kind: to.Ptr(armsecurityinsights.KindPlaybook), + Version: to.Ptr("1.0"), + }, + { + ContentID: to.Ptr("21ba424a-9438-4444-953a-7059539a7a1b"), + Kind: to.Ptr(armsecurityinsights.KindParser), + }}, + Operator: to.Ptr(armsecurityinsights.OperatorAND), + }, + FirstPublishDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-05-18"); return t }()), + Kind: to.Ptr(armsecurityinsights.KindAnalyticsRule), + LastPublishDate: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2021-05-18"); return t }()), + ParentID: to.Ptr("/subscriptions/2e1dc338-d04d-4443-b721-037eff4fdcac/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/alertRules/ruleName"), + PreviewImages: []*string{ + to.Ptr("firstImage.png"), + to.Ptr("secondImage.jpeg")}, + PreviewImagesDark: []*string{ + to.Ptr("firstImageDark.png"), + to.Ptr("secondImageDark.jpeg")}, + Providers: []*string{ + to.Ptr("Amazon"), + to.Ptr("Microsoft")}, + Source: &armsecurityinsights.MetadataSource{ + Name: to.Ptr("Contoso Solution 1.0"), + Kind: to.Ptr(armsecurityinsights.SourceKindSolution), + SourceID: to.Ptr("b688a130-76f4-4a07-bf57-762222a3cadf"), + }, + Support: &armsecurityinsights.MetadataSupport{ + Name: to.Ptr("Microsoft"), + Email: to.Ptr("support@microsoft.com"), + Link: to.Ptr("https://support.microsoft.com/"), + Tier: to.Ptr(armsecurityinsights.SupportTierPartner), + }, + ThreatAnalysisTactics: []*string{ + to.Ptr("reconnaissance"), + to.Ptr("commandandcontrol")}, + ThreatAnalysisTechniques: []*string{ + to.Ptr("T1548"), + to.Ptr("T1548.001")}, + Version: to.Ptr("1.0.0.0"), + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewMetadataClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Update(ctx, + "myRg", + "myWorkspace", + "metadataName", + armsecurityinsights.MetadataPatch{ + Properties: &armsecurityinsights.MetadataPropertiesPatch{ + Author: &armsecurityinsights.MetadataAuthor{ + Name: to.Ptr("User Name"), + Email: to.Ptr("email@microsoft.com"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildserviceagentpool_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_officeconsents_client_test.go similarity index 50% rename from sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildserviceagentpool_client_test.go rename to sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_officeconsents_client_test.go index 770522446c42..0865525bdcc7 100644 --- a/sdk/resourcemanager/appplatform/armappplatform/ze_generated_example_buildserviceagentpool_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_officeconsents_client_test.go @@ -6,31 +6,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -package armappplatform_test +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/appplatform/armappplatform" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceAgentPool_List.json -func ExampleBuildServiceAgentPoolClient_NewListPager() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/officeConsents/GetOfficeConsents.json +func ExampleOfficeConsentsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - client, err := armappplatform.NewBuildServiceAgentPoolClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armsecurityinsights.NewOfficeConsentsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := client.NewListPager("myResourceGroup", - "myservice", - "default", + pager := client.NewListPager("myRg", + "myWorkspace", nil) for pager.More() { nextResult, err := pager.NextPage(ctx) @@ -44,22 +42,21 @@ func ExampleBuildServiceAgentPoolClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceAgentPool_Get.json -func ExampleBuildServiceAgentPoolClient_Get() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armappplatform.NewBuildServiceAgentPoolClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armsecurityinsights.NewOfficeConsentsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } res, err := client.Get(ctx, - "myResourceGroup", - "myservice", - "default", - "default", + "myRg", + "myWorkspace", + "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -68,37 +65,23 @@ func ExampleBuildServiceAgentPoolClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/appplatform/resource-manager/Microsoft.AppPlatform/stable/2022-04-01/examples/BuildServiceAgentPool_UpdatePut.json -func ExampleBuildServiceAgentPoolClient_BeginUpdatePut() { +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armappplatform.NewBuildServiceAgentPoolClient("00000000-0000-0000-0000-000000000000", cred, nil) + client, err := armsecurityinsights.NewOfficeConsentsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := client.BeginUpdatePut(ctx, - "myResourceGroup", - "myservice", - "default", - "default", - armappplatform.BuildServiceAgentPoolResource{ - Properties: &armappplatform.BuildServiceAgentPoolProperties{ - PoolSize: &armappplatform.BuildServiceAgentPoolSizeProperties{ - Name: to.Ptr("S3"), - }, - }, - }, + _, err = client.Delete(ctx, + "myRg", + "myWorkspace", + "04e5fd05-ff86-4b97-b8d2-1c20933cb46c", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_operations_client_test.go index f30c142e0fc3..2f9bba326ca5 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/operations/ListOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/operations/ListOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 new file mode 100644 index 000000000000..fc78d1db198b --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_productsettings_client_test.go @@ -0,0 +1,112 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewProductSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.List(ctx, + "myRg", + "myWorkspace", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewProductSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "EyesOn", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewProductSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "myRg", + "myWorkspace", + "EyesOn", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewProductSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Update(ctx, + "myRg", + "myWorkspace", + "EyesOn", + &armsecurityinsights.EyesOn{ + Etag: to.Ptr("\"0300bf09-0000-0000-0000-5c37296e0000\""), + Kind: to.Ptr(armsecurityinsights.SettingKindEyesOn), + Properties: &armsecurityinsights.EyesOnSettingsProperties{}, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_securitymlanalyticssettings_client_test.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_securitymlanalyticssettings_client_test.go new file mode 100644 index 000000000000..eefbf5a00ef0 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_securitymlanalyticssettings_client_test.go @@ -0,0 +1,181 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/securityMLAnalyticsSettings/GetAllSecurityMLAnalyticsSettings.json +func ExampleSecurityMLAnalyticsSettingsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewSecurityMLAnalyticsSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/securityMLAnalyticsSettings/GetAnomalySecurityMLAnalyticsSetting.json +func ExampleSecurityMLAnalyticsSettingsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewSecurityMLAnalyticsSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "myFirstAnomalySettings", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/securityMLAnalyticsSettings/CreateAnomalySecurityMLAnalyticsSetting.json +func ExampleSecurityMLAnalyticsSettingsClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewSecurityMLAnalyticsSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, + "myRg", + "myWorkspace", + "f209187f-1d17-4431-94af-c141bf5f23db", + &armsecurityinsights.AnomalySecurityMLAnalyticsSettings{ + Etag: to.Ptr("\"260090e2-0000-0d00-0000-5d6fb8670000\""), + Kind: to.Ptr(armsecurityinsights.SecurityMLAnalyticsSettingsKindAnomaly), + Properties: &armsecurityinsights.AnomalySecurityMLAnalyticsSettingsProperties{ + Description: to.Ptr("When account logs from a source region that has rarely been logged in from during the last 14 days, an anomaly is triggered."), + AnomalySettingsVersion: to.Ptr[int32](0), + AnomalyVersion: to.Ptr("1.0.5"), + CustomizableObservations: map[string]interface{}{ + "multiSelectObservations": nil, + "prioritizeExcludeObservations": nil, + "singleSelectObservations": []interface{}{ + map[string]interface{}{ + "name": "Device vendor", + "description": "Select device vendor of network connection logs from CommonSecurityLog", + "rerun": "RerunAlways", + "sequenceNumber": float64(1), + "supportedValues": []interface{}{ + "Palo Alto Networks", + "Fortinet", + "Check Point", + }, + "supportedValuesKql": nil, + "value": []interface{}{ + "Palo Alto Networks", + }, + "valuesKql": nil, + }, + }, + "singleValueObservations": nil, + "thresholdObservations": []interface{}{ + map[string]interface{}{ + "name": "Daily data transfer threshold in MB", + "description": "Suppress anomalies when daily data transfered (in MB) per hour is less than the chosen value", + "maximum": "100", + "minimum": "1", + "rerun": "RerunAlways", + "sequenceNumber": float64(1), + "value": "25", + }, + map[string]interface{}{ + "name": "Number of standard deviations", + "description": "Triggers anomalies when number of standard deviations is greater than the chosen value", + "maximum": "10", + "minimum": "2", + "rerun": "RerunAlways", + "sequenceNumber": float64(2), + "value": "3", + }, + }, + }, + DisplayName: to.Ptr("Login from unusual region"), + Enabled: to.Ptr(true), + Frequency: to.Ptr("PT1H"), + IsDefaultSettings: to.Ptr(true), + RequiredDataConnectors: []*armsecurityinsights.SecurityMLAnalyticsSettingsDataSource{ + { + ConnectorID: to.Ptr("AWS"), + DataTypes: []*string{ + to.Ptr("AWSCloudTrail")}, + }}, + SettingsDefinitionID: to.Ptr("f209187f-1d17-4431-94af-c141bf5f23db"), + SettingsStatus: to.Ptr(armsecurityinsights.SettingsStatusProduction), + Tactics: []*armsecurityinsights.AttackTactic{ + to.Ptr(armsecurityinsights.AttackTacticExfiltration), + to.Ptr(armsecurityinsights.AttackTacticCommandAndControl)}, + Techniques: []*string{ + to.Ptr("T1037"), + to.Ptr("T1021")}, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/securityMLAnalyticsSettings/DeleteSecurityMLAnalyticsSetting.json +func ExampleSecurityMLAnalyticsSettingsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewSecurityMLAnalyticsSettingsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "myRg", + "myWorkspace", + "f209187f-1d17-4431-94af-c141bf5f23db", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} 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 index bca89f7569b3..65e859ef6e4a 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sentinelonboardingstates_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sentinelonboardingstates_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/onboardingStates/GetSentinelOnboardingState.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/onboardingStates/GetSentinelOnboardingState.json func ExampleSentinelOnboardingStatesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -40,7 +40,7 @@ func ExampleSentinelOnboardingStatesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/onboardingStates/CreateSentinelOnboardingState.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/onboardingStates/CreateSentinelOnboardingState.json func ExampleSentinelOnboardingStatesClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleSentinelOnboardingStatesClient_Create() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/onboardingStates/DeleteSentinelOnboardingState.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/onboardingStates/DeleteSentinelOnboardingState.json func ExampleSentinelOnboardingStatesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -89,7 +89,7 @@ func ExampleSentinelOnboardingStatesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/onboardingStates/GetAllSentinelOnboardingStates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/onboardingStates/GetAllSentinelOnboardingStates.json func ExampleSentinelOnboardingStatesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 new file mode 100644 index 000000000000..8c61419bc9ea --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrol_client_test.go @@ -0,0 +1,44 @@ +//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_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/repositories/GetRepositories.json +func ExampleSourceControlClient_NewListRepositoriesPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewSourceControlClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListRepositoriesPager("myRg", + "myWorkspace", + armsecurityinsights.RepoTypeGithub, + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = 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 new file mode 100644 index 000000000000..a69707ab9e95 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_sourcecontrols_client_test.go @@ -0,0 +1,136 @@ +//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_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" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/sourcecontrols/GetSourceControls.json +func ExampleSourceControlsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armsecurityinsights.NewSourceControlsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myRg", + "myWorkspace", + nil) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewSourceControlsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, + "myRg", + "myWorkspace", + "789e0c1f-4a3d-43ad-809c-e713b677b04a", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewSourceControlsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, + "myRg", + "myWorkspace", + "789e0c1f-4a3d-43ad-809c-e713b677b04a", + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-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, err := armsecurityinsights.NewSourceControlsClient("d0cfe6b2-9ac0-4464-9919-dccaee2e48c0", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Create(ctx, + "myRg", + "myWorkspace", + "789e0c1f-4a3d-43ad-809c-e713b677b04a", + armsecurityinsights.SourceControl{ + Etag: to.Ptr("\"0300bf09-0000-0000-0000-5c37296e0000\""), + Properties: &armsecurityinsights.SourceControlProperties{ + Description: to.Ptr("This is a source control"), + ContentTypes: []*armsecurityinsights.ContentType{ + to.Ptr(armsecurityinsights.ContentType("AnalyticRules")), + to.Ptr(armsecurityinsights.ContentTypeWorkbook)}, + DisplayName: to.Ptr("My Source Control"), + RepoType: to.Ptr(armsecurityinsights.RepoTypeGithub), + Repository: &armsecurityinsights.Repository{ + Branch: to.Ptr("master"), + DisplayURL: to.Ptr("https://github.com/user/repo"), + PathMapping: []*armsecurityinsights.ContentPathMap{ + { + Path: to.Ptr("path/to/rules"), + ContentType: to.Ptr(armsecurityinsights.ContentType("AnalyticRules")), + }, + { + Path: to.Ptr("path/to/workbooks"), + ContentType: to.Ptr(armsecurityinsights.ContentTypeWorkbook), + }}, + URL: to.Ptr("https://github.com/user/repo"), + }, + }, + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // TODO: use response item + _ = res +} 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 index 528e9c701511..59b5a0871c06 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicator_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicator_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/CreateThreatIntelligence.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/CreateThreatIntelligence.json func ExampleThreatIntelligenceIndicatorClient_CreateIndicator() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -32,7 +32,7 @@ func ExampleThreatIntelligenceIndicatorClient_CreateIndicator() { "myRg", "myWorkspace", armsecurityinsights.ThreatIntelligenceIndicatorModel{ - Kind: to.Ptr(armsecurityinsights.ThreatIntelligenceResourceInnerKindIndicator), + Kind: to.Ptr(armsecurityinsights.ThreatIntelligenceResourceKindEnumIndicator), Properties: &armsecurityinsights.ThreatIntelligenceIndicatorProperties{ Description: to.Ptr("debugging indicators"), Confidence: to.Ptr[int32](78), @@ -51,7 +51,7 @@ func ExampleThreatIntelligenceIndicatorClient_CreateIndicator() { to.Ptr("new schema")}, ThreatTypes: []*string{ to.Ptr("compromised")}, - ValidFrom: to.Ptr("2020-04-15T17:44:00.114052Z"), + ValidFrom: to.Ptr("2021-09-15T17:44:00.114052Z"), ValidUntil: to.Ptr(""), }, }, @@ -63,7 +63,7 @@ func ExampleThreatIntelligenceIndicatorClient_CreateIndicator() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/GetThreatIntelligenceById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/GetThreatIntelligenceById.json func ExampleThreatIntelligenceIndicatorClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -86,7 +86,7 @@ func ExampleThreatIntelligenceIndicatorClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/UpdateThreatIntelligence.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/UpdateThreatIntelligence.json func ExampleThreatIntelligenceIndicatorClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -102,7 +102,7 @@ func ExampleThreatIntelligenceIndicatorClient_Create() { "myWorkspace", "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", armsecurityinsights.ThreatIntelligenceIndicatorModel{ - Kind: to.Ptr(armsecurityinsights.ThreatIntelligenceResourceInnerKindIndicator), + Kind: to.Ptr(armsecurityinsights.ThreatIntelligenceResourceKindEnumIndicator), Properties: &armsecurityinsights.ThreatIntelligenceIndicatorProperties{ Description: to.Ptr("debugging indicators"), Confidence: to.Ptr[int32](78), @@ -133,7 +133,7 @@ func ExampleThreatIntelligenceIndicatorClient_Create() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/DeleteThreatIntelligence.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/DeleteThreatIntelligence.json func ExampleThreatIntelligenceIndicatorClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -154,7 +154,7 @@ func ExampleThreatIntelligenceIndicatorClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/QueryThreatIntelligence.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/QueryThreatIntelligence.json func ExampleThreatIntelligenceIndicatorClient_NewQueryIndicatorsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -169,14 +169,14 @@ func ExampleThreatIntelligenceIndicatorClient_NewQueryIndicatorsPager() { "myWorkspace", armsecurityinsights.ThreatIntelligenceFilteringCriteria{ MaxConfidence: to.Ptr[int32](80), - MaxValidUntil: to.Ptr("2020-04-25T17:44:00.114052Z"), + MaxValidUntil: to.Ptr("2021-04-25T17:44:00.114052Z"), MinConfidence: to.Ptr[int32](25), - MinValidUntil: to.Ptr("2020-04-05T17:44:00.114052Z"), + MinValidUntil: to.Ptr("2021-04-05T17:44:00.114052Z"), PageSize: to.Ptr[int32](100), SortBy: []*armsecurityinsights.ThreatIntelligenceSortingCriteria{ { ItemKey: to.Ptr("lastUpdatedTimeUtc"), - SortOrder: to.Ptr(armsecurityinsights.ThreatIntelligenceSortingOrderDescending), + SortOrder: to.Ptr(armsecurityinsights.ThreatIntelligenceSortingCriteriaEnumDescending), }}, Sources: []*string{ to.Ptr("Azure Sentinel")}, @@ -194,7 +194,7 @@ func ExampleThreatIntelligenceIndicatorClient_NewQueryIndicatorsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/AppendTagsThreatIntelligence.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/AppendTagsThreatIntelligence.json func ExampleThreatIntelligenceIndicatorClient_AppendTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -220,7 +220,7 @@ func ExampleThreatIntelligenceIndicatorClient_AppendTags() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/ReplaceTagsThreatIntelligence.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/ReplaceTagsThreatIntelligence.json func ExampleThreatIntelligenceIndicatorClient_ReplaceTags() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -237,7 +237,7 @@ func ExampleThreatIntelligenceIndicatorClient_ReplaceTags() { "d9cd6f0b-96b9-3984-17cd-a779d1e15a93", armsecurityinsights.ThreatIntelligenceIndicatorModel{ Etag: to.Ptr("\"0000262c-0000-0800-0000-5e9767060000\""), - Kind: to.Ptr(armsecurityinsights.ThreatIntelligenceResourceInnerKindIndicator), + Kind: to.Ptr(armsecurityinsights.ThreatIntelligenceResourceKindEnumIndicator), Properties: &armsecurityinsights.ThreatIntelligenceIndicatorProperties{ ThreatIntelligenceTags: []*string{ to.Ptr("patching tags")}, 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 index 647735ec08f9..4fee0f405e1a 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicatormetrics_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicatormetrics_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/CollectThreatIntelligenceMetrics.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/CollectThreatIntelligenceMetrics.json func ExampleThreatIntelligenceIndicatorMetricsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index 82e288cf61c1..db16dc4ba2ae 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicators_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_threatintelligenceindicators_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/threatintelligence/GetThreatIntelligence.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/threatintelligence/GetThreatIntelligence.json func ExampleThreatIntelligenceIndicatorsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -30,9 +30,9 @@ func ExampleThreatIntelligenceIndicatorsClient_NewListPager() { pager := client.NewListPager("myRg", "myWorkspace", &armsecurityinsights.ThreatIntelligenceIndicatorsClientListOptions{Filter: nil, + Orderby: nil, Top: nil, SkipToken: nil, - Orderby: nil, }) for pager.More() { nextResult, err := pager.NextPage(ctx) 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 index d9de3ada7e76..4146715a1c8d 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlistitems_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlistitems_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/GetWatchlistItems.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/GetWatchlistItems.json func ExampleWatchlistItemsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -44,7 +44,7 @@ func ExampleWatchlistItemsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/GetWatchlistItemById.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/GetWatchlistItemById.json func ExampleWatchlistItemsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -68,7 +68,7 @@ func ExampleWatchlistItemsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/DeleteWatchlistItem.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/DeleteWatchlistItem.json func ExampleWatchlistItemsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleWatchlistItemsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/CreateWatchlistItem.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/CreateWatchlistItem.json func ExampleWatchlistItemsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { 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 index 65ce5d26652d..7e05e0eeea66 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlists_client_test.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/ze_generated_example_watchlists_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/securityinsights/armsecurityinsights" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/GetWatchlists.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/GetWatchlists.json func ExampleWatchlistsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleWatchlistsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/GetWatchlistByAlias.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/GetWatchlistByAlias.json func ExampleWatchlistsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleWatchlistsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/DeleteWatchlist.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/DeleteWatchlist.json func ExampleWatchlistsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -87,7 +87,7 @@ func ExampleWatchlistsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/stable/2021-10-01/examples/watchlists/CreateWatchlistAndWatchlistItems.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/securityinsights/resource-manager/Microsoft.SecurityInsights/preview/2022-05-01-preview/examples/watchlists/CreateWatchlistAndWatchlistItems.json func ExampleWatchlistsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -112,7 +112,8 @@ func ExampleWatchlistsClient_CreateOrUpdate() { NumberOfLinesToSkip: to.Ptr[int32](1), Provider: to.Ptr("Microsoft"), RawContent: to.Ptr("This line will be skipped\nheader1,header2\nvalue1,value2"), - Source: to.Ptr(armsecurityinsights.SourceLocalFile), + Source: to.Ptr("watchlist.csv"), + SourceType: to.Ptr(armsecurityinsights.SourceTypeLocalFile), }, }, nil) diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go index abefaf8d8688..79e92a1ab3b7 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_actions_client.go @@ -56,7 +56,7 @@ func NewActionsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates the action of alert rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // ruleID - Alert rule ID @@ -106,7 +106,7 @@ func (client *ActionsClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, action) @@ -123,7 +123,7 @@ func (client *ActionsClient) createOrUpdateHandleResponse(resp *http.Response) ( // Delete - Delete the action of alert rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // ruleID - Alert rule ID @@ -172,7 +172,7 @@ func (client *ActionsClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *ActionsClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the action of alert rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // ruleID - Alert rule ID @@ -229,7 +229,7 @@ func (client *ActionsClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,7 +246,7 @@ func (client *ActionsClient) getHandleResponse(resp *http.Response) (ActionsClie // NewListByAlertRulePager - Gets all actions of alert rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // ruleID - Alert rule ID @@ -303,7 +303,7 @@ func (client *ActionsClient) listByAlertRuleCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go index 895d5bb548bc..e4ce180ac651 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertrules_client.go @@ -56,7 +56,7 @@ func NewAlertRulesClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates the alert rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // ruleID - Alert rule ID @@ -102,7 +102,7 @@ func (client *AlertRulesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, alertRule) @@ -119,7 +119,7 @@ func (client *AlertRulesClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Delete the alert rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // ruleID - Alert rule ID @@ -163,7 +163,7 @@ func (client *AlertRulesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *AlertRulesClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the alert rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // ruleID - Alert rule ID @@ -215,7 +215,7 @@ func (client *AlertRulesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *AlertRulesClient) getHandleResponse(resp *http.Response) (AlertRul // NewListPager - Gets all alert rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // 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. @@ -284,7 +284,7 @@ func (client *AlertRulesClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go index 56ed170ecb9f..33f8e072d8b2 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_alertruletemplates_client.go @@ -56,7 +56,7 @@ func NewAlertRuleTemplatesClient(subscriptionID string, credential azcore.TokenC // Get - Gets the alert rule template. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // alertRuleTemplateID - Alert rule template ID @@ -100,7 +100,7 @@ func (client *AlertRuleTemplatesClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *AlertRuleTemplatesClient) getHandleResponse(resp *http.Response) ( // NewListPager - Gets all alert rule templates. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // 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. @@ -169,7 +169,7 @@ func (client *AlertRuleTemplatesClient) listCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go index 01b157f0eae9..66db42517319 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_automationrules_client.go @@ -54,9 +54,9 @@ func NewAutomationRulesClient(subscriptionID string, credential azcore.TokenCred return client, nil } -// CreateOrUpdate - Creates or updates the automation rule +// CreateOrUpdate - Creates or updates the automation rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // automationRuleID - Automation rule ID @@ -101,7 +101,7 @@ func (client *AutomationRulesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.AutomationRuleToUpsert != nil { @@ -119,9 +119,9 @@ func (client *AutomationRulesClient) createOrUpdateHandleResponse(resp *http.Res return result, nil } -// Delete - Delete the automation rule +// Delete - Delete the automation rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // automationRuleID - Automation rule ID @@ -165,7 +165,7 @@ func (client *AutomationRulesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,9 +180,9 @@ func (client *AutomationRulesClient) deleteHandleResponse(resp *http.Response) ( return result, nil } -// Get - Gets the automation rule +// Get - Gets the automation rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // automationRuleID - Automation rule ID @@ -226,7 +226,7 @@ func (client *AutomationRulesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -241,9 +241,9 @@ func (client *AutomationRulesClient) getHandleResponse(resp *http.Response) (Aut return result, nil } -// NewListPager - Gets all automation rules +// NewListPager - Gets all automation rules. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // 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. @@ -295,7 +295,7 @@ func (client *AutomationRulesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmark_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmark_client.go new file mode 100644 index 000000000000..f5657dc8c529 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmark_client.go @@ -0,0 +1,117 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// BookmarkClient contains the methods for the Bookmark group. +// Don't use this type directly, use NewBookmarkClient() instead. +type BookmarkClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewBookmarkClient creates a new instance of BookmarkClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Expand - Expand an bookmark +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// bookmarkID - Bookmark ID +// parameters - The parameters required to execute an expand operation on the given bookmark. +// options - BookmarkClientExpandOptions contains the optional parameters for the BookmarkClient.Expand method. +func (client *BookmarkClient) Expand(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, parameters BookmarkExpandParameters, options *BookmarkClientExpandOptions) (BookmarkClientExpandResponse, error) { + req, err := client.expandCreateRequest(ctx, resourceGroupName, workspaceName, bookmarkID, parameters, options) + if err != nil { + return BookmarkClientExpandResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BookmarkClientExpandResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BookmarkClientExpandResponse{}, runtime.NewResponseError(resp) + } + return client.expandHandleResponse(resp) +} + +// expandCreateRequest creates the Expand request. +func (client *BookmarkClient) expandCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, parameters BookmarkExpandParameters, options *BookmarkClientExpandOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/expand" + 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 bookmarkID == "" { + return nil, errors.New("parameter bookmarkID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bookmarkId}", url.PathEscape(bookmarkID)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// expandHandleResponse handles the Expand response. +func (client *BookmarkClient) expandHandleResponse(resp *http.Response) (BookmarkClientExpandResponse, error) { + result := BookmarkClientExpandResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.BookmarkExpandResponse); err != nil { + return BookmarkClientExpandResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarkrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarkrelations_client.go new file mode 100644 index 000000000000..a4ad0b73e113 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarkrelations_client.go @@ -0,0 +1,334 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// BookmarkRelationsClient contains the methods for the BookmarkRelations group. +// Don't use this type directly, use NewBookmarkRelationsClient() instead. +type BookmarkRelationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewBookmarkRelationsClient creates a new instance of BookmarkRelationsClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates the bookmark relation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// bookmarkID - Bookmark ID +// relationName - Relation Name +// relation - The relation model +// options - BookmarkRelationsClientCreateOrUpdateOptions contains the optional parameters for the BookmarkRelationsClient.CreateOrUpdate +// method. +func (client *BookmarkRelationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, relationName string, relation Relation, options *BookmarkRelationsClientCreateOrUpdateOptions) (BookmarkRelationsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, bookmarkID, relationName, relation, options) + if err != nil { + return BookmarkRelationsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BookmarkRelationsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return BookmarkRelationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *BookmarkRelationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, relationName string, relation Relation, options *BookmarkRelationsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}" + 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 bookmarkID == "" { + return nil, errors.New("parameter bookmarkID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bookmarkId}", url.PathEscape(bookmarkID)) + if relationName == "" { + return nil, errors.New("parameter relationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relationName}", url.PathEscape(relationName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, relation) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *BookmarkRelationsClient) createOrUpdateHandleResponse(resp *http.Response) (BookmarkRelationsClientCreateOrUpdateResponse, error) { + result := BookmarkRelationsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { + return BookmarkRelationsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete the bookmark relation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// bookmarkID - Bookmark ID +// relationName - Relation Name +// options - BookmarkRelationsClientDeleteOptions contains the optional parameters for the BookmarkRelationsClient.Delete +// method. +func (client *BookmarkRelationsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, relationName string, options *BookmarkRelationsClientDeleteOptions) (BookmarkRelationsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, bookmarkID, relationName, options) + if err != nil { + return BookmarkRelationsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BookmarkRelationsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return BookmarkRelationsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return BookmarkRelationsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *BookmarkRelationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, relationName string, options *BookmarkRelationsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}" + 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 bookmarkID == "" { + return nil, errors.New("parameter bookmarkID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bookmarkId}", url.PathEscape(bookmarkID)) + if relationName == "" { + return nil, errors.New("parameter relationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relationName}", url.PathEscape(relationName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a bookmark relation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// bookmarkID - Bookmark ID +// relationName - Relation Name +// options - BookmarkRelationsClientGetOptions contains the optional parameters for the BookmarkRelationsClient.Get method. +func (client *BookmarkRelationsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, relationName string, options *BookmarkRelationsClientGetOptions) (BookmarkRelationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, bookmarkID, relationName, options) + if err != nil { + return BookmarkRelationsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return BookmarkRelationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return BookmarkRelationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *BookmarkRelationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, relationName string, options *BookmarkRelationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}" + 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 bookmarkID == "" { + return nil, errors.New("parameter bookmarkID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bookmarkId}", url.PathEscape(bookmarkID)) + if relationName == "" { + return nil, errors.New("parameter relationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relationName}", url.PathEscape(relationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *BookmarkRelationsClient) getHandleResponse(resp *http.Response) (BookmarkRelationsClientGetResponse, error) { + result := BookmarkRelationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { + return BookmarkRelationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all bookmark relations. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// bookmarkID - Bookmark ID +// options - BookmarkRelationsClientListOptions contains the optional parameters for the BookmarkRelationsClient.List method. +func (client *BookmarkRelationsClient) NewListPager(resourceGroupName string, workspaceName string, bookmarkID string, options *BookmarkRelationsClientListOptions) *runtime.Pager[BookmarkRelationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[BookmarkRelationsClientListResponse]{ + More: func(page BookmarkRelationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *BookmarkRelationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, bookmarkID string, options *BookmarkRelationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations" + 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 bookmarkID == "" { + return nil, errors.New("parameter bookmarkID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{bookmarkId}", url.PathEscape(bookmarkID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *BookmarkRelationsClient) listHandleResponse(resp *http.Response) (BookmarkRelationsClientListResponse, error) { + result := BookmarkRelationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RelationList); err != nil { + return BookmarkRelationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go index 85f9fb6aac18..9b50e7a2704d 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_bookmarks_client.go @@ -56,7 +56,7 @@ func NewBookmarksClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates the bookmark. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // bookmarkID - Bookmark ID @@ -102,7 +102,7 @@ func (client *BookmarksClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, bookmark) @@ -119,7 +119,7 @@ func (client *BookmarksClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Delete the bookmark. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // bookmarkID - Bookmark ID @@ -163,7 +163,7 @@ func (client *BookmarksClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +171,7 @@ func (client *BookmarksClient) deleteCreateRequest(ctx context.Context, resource // Get - Gets a bookmark. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // bookmarkID - Bookmark ID @@ -215,7 +215,7 @@ func (client *BookmarksClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +232,7 @@ func (client *BookmarksClient) getHandleResponse(resp *http.Response) (Bookmarks // NewListPager - Gets all bookmarks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // 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. @@ -284,7 +284,7 @@ func (client *BookmarksClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go index 63929448bb47..2097d51765eb 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_constants.go @@ -10,10 +10,10 @@ package armsecurityinsights const ( moduleName = "armsecurityinsights" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) -// ActionType - The type of the automation rule action +// ActionType - The type of the automation rule action. type ActionType string const ( @@ -54,16 +54,22 @@ type AlertRuleKind string const ( AlertRuleKindFusion AlertRuleKind = "Fusion" + AlertRuleKindMLBehaviorAnalytics AlertRuleKind = "MLBehaviorAnalytics" AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" + AlertRuleKindNRT AlertRuleKind = "NRT" AlertRuleKindScheduled AlertRuleKind = "Scheduled" + AlertRuleKindThreatIntelligence AlertRuleKind = "ThreatIntelligence" ) // PossibleAlertRuleKindValues returns the possible values for the AlertRuleKind const type. func PossibleAlertRuleKindValues() []AlertRuleKind { return []AlertRuleKind{ AlertRuleKindFusion, + AlertRuleKindMLBehaviorAnalytics, AlertRuleKindMicrosoftSecurityIncidentCreation, + AlertRuleKindNRT, AlertRuleKindScheduled, + AlertRuleKindThreatIntelligence, } } @@ -146,19 +152,23 @@ func PossibleAntispamMailDirectionValues() []AntispamMailDirection { type AttackTactic string const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" + AttackTacticCollection AttackTactic = "Collection" + AttackTacticCommandAndControl AttackTactic = "CommandAndControl" + AttackTacticCredentialAccess AttackTactic = "CredentialAccess" + AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" + AttackTacticDiscovery AttackTactic = "Discovery" + AttackTacticExecution AttackTactic = "Execution" + AttackTacticExfiltration AttackTactic = "Exfiltration" + AttackTacticImpact AttackTactic = "Impact" + AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" + AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" + AttackTacticInitialAccess AttackTactic = "InitialAccess" + AttackTacticLateralMovement AttackTactic = "LateralMovement" + AttackTacticPersistence AttackTactic = "Persistence" + AttackTacticPreAttack AttackTactic = "PreAttack" + AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" + AttackTacticReconnaissance AttackTactic = "Reconnaissance" + AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" ) // PossibleAttackTacticValues returns the possible values for the AttackTactic const type. @@ -172,11 +182,91 @@ func PossibleAttackTacticValues() []AttackTactic { AttackTacticExecution, AttackTacticExfiltration, AttackTacticImpact, + AttackTacticImpairProcessControl, + AttackTacticInhibitResponseFunction, AttackTacticInitialAccess, AttackTacticLateralMovement, AttackTacticPersistence, AttackTacticPreAttack, AttackTacticPrivilegeEscalation, + AttackTacticReconnaissance, + AttackTacticResourceDevelopment, + } +} + +type AutomationRulePropertyArrayChangedConditionSupportedArrayType string + +const ( + // AutomationRulePropertyArrayChangedConditionSupportedArrayTypeAlerts - Evaluate the condition on the alerts + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeAlerts AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Alerts" + // AutomationRulePropertyArrayChangedConditionSupportedArrayTypeComments - Evaluate the condition on the comments + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeComments AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Comments" + // AutomationRulePropertyArrayChangedConditionSupportedArrayTypeLabels - Evaluate the condition on the labels + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeLabels AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Labels" + // AutomationRulePropertyArrayChangedConditionSupportedArrayTypeTactics - Evaluate the condition on the tactics + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeTactics AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Tactics" +) + +// PossibleAutomationRulePropertyArrayChangedConditionSupportedArrayTypeValues returns the possible values for the AutomationRulePropertyArrayChangedConditionSupportedArrayType const type. +func PossibleAutomationRulePropertyArrayChangedConditionSupportedArrayTypeValues() []AutomationRulePropertyArrayChangedConditionSupportedArrayType { + return []AutomationRulePropertyArrayChangedConditionSupportedArrayType{ + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeAlerts, + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeComments, + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeLabels, + AutomationRulePropertyArrayChangedConditionSupportedArrayTypeTactics, + } +} + +type AutomationRulePropertyArrayChangedConditionSupportedChangeType string + +const ( + // AutomationRulePropertyArrayChangedConditionSupportedChangeTypeAdded - Evaluate the condition on items added to the array + AutomationRulePropertyArrayChangedConditionSupportedChangeTypeAdded AutomationRulePropertyArrayChangedConditionSupportedChangeType = "Added" +) + +// PossibleAutomationRulePropertyArrayChangedConditionSupportedChangeTypeValues returns the possible values for the AutomationRulePropertyArrayChangedConditionSupportedChangeType const type. +func PossibleAutomationRulePropertyArrayChangedConditionSupportedChangeTypeValues() []AutomationRulePropertyArrayChangedConditionSupportedChangeType { + return []AutomationRulePropertyArrayChangedConditionSupportedChangeType{ + AutomationRulePropertyArrayChangedConditionSupportedChangeTypeAdded, + } +} + +type AutomationRulePropertyChangedConditionSupportedChangedType string + +const ( + // AutomationRulePropertyChangedConditionSupportedChangedTypeChangedFrom - Evaluate the condition on the previous value of + // the property + AutomationRulePropertyChangedConditionSupportedChangedTypeChangedFrom AutomationRulePropertyChangedConditionSupportedChangedType = "ChangedFrom" + // AutomationRulePropertyChangedConditionSupportedChangedTypeChangedTo - Evaluate the condition on the updated value of the + // property + AutomationRulePropertyChangedConditionSupportedChangedTypeChangedTo AutomationRulePropertyChangedConditionSupportedChangedType = "ChangedTo" +) + +// PossibleAutomationRulePropertyChangedConditionSupportedChangedTypeValues returns the possible values for the AutomationRulePropertyChangedConditionSupportedChangedType const type. +func PossibleAutomationRulePropertyChangedConditionSupportedChangedTypeValues() []AutomationRulePropertyChangedConditionSupportedChangedType { + return []AutomationRulePropertyChangedConditionSupportedChangedType{ + AutomationRulePropertyChangedConditionSupportedChangedTypeChangedFrom, + AutomationRulePropertyChangedConditionSupportedChangedTypeChangedTo, + } +} + +type AutomationRulePropertyChangedConditionSupportedPropertyType string + +const ( + // AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentOwner - Evaluate the condition on the incident owner + AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentOwner AutomationRulePropertyChangedConditionSupportedPropertyType = "IncidentOwner" + // AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentSeverity - Evaluate the condition on the incident severity + AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentSeverity AutomationRulePropertyChangedConditionSupportedPropertyType = "IncidentSeverity" + // AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentStatus - Evaluate the condition on the incident status + AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentStatus AutomationRulePropertyChangedConditionSupportedPropertyType = "IncidentStatus" +) + +// PossibleAutomationRulePropertyChangedConditionSupportedPropertyTypeValues returns the possible values for the AutomationRulePropertyChangedConditionSupportedPropertyType const type. +func PossibleAutomationRulePropertyChangedConditionSupportedPropertyTypeValues() []AutomationRulePropertyChangedConditionSupportedPropertyType { + return []AutomationRulePropertyChangedConditionSupportedPropertyType{ + AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentOwner, + AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentSeverity, + AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentStatus, } } @@ -222,7 +312,7 @@ func PossibleAutomationRulePropertyConditionSupportedOperatorValues() []Automati } } -// AutomationRulePropertyConditionSupportedProperty - The property to evaluate in an automation rule property condition +// AutomationRulePropertyConditionSupportedProperty - The property to evaluate in an automation rule property condition. type AutomationRulePropertyConditionSupportedProperty string const ( @@ -401,12 +491,18 @@ type ConditionType string const ( // ConditionTypeProperty - Evaluate an object property value ConditionTypeProperty ConditionType = "Property" + // ConditionTypePropertyArrayChanged - Evaluate an object array property changed value + ConditionTypePropertyArrayChanged ConditionType = "PropertyArrayChanged" + // ConditionTypePropertyChanged - Evaluate an object property changed value + ConditionTypePropertyChanged ConditionType = "PropertyChanged" ) // PossibleConditionTypeValues returns the possible values for the ConditionType const type. func PossibleConditionTypeValues() []ConditionType { return []ConditionType{ ConditionTypeProperty, + ConditionTypePropertyArrayChanged, + ConditionTypePropertyChanged, } } @@ -457,6 +553,54 @@ func PossibleConfidenceScoreStatusValues() []ConfidenceScoreStatus { } } +// ConnectAuthKind - The authentication kind used to poll the data +type ConnectAuthKind string + +const ( + ConnectAuthKindAPIKey ConnectAuthKind = "APIKey" + ConnectAuthKindBasic ConnectAuthKind = "Basic" + ConnectAuthKindOAuth2 ConnectAuthKind = "OAuth2" +) + +// PossibleConnectAuthKindValues returns the possible values for the ConnectAuthKind const type. +func PossibleConnectAuthKindValues() []ConnectAuthKind { + return []ConnectAuthKind{ + ConnectAuthKindAPIKey, + ConnectAuthKindBasic, + ConnectAuthKindOAuth2, + } +} + +// ConnectivityType - type of connectivity +type ConnectivityType string + +const ( + ConnectivityTypeIsConnectedQuery ConnectivityType = "IsConnectedQuery" +) + +// PossibleConnectivityTypeValues returns the possible values for the ConnectivityType const type. +func PossibleConnectivityTypeValues() []ConnectivityType { + return []ConnectivityType{ + ConnectivityTypeIsConnectedQuery, + } +} + +// ContentType - The content type of a source control path. +type ContentType string + +const ( + ContentTypeAnalyticRule ContentType = "AnalyticRule" + ContentTypeWorkbook ContentType = "Workbook" +) + +// PossibleContentTypeValues returns the possible values for the ContentType const type. +func PossibleContentTypeValues() []ContentType { + return []ContentType{ + ContentTypeAnalyticRule, + ContentTypeWorkbook, + } +} + // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -477,31 +621,103 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } +// CustomEntityQueryKind - The kind of the entity query that supports put request. +type CustomEntityQueryKind string + +const ( + CustomEntityQueryKindActivity CustomEntityQueryKind = "Activity" +) + +// PossibleCustomEntityQueryKindValues returns the possible values for the CustomEntityQueryKind const type. +func PossibleCustomEntityQueryKindValues() []CustomEntityQueryKind { + return []CustomEntityQueryKind{ + CustomEntityQueryKindActivity, + } +} + +// DataConnectorAuthorizationState - Describes the state of user's authorization for a connector kind. +type DataConnectorAuthorizationState string + +const ( + DataConnectorAuthorizationStateInvalid DataConnectorAuthorizationState = "Invalid" + DataConnectorAuthorizationStateValid DataConnectorAuthorizationState = "Valid" +) + +// PossibleDataConnectorAuthorizationStateValues returns the possible values for the DataConnectorAuthorizationState const type. +func PossibleDataConnectorAuthorizationStateValues() []DataConnectorAuthorizationState { + return []DataConnectorAuthorizationState{ + DataConnectorAuthorizationStateInvalid, + DataConnectorAuthorizationStateValid, + } +} + // DataConnectorKind - The kind of the data connector type DataConnectorKind string const ( + DataConnectorKindAPIPolling DataConnectorKind = "APIPolling" DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" + DataConnectorKindAmazonWebServicesS3 DataConnectorKind = "AmazonWebServicesS3" DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" + DataConnectorKindDynamics365 DataConnectorKind = "Dynamics365" + DataConnectorKindGenericUI DataConnectorKind = "GenericUI" + DataConnectorKindIOT DataConnectorKind = "IOT" DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" + DataConnectorKindMicrosoftThreatIntelligence DataConnectorKind = "MicrosoftThreatIntelligence" + DataConnectorKindMicrosoftThreatProtection DataConnectorKind = "MicrosoftThreatProtection" DataConnectorKindOffice365 DataConnectorKind = "Office365" + DataConnectorKindOffice365Project DataConnectorKind = "Office365Project" + DataConnectorKindOfficeATP DataConnectorKind = "OfficeATP" + DataConnectorKindOfficeIRM DataConnectorKind = "OfficeIRM" + DataConnectorKindOfficePowerBI DataConnectorKind = "OfficePowerBI" DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" + DataConnectorKindThreatIntelligenceTaxii DataConnectorKind = "ThreatIntelligenceTaxii" ) // PossibleDataConnectorKindValues returns the possible values for the DataConnectorKind const type. func PossibleDataConnectorKindValues() []DataConnectorKind { return []DataConnectorKind{ + DataConnectorKindAPIPolling, DataConnectorKindAmazonWebServicesCloudTrail, + DataConnectorKindAmazonWebServicesS3, DataConnectorKindAzureActiveDirectory, DataConnectorKindAzureAdvancedThreatProtection, DataConnectorKindAzureSecurityCenter, + DataConnectorKindDynamics365, + DataConnectorKindGenericUI, + DataConnectorKindIOT, DataConnectorKindMicrosoftCloudAppSecurity, DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, + DataConnectorKindMicrosoftThreatIntelligence, + DataConnectorKindMicrosoftThreatProtection, DataConnectorKindOffice365, + DataConnectorKindOffice365Project, + DataConnectorKindOfficeATP, + DataConnectorKindOfficeIRM, + DataConnectorKindOfficePowerBI, DataConnectorKindThreatIntelligence, + DataConnectorKindThreatIntelligenceTaxii, + } +} + +// DataConnectorLicenseState - Describes the state of user's license for a connector kind. +type DataConnectorLicenseState string + +const ( + DataConnectorLicenseStateInvalid DataConnectorLicenseState = "Invalid" + DataConnectorLicenseStateUnknown DataConnectorLicenseState = "Unknown" + DataConnectorLicenseStateValid DataConnectorLicenseState = "Valid" +) + +// PossibleDataConnectorLicenseStateValues returns the possible values for the DataConnectorLicenseState const type. +func PossibleDataConnectorLicenseStateValues() []DataConnectorLicenseState { + return []DataConnectorLicenseState{ + DataConnectorLicenseStateInvalid, + DataConnectorLicenseStateUnknown, + DataConnectorLicenseStateValid, } } @@ -587,6 +803,62 @@ func PossibleDeliveryLocationValues() []DeliveryLocation { } } +// 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. type ElevationToken string @@ -608,78 +880,92 @@ func PossibleElevationTokenValues() []ElevationToken { } } -// EntityKindEnum - The kind of the entity -type EntityKindEnum string - -const ( - // EntityKindEnumAccount - Entity represents account in the system. - EntityKindEnumAccount EntityKindEnum = "Account" - // EntityKindEnumAzureResource - Entity represents azure resource in the system. - EntityKindEnumAzureResource EntityKindEnum = "AzureResource" - // EntityKindEnumBookmark - Entity represents bookmark in the system. - EntityKindEnumBookmark EntityKindEnum = "Bookmark" - // EntityKindEnumCloudApplication - Entity represents cloud application in the system. - EntityKindEnumCloudApplication EntityKindEnum = "CloudApplication" - // EntityKindEnumDNSResolution - Entity represents dns resolution in the system. - EntityKindEnumDNSResolution EntityKindEnum = "DnsResolution" - // EntityKindEnumFile - Entity represents file in the system. - EntityKindEnumFile EntityKindEnum = "File" - // EntityKindEnumFileHash - Entity represents file hash in the system. - EntityKindEnumFileHash EntityKindEnum = "FileHash" - // EntityKindEnumHost - Entity represents host in the system. - EntityKindEnumHost EntityKindEnum = "Host" - // EntityKindEnumIP - Entity represents ip in the system. - EntityKindEnumIP EntityKindEnum = "Ip" - // EntityKindEnumIoTDevice - Entity represents IoT device in the system. - EntityKindEnumIoTDevice EntityKindEnum = "IoTDevice" - // EntityKindEnumMailCluster - Entity represents mail cluster in the system. - EntityKindEnumMailCluster EntityKindEnum = "MailCluster" - // EntityKindEnumMailMessage - Entity represents mail message in the system. - EntityKindEnumMailMessage EntityKindEnum = "MailMessage" - // EntityKindEnumMailbox - Entity represents mailbox in the system. - EntityKindEnumMailbox EntityKindEnum = "Mailbox" - // EntityKindEnumMalware - Entity represents malware in the system. - EntityKindEnumMalware EntityKindEnum = "Malware" - // EntityKindEnumProcess - Entity represents process in the system. - EntityKindEnumProcess EntityKindEnum = "Process" - // EntityKindEnumRegistryKey - Entity represents registry key in the system. - EntityKindEnumRegistryKey EntityKindEnum = "RegistryKey" - // EntityKindEnumRegistryValue - Entity represents registry value in the system. - EntityKindEnumRegistryValue EntityKindEnum = "RegistryValue" - // EntityKindEnumSecurityAlert - Entity represents security alert in the system. - EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" - // EntityKindEnumSecurityGroup - Entity represents security group in the system. - EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" - // EntityKindEnumSubmissionMail - Entity represents submission mail in the system. - EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - // EntityKindEnumURL - Entity represents url in the system. - EntityKindEnumURL EntityKindEnum = "Url" -) - -// PossibleEntityKindEnumValues returns the possible values for the EntityKindEnum const type. -func PossibleEntityKindEnumValues() []EntityKindEnum { - return []EntityKindEnum{ - EntityKindEnumAccount, - EntityKindEnumAzureResource, - EntityKindEnumBookmark, - EntityKindEnumCloudApplication, - EntityKindEnumDNSResolution, - EntityKindEnumFile, - EntityKindEnumFileHash, - EntityKindEnumHost, - EntityKindEnumIP, - EntityKindEnumIoTDevice, - EntityKindEnumMailCluster, - EntityKindEnumMailMessage, - EntityKindEnumMailbox, - EntityKindEnumMalware, - EntityKindEnumProcess, - EntityKindEnumRegistryKey, - EntityKindEnumRegistryValue, - EntityKindEnumSecurityAlert, - EntityKindEnumSecurityGroup, - EntityKindEnumSubmissionMail, - EntityKindEnumURL, +type EntityItemQueryKind string + +const ( + // EntityItemQueryKindInsight - insight + EntityItemQueryKindInsight EntityItemQueryKind = "Insight" +) + +// PossibleEntityItemQueryKindValues returns the possible values for the EntityItemQueryKind const type. +func PossibleEntityItemQueryKindValues() []EntityItemQueryKind { + return []EntityItemQueryKind{ + EntityItemQueryKindInsight, + } +} + +// EntityKind - The kind of the entity +type EntityKind string + +const ( + // EntityKindAccount - Entity represents account in the system. + EntityKindAccount EntityKind = "Account" + // EntityKindAzureResource - Entity represents azure resource in the system. + EntityKindAzureResource EntityKind = "AzureResource" + // EntityKindBookmark - Entity represents bookmark in the system. + EntityKindBookmark EntityKind = "Bookmark" + // EntityKindCloudApplication - Entity represents cloud application in the system. + EntityKindCloudApplication EntityKind = "CloudApplication" + // EntityKindDNSResolution - Entity represents dns resolution in the system. + EntityKindDNSResolution EntityKind = "DnsResolution" + // EntityKindFile - Entity represents file in the system. + EntityKindFile EntityKind = "File" + // EntityKindFileHash - Entity represents file hash in the system. + EntityKindFileHash EntityKind = "FileHash" + // EntityKindHost - Entity represents host in the system. + EntityKindHost EntityKind = "Host" + // EntityKindIP - Entity represents ip in the system. + EntityKindIP EntityKind = "Ip" + // EntityKindIoTDevice - Entity represents IoT device in the system. + EntityKindIoTDevice EntityKind = "IoTDevice" + // EntityKindMailCluster - Entity represents mail cluster in the system. + EntityKindMailCluster EntityKind = "MailCluster" + // EntityKindMailMessage - Entity represents mail message in the system. + EntityKindMailMessage EntityKind = "MailMessage" + // EntityKindMailbox - Entity represents mailbox in the system. + EntityKindMailbox EntityKind = "Mailbox" + // EntityKindMalware - Entity represents malware in the system. + EntityKindMalware EntityKind = "Malware" + // EntityKindProcess - Entity represents process in the system. + EntityKindProcess EntityKind = "Process" + // EntityKindRegistryKey - Entity represents registry key in the system. + EntityKindRegistryKey EntityKind = "RegistryKey" + // EntityKindRegistryValue - Entity represents registry value in the system. + EntityKindRegistryValue EntityKind = "RegistryValue" + // EntityKindSecurityAlert - Entity represents security alert in the system. + EntityKindSecurityAlert EntityKind = "SecurityAlert" + // EntityKindSecurityGroup - Entity represents security group in the system. + EntityKindSecurityGroup EntityKind = "SecurityGroup" + // EntityKindSubmissionMail - Entity represents submission mail in the system. + EntityKindSubmissionMail EntityKind = "SubmissionMail" + // EntityKindURL - Entity represents url in the system. + EntityKindURL EntityKind = "Url" +) + +// PossibleEntityKindValues returns the possible values for the EntityKind const type. +func PossibleEntityKindValues() []EntityKind { + return []EntityKind{ + EntityKindAccount, + EntityKindAzureResource, + EntityKindBookmark, + EntityKindCloudApplication, + EntityKindDNSResolution, + EntityKindFile, + EntityKindFileHash, + EntityKindHost, + EntityKindIP, + EntityKindIoTDevice, + EntityKindMailCluster, + EntityKindMailMessage, + EntityKindMailbox, + EntityKindMalware, + EntityKindProcess, + EntityKindRegistryKey, + EntityKindRegistryValue, + EntityKindSecurityAlert, + EntityKindSecurityGroup, + EntityKindSubmissionMail, + EntityKindURL, } } @@ -749,6 +1035,181 @@ func PossibleEntityMappingTypeValues() []EntityMappingType { } } +// 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 +type EntityQueryKind string + +const ( + EntityQueryKindActivity EntityQueryKind = "Activity" + EntityQueryKindExpansion EntityQueryKind = "Expansion" + EntityQueryKindInsight EntityQueryKind = "Insight" +) + +// PossibleEntityQueryKindValues returns the possible values for the EntityQueryKind const type. +func PossibleEntityQueryKindValues() []EntityQueryKind { + return []EntityQueryKind{ + EntityQueryKindActivity, + EntityQueryKindExpansion, + EntityQueryKindInsight, + } +} + +// EntityQueryTemplateKind - The kind of the entity query template. +type EntityQueryTemplateKind string + +const ( + EntityQueryTemplateKindActivity EntityQueryTemplateKind = "Activity" +) + +// PossibleEntityQueryTemplateKindValues returns the possible values for the EntityQueryTemplateKind const type. +func PossibleEntityQueryTemplateKindValues() []EntityQueryTemplateKind { + return []EntityQueryTemplateKind{ + EntityQueryTemplateKindActivity, + } +} + +// EntityTimelineKind - The entity query kind +type EntityTimelineKind string + +const ( + // EntityTimelineKindActivity - activity + EntityTimelineKindActivity EntityTimelineKind = "Activity" + // EntityTimelineKindAnomaly - anomaly + EntityTimelineKindAnomaly EntityTimelineKind = "Anomaly" + // EntityTimelineKindBookmark - bookmarks + EntityTimelineKindBookmark EntityTimelineKind = "Bookmark" + // EntityTimelineKindSecurityAlert - security alerts + EntityTimelineKindSecurityAlert EntityTimelineKind = "SecurityAlert" +) + +// PossibleEntityTimelineKindValues returns the possible values for the EntityTimelineKind const type. +func PossibleEntityTimelineKindValues() []EntityTimelineKind { + return []EntityTimelineKind{ + EntityTimelineKindActivity, + EntityTimelineKindAnomaly, + EntityTimelineKindBookmark, + EntityTimelineKindSecurityAlert, + } +} + +// EntityType - The type of the entity +type EntityType string + +const ( + // EntityTypeAccount - Entity represents account in the system. + EntityTypeAccount EntityType = "Account" + // EntityTypeAzureResource - Entity represents azure resource in the system. + EntityTypeAzureResource EntityType = "AzureResource" + // EntityTypeCloudApplication - Entity represents cloud application in the system. + EntityTypeCloudApplication EntityType = "CloudApplication" + // EntityTypeDNS - Entity represents dns in the system. + EntityTypeDNS EntityType = "DNS" + // EntityTypeFile - Entity represents file in the system. + EntityTypeFile EntityType = "File" + // EntityTypeFileHash - Entity represents file hash in the system. + EntityTypeFileHash EntityType = "FileHash" + // EntityTypeHost - Entity represents host in the system. + EntityTypeHost EntityType = "Host" + // EntityTypeHuntingBookmark - Entity represents HuntingBookmark in the system. + EntityTypeHuntingBookmark EntityType = "HuntingBookmark" + // EntityTypeIP - Entity represents ip in the system. + EntityTypeIP EntityType = "IP" + // EntityTypeIoTDevice - Entity represents IoT device in the system. + EntityTypeIoTDevice EntityType = "IoTDevice" + // EntityTypeMailCluster - Entity represents mail cluster in the system. + EntityTypeMailCluster EntityType = "MailCluster" + // EntityTypeMailMessage - Entity represents mail message in the system. + EntityTypeMailMessage EntityType = "MailMessage" + // EntityTypeMailbox - Entity represents mailbox in the system. + EntityTypeMailbox EntityType = "Mailbox" + // EntityTypeMalware - Entity represents malware in the system. + EntityTypeMalware EntityType = "Malware" + // EntityTypeProcess - Entity represents process in the system. + EntityTypeProcess EntityType = "Process" + // EntityTypeRegistryKey - Entity represents registry key in the system. + EntityTypeRegistryKey EntityType = "RegistryKey" + // EntityTypeRegistryValue - Entity represents registry value in the system. + EntityTypeRegistryValue EntityType = "RegistryValue" + // EntityTypeSecurityAlert - Entity represents security alert in the system. + EntityTypeSecurityAlert EntityType = "SecurityAlert" + // EntityTypeSecurityGroup - Entity represents security group in the system. + EntityTypeSecurityGroup EntityType = "SecurityGroup" + // EntityTypeSubmissionMail - Entity represents submission mail in the system. + EntityTypeSubmissionMail EntityType = "SubmissionMail" + // EntityTypeURL - Entity represents url in the system. + EntityTypeURL EntityType = "URL" +) + +// PossibleEntityTypeValues returns the possible values for the EntityType const type. +func PossibleEntityTypeValues() []EntityType { + return []EntityType{ + EntityTypeAccount, + EntityTypeAzureResource, + EntityTypeCloudApplication, + EntityTypeDNS, + EntityTypeFile, + EntityTypeFileHash, + EntityTypeHost, + EntityTypeHuntingBookmark, + EntityTypeIP, + EntityTypeIoTDevice, + EntityTypeMailCluster, + EntityTypeMailMessage, + EntityTypeMailbox, + EntityTypeMalware, + EntityTypeProcess, + EntityTypeRegistryKey, + EntityTypeRegistryValue, + EntityTypeSecurityAlert, + EntityTypeSecurityGroup, + EntityTypeSubmissionMail, + EntityTypeURL, + } +} + +type Enum13 string + +const ( + Enum13Activity Enum13 = "Activity" + Enum13Expansion Enum13 = "Expansion" +) + +// PossibleEnum13Values returns the possible values for the Enum13 const type. +func PossibleEnum13Values() []Enum13 { + return []Enum13{ + Enum13Activity, + Enum13Expansion, + } +} + +type Enum15 string + +const ( + Enum15Activity Enum15 = "Activity" +) + +// PossibleEnum15Values returns the possible values for the Enum15 const type. +func PossibleEnum15Values() []Enum15 { + return []Enum15{ + Enum15Activity, + } +} + // EventGroupingAggregationKind - The event grouping aggregation kinds type EventGroupingAggregationKind string @@ -792,6 +1253,20 @@ func PossibleFileHashAlgorithmValues() []FileHashAlgorithm { } } +// GetInsightsError - the query kind +type GetInsightsError string + +const ( + GetInsightsErrorInsight GetInsightsError = "Insight" +) + +// PossibleGetInsightsErrorValues returns the possible values for the GetInsightsError const type. +func PossibleGetInsightsErrorValues() []GetInsightsError { + return []GetInsightsError{ + GetInsightsErrorInsight, + } +} + // IncidentClassification - The reason the incident was closed type IncidentClassification string @@ -991,6 +1466,52 @@ func PossibleKillChainIntentValues() []KillChainIntent { } } +// Kind - The kind of content the metadata is for. +type Kind string + +const ( + 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. +func PossibleKindValues() []Kind { + return []Kind{ + KindAnalyticsRule, + KindAnalyticsRuleTemplate, + KindAutomationRule, + KindAzureFunction, + KindDataConnector, + KindDataType, + KindHuntingQuery, + KindInvestigationQuery, + KindLogicAppsCustomConnector, + KindParser, + KindPlaybook, + KindPlaybookTemplate, + KindSolution, + KindWatchlist, + KindWatchlistTemplate, + KindWorkbook, + KindWorkbookTemplate, + } +} + // MatchingMethod - Grouping matching method. When method is Selected at least one of groupByEntities, groupByAlertDetails, // groupByCustomDetails must be provided and not empty. type MatchingMethod string @@ -1018,11 +1539,13 @@ func PossibleMatchingMethodValues() []MatchingMethod { type MicrosoftSecurityProductName string const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" + MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" + MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" + MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" + MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" + MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" + MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection MicrosoftSecurityProductName = "Microsoft Defender Advanced Threat Protection" + MicrosoftSecurityProductNameOffice365AdvancedThreatProtection MicrosoftSecurityProductName = "Office 365 Advanced Threat Protection" ) // PossibleMicrosoftSecurityProductNameValues returns the possible values for the MicrosoftSecurityProductName const type. @@ -1033,6 +1556,8 @@ func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName MicrosoftSecurityProductNameAzureSecurityCenter, MicrosoftSecurityProductNameAzureSecurityCenterForIoT, MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, + MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection, + MicrosoftSecurityProductNameOffice365AdvancedThreatProtection, } } @@ -1063,6 +1588,42 @@ func PossibleOSFamilyValues() []OSFamily { } } +// Operator - Operator used for list of dependencies in criteria array. +type Operator string + +const ( + OperatorAND Operator = "AND" + OperatorOR Operator = "OR" +) + +// PossibleOperatorValues returns the possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{ + OperatorAND, + OperatorOR, + } +} + +// OutputType - Insights Column type. +type OutputType string + +const ( + OutputTypeDate OutputType = "Date" + OutputTypeEntity OutputType = "Entity" + OutputTypeNumber OutputType = "Number" + OutputTypeString OutputType = "String" +) + +// PossibleOutputTypeValues returns the possible values for the OutputType const type. +func PossibleOutputTypeValues() []OutputType { + return []OutputType{ + OutputTypeDate, + OutputTypeEntity, + OutputTypeNumber, + OutputTypeString, + } +} + // OwnerType - The type of the owner the incident is assigned to. type OwnerType string @@ -1084,6 +1645,69 @@ func PossibleOwnerTypeValues() []OwnerType { } } +// PermissionProviderScope - Permission provider scope +type PermissionProviderScope string + +const ( + PermissionProviderScopeResourceGroup PermissionProviderScope = "ResourceGroup" + PermissionProviderScopeSubscription PermissionProviderScope = "Subscription" + PermissionProviderScopeWorkspace PermissionProviderScope = "Workspace" +) + +// PossiblePermissionProviderScopeValues returns the possible values for the PermissionProviderScope const type. +func PossiblePermissionProviderScopeValues() []PermissionProviderScope { + return []PermissionProviderScope{ + PermissionProviderScopeResourceGroup, + PermissionProviderScopeSubscription, + PermissionProviderScopeWorkspace, + } +} + +// PollingFrequency - The polling frequency for the TAXII server. +type PollingFrequency string + +const ( + // PollingFrequencyOnceADay - Once a day + PollingFrequencyOnceADay PollingFrequency = "OnceADay" + // PollingFrequencyOnceAMinute - Once a minute + PollingFrequencyOnceAMinute PollingFrequency = "OnceAMinute" + // PollingFrequencyOnceAnHour - Once an hour + PollingFrequencyOnceAnHour PollingFrequency = "OnceAnHour" +) + +// PossiblePollingFrequencyValues returns the possible values for the PollingFrequency const type. +func PossiblePollingFrequencyValues() []PollingFrequency { + return []PollingFrequency{ + PollingFrequencyOnceADay, + PollingFrequencyOnceAMinute, + PollingFrequencyOnceAnHour, + } +} + +// ProviderName - Provider name +type ProviderName string + +const ( + ProviderNameMicrosoftAadiamDiagnosticSettings ProviderName = "microsoft.aadiam/diagnosticSettings" + ProviderNameMicrosoftAuthorizationPolicyAssignments ProviderName = "Microsoft.Authorization/policyAssignments" + ProviderNameMicrosoftOperationalInsightsSolutions ProviderName = "Microsoft.OperationalInsights/solutions" + ProviderNameMicrosoftOperationalInsightsWorkspaces ProviderName = "Microsoft.OperationalInsights/workspaces" + ProviderNameMicrosoftOperationalInsightsWorkspacesDatasources ProviderName = "Microsoft.OperationalInsights/workspaces/datasources" + ProviderNameMicrosoftOperationalInsightsWorkspacesSharedKeys ProviderName = "Microsoft.OperationalInsights/workspaces/sharedKeys" +) + +// PossibleProviderNameValues returns the possible values for the ProviderName const type. +func PossibleProviderNameValues() []ProviderName { + return []ProviderName{ + ProviderNameMicrosoftAadiamDiagnosticSettings, + ProviderNameMicrosoftAuthorizationPolicyAssignments, + ProviderNameMicrosoftOperationalInsightsSolutions, + ProviderNameMicrosoftOperationalInsightsWorkspaces, + ProviderNameMicrosoftOperationalInsightsWorkspacesDatasources, + ProviderNameMicrosoftOperationalInsightsWorkspacesSharedKeys, + } +} + // RegistryHive - the hive that holds the registry key. type RegistryHive string @@ -1163,19 +1787,143 @@ func PossibleRegistryValueKindValues() []RegistryValueKind { } } -// Source - The source of the watchlist -type Source string +// RepoType - The type of repository. +type RepoType string + +const ( + RepoTypeDevOps RepoType = "DevOps" + RepoTypeGithub RepoType = "Github" +) + +// PossibleRepoTypeValues returns the possible values for the RepoType const type. +func PossibleRepoTypeValues() []RepoType { + return []RepoType{ + RepoTypeDevOps, + RepoTypeGithub, + } +} + +// SecurityMLAnalyticsSettingsKind - The kind of security ML analytics settings +type SecurityMLAnalyticsSettingsKind string const ( - SourceLocalFile Source = "Local file" - SourceRemoteStorage Source = "Remote storage" + SecurityMLAnalyticsSettingsKindAnomaly SecurityMLAnalyticsSettingsKind = "Anomaly" ) -// PossibleSourceValues returns the possible values for the Source const type. -func PossibleSourceValues() []Source { - return []Source{ - SourceLocalFile, - SourceRemoteStorage, +// PossibleSecurityMLAnalyticsSettingsKindValues returns the possible values for the SecurityMLAnalyticsSettingsKind const type. +func PossibleSecurityMLAnalyticsSettingsKindValues() []SecurityMLAnalyticsSettingsKind { + return []SecurityMLAnalyticsSettingsKind{ + SecurityMLAnalyticsSettingsKindAnomaly, + } +} + +// SettingKind - The kind of the setting +type SettingKind string + +const ( + SettingKindAnomalies SettingKind = "Anomalies" + SettingKindEntityAnalytics SettingKind = "EntityAnalytics" + SettingKindEyesOn SettingKind = "EyesOn" + SettingKindUeba SettingKind = "Ueba" +) + +// PossibleSettingKindValues returns the possible values for the SettingKind const type. +func PossibleSettingKindValues() []SettingKind { + return []SettingKind{ + SettingKindAnomalies, + SettingKindEntityAnalytics, + SettingKindEyesOn, + SettingKindUeba, + } +} + +// SettingType - The kind of the setting +type SettingType string + +const ( + SettingTypeCopyableLabel SettingType = "CopyableLabel" + SettingTypeInfoMessage SettingType = "InfoMessage" + SettingTypeInstructionStepsGroup SettingType = "InstructionStepsGroup" +) + +// PossibleSettingTypeValues returns the possible values for the SettingType const type. +func PossibleSettingTypeValues() []SettingType { + return []SettingType{ + SettingTypeCopyableLabel, + SettingTypeInfoMessage, + SettingTypeInstructionStepsGroup, + } +} + +// SettingsStatus - The anomaly SecurityMLAnalyticsSettings status +type SettingsStatus string + +const ( + // SettingsStatusFlighting - Anomaly settings status in Flighting mode + SettingsStatusFlighting SettingsStatus = "Flighting" + // SettingsStatusProduction - Anomaly settings status in Production mode + SettingsStatusProduction SettingsStatus = "Production" +) + +// PossibleSettingsStatusValues returns the possible values for the SettingsStatus const type. +func PossibleSettingsStatusValues() []SettingsStatus { + return []SettingsStatus{ + SettingsStatusFlighting, + SettingsStatusProduction, + } +} + +// SourceKind - Source type of the content +type SourceKind string + +const ( + SourceKindCommunity SourceKind = "Community" + SourceKindLocalWorkspace SourceKind = "LocalWorkspace" + SourceKindSolution SourceKind = "Solution" + SourceKindSourceRepository SourceKind = "SourceRepository" +) + +// PossibleSourceKindValues returns the possible values for the SourceKind const type. +func PossibleSourceKindValues() []SourceKind { + return []SourceKind{ + SourceKindCommunity, + SourceKindLocalWorkspace, + SourceKindSolution, + SourceKindSourceRepository, + } +} + +// 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 +type SupportTier string + +const ( + SupportTierCommunity SupportTier = "Community" + SupportTierMicrosoft SupportTier = "Microsoft" + SupportTierPartner SupportTier = "Partner" +) + +// PossibleSupportTierValues returns the possible values for the SupportTier const type. +func PossibleSupportTierValues() []SupportTier { + return []SupportTier{ + SupportTierCommunity, + SupportTierMicrosoft, + SupportTierPartner, } } @@ -1200,36 +1948,36 @@ func PossibleTemplateStatusValues() []TemplateStatus { } } -// ThreatIntelligenceResourceInnerKind - The kind of the threat intelligence entity -type ThreatIntelligenceResourceInnerKind string +// ThreatIntelligenceResourceKindEnum - The kind of the threat intelligence entity +type ThreatIntelligenceResourceKindEnum string const ( - // ThreatIntelligenceResourceInnerKindIndicator - Entity represents threat intelligence indicator in the system. - ThreatIntelligenceResourceInnerKindIndicator ThreatIntelligenceResourceInnerKind = "indicator" + // ThreatIntelligenceResourceKindEnumIndicator - Entity represents threat intelligence indicator in the system. + ThreatIntelligenceResourceKindEnumIndicator ThreatIntelligenceResourceKindEnum = "indicator" ) -// PossibleThreatIntelligenceResourceInnerKindValues returns the possible values for the ThreatIntelligenceResourceInnerKind const type. -func PossibleThreatIntelligenceResourceInnerKindValues() []ThreatIntelligenceResourceInnerKind { - return []ThreatIntelligenceResourceInnerKind{ - ThreatIntelligenceResourceInnerKindIndicator, +// PossibleThreatIntelligenceResourceKindEnumValues returns the possible values for the ThreatIntelligenceResourceKindEnum const type. +func PossibleThreatIntelligenceResourceKindEnumValues() []ThreatIntelligenceResourceKindEnum { + return []ThreatIntelligenceResourceKindEnum{ + ThreatIntelligenceResourceKindEnumIndicator, } } -// ThreatIntelligenceSortingOrder - Sorting order (ascending/descending/unsorted). -type ThreatIntelligenceSortingOrder string +// ThreatIntelligenceSortingCriteriaEnum - Sorting order (ascending/descending/unsorted). +type ThreatIntelligenceSortingCriteriaEnum string const ( - ThreatIntelligenceSortingOrderAscending ThreatIntelligenceSortingOrder = "ascending" - ThreatIntelligenceSortingOrderDescending ThreatIntelligenceSortingOrder = "descending" - ThreatIntelligenceSortingOrderUnsorted ThreatIntelligenceSortingOrder = "unsorted" + ThreatIntelligenceSortingCriteriaEnumAscending ThreatIntelligenceSortingCriteriaEnum = "ascending" + ThreatIntelligenceSortingCriteriaEnumDescending ThreatIntelligenceSortingCriteriaEnum = "descending" + ThreatIntelligenceSortingCriteriaEnumUnsorted ThreatIntelligenceSortingCriteriaEnum = "unsorted" ) -// PossibleThreatIntelligenceSortingOrderValues returns the possible values for the ThreatIntelligenceSortingOrder const type. -func PossibleThreatIntelligenceSortingOrderValues() []ThreatIntelligenceSortingOrder { - return []ThreatIntelligenceSortingOrder{ - ThreatIntelligenceSortingOrderAscending, - ThreatIntelligenceSortingOrderDescending, - ThreatIntelligenceSortingOrderUnsorted, +// PossibleThreatIntelligenceSortingCriteriaEnumValues returns the possible values for the ThreatIntelligenceSortingCriteriaEnum const type. +func PossibleThreatIntelligenceSortingCriteriaEnumValues() []ThreatIntelligenceSortingCriteriaEnum { + return []ThreatIntelligenceSortingCriteriaEnum{ + ThreatIntelligenceSortingCriteriaEnumAscending, + ThreatIntelligenceSortingCriteriaEnumDescending, + ThreatIntelligenceSortingCriteriaEnumUnsorted, } } @@ -1272,11 +2020,50 @@ type TriggersWhen string const ( // TriggersWhenCreated - Trigger on created objects TriggersWhenCreated TriggersWhen = "Created" + // TriggersWhenUpdated - Trigger on updated objects + TriggersWhenUpdated TriggersWhen = "Updated" ) // PossibleTriggersWhenValues returns the possible values for the TriggersWhen const type. func PossibleTriggersWhenValues() []TriggersWhen { return []TriggersWhen{ TriggersWhenCreated, + TriggersWhenUpdated, + } +} + +// UebaDataSources - The data source that enriched by ueba. +type UebaDataSources string + +const ( + UebaDataSourcesAuditLogs UebaDataSources = "AuditLogs" + UebaDataSourcesAzureActivity UebaDataSources = "AzureActivity" + UebaDataSourcesSecurityEvent UebaDataSources = "SecurityEvent" + UebaDataSourcesSigninLogs UebaDataSources = "SigninLogs" +) + +// PossibleUebaDataSourcesValues returns the possible values for the UebaDataSources const type. +func PossibleUebaDataSourcesValues() []UebaDataSources { + return []UebaDataSources{ + UebaDataSourcesAuditLogs, + UebaDataSourcesAzureActivity, + UebaDataSourcesSecurityEvent, + UebaDataSourcesSigninLogs, + } +} + +// 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 5cd9121fde3f..59adf649bf38 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectors_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectors_client.go @@ -54,9 +54,62 @@ func NewDataConnectorsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } +// Connect - Connects a data connector. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// dataConnectorID - Connector ID +// connectBody - The data connector +// options - DataConnectorsClientConnectOptions contains the optional parameters for the DataConnectorsClient.Connect method. +func (client *DataConnectorsClient) Connect(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string, connectBody DataConnectorConnectBody, options *DataConnectorsClientConnectOptions) (DataConnectorsClientConnectResponse, error) { + req, err := client.connectCreateRequest(ctx, resourceGroupName, workspaceName, dataConnectorID, connectBody, options) + if err != nil { + return DataConnectorsClientConnectResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataConnectorsClientConnectResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataConnectorsClientConnectResponse{}, runtime.NewResponseError(resp) + } + return DataConnectorsClientConnectResponse{}, nil +} + +// connectCreateRequest creates the Connect request. +func (client *DataConnectorsClient) connectCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string, connectBody DataConnectorConnectBody, options *DataConnectorsClientConnectOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/connect" + 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 dataConnectorID == "" { + return nil, errors.New("parameter dataConnectorID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataConnectorId}", url.PathEscape(dataConnectorID)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, connectBody) +} + // CreateOrUpdate - Creates or updates the data connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // dataConnectorID - Connector ID @@ -102,7 +155,7 @@ func (client *DataConnectorsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, dataConnector) @@ -119,7 +172,7 @@ func (client *DataConnectorsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Delete the data connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // dataConnectorID - Connector ID @@ -163,7 +216,60 @@ func (client *DataConnectorsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Disconnect - Disconnect a data connector. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// dataConnectorID - Connector ID +// options - DataConnectorsClientDisconnectOptions contains the optional parameters for the DataConnectorsClient.Disconnect +// method. +func (client *DataConnectorsClient) Disconnect(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string, options *DataConnectorsClientDisconnectOptions) (DataConnectorsClientDisconnectResponse, error) { + req, err := client.disconnectCreateRequest(ctx, resourceGroupName, workspaceName, dataConnectorID, options) + if err != nil { + return DataConnectorsClientDisconnectResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataConnectorsClientDisconnectResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataConnectorsClientDisconnectResponse{}, runtime.NewResponseError(resp) + } + return DataConnectorsClientDisconnectResponse{}, nil +} + +// disconnectCreateRequest creates the Disconnect request. +func (client *DataConnectorsClient) disconnectCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string, options *DataConnectorsClientDisconnectOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}/disconnect" + 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 dataConnectorID == "" { + return nil, errors.New("parameter dataConnectorID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataConnectorId}", url.PathEscape(dataConnectorID)) + 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-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -171,7 +277,7 @@ func (client *DataConnectorsClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a data connector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // dataConnectorID - Connector ID @@ -215,7 +321,7 @@ func (client *DataConnectorsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,7 +338,7 @@ func (client *DataConnectorsClient) getHandleResponse(resp *http.Response) (Data // NewListPager - Gets all data connectors. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // 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. @@ -284,7 +390,7 @@ func (client *DataConnectorsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectorscheckrequirements_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectorscheckrequirements_client.go new file mode 100644 index 000000000000..ff369ed52039 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_dataconnectorscheckrequirements_client.go @@ -0,0 +1,113 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// DataConnectorsCheckRequirementsClient contains the methods for the DataConnectorsCheckRequirements group. +// Don't use this type directly, use NewDataConnectorsCheckRequirementsClient() instead. +type DataConnectorsCheckRequirementsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDataConnectorsCheckRequirementsClient creates a new instance of DataConnectorsCheckRequirementsClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Post - Get requirements state for a data connector type. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// dataConnectorsCheckRequirements - The parameters for requirements check message +// options - DataConnectorsCheckRequirementsClientPostOptions contains the optional parameters for the DataConnectorsCheckRequirementsClient.Post +// method. +func (client *DataConnectorsCheckRequirementsClient) Post(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorsCheckRequirements DataConnectorsCheckRequirementsClassification, options *DataConnectorsCheckRequirementsClientPostOptions) (DataConnectorsCheckRequirementsClientPostResponse, error) { + req, err := client.postCreateRequest(ctx, resourceGroupName, workspaceName, dataConnectorsCheckRequirements, options) + if err != nil { + return DataConnectorsCheckRequirementsClientPostResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DataConnectorsCheckRequirementsClientPostResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DataConnectorsCheckRequirementsClientPostResponse{}, runtime.NewResponseError(resp) + } + return client.postHandleResponse(resp) +} + +// postCreateRequest creates the Post request. +func (client *DataConnectorsCheckRequirementsClient) postCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorsCheckRequirements DataConnectorsCheckRequirementsClassification, options *DataConnectorsCheckRequirementsClientPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements" + 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)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, dataConnectorsCheckRequirements) +} + +// postHandleResponse handles the Post response. +func (client *DataConnectorsCheckRequirementsClient) postHandleResponse(resp *http.Response) (DataConnectorsCheckRequirementsClientPostResponse, error) { + result := DataConnectorsCheckRequirementsClientPostResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DataConnectorRequirementsState); err != nil { + return DataConnectorsCheckRequirementsClientPostResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_date_type.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_date_type.go new file mode 100644 index 000000000000..90fdb5cc71a6 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_date_type.go @@ -0,0 +1,59 @@ +//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" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "strings" + "time" +) + +const ( + fullDateJSON = `"2006-01-02"` + jsonFormat = `"%04d-%02d-%02d"` +) + +type dateType time.Time + +func (t dateType) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(jsonFormat, time.Time(t).Year(), time.Time(t).Month(), time.Time(t).Day())), nil +} + +func (d *dateType) UnmarshalJSON(data []byte) (err error) { + t, err := time.Parse(fullDateJSON, string(data)) + *d = (dateType)(t) + return err +} + +func populateDateType(m map[string]interface{}, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateType)(t) +} + +func unpopulateDateType(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || strings.EqualFold(string(data), "null") { + return nil + } + var aux dateType + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_domainwhois_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_domainwhois_client.go new file mode 100644 index 000000000000..d3ac119a5780 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_domainwhois_client.go @@ -0,0 +1,108 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// DomainWhoisClient contains the methods for the DomainWhois group. +// Don't use this type directly, use NewDomainWhoisClient() instead. +type DomainWhoisClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDomainWhoisClient creates a new instance of DomainWhoisClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Get - Get whois information for a single domain name +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// domain - Domain name to be enriched +// options - DomainWhoisClientGetOptions contains the optional parameters for the DomainWhoisClient.Get method. +func (client *DomainWhoisClient) Get(ctx context.Context, resourceGroupName string, domain string, options *DomainWhoisClientGetOptions) (DomainWhoisClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, domain, options) + if err != nil { + return DomainWhoisClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DomainWhoisClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DomainWhoisClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DomainWhoisClient) getCreateRequest(ctx context.Context, resourceGroupName string, domain string, options *DomainWhoisClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/domain/whois/" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("domain", domain) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DomainWhoisClient) getHandleResponse(resp *http.Response) (DomainWhoisClientGetResponse, error) { + result := DomainWhoisClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnrichmentDomainWhois); err != nil { + return DomainWhoisClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entities_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entities_client.go new file mode 100644 index 000000000000..5bfe8b242a62 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entities_client.go @@ -0,0 +1,372 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// EntitiesClient contains the methods for the Entities group. +// Don't use this type directly, use NewEntitiesClient() instead. +type EntitiesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEntitiesClient creates a new instance of EntitiesClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Expand - Expands an entity. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityID - entity ID +// parameters - The parameters required to execute an expand operation on the given entity. +// options - EntitiesClientExpandOptions contains the optional parameters for the EntitiesClient.Expand method. +func (client *EntitiesClient) Expand(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, parameters EntityExpandParameters, options *EntitiesClientExpandOptions) (EntitiesClientExpandResponse, error) { + req, err := client.expandCreateRequest(ctx, resourceGroupName, workspaceName, entityID, parameters, options) + if err != nil { + return EntitiesClientExpandResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntitiesClientExpandResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntitiesClientExpandResponse{}, runtime.NewResponseError(resp) + } + return client.expandHandleResponse(resp) +} + +// expandCreateRequest creates the Expand request. +func (client *EntitiesClient) expandCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, parameters EntityExpandParameters, options *EntitiesClientExpandOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/expand" + 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 entityID == "" { + return nil, errors.New("parameter entityID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityId}", url.PathEscape(entityID)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// expandHandleResponse handles the Expand response. +func (client *EntitiesClient) expandHandleResponse(resp *http.Response) (EntitiesClientExpandResponse, error) { + result := EntitiesClientExpandResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EntityExpandResponse); err != nil { + return EntitiesClientExpandResponse{}, err + } + return result, nil +} + +// Get - Gets an entity. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityID - entity ID +// options - EntitiesClientGetOptions contains the optional parameters for the EntitiesClient.Get method. +func (client *EntitiesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, options *EntitiesClientGetOptions) (EntitiesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, entityID, options) + if err != nil { + return EntitiesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntitiesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntitiesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *EntitiesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, options *EntitiesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}" + 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 entityID == "" { + return nil, errors.New("parameter entityID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityId}", url.PathEscape(entityID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *EntitiesClient) getHandleResponse(resp *http.Response) (EntitiesClientGetResponse, error) { + result := EntitiesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return EntitiesClientGetResponse{}, err + } + return result, nil +} + +// GetInsights - Execute Insights for an entity. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityID - entity ID +// parameters - The parameters required to execute insights on the given entity. +// options - EntitiesClientGetInsightsOptions contains the optional parameters for the EntitiesClient.GetInsights method. +func (client *EntitiesClient) GetInsights(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, parameters EntityGetInsightsParameters, options *EntitiesClientGetInsightsOptions) (EntitiesClientGetInsightsResponse, error) { + req, err := client.getInsightsCreateRequest(ctx, resourceGroupName, workspaceName, entityID, parameters, options) + if err != nil { + return EntitiesClientGetInsightsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntitiesClientGetInsightsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntitiesClientGetInsightsResponse{}, runtime.NewResponseError(resp) + } + return client.getInsightsHandleResponse(resp) +} + +// getInsightsCreateRequest creates the GetInsights request. +func (client *EntitiesClient) getInsightsCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, parameters EntityGetInsightsParameters, options *EntitiesClientGetInsightsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getInsights" + 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 entityID == "" { + return nil, errors.New("parameter entityID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityId}", url.PathEscape(entityID)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// getInsightsHandleResponse handles the GetInsights response. +func (client *EntitiesClient) getInsightsHandleResponse(resp *http.Response) (EntitiesClientGetInsightsResponse, error) { + result := EntitiesClientGetInsightsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EntityGetInsightsResponse); err != nil { + return EntitiesClientGetInsightsResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all entities. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// 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) NewListPager(resourceGroupName string, workspaceName string, options *EntitiesClientListOptions) *runtime.Pager[EntitiesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[EntitiesClientListResponse]{ + More: func(page EntitiesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *EntitiesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *EntitiesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *EntitiesClient) listHandleResponse(resp *http.Response) (EntitiesClientListResponse, error) { + result := EntitiesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EntityList); err != nil { + return EntitiesClientListResponse{}, err + } + return result, nil +} + +// Queries - Get Insights and Activities for an entity. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityID - entity ID +// kind - The Kind parameter for queries +// options - EntitiesClientQueriesOptions contains the optional parameters for the EntitiesClient.Queries method. +func (client *EntitiesClient) Queries(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, kind EntityItemQueryKind, options *EntitiesClientQueriesOptions) (EntitiesClientQueriesResponse, error) { + req, err := client.queriesCreateRequest(ctx, resourceGroupName, workspaceName, entityID, kind, options) + if err != nil { + return EntitiesClientQueriesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntitiesClientQueriesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntitiesClientQueriesResponse{}, runtime.NewResponseError(resp) + } + return client.queriesHandleResponse(resp) +} + +// queriesCreateRequest creates the Queries request. +func (client *EntitiesClient) queriesCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, kind EntityItemQueryKind, options *EntitiesClientQueriesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/queries" + 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 entityID == "" { + return nil, errors.New("parameter entityID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityId}", url.PathEscape(entityID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("kind", string(kind)) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// queriesHandleResponse handles the Queries response. +func (client *EntitiesClient) queriesHandleResponse(resp *http.Response) (EntitiesClientQueriesResponse, error) { + result := EntitiesClientQueriesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GetQueriesResponse); err != nil { + return EntitiesClientQueriesResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesgettimeline_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesgettimeline_client.go new file mode 100644 index 000000000000..ea3075ab4d90 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesgettimeline_client.go @@ -0,0 +1,118 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// EntitiesGetTimelineClient contains the methods for the EntitiesGetTimeline group. +// Don't use this type directly, use NewEntitiesGetTimelineClient() instead. +type EntitiesGetTimelineClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEntitiesGetTimelineClient creates a new instance of EntitiesGetTimelineClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// List - Timeline for an entity. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityID - entity ID +// parameters - The parameters required to execute an timeline operation on the given entity. +// options - EntitiesGetTimelineClientListOptions contains the optional parameters for the EntitiesGetTimelineClient.List +// method. +func (client *EntitiesGetTimelineClient) List(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, parameters EntityTimelineParameters, options *EntitiesGetTimelineClientListOptions) (EntitiesGetTimelineClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, workspaceName, entityID, parameters, options) + if err != nil { + return EntitiesGetTimelineClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntitiesGetTimelineClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntitiesGetTimelineClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *EntitiesGetTimelineClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, parameters EntityTimelineParameters, options *EntitiesGetTimelineClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/getTimeline" + 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 entityID == "" { + return nil, errors.New("parameter entityID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityId}", url.PathEscape(entityID)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// listHandleResponse handles the List response. +func (client *EntitiesGetTimelineClient) listHandleResponse(resp *http.Response) (EntitiesGetTimelineClientListResponse, error) { + result := EntitiesGetTimelineClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EntityTimelineResponse); err != nil { + return EntitiesGetTimelineClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesrelations_client.go new file mode 100644 index 000000000000..2ebedba48f4b --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entitiesrelations_client.go @@ -0,0 +1,142 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// EntitiesRelationsClient contains the methods for the EntitiesRelations group. +// Don't use this type directly, use NewEntitiesRelationsClient() instead. +type EntitiesRelationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEntitiesRelationsClient creates a new instance of EntitiesRelationsClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Gets all relations of an entity. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityID - entity ID +// options - EntitiesRelationsClientListOptions contains the optional parameters for the EntitiesRelationsClient.List method. +func (client *EntitiesRelationsClient) NewListPager(resourceGroupName string, workspaceName string, entityID string, options *EntitiesRelationsClientListOptions) *runtime.Pager[EntitiesRelationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[EntitiesRelationsClientListResponse]{ + More: func(page EntitiesRelationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *EntitiesRelationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, options *EntitiesRelationsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations" + 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 entityID == "" { + return nil, errors.New("parameter entityID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityId}", url.PathEscape(entityID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *EntitiesRelationsClient) listHandleResponse(resp *http.Response) (EntitiesRelationsClientListResponse, error) { + result := EntitiesRelationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RelationList); err != nil { + return EntitiesRelationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityqueries_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityqueries_client.go new file mode 100644 index 000000000000..7eddd4f75b23 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityqueries_client.go @@ -0,0 +1,303 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// EntityQueriesClient contains the methods for the EntityQueries group. +// Don't use this type directly, use NewEntityQueriesClient() instead. +type EntityQueriesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEntityQueriesClient creates a new instance of EntityQueriesClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates the entity query. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityQueryID - entity query ID +// entityQuery - The entity query we want to create or update +// options - EntityQueriesClientCreateOrUpdateOptions contains the optional parameters for the EntityQueriesClient.CreateOrUpdate +// method. +func (client *EntityQueriesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryID string, entityQuery CustomEntityQueryClassification, options *EntityQueriesClientCreateOrUpdateOptions) (EntityQueriesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, entityQueryID, entityQuery, options) + if err != nil { + return EntityQueriesClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntityQueriesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return EntityQueriesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *EntityQueriesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryID string, entityQuery CustomEntityQueryClassification, options *EntityQueriesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}" + 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 entityQueryID == "" { + return nil, errors.New("parameter entityQueryID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityQueryId}", url.PathEscape(entityQueryID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, entityQuery) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *EntityQueriesClient) createOrUpdateHandleResponse(resp *http.Response) (EntityQueriesClientCreateOrUpdateResponse, error) { + result := EntityQueriesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return EntityQueriesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete the entity query. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityQueryID - entity query ID +// options - EntityQueriesClientDeleteOptions contains the optional parameters for the EntityQueriesClient.Delete method. +func (client *EntityQueriesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryID string, options *EntityQueriesClientDeleteOptions) (EntityQueriesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, entityQueryID, options) + if err != nil { + return EntityQueriesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntityQueriesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return EntityQueriesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return EntityQueriesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *EntityQueriesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryID string, options *EntityQueriesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}" + 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 entityQueryID == "" { + return nil, errors.New("parameter entityQueryID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityQueryId}", url.PathEscape(entityQueryID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets an entity query. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityQueryID - entity query ID +// options - EntityQueriesClientGetOptions contains the optional parameters for the EntityQueriesClient.Get method. +func (client *EntityQueriesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryID string, options *EntityQueriesClientGetOptions) (EntityQueriesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, entityQueryID, options) + if err != nil { + return EntityQueriesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntityQueriesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntityQueriesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *EntityQueriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryID string, options *EntityQueriesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries/{entityQueryId}" + 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 entityQueryID == "" { + return nil, errors.New("parameter entityQueryID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityQueryId}", url.PathEscape(entityQueryID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *EntityQueriesClient) getHandleResponse(resp *http.Response) (EntityQueriesClientGetResponse, error) { + result := EntityQueriesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return EntityQueriesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all entity queries. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// 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) NewListPager(resourceGroupName string, workspaceName string, options *EntityQueriesClientListOptions) *runtime.Pager[EntityQueriesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[EntityQueriesClientListResponse]{ + More: func(page EntityQueriesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *EntityQueriesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *EntityQueriesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueries" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Kind != nil { + reqQP.Set("kind", string(*options.Kind)) + } + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *EntityQueriesClient) listHandleResponse(resp *http.Response) (EntityQueriesClientListResponse, error) { + result := EntityQueriesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EntityQueryList); err != nil { + return EntityQueriesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityquerytemplates_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityquerytemplates_client.go new file mode 100644 index 000000000000..75100848a320 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityquerytemplates_client.go @@ -0,0 +1,190 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// EntityQueryTemplatesClient contains the methods for the EntityQueryTemplates group. +// Don't use this type directly, use NewEntityQueryTemplatesClient() instead. +type EntityQueryTemplatesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEntityQueryTemplatesClient creates a new instance of EntityQueryTemplatesClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Get - Gets an entity query. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityQueryTemplateID - entity query template ID +// options - EntityQueryTemplatesClientGetOptions contains the optional parameters for the EntityQueryTemplatesClient.Get +// method. +func (client *EntityQueryTemplatesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryTemplateID string, options *EntityQueryTemplatesClientGetOptions) (EntityQueryTemplatesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, entityQueryTemplateID, options) + if err != nil { + return EntityQueryTemplatesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntityQueryTemplatesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntityQueryTemplatesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *EntityQueryTemplatesClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityQueryTemplateID string, options *EntityQueryTemplatesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates/{entityQueryTemplateId}" + 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 entityQueryTemplateID == "" { + return nil, errors.New("parameter entityQueryTemplateID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityQueryTemplateId}", url.PathEscape(entityQueryTemplateID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *EntityQueryTemplatesClient) getHandleResponse(resp *http.Response) (EntityQueryTemplatesClientGetResponse, error) { + result := EntityQueryTemplatesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return EntityQueryTemplatesClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all entity query templates. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// options - EntityQueryTemplatesClientListOptions contains the optional parameters for the EntityQueryTemplatesClient.List +// method. +func (client *EntityQueryTemplatesClient) NewListPager(resourceGroupName string, workspaceName string, options *EntityQueryTemplatesClientListOptions) *runtime.Pager[EntityQueryTemplatesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[EntityQueryTemplatesClientListResponse]{ + More: func(page EntityQueryTemplatesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *EntityQueryTemplatesClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *EntityQueryTemplatesClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entityQueryTemplates" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Kind != nil { + reqQP.Set("kind", string(*options.Kind)) + } + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *EntityQueryTemplatesClient) listHandleResponse(resp *http.Response) (EntityQueryTemplatesClientListResponse, error) { + result := EntityQueryTemplatesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EntityQueryTemplateList); err != nil { + return EntityQueryTemplatesClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityrelations_client.go new file mode 100644 index 000000000000..5d711af04ae0 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_entityrelations_client.go @@ -0,0 +1,122 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// EntityRelationsClient contains the methods for the EntityRelations group. +// Don't use this type directly, use NewEntityRelationsClient() instead. +type EntityRelationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewEntityRelationsClient creates a new instance of EntityRelationsClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// GetRelation - Gets an entity relation. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// entityID - entity ID +// relationName - Relation Name +// options - EntityRelationsClientGetRelationOptions contains the optional parameters for the EntityRelationsClient.GetRelation +// method. +func (client *EntityRelationsClient) GetRelation(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, relationName string, options *EntityRelationsClientGetRelationOptions) (EntityRelationsClientGetRelationResponse, error) { + req, err := client.getRelationCreateRequest(ctx, resourceGroupName, workspaceName, entityID, relationName, options) + if err != nil { + return EntityRelationsClientGetRelationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return EntityRelationsClientGetRelationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return EntityRelationsClientGetRelationResponse{}, runtime.NewResponseError(resp) + } + return client.getRelationHandleResponse(resp) +} + +// getRelationCreateRequest creates the GetRelation request. +func (client *EntityRelationsClient) getRelationCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, entityID string, relationName string, options *EntityRelationsClientGetRelationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/entities/{entityId}/relations/{relationName}" + 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 entityID == "" { + return nil, errors.New("parameter entityID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{entityId}", url.PathEscape(entityID)) + if relationName == "" { + return nil, errors.New("parameter relationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{relationName}", url.PathEscape(relationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getRelationHandleResponse handles the GetRelation response. +func (client *EntityRelationsClient) getRelationHandleResponse(resp *http.Response) (EntityRelationsClientGetRelationResponse, error) { + result := EntityRelationsClientGetRelationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Relation); err != nil { + return EntityRelationsClientGetRelationResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go index 44b472d42544..458c0ba87990 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentcomments_client.go @@ -55,9 +55,9 @@ func NewIncidentCommentsClient(subscriptionID string, credential azcore.TokenCre return client, nil } -// CreateOrUpdate - Creates or updates a comment for a given incident. +// CreateOrUpdate - Creates or updates the incident comment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -108,7 +108,7 @@ func (client *IncidentCommentsClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, incidentComment) @@ -123,9 +123,9 @@ func (client *IncidentCommentsClient) createOrUpdateHandleResponse(resp *http.Re return result, nil } -// Delete - Deletes a comment for a given incident. +// Delete - Delete the incident comment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -174,15 +174,15 @@ func (client *IncidentCommentsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets a comment for a given incident. +// Get - Gets an incident comment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -231,7 +231,7 @@ func (client *IncidentCommentsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,9 +246,9 @@ func (client *IncidentCommentsClient) getHandleResponse(resp *http.Response) (In return result, nil } -// NewListPager - Gets all comments for a given incident. +// NewListPager - Gets all incident comments. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -305,7 +305,7 @@ func (client *IncidentCommentsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go index 5bd865b7f997..2ff16d6063a8 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidentrelations_client.go @@ -55,9 +55,9 @@ func NewIncidentRelationsClient(subscriptionID string, credential azcore.TokenCr return client, nil } -// CreateOrUpdate - Creates or updates a relation for a given incident. +// CreateOrUpdate - Creates or updates the incident relation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -108,7 +108,7 @@ func (client *IncidentRelationsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, relation) @@ -123,9 +123,9 @@ func (client *IncidentRelationsClient) createOrUpdateHandleResponse(resp *http.R return result, nil } -// Delete - Deletes a relation for a given incident. +// Delete - Delete the incident relation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -175,15 +175,15 @@ func (client *IncidentRelationsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets a relation for a given incident. +// Get - Gets an incident relation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -232,7 +232,7 @@ func (client *IncidentRelationsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,9 +247,9 @@ func (client *IncidentRelationsClient) getHandleResponse(resp *http.Response) (I return result, nil } -// NewListPager - Gets all relations for a given incident. +// NewListPager - Gets all incident relations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -306,7 +306,7 @@ func (client *IncidentRelationsClient) listCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go index bed0c274e3cc..5d52d0914bbf 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_incidents_client.go @@ -55,9 +55,9 @@ func NewIncidentsClient(subscriptionID string, credential azcore.TokenCredential return client, nil } -// CreateOrUpdate - Creates or updates an incident. +// CreateOrUpdate - Creates or updates the incident. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -103,7 +103,7 @@ func (client *IncidentsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, incident) @@ -118,9 +118,71 @@ func (client *IncidentsClient) createOrUpdateHandleResponse(resp *http.Response) return result, nil } -// Delete - Deletes a given incident. +// CreateTeam - Creates a Microsoft team to investigate the incident by sharing information and insights between participants. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// incidentID - Incident ID +// teamProperties - Team properties +// options - IncidentsClientCreateTeamOptions contains the optional parameters for the IncidentsClient.CreateTeam method. +func (client *IncidentsClient) CreateTeam(ctx context.Context, resourceGroupName string, workspaceName string, incidentID string, teamProperties TeamProperties, options *IncidentsClientCreateTeamOptions) (IncidentsClientCreateTeamResponse, error) { + req, err := client.createTeamCreateRequest(ctx, resourceGroupName, workspaceName, incidentID, teamProperties, options) + if err != nil { + return IncidentsClientCreateTeamResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IncidentsClientCreateTeamResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IncidentsClientCreateTeamResponse{}, runtime.NewResponseError(resp) + } + return client.createTeamHandleResponse(resp) +} + +// createTeamCreateRequest creates the CreateTeam request. +func (client *IncidentsClient) createTeamCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, incidentID string, teamProperties TeamProperties, options *IncidentsClientCreateTeamOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/incidents/{incidentId}/createTeam" + 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 incidentID == "" { + return nil, errors.New("parameter incidentID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{incidentId}", url.PathEscape(incidentID)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, teamProperties) +} + +// createTeamHandleResponse handles the CreateTeam response. +func (client *IncidentsClient) createTeamHandleResponse(resp *http.Response) (IncidentsClientCreateTeamResponse, error) { + result := IncidentsClientCreateTeamResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.TeamInformation); err != nil { + return IncidentsClientCreateTeamResponse{}, err + } + return result, nil +} + +// Delete - Delete the incident. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -164,15 +226,15 @@ func (client *IncidentsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Gets a given incident. +// Get - Gets an incident. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -216,7 +278,7 @@ func (client *IncidentsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,7 +295,7 @@ func (client *IncidentsClient) getHandleResponse(resp *http.Response) (Incidents // NewListPager - Gets all incidents. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // 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. @@ -285,7 +347,7 @@ func (client *IncidentsClient) listCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -312,9 +374,9 @@ func (client *IncidentsClient) listHandleResponse(resp *http.Response) (Incident return result, nil } -// ListAlerts - Gets all alerts for an incident. +// ListAlerts - Gets all incident alerts. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -358,7 +420,7 @@ func (client *IncidentsClient) listAlertsCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -373,9 +435,9 @@ func (client *IncidentsClient) listAlertsHandleResponse(resp *http.Response) (In return result, nil } -// ListBookmarks - Gets all bookmarks for an incident. +// ListBookmarks - Gets all incident bookmarks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -419,7 +481,7 @@ func (client *IncidentsClient) listBookmarksCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -434,9 +496,9 @@ func (client *IncidentsClient) listBookmarksHandleResponse(resp *http.Response) return result, nil } -// ListEntities - Gets all entities for an incident. +// ListEntities - Gets all incident related entities. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // incidentID - Incident ID @@ -480,7 +542,7 @@ func (client *IncidentsClient) listEntitiesCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -494,3 +556,66 @@ func (client *IncidentsClient) listEntitiesHandleResponse(resp *http.Response) ( } return result, nil } + +// RunPlaybook - Triggers playbook on a specific incident +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"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 new file mode 100644 index 000000000000..965c9716ec89 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_ipgeodata_client.go @@ -0,0 +1,108 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// IPGeodataClient contains the methods for the IPGeodata group. +// Don't use this type directly, use NewIPGeodataClient() instead. +type IPGeodataClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewIPGeodataClient creates a new instance of IPGeodataClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Get - Get geodata for a single IP address +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// ipAddress - IP address (v4 or v6) to be enriched +// options - IPGeodataClientGetOptions contains the optional parameters for the IPGeodataClient.Get method. +func (client *IPGeodataClient) Get(ctx context.Context, resourceGroupName string, ipAddress string, options *IPGeodataClientGetOptions) (IPGeodataClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, ipAddress, options) + if err != nil { + return IPGeodataClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IPGeodataClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IPGeodataClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *IPGeodataClient) getCreateRequest(ctx context.Context, resourceGroupName string, ipAddress string, options *IPGeodataClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SecurityInsights/enrichment/ip/geodata/" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("ipAddress", ipAddress) + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *IPGeodataClient) getHandleResponse(resp *http.Response) (IPGeodataClientGetResponse, error) { + result := IPGeodataClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.EnrichmentIPGeodata); err != nil { + return IPGeodataClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_metadata_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_metadata_client.go new file mode 100644 index 000000000000..bcee62552034 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_metadata_client.go @@ -0,0 +1,374 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strconv" + "strings" +) + +// MetadataClient contains the methods for the Metadata group. +// Don't use this type directly, use NewMetadataClient() instead. +type MetadataClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewMetadataClient creates a new instance of MetadataClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Create - Create a Metadata. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// metadataName - The Metadata name. +// metadata - Metadata resource. +// options - MetadataClientCreateOptions contains the optional parameters for the MetadataClient.Create method. +func (client *MetadataClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, metadata MetadataModel, options *MetadataClientCreateOptions) (MetadataClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, workspaceName, metadataName, metadata, options) + if err != nil { + return MetadataClientCreateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MetadataClientCreateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return MetadataClientCreateResponse{}, runtime.NewResponseError(resp) + } + return client.createHandleResponse(resp) +} + +// createCreateRequest creates the Create request. +func (client *MetadataClient) createCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, metadata MetadataModel, options *MetadataClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}" + 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 metadataName == "" { + return nil, errors.New("parameter metadataName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{metadataName}", url.PathEscape(metadataName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, metadata) +} + +// createHandleResponse handles the Create response. +func (client *MetadataClient) createHandleResponse(resp *http.Response) (MetadataClientCreateResponse, error) { + result := MetadataClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MetadataModel); err != nil { + return MetadataClientCreateResponse{}, err + } + return result, nil +} + +// Delete - Delete a Metadata. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// metadataName - The Metadata name. +// options - MetadataClientDeleteOptions contains the optional parameters for the MetadataClient.Delete method. +func (client *MetadataClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, options *MetadataClientDeleteOptions) (MetadataClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, metadataName, options) + if err != nil { + return MetadataClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MetadataClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return MetadataClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return MetadataClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *MetadataClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, options *MetadataClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}" + 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 metadataName == "" { + return nil, errors.New("parameter metadataName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{metadataName}", url.PathEscape(metadataName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a Metadata. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// metadataName - The Metadata name. +// options - MetadataClientGetOptions contains the optional parameters for the MetadataClient.Get method. +func (client *MetadataClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, options *MetadataClientGetOptions) (MetadataClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, metadataName, options) + if err != nil { + return MetadataClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MetadataClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MetadataClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *MetadataClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, options *MetadataClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}" + 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 metadataName == "" { + return nil, errors.New("parameter metadataName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{metadataName}", url.PathEscape(metadataName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *MetadataClient) getHandleResponse(resp *http.Response) (MetadataClientGetResponse, error) { + result := MetadataClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MetadataModel); err != nil { + return MetadataClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List of all metadata +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// 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) NewListPager(resourceGroupName string, workspaceName string, options *MetadataClientListOptions) *runtime.Pager[MetadataClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[MetadataClientListResponse]{ + More: func(page MetadataClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *MetadataClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *MetadataClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *MetadataClient) listHandleResponse(resp *http.Response) (MetadataClientListResponse, error) { + result := MetadataClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MetadataList); err != nil { + return MetadataClientListResponse{}, err + } + return result, nil +} + +// Update - Update an existing Metadata. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// metadataName - The Metadata name. +// metadataPatch - Partial metadata request. +// options - MetadataClientUpdateOptions contains the optional parameters for the MetadataClient.Update method. +func (client *MetadataClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, metadataPatch MetadataPatch, options *MetadataClientUpdateOptions) (MetadataClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, metadataName, metadataPatch, options) + if err != nil { + return MetadataClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MetadataClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MetadataClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *MetadataClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, metadataName string, metadataPatch MetadataPatch, options *MetadataClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/metadata/{metadataName}" + 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 metadataName == "" { + return nil, errors.New("parameter metadataName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{metadataName}", url.PathEscape(metadataName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, metadataPatch) +} + +// updateHandleResponse handles the Update response. +func (client *MetadataClient) updateHandleResponse(resp *http.Response) (MetadataClientUpdateResponse, error) { + result := MetadataClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MetadataModel); err != nil { + return MetadataClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go index a611d44026df..6cf39bbf320f 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models.go @@ -10,6 +10,28 @@ package armsecurityinsights import "time" +// AADCheckRequirements - Represents AAD (Azure Active Directory) requirements check request. +type AADCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // AAD (Azure Active Directory) requirements check properties. + Properties *AADCheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AADCheckRequirements. +func (a *AADCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// AADCheckRequirementsProperties - AAD (Azure Active Directory) requirements check properties. +type AADCheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + // AADDataConnector - Represents AAD (Azure Active Directory) data connector. type AADDataConnector struct { // REQUIRED; The data connector kind @@ -48,10 +70,32 @@ func (a *AADDataConnector) GetDataConnector() *DataConnector { // AADDataConnectorProperties - AAD (Azure Active Directory) data connector properties. type AADDataConnectorProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` + // The available data types for the connector. DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// AATPCheckRequirements - Represents AATP (Azure Advanced Threat Protection) requirements check request. +type AATPCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // AATP (Azure Advanced Threat Protection) requirements check properties. + Properties *AATPCheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AATPCheckRequirements. +func (a *AATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} - // The tenant id to connect to, and get the data from. +// AATPCheckRequirementsProperties - AATP (Azure Advanced Threat Protection) requirements check properties. +type AATPCheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. TenantID *string `json:"tenantId,omitempty"` } @@ -93,11 +137,42 @@ func (a *AATPDataConnector) GetDataConnector() *DataConnector { // AATPDataConnectorProperties - AATP (Azure Advanced Threat Protection) data connector properties. type AATPDataConnectorProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` + // The available data types for the connector. DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} - // The tenant id to connect to, and get the data from. - TenantID *string `json:"tenantId,omitempty"` +// APIPollingParameters - Represents Codeless API Polling data connector +type APIPollingParameters struct { + // Config to describe the instructions blade + ConnectorUIConfig *CodelessUIConnectorConfigProperties `json:"connectorUiConfig,omitempty"` + + // Config to describe the polling instructions + PollingConfig *CodelessConnectorPollingConfigProperties `json:"pollingConfig,omitempty"` +} + +// ASCCheckRequirements - Represents ASC (Azure Security Center) requirements check request. +type ASCCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // ASC (Azure Security Center) requirements check properties. + Properties *ASCCheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type ASCCheckRequirements. +func (a *ASCCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// ASCCheckRequirementsProperties - ASC (Azure Security Center) requirements check properties. +type ASCCheckRequirementsProperties struct { + // The subscription id to connect to, and get the data from. + SubscriptionID *string `json:"subscriptionId,omitempty"` } // ASCDataConnector - Represents ASC (Azure Security Center) data connector. @@ -148,7 +223,7 @@ type ASCDataConnectorProperties struct { // AccountEntity - Represents an account entity. type AccountEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // Account entity properties Properties *AccountEntityProperties `json:"properties,omitempty"` @@ -207,7 +282,7 @@ type AccountEntityProperties struct { // READ-ONLY; Determines whether this is a domain account. IsDomainJoined *bool `json:"isDomainJoined,omitempty" azure:"ro"` - // READ-ONLY; The NetBIOS domain name as it appears in the alert format - domain\username. Examples: NT AUTHORITY. + // READ-ONLY; The NetBIOS domain name as it appears in the alert format domain/username. Examples: NT AUTHORITY. NtDomain *string `json:"ntDomain,omitempty" azure:"ro"` // READ-ONLY; The objectGUID attribute is a single-value attribute that is the unique identifier for the object, assigned @@ -262,7 +337,7 @@ type ActionRequestProperties struct { // ActionResponse - Action for alert rule. type ActionResponse struct { - // Etag of the action. + // Etag of the azure resource Etag *string `json:"etag,omitempty"` // Action properties for get request @@ -319,6 +394,222 @@ type ActionsList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// ActivityCustomEntityQuery - Represents Activity entity query. +type ActivityCustomEntityQuery struct { + // REQUIRED; the entity query kind + Kind *CustomEntityQueryKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Activity entity query properties + Properties *ActivityEntityQueriesProperties `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"` +} + +// 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, + } +} + +// ActivityEntityQueriesProperties - Describes activity entity query properties +type ActivityEntityQueriesProperties struct { + // The entity query content to display in timeline + Content *string `json:"content,omitempty"` + + // The entity query description + Description *string `json:"description,omitempty"` + + // Determines whether this activity is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + + // The query applied only to entities matching to all filters + EntitiesFilter map[string][]*string `json:"entitiesFilter,omitempty"` + + // The type of the query's source entity + InputEntityType *EntityType `json:"inputEntityType,omitempty"` + + // The Activity query definitions + QueryDefinitions *ActivityEntityQueriesPropertiesQueryDefinitions `json:"queryDefinitions,omitempty"` + + // List of the fields of the source entity that are required to run the query + RequiredInputFieldsSets [][]*string `json:"requiredInputFieldsSets,omitempty"` + + // The template id this activity was created from + TemplateName *string `json:"templateName,omitempty"` + + // The entity query title + Title *string `json:"title,omitempty"` + + // READ-ONLY; The time the activity was created + CreatedTimeUTC *time.Time `json:"createdTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; The last time the activity was updated + LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` +} + +// ActivityEntityQueriesPropertiesQueryDefinitions - The Activity query definitions +type ActivityEntityQueriesPropertiesQueryDefinitions struct { + // The Activity query to run on a given entity + Query *string `json:"query,omitempty"` +} + +// ActivityEntityQuery - Represents Activity entity query. +type ActivityEntityQuery struct { + // REQUIRED; the entity query kind + Kind *EntityQueryKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Activity entity query properties + Properties *ActivityEntityQueriesProperties `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"` +} + +// 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, + } +} + +// ActivityEntityQueryTemplate - Represents Activity entity query. +type ActivityEntityQueryTemplate struct { + // REQUIRED; the entity query template kind + Kind *EntityQueryTemplateKind `json:"kind,omitempty"` + + // Activity entity query properties + Properties *ActivityEntityQueryTemplateProperties `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"` +} + +// 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, + } +} + +// ActivityEntityQueryTemplateProperties - Describes activity entity query properties +type ActivityEntityQueryTemplateProperties struct { + // The entity query content to display in timeline + Content *string `json:"content,omitempty"` + + // List of required data types for the given entity query template + DataTypes []*DataTypeDefinitions `json:"dataTypes,omitempty"` + + // The entity query description + Description *string `json:"description,omitempty"` + + // The query applied only to entities matching to all filters + EntitiesFilter map[string][]*string `json:"entitiesFilter,omitempty"` + + // The type of the query's source entity + InputEntityType *EntityType `json:"inputEntityType,omitempty"` + + // The Activity query definitions + QueryDefinitions *ActivityEntityQueryTemplatePropertiesQueryDefinitions `json:"queryDefinitions,omitempty"` + + // List of the fields of the source entity that are required to run the query + RequiredInputFieldsSets [][]*string `json:"requiredInputFieldsSets,omitempty"` + + // The entity query title + Title *string `json:"title,omitempty"` +} + +// ActivityEntityQueryTemplatePropertiesQueryDefinitions - The Activity query definitions +type ActivityEntityQueryTemplatePropertiesQueryDefinitions struct { + // The Activity query to run on a given entity + Query *string `json:"query,omitempty"` + + // The dimensions we want to summarize the timeline results on, this is comma separated list + SummarizeBy *string `json:"summarizeBy,omitempty"` +} + +// ActivityTimelineItem - Represents Activity timeline item. +type ActivityTimelineItem struct { + // REQUIRED; The grouping bucket end time. + BucketEndTimeUTC *time.Time `json:"bucketEndTimeUTC,omitempty"` + + // REQUIRED; The grouping bucket start time. + BucketStartTimeUTC *time.Time `json:"bucketStartTimeUTC,omitempty"` + + // REQUIRED; The activity timeline content. + Content *string `json:"content,omitempty"` + + // REQUIRED; The time of the first activity in the grouping bucket. + FirstActivityTimeUTC *time.Time `json:"firstActivityTimeUTC,omitempty"` + + // REQUIRED; The entity query kind type. + Kind *EntityTimelineKind `json:"kind,omitempty"` + + // REQUIRED; The time of the last activity in the grouping bucket. + LastActivityTimeUTC *time.Time `json:"lastActivityTimeUTC,omitempty"` + + // REQUIRED; The activity query id. + QueryID *string `json:"queryId,omitempty"` + + // REQUIRED; The activity timeline title. + Title *string `json:"title,omitempty"` +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type ActivityTimelineItem. +func (a *ActivityTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { + return &EntityTimelineItem{ + Kind: a.Kind, + } +} + // AlertDetailsOverride - Settings for how to dynamically override alert static details type AlertDetailsOverride struct { // the format containing columns name(s) to override the alert description @@ -337,7 +628,8 @@ type AlertDetailsOverride struct { // AlertRuleClassification provides polymorphic access to related types. // Call the interface's GetAlertRule() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AlertRule, *FusionAlertRule, *MicrosoftSecurityIncidentCreationAlertRule, *ScheduledAlertRule +// - *AlertRule, *FusionAlertRule, *MLBehaviorAnalyticsAlertRule, *MicrosoftSecurityIncidentCreationAlertRule, *NrtAlertRule, +// - *ScheduledAlertRule, *ThreatIntelligenceAlertRule type AlertRuleClassification interface { // GetAlertRule returns the AlertRule content of the underlying type. GetAlertRule() *AlertRule @@ -345,7 +637,7 @@ type AlertRuleClassification interface { // AlertRule - Alert rule. type AlertRule struct { - // REQUIRED; The alert rule kind + // REQUIRED; The kind of the alert rule Kind *AlertRuleKind `json:"kind,omitempty"` // Etag of the azure resource @@ -370,7 +662,8 @@ 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: -// - *AlertRuleTemplate, *FusionAlertRuleTemplate, *MicrosoftSecurityIncidentCreationAlertRuleTemplate, *ScheduledAlertRuleTemplate +// - *AlertRuleTemplate, *FusionAlertRuleTemplate, *MLBehaviorAnalyticsAlertRuleTemplate, *MicrosoftSecurityIncidentCreationAlertRuleTemplate, +// - *NrtAlertRuleTemplate, *ScheduledAlertRuleTemplate, *ThreatIntelligenceAlertRuleTemplate type AlertRuleTemplateClassification interface { // GetAlertRuleTemplate returns the AlertRuleTemplate content of the underlying type. GetAlertRuleTemplate() *AlertRuleTemplate @@ -378,7 +671,7 @@ type AlertRuleTemplateClassification interface { // AlertRuleTemplate - Alert rule template. type AlertRuleTemplate struct { - // REQUIRED; The alert rule kind + // REQUIRED; The kind of the alert rule Kind *AlertRuleKind `json:"kind,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -406,6 +699,60 @@ type AlertRuleTemplateDataSource struct { DataTypes []*string `json:"dataTypes,omitempty"` } +// AlertRuleTemplatePropertiesBase - Base alert rule template property bag. +type AlertRuleTemplatePropertiesBase struct { + // the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + + // The description of the alert rule template. + Description *string `json:"description,omitempty"` + + // The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + + // The required data sources for this template + RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + + // The alert rule template status. + Status *TemplateStatus `json:"status,omitempty"` + + // 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. + LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` +} + +// AlertRuleTemplateWithMitreProperties - Alert rule template with MITRE property bag. +type AlertRuleTemplateWithMitreProperties struct { + // the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + + // The description of the alert rule template. + Description *string `json:"description,omitempty"` + + // The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + + // The required data sources for this template + RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + + // The alert rule template status. + Status *TemplateStatus `json:"status,omitempty"` + + // The tactics of the alert rule + Tactics []*AttackTactic `json:"tactics,omitempty"` + + // The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty"` + + // 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. + LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` +} + // AlertRuleTemplatesClientGetOptions contains the optional parameters for the AlertRuleTemplatesClient.Get method. type AlertRuleTemplatesClientGetOptions struct { // placeholder for future optional parameters @@ -456,17 +803,21 @@ type AlertRulesList struct { // AlertsDataTypeOfDataConnector - Alerts data type for data connectors. type AlertsDataTypeOfDataConnector struct { - // Alerts data type connection. + // REQUIRED; Alerts data type connection. Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` } -type AutomationRule struct { - // REQUIRED; Automation rule properties - Properties *AutomationRuleProperties `json:"properties,omitempty"` +// Anomalies - Settings with single toggle. +type Anomalies struct { + // REQUIRED; The kind of the setting + Kind *SettingKind `json:"kind,omitempty"` // Etag of the azure resource Etag *string `json:"etag,omitempty"` + // Anomalies properties + Properties *AnomaliesSettingsProperties `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"` @@ -480,54 +831,220 @@ type AutomationRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// AutomationRuleActionClassification provides polymorphic access to related types. -// Call the interface's GetAutomationRuleAction() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutomationRuleAction, *AutomationRuleModifyPropertiesAction, *AutomationRuleRunPlaybookAction -type AutomationRuleActionClassification interface { - // GetAutomationRuleAction returns the AutomationRuleAction content of the underlying type. - GetAutomationRuleAction() *AutomationRuleAction +// 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, + } } -// AutomationRuleAction - Describes an automation rule action -type AutomationRuleAction struct { - // REQUIRED; The type of the automation rule action - ActionType *ActionType `json:"actionType,omitempty"` - - // REQUIRED - Order *int32 `json:"order,omitempty"` +// AnomaliesSettingsProperties - Anomalies property bag. +type AnomaliesSettingsProperties struct { + // READ-ONLY; Determines whether the setting is enable or disabled. + IsEnabled *bool `json:"isEnabled,omitempty" azure:"ro"` } -// GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleAction. -func (a *AutomationRuleAction) GetAutomationRuleAction() *AutomationRuleAction { return a } +// AnomalySecurityMLAnalyticsSettings - Represents Anomaly Security ML Analytics Settings +type AnomalySecurityMLAnalyticsSettings struct { + // REQUIRED; The kind of security ML Analytics Settings + Kind *SecurityMLAnalyticsSettingsKind `json:"kind,omitempty"` -// 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: -// - *AutomationRuleCondition, *PropertyConditionProperties -type AutomationRuleConditionClassification interface { - // GetAutomationRuleCondition returns the AutomationRuleCondition content of the underlying type. - GetAutomationRuleCondition() *AutomationRuleCondition -} + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` -// AutomationRuleCondition - Describes an automation rule condition -type AutomationRuleCondition struct { - // REQUIRED - ConditionType *ConditionType `json:"conditionType,omitempty"` -} + // Anomaly Security ML Analytics Settings properties + Properties *AnomalySecurityMLAnalyticsSettingsProperties `json:"properties,omitempty"` -// GetAutomationRuleCondition implements the AutomationRuleConditionClassification interface for type AutomationRuleCondition. -func (a *AutomationRuleCondition) GetAutomationRuleCondition() *AutomationRuleCondition { return a } + // 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"` -// AutomationRuleModifyPropertiesAction - Describes an automation rule action to modify an object's properties. -type AutomationRuleModifyPropertiesAction struct { - // REQUIRED; The type of the automation rule action - ActionType *ActionType `json:"actionType,omitempty"` + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` - // REQUIRED - Order *int32 `json:"order,omitempty"` - ActionConfiguration *IncidentPropertiesAction `json:"actionConfiguration,omitempty"` -} + // 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"` +} + +// GetSecurityMLAnalyticsSetting implements the SecurityMLAnalyticsSettingClassification interface for type AnomalySecurityMLAnalyticsSettings. +func (a *AnomalySecurityMLAnalyticsSettings) GetSecurityMLAnalyticsSetting() *SecurityMLAnalyticsSetting { + return &SecurityMLAnalyticsSetting{ + Kind: a.Kind, + Etag: a.Etag, + ID: a.ID, + Name: a.Name, + Type: a.Type, + SystemData: a.SystemData, + } +} + +// AnomalySecurityMLAnalyticsSettingsProperties - AnomalySecurityMLAnalytics settings base property bag. +type AnomalySecurityMLAnalyticsSettingsProperties struct { + // REQUIRED; The anomaly version of the AnomalySecurityMLAnalyticsSettings. + AnomalyVersion *string `json:"anomalyVersion,omitempty"` + + // REQUIRED; The display name for settings created by this SecurityMLAnalyticsSettings. + DisplayName *string `json:"displayName,omitempty"` + + // REQUIRED; Determines whether this settings is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + + // REQUIRED; The frequency that this SecurityMLAnalyticsSettings will be run. + Frequency *string `json:"frequency,omitempty"` + + // REQUIRED; Determines whether this anomaly security ml analytics settings is a default settings + IsDefaultSettings *bool `json:"isDefaultSettings,omitempty"` + + // REQUIRED; The anomaly SecurityMLAnalyticsSettings status + SettingsStatus *SettingsStatus `json:"settingsStatus,omitempty"` + + // The anomaly settings version of the Anomaly security ml analytics settings that dictates whether job version gets updated + // or not. + AnomalySettingsVersion *int32 `json:"anomalySettingsVersion,omitempty"` + + // The customizable observations of the AnomalySecurityMLAnalyticsSettings. + CustomizableObservations interface{} `json:"customizableObservations,omitempty"` + + // The description of the SecurityMLAnalyticsSettings. + Description *string `json:"description,omitempty"` + + // The required data sources for this SecurityMLAnalyticsSettings + RequiredDataConnectors []*SecurityMLAnalyticsSettingsDataSource `json:"requiredDataConnectors,omitempty"` + + // The anomaly settings definition Id + SettingsDefinitionID *string `json:"settingsDefinitionId,omitempty"` + + // The tactics of the SecurityMLAnalyticsSettings + Tactics []*AttackTactic `json:"tactics,omitempty"` + + // The techniques of the SecurityMLAnalyticsSettings + Techniques []*string `json:"techniques,omitempty"` + + // READ-ONLY; The last time that this SecurityMLAnalyticsSettings has been modified. + LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` +} + +// AnomalyTimelineItem - Represents anomaly timeline item. +type AnomalyTimelineItem struct { + // REQUIRED; The anomaly azure resource id. + AzureResourceID *string `json:"azureResourceId,omitempty"` + + // REQUIRED; The anomaly name. + DisplayName *string `json:"displayName,omitempty"` + + // REQUIRED; The anomaly end time. + EndTimeUTC *time.Time `json:"endTimeUtc,omitempty"` + + // REQUIRED; The entity query kind type. + Kind *EntityTimelineKind `json:"kind,omitempty"` + + // REQUIRED; The anomaly start time. + StartTimeUTC *time.Time `json:"startTimeUtc,omitempty"` + + // REQUIRED; The anomaly generated time. + TimeGenerated *time.Time `json:"timeGenerated,omitempty"` + + // The anomaly description. + Description *string `json:"description,omitempty"` + + // The intent of the anomaly. + Intent *string `json:"intent,omitempty"` + + // The anomaly product name. + ProductName *string `json:"productName,omitempty"` + + // The reasons that cause the anomaly. + Reasons []*string `json:"reasons,omitempty"` + + // The techniques of the anomaly. + Techniques []*string `json:"techniques,omitempty"` + + // The name of the anomaly vendor. + Vendor *string `json:"vendor,omitempty"` +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type AnomalyTimelineItem. +func (a *AnomalyTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { + return &EntityTimelineItem{ + Kind: a.Kind, + } +} + +type AutomationRule struct { + // REQUIRED; Automation rule properties + Properties *AutomationRuleProperties `json:"properties,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,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"` +} + +// AutomationRuleActionClassification provides polymorphic access to related types. +// Call the interface's GetAutomationRuleAction() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutomationRuleAction, *AutomationRuleModifyPropertiesAction, *AutomationRuleRunPlaybookAction +type AutomationRuleActionClassification interface { + // GetAutomationRuleAction returns the AutomationRuleAction content of the underlying type. + GetAutomationRuleAction() *AutomationRuleAction +} + +// AutomationRuleAction - Describes an automation rule action. +type AutomationRuleAction struct { + // REQUIRED; The type of the automation rule action. + ActionType *ActionType `json:"actionType,omitempty"` + + // REQUIRED + 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: +// - *AutomationRuleCondition, *PropertyArrayChangedConditionProperties, *PropertyChangedConditionProperties, *PropertyConditionProperties +type AutomationRuleConditionClassification interface { + // GetAutomationRuleCondition returns the AutomationRuleCondition content of the underlying type. + GetAutomationRuleCondition() *AutomationRuleCondition +} + +// AutomationRuleCondition - Describes an automation rule condition. +type AutomationRuleCondition struct { + // REQUIRED + 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. + ActionType *ActionType `json:"actionType,omitempty"` + + // REQUIRED + Order *int32 `json:"order,omitempty"` + ActionConfiguration *IncidentPropertiesAction `json:"actionConfiguration,omitempty"` +} // GetAutomationRuleAction implements the AutomationRuleActionClassification interface for type AutomationRuleModifyPropertiesAction. func (a *AutomationRuleModifyPropertiesAction) GetAutomationRuleAction() *AutomationRuleAction { @@ -539,42 +1056,54 @@ func (a *AutomationRuleModifyPropertiesAction) GetAutomationRuleAction() *Automa // AutomationRuleProperties - Automation rule properties type AutomationRuleProperties struct { - // REQUIRED; The actions to execute when the automation rule is triggered + // REQUIRED; The actions to execute when the automation rule is triggered. Actions []AutomationRuleActionClassification `json:"actions,omitempty"` - // REQUIRED; The display name of the automation rule + // REQUIRED; The display name of the automation rule. DisplayName *string `json:"displayName,omitempty"` - // REQUIRED; The order of execution of the automation rule + // REQUIRED; The order of execution of the automation rule. Order *int32 `json:"order,omitempty"` - // REQUIRED; Describes automation rule triggering logic + // REQUIRED; Describes automation rule triggering logic. TriggeringLogic *AutomationRuleTriggeringLogic `json:"triggeringLogic,omitempty"` // READ-ONLY; Information on the client (user or application) that made some action CreatedBy *ClientInfo `json:"createdBy,omitempty" azure:"ro"` - // READ-ONLY; The time the automation rule was created + // READ-ONLY; The time the automation rule was created. CreatedTimeUTC *time.Time `json:"createdTimeUtc,omitempty" azure:"ro"` // READ-ONLY; Information on the client (user or application) that made some action LastModifiedBy *ClientInfo `json:"lastModifiedBy,omitempty" azure:"ro"` - // READ-ONLY; The last time the automation rule was updated + // READ-ONLY; The last time the automation rule was updated. LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` } +type AutomationRulePropertyArrayChangedValuesCondition struct { + ArrayType *AutomationRulePropertyArrayChangedConditionSupportedArrayType `json:"arrayType,omitempty"` + ChangeType *AutomationRulePropertyArrayChangedConditionSupportedChangeType `json:"changeType,omitempty"` +} + +type AutomationRulePropertyValuesChangedCondition struct { + ChangeType *AutomationRulePropertyChangedConditionSupportedChangedType `json:"changeType,omitempty"` + Operator *AutomationRulePropertyConditionSupportedOperator `json:"operator,omitempty"` + PropertyName *AutomationRulePropertyChangedConditionSupportedPropertyType `json:"propertyName,omitempty"` + PropertyValues []*string `json:"propertyValues,omitempty"` +} + type AutomationRulePropertyValuesCondition struct { Operator *AutomationRulePropertyConditionSupportedOperator `json:"operator,omitempty"` - // The property to evaluate in an automation rule property condition + // The property to evaluate in an automation rule property condition. PropertyName *AutomationRulePropertyConditionSupportedProperty `json:"propertyName,omitempty"` PropertyValues []*string `json:"propertyValues,omitempty"` } // AutomationRuleRunPlaybookAction - Describes an automation rule action to run a playbook type AutomationRuleRunPlaybookAction struct { - // REQUIRED; The type of the automation rule action + // REQUIRED; The type of the automation rule action. ActionType *ActionType `json:"actionType,omitempty"` // REQUIRED @@ -590,9 +1119,9 @@ func (a *AutomationRuleRunPlaybookAction) GetAutomationRuleAction() *AutomationR } } -// AutomationRuleTriggeringLogic - Describes automation rule triggering logic +// AutomationRuleTriggeringLogic - Describes automation rule triggering logic. type AutomationRuleTriggeringLogic struct { - // REQUIRED; Determines whether the automation rule is enabled or disabled + // REQUIRED; Determines whether the automation rule is enabled or disabled. IsEnabled *bool `json:"isEnabled,omitempty"` // REQUIRED @@ -601,7 +1130,7 @@ type AutomationRuleTriggeringLogic struct { // REQUIRED TriggersWhen *TriggersWhen `json:"triggersWhen,omitempty"` - // The conditions to evaluate to determine if the automation rule should be triggered on a given object + // The conditions to evaluate to determine if the automation rule should be triggered on a given object. Conditions []AutomationRuleConditionClassification `json:"conditions,omitempty"` // Determines when the automation rule should automatically expire and be disabled. @@ -635,6 +1164,28 @@ type AutomationRulesList struct { Value []*AutomationRule `json:"value,omitempty"` } +// Availability - Connector Availability Status +type Availability struct { + // Set connector as preview + IsPreview *bool `json:"isPreview,omitempty"` + + // The connector Availability Status + Status *int32 `json:"status,omitempty"` +} + +// AwsCloudTrailCheckRequirements - Amazon Web Services CloudTrail requirements check request. +type AwsCloudTrailCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AwsCloudTrailCheckRequirements. +func (a *AwsCloudTrailCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + // AwsCloudTrailDataConnector - Represents Amazon Web Services CloudTrail data connector. type AwsCloudTrailDataConnector struct { // REQUIRED; The data connector kind @@ -673,29 +1224,114 @@ func (a *AwsCloudTrailDataConnector) GetDataConnector() *DataConnector { // AwsCloudTrailDataConnectorDataTypes - The available data types for Amazon Web Services CloudTrail data connector. type AwsCloudTrailDataConnectorDataTypes struct { - // Logs data type. + // REQUIRED; Logs data type. Logs *AwsCloudTrailDataConnectorDataTypesLogs `json:"logs,omitempty"` } // AwsCloudTrailDataConnectorDataTypesLogs - Logs data type. type AwsCloudTrailDataConnectorDataTypesLogs struct { - // Describe whether this data type connection is enabled or not. + // REQUIRED; Describe whether this data type connection is enabled or not. State *DataTypeState `json:"state,omitempty"` } // AwsCloudTrailDataConnectorProperties - Amazon Web Services CloudTrail data connector properties. type AwsCloudTrailDataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *AwsCloudTrailDataConnectorDataTypes `json:"dataTypes,omitempty"` + // The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws account. AwsRoleArn *string `json:"awsRoleArn,omitempty"` +} - // The available data types for the connector. - DataTypes *AwsCloudTrailDataConnectorDataTypes `json:"dataTypes,omitempty"` +// AwsS3CheckRequirements - Amazon Web Services S3 requirements check request. +type AwsS3CheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type AwsS3CheckRequirements. +func (a *AwsS3CheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: a.Kind, + } +} + +// AwsS3DataConnector - Represents Amazon Web Services S3 data connector. +type AwsS3DataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Amazon Web Services S3 data connector properties. + Properties *AwsS3DataConnectorProperties `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"` +} + +// 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, + } +} + +// AwsS3DataConnectorDataTypes - The available data types for Amazon Web Services S3 data connector. +type AwsS3DataConnectorDataTypes struct { + // REQUIRED; Logs data type. + Logs *AwsS3DataConnectorDataTypesLogs `json:"logs,omitempty"` +} + +// AwsS3DataConnectorDataTypesLogs - Logs data type. +type AwsS3DataConnectorDataTypesLogs struct { + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` +} + +// AwsS3DataConnectorProperties - Amazon Web Services S3 data connector properties. +type AwsS3DataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *AwsS3DataConnectorDataTypes `json:"dataTypes,omitempty"` + + // REQUIRED; The logs destination table name in LogAnalytics. + DestinationTable *string `json:"destinationTable,omitempty"` + + // REQUIRED; The Aws Role Arn that is used to access the Aws account. + RoleArn *string `json:"roleArn,omitempty"` + + // REQUIRED; The AWS sqs urls for the connector. + SqsUrls []*string `json:"sqsUrls,omitempty"` +} + +// 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. type AzureResourceEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // AzureResource entity properties Properties *AzureResourceEntityProperties `json:"properties,omitempty"` @@ -761,12 +1397,56 @@ type Bookmark struct { Type *string `json:"type,omitempty" azure:"ro"` } +// BookmarkClientExpandOptions contains the optional parameters for the BookmarkClient.Expand method. +type BookmarkClientExpandOptions struct { + // placeholder for future optional parameters +} + +// BookmarkEntityMappings - Describes the entity mappings of a single entity +type BookmarkEntityMappings struct { + // The entity type + EntityType *string `json:"entityType,omitempty"` + + // Array of fields mapping for that entity type + FieldMappings []*EntityFieldMapping `json:"fieldMappings,omitempty"` +} + +// 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. + EndTime *time.Time `json:"endTime,omitempty"` + + // The Id of the expansion to perform. + ExpansionID *string `json:"expansionId,omitempty"` + + // The start date filter, so the only expansion results returned are after this date. + StartTime *time.Time `json:"startTime,omitempty"` +} + +// BookmarkExpandResponse - The entity expansion result operation response. +type BookmarkExpandResponse struct { + // The metadata from the expansion operation results. + MetaData *ExpansionResultsMetadata `json:"metaData,omitempty"` + + // The expansion result values. + Value *BookmarkExpandResponseValue `json:"value,omitempty"` +} + +// BookmarkExpandResponseValue - The expansion result values. +type BookmarkExpandResponseValue struct { + // Array of expansion result connected entities + Edges []*ConnectedEntity `json:"edges,omitempty"` + + // Array of the expansion result entities. + Entities []EntityClassification `json:"entities,omitempty"` +} + // BookmarkList - List all the bookmarks. type BookmarkList struct { // REQUIRED; Array of bookmarks. Value []*Bookmark `json:"value,omitempty"` - // READ-ONLY; URL to fetch the next set of cases. + // READ-ONLY; URL to fetch the next set of bookmarks. NextLink *string `json:"nextLink,omitempty" azure:"ro"` } @@ -784,6 +1464,9 @@ type BookmarkProperties struct { // Describes a user that created the bookmark CreatedBy *UserInfo `json:"createdBy,omitempty"` + // Describes the entity mappings of the bookmark + EntityMappings []*BookmarkEntityMappings `json:"entityMappings,omitempty"` + // The bookmark event time EventTime *time.Time `json:"eventTime,omitempty"` @@ -805,6 +1488,12 @@ type BookmarkProperties struct { // The start time for the query QueryStartTime *time.Time `json:"queryStartTime,omitempty"` + // A list of relevant mitre attacks + Tactics []*AttackTactic `json:"tactics,omitempty"` + + // A list of relevant mitre techniques + Techniques []*string `json:"techniques,omitempty"` + // The last time the bookmark was updated Updated *time.Time `json:"updated,omitempty"` @@ -812,6 +1501,73 @@ type BookmarkProperties struct { UpdatedBy *UserInfo `json:"updatedBy,omitempty"` } +// BookmarkRelationsClientCreateOrUpdateOptions contains the optional parameters for the BookmarkRelationsClient.CreateOrUpdate +// method. +type BookmarkRelationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// BookmarkRelationsClientDeleteOptions contains the optional parameters for the BookmarkRelationsClient.Delete method. +type BookmarkRelationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// BookmarkRelationsClientGetOptions contains the optional parameters for the BookmarkRelationsClient.Get method. +type BookmarkRelationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BookmarkRelationsClientListOptions contains the optional parameters for the BookmarkRelationsClient.List method. +type BookmarkRelationsClientListOptions struct { + // Filters the results, based on a Boolean condition. Optional. + Filter *string + // Sorts the results. Optional. + Orderby *string + // 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 + // Returns only the first n results. Optional. + Top *int32 +} + +// BookmarkTimelineItem - Represents bookmark timeline item. +type BookmarkTimelineItem struct { + // REQUIRED; The bookmark azure resource id. + AzureResourceID *string `json:"azureResourceId,omitempty"` + + // REQUIRED; The entity query kind type. + Kind *EntityTimelineKind `json:"kind,omitempty"` + + // Describes a user that created the bookmark + CreatedBy *UserInfo `json:"createdBy,omitempty"` + + // The bookmark display name. + DisplayName *string `json:"displayName,omitempty"` + + // The bookmark end time. + EndTimeUTC *time.Time `json:"endTimeUtc,omitempty"` + + // The bookmark event time. + EventTime *time.Time `json:"eventTime,omitempty"` + + // List of labels relevant to this bookmark + Labels []*string `json:"labels,omitempty"` + + // The notes of the bookmark + Notes *string `json:"notes,omitempty"` + + // The bookmark start time. + StartTimeUTC *time.Time `json:"startTimeUtc,omitempty"` +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type BookmarkTimelineItem. +func (b *BookmarkTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { + return &EntityTimelineItem{ + Kind: b.Kind, + } +} + // BookmarksClientCreateOrUpdateOptions contains the optional parameters for the BookmarksClient.CreateOrUpdate method. type BookmarksClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -850,7 +1606,7 @@ type ClientInfo struct { // CloudApplicationEntity - Represents a cloud application entity. type CloudApplicationEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // CloudApplication entity properties Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` @@ -914,13 +1670,16 @@ type CloudErrorBody struct { Message *string `json:"message,omitempty" azure:"ro"` } -// DNSEntity - Represents a dns entity. -type DNSEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// CodelessAPIPollingDataConnector - Represents Codeless API Polling data connector. +type CodelessAPIPollingDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` - // Dns entity properties - Properties *DNSEntityProperties `json:"properties,omitempty"` + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Codeless poling data connector properties + Properties *APIPollingParameters `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"` @@ -935,7 +1694,399 @@ type DNSEntity struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GetEntity implements the EntityClassification interface for type DNSEntity. +// 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, + } +} + +// CodelessConnectorPollingAuthProperties - Describe the authentication properties needed to successfully authenticate with +// the server +type CodelessConnectorPollingAuthProperties struct { + // REQUIRED; The authentication type + AuthType *string `json:"authType,omitempty"` + + // A prefix send in the header before the actual token + APIKeyIdentifier *string `json:"apiKeyIdentifier,omitempty"` + + // The header name which the token is sent with + APIKeyName *string `json:"apiKeyName,omitempty"` + + // The endpoint used to authorize the user, used in Oauth 2.0 flow + AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` + + // The query parameters used in authorization request, used in Oauth 2.0 flow + AuthorizationEndpointQueryParameters interface{} `json:"authorizationEndpointQueryParameters,omitempty"` + + // Describes the flow name, for example 'AuthCode' for Oauth 2.0 + FlowName *string `json:"flowName,omitempty"` + + // Marks if the key should sent in header + IsAPIKeyInPostPayload *string `json:"isApiKeyInPostPayload,omitempty"` + + // Marks if we should send the client secret in header or payload, used in Oauth 2.0 flow + IsClientSecretInHeader *bool `json:"isClientSecretInHeader,omitempty"` + + // The redirect endpoint where we will get the authorization code, used in Oauth 2.0 flow + RedirectionEndpoint *string `json:"redirectionEndpoint,omitempty"` + + // The OAuth token scope + Scope *string `json:"scope,omitempty"` + + // The endpoint used to issue a token, used in Oauth 2.0 flow + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + + // The query headers used in token request, used in Oauth 2.0 flow + TokenEndpointHeaders interface{} `json:"tokenEndpointHeaders,omitempty"` + + // The query parameters used in token request, used in Oauth 2.0 flow + TokenEndpointQueryParameters interface{} `json:"tokenEndpointQueryParameters,omitempty"` +} + +// CodelessConnectorPollingConfigProperties - Config to describe the polling config for API poller connector +type CodelessConnectorPollingConfigProperties struct { + // REQUIRED; Describe the authentication type of the poller + Auth *CodelessConnectorPollingAuthProperties `json:"auth,omitempty"` + + // REQUIRED; Describe the poll request config parameters of the poller + Request *CodelessConnectorPollingRequestProperties `json:"request,omitempty"` + + // The poller active status + IsActive *bool `json:"isActive,omitempty"` + + // Describe the poll request paging config of the poller + Paging *CodelessConnectorPollingPagingProperties `json:"paging,omitempty"` + + // Describe the response config parameters of the poller + Response *CodelessConnectorPollingResponseProperties `json:"response,omitempty"` +} + +// CodelessConnectorPollingPagingProperties - Describe the properties needed to make a pagination call +type CodelessConnectorPollingPagingProperties struct { + // REQUIRED; Describes the type. could be 'None', 'PageToken', 'PageCount', 'TimeStamp' + PagingType *string `json:"pagingType,omitempty"` + + // Defines the name of a next page attribute + NextPageParaName *string `json:"nextPageParaName,omitempty"` + + // Defines the path to a next page token JSON + NextPageTokenJSONPath *string `json:"nextPageTokenJsonPath,omitempty"` + + // Defines the path to a page count attribute + PageCountAttributePath *string `json:"pageCountAttributePath,omitempty"` + + // Defines the paging size + PageSize *int32 `json:"pageSize,omitempty"` + + // Defines the name of the page size parameter + PageSizeParaName *string `json:"pageSizeParaName,omitempty"` + + // Defines the path to a paging time stamp attribute + PageTimeStampAttributePath *string `json:"pageTimeStampAttributePath,omitempty"` + + // Defines the path to a page total count attribute + PageTotalCountAttributePath *string `json:"pageTotalCountAttributePath,omitempty"` + + // Determines whether to search for the latest time stamp in the events list + SearchTheLatestTimeStampFromEventsList *string `json:"searchTheLatestTimeStampFromEventsList,omitempty"` +} + +// CodelessConnectorPollingRequestProperties - Describe the request properties needed to successfully pull from the server +type CodelessConnectorPollingRequestProperties struct { + // REQUIRED; Describe the endpoint we should pull the data from + APIEndpoint *string `json:"apiEndpoint,omitempty"` + + // REQUIRED; The http method type we will use in the poll request, GET or POST + HTTPMethod *string `json:"httpMethod,omitempty"` + + // REQUIRED; The time format will be used the query events in a specific window + QueryTimeFormat *string `json:"queryTimeFormat,omitempty"` + + // REQUIRED; The window interval we will use the pull the data + QueryWindowInMin *int32 `json:"queryWindowInMin,omitempty"` + + // This will be used the query events from the end of the time window + EndTimeAttributeName *string `json:"endTimeAttributeName,omitempty"` + + // Describe the headers sent in the poll request + Headers interface{} `json:"headers,omitempty"` + + // Describe the query parameters sent in the poll request + QueryParameters interface{} `json:"queryParameters,omitempty"` + + // For advanced scenarios for example user name/password embedded in nested JSON payload + QueryParametersTemplate *string `json:"queryParametersTemplate,omitempty"` + + // Defines the rate limit QPS + RateLimitQPS *int32 `json:"rateLimitQps,omitempty"` + + // Describe the amount of time we should try and poll the data in case of failure + RetryCount *int32 `json:"retryCount,omitempty"` + + // This will be used the query events from a start of the time window + StartTimeAttributeName *string `json:"startTimeAttributeName,omitempty"` + + // The number of seconds we will consider as a request timeout + TimeoutInSeconds *int32 `json:"timeoutInSeconds,omitempty"` +} + +// CodelessConnectorPollingResponseProperties - Describes the response from the external server +type CodelessConnectorPollingResponseProperties struct { + // REQUIRED; Describes the path we should extract the data in the response + EventsJSONPaths []*string `json:"eventsJsonPaths,omitempty"` + + // Describes if the data in the response is Gzip + IsGzipCompressed *bool `json:"isGzipCompressed,omitempty"` + + // Describes the path we should extract the status code in the response + SuccessStatusJSONPath *string `json:"successStatusJsonPath,omitempty"` + + // Describes the path we should extract the status value in the response + SuccessStatusValue *string `json:"successStatusValue,omitempty"` +} + +// CodelessParameters - Represents Codeless UI data connector +type CodelessParameters struct { + // Config to describe the instructions blade + ConnectorUIConfig *CodelessUIConnectorConfigProperties `json:"connectorUiConfig,omitempty"` +} + +// CodelessUIConnectorConfigProperties - Config to describe the instructions blade +type CodelessUIConnectorConfigProperties struct { + // REQUIRED; Connector Availability Status + Availability *Availability `json:"availability,omitempty"` + + // REQUIRED; Define the way the connector check connectivity + ConnectivityCriteria []*CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem `json:"connectivityCriteria,omitempty"` + + // REQUIRED; Data types to check for last data received + DataTypes []*CodelessUIConnectorConfigPropertiesDataTypesItem `json:"dataTypes,omitempty"` + + // REQUIRED; Connector description + DescriptionMarkdown *string `json:"descriptionMarkdown,omitempty"` + + // REQUIRED; The graph query to show the current data status + GraphQueries []*CodelessUIConnectorConfigPropertiesGraphQueriesItem `json:"graphQueries,omitempty"` + + // REQUIRED; Name of the table the connector will insert the data to + GraphQueriesTableName *string `json:"graphQueriesTableName,omitempty"` + + // REQUIRED; Instruction steps to enable the connector + InstructionSteps []*CodelessUIConnectorConfigPropertiesInstructionStepsItem `json:"instructionSteps,omitempty"` + + // REQUIRED; Permissions required for the connector + Permissions *Permissions `json:"permissions,omitempty"` + + // REQUIRED; Connector publisher name + Publisher *string `json:"publisher,omitempty"` + + // REQUIRED; The sample queries for the connector + SampleQueries []*CodelessUIConnectorConfigPropertiesSampleQueriesItem `json:"sampleQueries,omitempty"` + + // REQUIRED; Connector blade title + Title *string `json:"title,omitempty"` + + // An optional custom image to be used when displaying the connector within Azure Sentinel's connector's gallery + CustomImage *string `json:"customImage,omitempty"` +} + +type CodelessUIConnectorConfigPropertiesConnectivityCriteriaItem struct { + // type of connectivity + Type *ConnectivityType `json:"type,omitempty"` + + // Queries for checking connectivity + Value []*string `json:"value,omitempty"` +} + +type CodelessUIConnectorConfigPropertiesDataTypesItem struct { + // Query for indicate last data received + LastDataReceivedQuery *string `json:"lastDataReceivedQuery,omitempty"` + + // Name of the data type to show in the graph. can be use with {{graphQueriesTableName}} placeholder + Name *string `json:"name,omitempty"` +} + +type CodelessUIConnectorConfigPropertiesGraphQueriesItem struct { + // The base query for the graph + BaseQuery *string `json:"baseQuery,omitempty"` + + // The legend for the graph + Legend *string `json:"legend,omitempty"` + + // the metric that the query is checking + MetricName *string `json:"metricName,omitempty"` +} + +type CodelessUIConnectorConfigPropertiesInstructionStepsItem struct { + // Instruction step description + Description *string `json:"description,omitempty"` + + // Instruction step details + Instructions []*InstructionStepsInstructionsItem `json:"instructions,omitempty"` + + // Instruction step title + Title *string `json:"title,omitempty"` +} + +type CodelessUIConnectorConfigPropertiesSampleQueriesItem struct { + // The sample query description + Description *string `json:"description,omitempty"` + + // the sample query + Query *string `json:"query,omitempty"` +} + +// CodelessUIDataConnector - Represents Codeless UI data connector. +type CodelessUIDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Codeless UI data connector properties + Properties *CodelessParameters `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"` +} + +// 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, + } +} + +// ConnectedEntity - Expansion result connected entities +type ConnectedEntity struct { + // key-value pairs for a connected entity mapping + AdditionalData interface{} `json:"additionalData,omitempty"` + + // Entity Id of the connected entity + TargetEntityID *string `json:"targetEntityId,omitempty"` +} + +// ConnectivityCriteria - Setting for the connector check connectivity +type ConnectivityCriteria struct { + // type of connectivity + Type *ConnectivityType `json:"type,omitempty"` + + // Queries for checking connectivity + Value []*string `json:"value,omitempty"` +} + +// ConnectorInstructionModelBase - Instruction step details +type ConnectorInstructionModelBase struct { + // REQUIRED; The kind of the setting + Type *SettingType `json:"type,omitempty"` + + // The parameters for the setting + Parameters interface{} `json:"parameters,omitempty"` +} + +// ContentPathMap - The mapping of content type to a repo path. +type ContentPathMap struct { + // Content type. + ContentType *ContentType `json:"contentType,omitempty"` + + // The path to the content. + Path *string `json:"path,omitempty"` +} + +// CustomEntityQueryClassification provides polymorphic access to related types. +// Call the interface's GetCustomEntityQuery() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActivityCustomEntityQuery, *CustomEntityQuery +type CustomEntityQueryClassification interface { + // GetCustomEntityQuery returns the CustomEntityQuery content of the underlying type. + GetCustomEntityQuery() *CustomEntityQuery +} + +// CustomEntityQuery - Specific entity query that supports put requests. +type CustomEntityQuery struct { + // REQUIRED; the entity query kind + Kind *CustomEntityQueryKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,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"` +} + +// 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 + Description *string `json:"description,omitempty"` + + // Customs permissions name + Name *string `json:"name,omitempty"` +} + +// CustomsPermission - Customs permissions required for the connector +type CustomsPermission struct { + // Customs permissions description + Description *string `json:"description,omitempty"` + + // Customs permissions name + Name *string `json:"name,omitempty"` +} + +// DNSEntity - Represents a dns entity. +type DNSEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // Dns entity properties + Properties *DNSEntityProperties `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"` +} + +// GetEntity implements the EntityClassification interface for type DNSEntity. func (d *DNSEntity) GetEntity() *Entity { return &Entity{ Kind: d.Kind, @@ -971,14 +2122,16 @@ type DNSEntityProperties struct { // 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, *DataConnector, *MCASDataConnector, -// - *MDATPDataConnector, *OfficeDataConnector, *TIDataConnector +// - *AADDataConnector, *AATPDataConnector, *ASCDataConnector, *AwsCloudTrailDataConnector, *AwsS3DataConnector, *CodelessAPIPollingDataConnector, +// - *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 } -// DataConnector - Data connector. +// DataConnector - Data connector type DataConnector struct { // REQUIRED; The data connector kind Kind *DataConnectorKind `json:"kind,omitempty"` @@ -1002,9 +2155,34 @@ type DataConnector struct { // 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. + APIKey *string `json:"apiKey,omitempty"` + + // The authorization code used in OAuth 2.0 code flow to issue a token. + AuthorizationCode *string `json:"authorizationCode,omitempty"` + + // The client id of the OAuth 2.0 application. + ClientID *string `json:"clientId,omitempty"` + + // The client secret of the OAuth 2.0 application. + ClientSecret *string `json:"clientSecret,omitempty"` + + // The authentication kind used to poll the data + Kind *ConnectAuthKind `json:"kind,omitempty"` + + // The user password in the audit log server. + Password *string `json:"password,omitempty"` + RequestConfigUserInputValues []interface{} `json:"requestConfigUserInputValues,omitempty"` + + // The user name in the audit log server. + UserName *string `json:"userName,omitempty"` +} + // DataConnectorDataTypeCommon - Common field for data type in data connectors. type DataConnectorDataTypeCommon struct { - // Describe whether this data type connection is enabled or not. + // REQUIRED; Describe whether this data type connection is enabled or not. State *DataTypeState `json:"state,omitempty"` } @@ -1017,9 +2195,18 @@ type DataConnectorList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// DataConnectorRequirementsState - Data connector requirements status. +type DataConnectorRequirementsState struct { + // Authorization state for this connector + AuthorizationState *DataConnectorAuthorizationState `json:"authorizationState,omitempty"` + + // License state for this connector + LicenseState *DataConnectorLicenseState `json:"licenseState,omitempty"` +} + // DataConnectorTenantID - Properties data connector on tenant level. type DataConnectorTenantID struct { - // The tenant id to connect to, and get the data from. + // REQUIRED; The tenant id to connect to, and get the data from. TenantID *string `json:"tenantId,omitempty"` } @@ -1029,6 +2216,40 @@ type DataConnectorWithAlertsProperties struct { DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` } +// DataConnectorsCheckRequirementsClassification provides polymorphic access to related types. +// 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, *IoTCheckRequirements, *MCASCheckRequirements, *MDATPCheckRequirements, +// - *MSTICheckRequirements, *MtpCheckRequirements, *Office365ProjectCheckRequirements, *OfficeATPCheckRequirements, *OfficeIRMCheckRequirements, +// - *OfficePowerBICheckRequirements, *TICheckRequirements, *TiTaxiiCheckRequirements +type DataConnectorsCheckRequirementsClassification interface { + // GetDataConnectorsCheckRequirements returns the DataConnectorsCheckRequirements content of the underlying type. + GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements +} + +// DataConnectorsCheckRequirements - Data connector requirements properties. +type DataConnectorsCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + 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 { + // placeholder for future optional parameters +} + +// DataConnectorsClientConnectOptions contains the optional parameters for the DataConnectorsClient.Connect method. +type DataConnectorsClientConnectOptions struct { + // placeholder for future optional parameters +} + // DataConnectorsClientCreateOrUpdateOptions contains the optional parameters for the DataConnectorsClient.CreateOrUpdate // method. type DataConnectorsClientCreateOrUpdateOptions struct { @@ -1040,6 +2261,11 @@ type DataConnectorsClientDeleteOptions struct { // placeholder for future optional parameters } +// DataConnectorsClientDisconnectOptions contains the optional parameters for the DataConnectorsClient.Disconnect method. +type DataConnectorsClientDisconnectOptions struct { + // placeholder for future optional parameters +} + // DataConnectorsClientGetOptions contains the optional parameters for the DataConnectorsClient.Get method. type DataConnectorsClientGetOptions struct { // placeholder for future optional parameters @@ -1050,80 +2276,79 @@ type DataConnectorsClientListOptions struct { // placeholder for future optional parameters } -// EntityClassification provides polymorphic access to related types. -// Call the interface's GetEntity() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AccountEntity, *AzureResourceEntity, *CloudApplicationEntity, *DNSEntity, *Entity, *FileEntity, *FileHashEntity, *HostEntity, -// - *HuntingBookmark, *IPEntity, *IoTDeviceEntity, *MailClusterEntity, *MailMessageEntity, *MailboxEntity, *MalwareEntity, -// - *ProcessEntity, *RegistryKeyEntity, *RegistryValueEntity, *SecurityAlert, *SecurityGroupEntity, *SubmissionMailEntity, -// - *URLEntity -type EntityClassification interface { - // GetEntity returns the Entity content of the underlying type. - GetEntity() *Entity +// DataTypeDefinitions - The data type definition +type DataTypeDefinitions struct { + // The data type name + DataType *string `json:"dataType,omitempty"` } -// Entity - Specific entity. -type Entity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// Deployment - Description about a deployment. +type Deployment struct { + // Deployment identifier. + DeploymentID *string `json:"deploymentId,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"` + // Url to access repository action logs. + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The outcome of the deployment. + DeploymentResult *DeploymentResult `json:"deploymentResult,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // Current status of the deployment. + DeploymentState *DeploymentState `json:"deploymentState,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // The time when the deployment finished. + DeploymentTime *time.Time `json:"deploymentTime,omitempty"` } -// GetEntity implements the EntityClassification interface for type Entity. -func (e *Entity) GetEntity() *Entity { return e } +// DeploymentInfo - Information regarding a deployment. +type DeploymentInfo struct { + // Deployment information. + Deployment *Deployment `json:"deployment,omitempty"` -// EntityCommonProperties - Entity common property bag. -type EntityCommonProperties struct { - // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + // Status while fetching the last deployment. + DeploymentFetchStatus *DeploymentFetchStatus `json:"deploymentFetchStatus,omitempty"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + // Additional details about the deployment that can be shown to the user. + Message *string `json:"message,omitempty"` } -// EntityMapping - Single entity mapping for the alert rule -type EntityMapping struct { - // The V3 type of the mapped entity - EntityType *EntityMappingType `json:"entityType,omitempty"` - - // array of field mappings for the given entity mapping - FieldMappings []*FieldMapping `json:"fieldMappings,omitempty"` +// DomainWhoisClientGetOptions contains the optional parameters for the DomainWhoisClient.Get method. +type DomainWhoisClientGetOptions struct { + // placeholder for future optional parameters } -// EventGroupingSettings - Event grouping settings property bag. -type EventGroupingSettings struct { - // The event grouping aggregation kinds - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` +// Dynamics365CheckRequirements - Represents Dynamics365 requirements check request. +type Dynamics365CheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Dynamics365 requirements check properties. + Properties *Dynamics365CheckRequirementsProperties `json:"properties,omitempty"` } -// FieldMapping - A single field mapping of the mapped entity -type FieldMapping struct { - // the column name to be mapped to the identifier - ColumnName *string `json:"columnName,omitempty"` +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type Dynamics365CheckRequirements. +func (d *Dynamics365CheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: d.Kind, + } +} - // the V3 identifier of the entity - Identifier *string `json:"identifier,omitempty"` +// Dynamics365CheckRequirementsProperties - Dynamics365 requirements check properties. +type Dynamics365CheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` } -// FileEntity - Represents a file entity. -type FileEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// Dynamics365DataConnector - Represents Dynamics365 data connector. +type Dynamics365DataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` - // File entity properties - Properties *FileEntityProperties `json:"properties,omitempty"` + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Dynamics365 data connector properties. + Properties *Dynamics365DataConnectorProperties `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"` @@ -1138,271 +2363,258 @@ 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, +// 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, } } -// 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. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` - - // READ-ONLY; The full path to the file. - Directory *string `json:"directory,omitempty" azure:"ro"` - - // READ-ONLY; The file hash entity identifiers associated with this file - FileHashEntityIDs []*string `json:"fileHashEntityIds,omitempty" azure:"ro"` +// Dynamics365DataConnectorDataTypes - The available data types for Dynamics365 data connector. +type Dynamics365DataConnectorDataTypes struct { + // REQUIRED; Common Data Service data type connection. + Dynamics365CdsActivities *Dynamics365DataConnectorDataTypesDynamics365CdsActivities `json:"dynamics365CdsActivities,omitempty"` +} - // READ-ONLY; The file name without path (some alerts might not include path). - FileName *string `json:"fileName,omitempty" azure:"ro"` +// Dynamics365DataConnectorDataTypesDynamics365CdsActivities - Common Data Service data type connection. +type Dynamics365DataConnectorDataTypesDynamics365CdsActivities struct { + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` +} - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` +// Dynamics365DataConnectorProperties - Dynamics365 data connector properties. +type Dynamics365DataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *Dynamics365DataConnectorDataTypes `json:"dataTypes,omitempty"` - // READ-ONLY; The Host entity id which the file belongs to - HostEntityID *string `json:"hostEntityId,omitempty" azure:"ro"` + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` } -// FileHashEntity - Represents a file hash entity. -type FileHashEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` - - // FileHash entity properties - Properties *FileHashEntityProperties `json:"properties,omitempty"` +// EnrichmentDomainWhois - Whois information for a given domain and associated metadata +type EnrichmentDomainWhois struct { + // The timestamp at which this record was created + Created *time.Time `json:"created,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"` + // The domain for this whois record + Domain *string `json:"domain,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The timestamp at which this record will expire + Expires *time.Time `json:"expires,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // The whois record for a given domain + ParsedWhois *EnrichmentDomainWhoisDetails `json:"parsedWhois,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} + // The hostname of this registrar's whois server + Server *string `json:"server,omitempty"` -// 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, - } + // The timestamp at which this record was last updated + Updated *time.Time `json:"updated,omitempty"` } -// 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. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` - - // READ-ONLY; The hash algorithm type. - Algorithm *FileHashAlgorithm `json:"algorithm,omitempty" azure:"ro"` +// EnrichmentDomainWhoisContact - An individual contact associated with this domain +type EnrichmentDomainWhoisContact struct { + // The city for this contact + City *string `json:"city,omitempty"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + // The country for this contact + Country *string `json:"country,omitempty"` - // READ-ONLY; The file hash value. - HashValue *string `json:"hashValue,omitempty" azure:"ro"` -} + // The email address for this contact + Email *string `json:"email,omitempty"` -// FusionAlertRule - Represents Fusion alert rule. -type FusionAlertRule struct { - // REQUIRED; The alert rule kind - Kind *AlertRuleKind `json:"kind,omitempty"` + // The fax number for this contact + Fax *string `json:"fax,omitempty"` - // Etag of the azure resource - Etag *string `json:"etag,omitempty"` + // The name of this contact + Name *string `json:"name,omitempty"` - // Fusion alert rule properties - Properties *FusionAlertRuleProperties `json:"properties,omitempty"` + // The organization for this contact + Org *string `json:"org,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"` + // The phone number for this contact + Phone *string `json:"phone,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The postal code for this contact + Postal *string `json:"postal,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // The state for this contact + State *string `json:"state,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // A list describing the street address for this contact + Street []*string `json:"street,omitempty"` } -// 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, - } -} +// EnrichmentDomainWhoisContacts - The set of contacts associated with this domain +type EnrichmentDomainWhoisContacts struct { + // The admin contact for this whois record + Admin *EnrichmentDomainWhoisContact `json:"admin,omitempty"` -// FusionAlertRuleProperties - Fusion alert rule base property bag. -type FusionAlertRuleProperties struct { - // REQUIRED; The Name of the alert rule template used to create this rule. - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + // The billing contact for this whois record + Billing *EnrichmentDomainWhoisContact `json:"billing,omitempty"` - // REQUIRED; Determines whether this alert rule is enabled or disabled. - Enabled *bool `json:"enabled,omitempty"` + // The registrant contact for this whois record + Registrant *EnrichmentDomainWhoisContact `json:"registrant,omitempty"` - // READ-ONLY; The description of the alert rule. - Description *string `json:"description,omitempty" azure:"ro"` + // The technical contact for this whois record + Tech *EnrichmentDomainWhoisContact `json:"tech,omitempty"` +} - // READ-ONLY; The display name for alerts created by this alert rule. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` +// EnrichmentDomainWhoisDetails - The whois record for a given domain +type EnrichmentDomainWhoisDetails struct { + // The set of contacts associated with this domain + Contacts *EnrichmentDomainWhoisContacts `json:"contacts,omitempty"` - // READ-ONLY; The last time that this alert has been modified. - LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` + // A list of name servers associated with this domain + NameServers []*string `json:"nameServers,omitempty"` - // READ-ONLY; The severity for alerts created by this alert rule. - Severity *AlertSeverity `json:"severity,omitempty" azure:"ro"` + // The registrar associated with this domain + Registrar *EnrichmentDomainWhoisRegistrarDetails `json:"registrar,omitempty"` - // READ-ONLY; The tactics of the alert rule - Tactics []*AttackTactic `json:"tactics,omitempty" azure:"ro"` + // The set of status flags for this whois record + Statuses []*string `json:"statuses,omitempty"` } -// FusionAlertRuleTemplate - Represents Fusion alert rule template. -type FusionAlertRuleTemplate struct { - // REQUIRED; The alert rule kind - Kind *AlertRuleKind `json:"kind,omitempty"` +// EnrichmentDomainWhoisRegistrarDetails - The registrar associated with this domain +type EnrichmentDomainWhoisRegistrarDetails struct { + // This registrar's abuse contact email + AbuseContactEmail *string `json:"abuseContactEmail,omitempty"` - // Fusion alert rule template properties - Properties *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` + // This registrar's abuse contact phone number + AbuseContactPhone *string `json:"abuseContactPhone,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"` + // This registrar's Internet Assigned Numbers Authority id + IanaID *string `json:"ianaId,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The name of this registrar + Name *string `json:"name,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // This registrar's URL + URL *string `json:"url,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // The hostname of this registrar's whois server + WhoisServer *string `json:"whoisServer,omitempty"` } -// 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, - } -} +// EnrichmentIPGeodata - Geodata information for a given IP address +type EnrichmentIPGeodata struct { + // The autonomous system number associated with this IP address + Asn *string `json:"asn,omitempty"` -// FusionAlertRuleTemplateProperties - Represents Fusion alert rule template properties -type FusionAlertRuleTemplateProperties struct { - // the number of alert rules that were created by this template - AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // The name of the carrier for this IP address + Carrier *string `json:"carrier,omitempty"` - // The description of the alert rule template. - Description *string `json:"description,omitempty"` + // The city this IP address is located in + City *string `json:"city,omitempty"` - // The display name for alert rule template. - DisplayName *string `json:"displayName,omitempty"` + // A numeric rating of confidence that the value in the 'city' field is correct, on a scale of 0-100 + CityCf *int32 `json:"cityCf,omitempty"` - // The required data connectors for this template - RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + // The continent this IP address is located on + Continent *string `json:"continent,omitempty"` - // The severity for alerts created by this alert rule. - Severity *AlertSeverity `json:"severity,omitempty"` + // The county this IP address is located in + Country *string `json:"country,omitempty"` - // The alert rule template status. - Status *TemplateStatus `json:"status,omitempty"` + // A numeric rating of confidence that the value in the 'country' field is correct on a scale of 0-100 + CountryCf *int32 `json:"countryCf,omitempty"` - // The tactics of the alert rule template - Tactics []*AttackTactic `json:"tactics,omitempty"` + // The dotted-decimal or colon-separated string representation of the IP address + IPAddr *string `json:"ipAddr,omitempty"` - // READ-ONLY; The time that this alert rule template has been added. - CreatedDateUTC *time.Time `json:"createdDateUTC,omitempty" azure:"ro"` + // A description of the connection type of this IP address + IPRoutingType *string `json:"ipRoutingType,omitempty"` - // READ-ONLY; The time that this alert rule template was last updated. - LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` -} + // The latitude of this IP address + Latitude *string `json:"latitude,omitempty"` -// GeoLocation - The geo-location context attached to the ip entity -type GeoLocation struct { - // READ-ONLY; Autonomous System Number - Asn *int32 `json:"asn,omitempty" azure:"ro"` + // The longitude of this IP address + Longitude *string `json:"longitude,omitempty"` - // READ-ONLY; City name - City *string `json:"city,omitempty" azure:"ro"` + // The name of the organization for this IP address + Organization *string `json:"organization,omitempty"` - // READ-ONLY; The country code according to ISO 3166 format - CountryCode *string `json:"countryCode,omitempty" azure:"ro"` + // The type of the organization for this IP address + OrganizationType *string `json:"organizationType,omitempty"` - // READ-ONLY; Country name according to ISO 3166 Alpha 2: the lowercase of the English Short Name - CountryName *string `json:"countryName,omitempty" azure:"ro"` + // The geographic region this IP address is located in + Region *string `json:"region,omitempty"` - // READ-ONLY; The longitude of the identified location, expressed as a floating point number with range of -180 to 180, with - // positive numbers representing East and negative numbers representing West. Latitude and - // longitude are derived from the city or postal code. - Latitude *float64 `json:"latitude,omitempty" azure:"ro"` + // The state this IP address is located in + State *string `json:"state,omitempty"` - // READ-ONLY; The latitude of the identified location, expressed as a floating point number with range of - 90 to 90, with - // positive numbers representing North and negative numbers representing South. Latitude and - // longitude are derived from the city or postal code. - Longitude *float64 `json:"longitude,omitempty" azure:"ro"` + // A numeric rating of confidence that the value in the 'state' field is correct on a scale of 0-100 + StateCf *int32 `json:"stateCf,omitempty"` - // READ-ONLY; State name - State *string `json:"state,omitempty" azure:"ro"` + // The abbreviated name for the state this IP address is located in + StateCode *string `json:"stateCode,omitempty"` } -// GroupingConfiguration - Grouping configuration property bag. -type GroupingConfiguration struct { - // REQUIRED; Grouping enabled - Enabled *bool `json:"enabled,omitempty"` - - // REQUIRED; Limit the group to alerts created within the lookback duration (in ISO 8601 duration format) - LookbackDuration *string `json:"lookbackDuration,omitempty"` +// EntitiesClientExpandOptions contains the optional parameters for the EntitiesClient.Expand method. +type EntitiesClientExpandOptions struct { + // placeholder for future optional parameters +} - // REQUIRED; Grouping matching method. When method is Selected at least one of groupByEntities, groupByAlertDetails, groupByCustomDetails - // must be provided and not empty. - MatchingMethod *MatchingMethod `json:"matchingMethod,omitempty"` +// EntitiesClientGetInsightsOptions contains the optional parameters for the EntitiesClient.GetInsights method. +type EntitiesClientGetInsightsOptions struct { + // placeholder for future optional parameters +} - // REQUIRED; Re-open closed matching incidents - ReopenClosedIncident *bool `json:"reopenClosedIncident,omitempty"` +// EntitiesClientGetOptions contains the optional parameters for the EntitiesClient.Get method. +type EntitiesClientGetOptions struct { + // placeholder for future optional parameters +} - // A list of alert details to group by (when matchingMethod is Selected) - GroupByAlertDetails []*AlertDetail `json:"groupByAlertDetails,omitempty"` +// EntitiesClientListOptions contains the optional parameters for the EntitiesClient.List method. +type EntitiesClientListOptions struct { + // placeholder for future optional parameters +} - // A list of custom details keys to group by (when matchingMethod is Selected). Only keys defined in the current alert rule - // may be used. - GroupByCustomDetails []*string `json:"groupByCustomDetails,omitempty"` +// EntitiesClientQueriesOptions contains the optional parameters for the EntitiesClient.Queries method. +type EntitiesClientQueriesOptions struct { + // placeholder for future optional parameters +} - // A list of entity types to group by (when matchingMethod is Selected). Only entities defined in the current alert rule may - // be used. - GroupByEntities []*EntityMappingType `json:"groupByEntities,omitempty"` +// EntitiesGetTimelineClientListOptions contains the optional parameters for the EntitiesGetTimelineClient.List method. +type EntitiesGetTimelineClientListOptions struct { + // placeholder for future optional parameters } -// HostEntity - Represents a host entity. -type HostEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// EntitiesRelationsClientListOptions contains the optional parameters for the EntitiesRelationsClient.List method. +type EntitiesRelationsClientListOptions struct { + // Filters the results, based on a Boolean condition. Optional. + Filter *string + // Sorts the results. Optional. + Orderby *string + // 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 + // Returns only the first n results. Optional. + Top *int32 +} - // Host entity properties - Properties *HostEntityProperties `json:"properties,omitempty"` +// EntityClassification provides polymorphic access to related types. +// Call the interface's GetEntity() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AccountEntity, *AzureResourceEntity, *CloudApplicationEntity, *DNSEntity, *Entity, *FileEntity, *FileHashEntity, *HostEntity, +// - *HuntingBookmark, *IPEntity, *IoTDeviceEntity, *MailClusterEntity, *MailMessageEntity, *MailboxEntity, *MalwareEntity, +// - *ProcessEntity, *RegistryKeyEntity, *RegistryValueEntity, *SecurityAlert, *SecurityGroupEntity, *SubmissionMailEntity, +// - *URLEntity +type EntityClassification interface { + // GetEntity returns the Entity content of the underlying type. + GetEntity() *Entity +} + +// Entity - Specific entity. +type Entity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,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"` @@ -1417,137 +2629,212 @@ 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, +// 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 + Kind *SettingKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // EntityAnalytics properties + Properties *EntityAnalyticsProperties `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"` +} + +// 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, } } -// HostEntityProperties - Host entity property bag. -type HostEntityProperties struct { - // The operating system type. - OSFamily *OSFamily `json:"osFamily,omitempty"` +// EntityAnalyticsProperties - EntityAnalytics property bag. +type EntityAnalyticsProperties struct { + // The relevant entity providers that are synced + EntityProviders []*EntityProviders `json:"entityProviders,omitempty"` +} +// EntityCommonProperties - Entity common property bag. +type EntityCommonProperties struct { // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` - // READ-ONLY; The azure resource id of the VM. - AzureID *string `json:"azureID,omitempty" azure:"ro"` - - // READ-ONLY; The DNS domain that this host belongs to. Should contain the compete DNS suffix for the domain - DNSDomain *string `json:"dnsDomain,omitempty" azure:"ro"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property // is optional and might be system generated. FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` +} - // READ-ONLY; The hostname without the domain suffix. - HostName *string `json:"hostName,omitempty" azure:"ro"` +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty"` - // READ-ONLY; Determines whether this host belongs to a domain. - IsDomainJoined *bool `json:"isDomainJoined,omitempty" azure:"ro"` + // The target entity Id. + TargetEntityID *string `json:"targetEntityId,omitempty"` +} - // READ-ONLY; The host name (pre-windows2000). - NetBiosName *string `json:"netBiosName,omitempty" azure:"ro"` +// 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. + EndTime *time.Time `json:"endTime,omitempty"` - // READ-ONLY; The NT domain that this host belongs to. - NtDomain *string `json:"ntDomain,omitempty" azure:"ro"` + // The Id of the expansion to perform. + ExpansionID *string `json:"expansionId,omitempty"` - // READ-ONLY; A free text representation of the operating system. This field is meant to hold specific versions the are more - // fine grained than OSFamily or future values not supported by OSFamily enumeration - OSVersion *string `json:"osVersion,omitempty" azure:"ro"` + // The start date filter, so the only expansion results returned are after this date. + StartTime *time.Time `json:"startTime,omitempty"` +} - // READ-ONLY; The OMS agent id, if the host has OMS agent installed. - OmsAgentID *string `json:"omsAgentID,omitempty" azure:"ro"` +// EntityExpandResponse - The entity expansion result operation response. +type EntityExpandResponse struct { + // The metadata from the expansion operation results. + MetaData *ExpansionResultsMetadata `json:"metaData,omitempty"` + + // The expansion result values. + Value *EntityExpandResponseValue `json:"value,omitempty"` } -// HuntingBookmark - Represents a Hunting bookmark entity. -type HuntingBookmark struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// EntityExpandResponseValue - The expansion result values. +type EntityExpandResponseValue struct { + // Array of edges that connects the entity to the list of entities. + Edges []*EntityEdges `json:"edges,omitempty"` - // HuntingBookmark entity properties - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` + // Array of the expansion result entities. + Entities []EntityClassification `json:"entities,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"` +// EntityFieldMapping - Map identifiers of a single entity +type EntityFieldMapping struct { + // Alert V3 identifier + Identifier *string `json:"identifier,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The value of the identifier + Value *string `json:"value,omitempty"` +} - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` +// EntityGetInsightsParameters - The parameters required to execute insights operation on the given entity. +type EntityGetInsightsParameters struct { + // REQUIRED; The end timeline date, so the results returned are before this date. + EndTime *time.Time `json:"endTime,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // REQUIRED; The start timeline date, so the results returned are after this date. + StartTime *time.Time `json:"startTime,omitempty"` + + // Indicates if query time range should be extended with default time range of the query. Default value is false + AddDefaultExtendedTimeRange *bool `json:"addDefaultExtendedTimeRange,omitempty"` + + // List of Insights Query Id. If empty, default value is all insights of this entity + InsightQueryIDs []*string `json:"insightQueryIds,omitempty"` } -// 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, - } +// EntityGetInsightsResponse - The Get Insights result operation response. +type EntityGetInsightsResponse struct { + // The metadata from the get insights operation results. + MetaData *GetInsightsResultsMetadata `json:"metaData,omitempty"` + + // The insights result values. + Value []*EntityInsightItem `json:"value,omitempty"` } -// HuntingBookmarkProperties - Describes bookmark properties -type HuntingBookmarkProperties struct { - // REQUIRED; The display name of the bookmark - DisplayName *string `json:"displayName,omitempty"` +// EntityInsightItem - Entity insight Item. +type EntityInsightItem struct { + // Query results for table insights query. + ChartQueryResults []*InsightsTableResult `json:"chartQueryResults,omitempty"` - // REQUIRED; The query of the bookmark. - Query *string `json:"query,omitempty"` + // The query id of the insight + QueryID *string `json:"queryId,omitempty"` - // The time the bookmark was created - Created *time.Time `json:"created,omitempty"` + // The Time interval that the query actually executed on. + QueryTimeInterval *EntityInsightItemQueryTimeInterval `json:"queryTimeInterval,omitempty"` - // Describes a user that created the bookmark - CreatedBy *UserInfo `json:"createdBy,omitempty"` + // Query results for table insights query. + TableQueryResults *InsightsTableResult `json:"tableQueryResults,omitempty"` +} - // The time of the event - EventTime *time.Time `json:"eventTime,omitempty"` +// EntityInsightItemQueryTimeInterval - The Time interval that the query actually executed on. +type EntityInsightItemQueryTimeInterval struct { + // Insight query end time + EndTime *time.Time `json:"endTime,omitempty"` - // Describes an incident that relates to bookmark - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` + // Insight query start time + StartTime *time.Time `json:"startTime,omitempty"` +} - // List of labels relevant to this bookmark - Labels []*string `json:"labels,omitempty"` +// EntityList - List of all the entities. +type EntityList struct { + // REQUIRED; Array of entities. + Value []EntityClassification `json:"value,omitempty"` - // The notes of the bookmark - Notes *string `json:"notes,omitempty"` + // READ-ONLY; URL to fetch the next set of entities. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} - // The query result of the bookmark. - QueryResult *string `json:"queryResult,omitempty"` +// EntityMapping - Single entity mapping for the alert rule +type EntityMapping struct { + // The V3 type of the mapped entity + EntityType *EntityMappingType `json:"entityType,omitempty"` - // The last time the bookmark was updated - Updated *time.Time `json:"updated,omitempty"` + // array of field mappings for the given entity mapping + FieldMappings []*FieldMapping `json:"fieldMappings,omitempty"` +} - // Describes a user that updated the bookmark - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` +// EntityQueriesClientCreateOrUpdateOptions contains the optional parameters for the EntityQueriesClient.CreateOrUpdate method. +type EntityQueriesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` +// EntityQueriesClientDeleteOptions contains the optional parameters for the EntityQueriesClient.Delete method. +type EntityQueriesClientDeleteOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` +// EntityQueriesClientGetOptions contains the optional parameters for the EntityQueriesClient.Get method. +type EntityQueriesClientGetOptions struct { + // placeholder for future optional parameters } -// IPEntity - Represents an ip entity. -type IPEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// EntityQueriesClientListOptions contains the optional parameters for the EntityQueriesClient.List method. +type EntityQueriesClientListOptions struct { + // The entity query kind we want to fetch + Kind *Enum13 +} - // Ip entity properties - Properties *IPEntityProperties `json:"properties,omitempty"` +// EntityQueryClassification provides polymorphic access to related types. +// Call the interface's GetEntityQuery() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActivityEntityQuery, *EntityQuery, *ExpansionEntityQuery +type EntityQueryClassification interface { + // GetEntityQuery returns the EntityQuery content of the underlying type. + GetEntityQuery() *EntityQuery +} + +// EntityQuery - Specific entity query. +type EntityQuery struct { + // REQUIRED; the entity query kind + Kind *EntityQueryKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,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"` @@ -1562,43 +2849,78 @@ 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, - } +// 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: +// - *EntityQueryItem, *InsightQueryItem +type EntityQueryItemClassification interface { + // GetEntityQueryItem returns the EntityQueryItem content of the underlying type. + GetEntityQueryItem() *EntityQueryItem } -// 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. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` +// EntityQueryItem - An abstract Query item for entity +type EntityQueryItem struct { + // REQUIRED; The kind of the entity query + Kind *EntityQueryKind `json:"kind,omitempty"` - // READ-ONLY; The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6) - Address *string `json:"address,omitempty" azure:"ro"` + // Query Template ARM Name + Name *string `json:"name,omitempty"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + // ARM Type + Type *string `json:"type,omitempty"` - // READ-ONLY; The geo-location context attached to the ip entity - Location *GeoLocation `json:"location,omitempty" azure:"ro"` + // READ-ONLY; Query Template ARM ID + ID *string `json:"id,omitempty" azure:"ro"` +} - // READ-ONLY; A list of TI contexts attached to the ip entity. - ThreatIntelligence []*ThreatIntelligence `json:"threatIntelligence,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 + DataTypes []*EntityQueryItemPropertiesDataTypesItem `json:"dataTypes,omitempty"` + + // The query applied only to entities matching to all filters + EntitiesFilter interface{} `json:"entitiesFilter,omitempty"` + + // The type of the entity + InputEntityType *EntityType `json:"inputEntityType,omitempty"` + + // Data types for template + RequiredInputFieldsSets [][]*string `json:"requiredInputFieldsSets,omitempty"` } -// Incident - Represents an incident in Azure Security Insights. -type Incident struct { - // Etag of the azure resource - Etag *string `json:"etag,omitempty"` +type EntityQueryItemPropertiesDataTypesItem struct { + // Data type name + DataType *string `json:"dataType,omitempty"` +} - // Incident properties - Properties *IncidentProperties `json:"properties,omitempty"` +// EntityQueryList - List of all the entity queries. +type EntityQueryList struct { + // REQUIRED; Array of entity queries. + Value []EntityQueryClassification `json:"value,omitempty"` + + // READ-ONLY; URL to fetch the next set of entity queries. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// 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: +// - *ActivityEntityQueryTemplate, *EntityQueryTemplate +type EntityQueryTemplateClassification interface { + // GetEntityQueryTemplate returns the EntityQueryTemplate content of the underlying type. + GetEntityQueryTemplate() *EntityQueryTemplate +} + +// EntityQueryTemplate - Specific entity query template. +type EntityQueryTemplate struct { + // REQUIRED; the entity query template kind + Kind *EntityQueryTemplateKind `json:"kind,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"` @@ -1613,362 +2935,2397 @@ type Incident struct { Type *string `json:"type,omitempty" azure:"ro"` } -// IncidentAdditionalData - Incident additional data property bag. -type IncidentAdditionalData struct { - // READ-ONLY; List of product names of alerts in the incident - AlertProductNames []*string `json:"alertProductNames,omitempty" azure:"ro"` +// GetEntityQueryTemplate implements the EntityQueryTemplateClassification interface for type EntityQueryTemplate. +func (e *EntityQueryTemplate) GetEntityQueryTemplate() *EntityQueryTemplate { return e } - // READ-ONLY; The number of alerts in the incident - AlertsCount *int32 `json:"alertsCount,omitempty" azure:"ro"` +// EntityQueryTemplateList - List of all the entity query templates. +type EntityQueryTemplateList struct { + // REQUIRED; Array of entity query templates. + Value []EntityQueryTemplateClassification `json:"value,omitempty"` - // READ-ONLY; The number of bookmarks in the incident - BookmarksCount *int32 `json:"bookmarksCount,omitempty" azure:"ro"` + // READ-ONLY; URL to fetch the next set of entity query templates. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} - // READ-ONLY; The number of comments in the incident - CommentsCount *int32 `json:"commentsCount,omitempty" azure:"ro"` +// EntityQueryTemplatesClientGetOptions contains the optional parameters for the EntityQueryTemplatesClient.Get method. +type EntityQueryTemplatesClientGetOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; The tactics associated with incident - Tactics []*AttackTactic `json:"tactics,omitempty" azure:"ro"` +// EntityQueryTemplatesClientListOptions contains the optional parameters for the EntityQueryTemplatesClient.List method. +type EntityQueryTemplatesClientListOptions struct { + // The entity template query kind we want to fetch + Kind *Enum15 } -// IncidentAlertList - List of incident alerts. -type IncidentAlertList struct { - // REQUIRED; Array of incident alerts. - Value []*SecurityAlert `json:"value,omitempty"` +// EntityRelationsClientGetRelationOptions contains the optional parameters for the EntityRelationsClient.GetRelation method. +type EntityRelationsClientGetRelationOptions struct { + // placeholder for future optional parameters } -// IncidentBookmarkList - List of incident bookmarks. -type IncidentBookmarkList struct { - // REQUIRED; Array of incident bookmarks. - Value []*HuntingBookmark `json:"value,omitempty"` +// EntityTimelineItemClassification provides polymorphic access to related types. +// Call the interface's GetEntityTimelineItem() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActivityTimelineItem, *AnomalyTimelineItem, *BookmarkTimelineItem, *EntityTimelineItem, *SecurityAlertTimelineItem +type EntityTimelineItemClassification interface { + // GetEntityTimelineItem returns the EntityTimelineItem content of the underlying type. + GetEntityTimelineItem() *EntityTimelineItem } -// IncidentComment - Represents an incident comment -type IncidentComment struct { - // Etag of the azure resource - Etag *string `json:"etag,omitempty"` +// EntityTimelineItem - Entity timeline Item. +type EntityTimelineItem struct { + // REQUIRED; The entity query kind type. + Kind *EntityTimelineKind `json:"kind,omitempty"` +} - // Incident comment properties - Properties *IncidentCommentProperties `json:"properties,omitempty"` +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type EntityTimelineItem. +func (e *EntityTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { return e } - // 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"` +// 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. + EndTime *time.Time `json:"endTime,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // REQUIRED; The start timeline date, so the results returned are after this date. + StartTime *time.Time `json:"startTime,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // Array of timeline Item kinds. + Kinds []*EntityTimelineKind `json:"kinds,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // The number of bucket for timeline queries aggregation. + NumberOfBucket *int32 `json:"numberOfBucket,omitempty"` } -// IncidentCommentList - List of incident comments. -type IncidentCommentList struct { - // REQUIRED; Array of comments. - Value []*IncidentComment `json:"value,omitempty"` +// EntityTimelineResponse - The entity timeline result operation response. +type EntityTimelineResponse struct { + // The metadata from the timeline operation results. + MetaData *TimelineResultsMetadata `json:"metaData,omitempty"` - // READ-ONLY; URL to fetch the next set of comments. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + // The timeline result values. + Value []EntityTimelineItemClassification `json:"value,omitempty"` } -// IncidentCommentProperties - Incident comment property bag. -type IncidentCommentProperties struct { - // REQUIRED; The comment message +// EventGroupingSettings - Event grouping settings property bag. +type EventGroupingSettings struct { + // The event grouping aggregation kinds + AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` +} + +// ExpansionEntityQueriesProperties - Describes expansion entity query properties +type ExpansionEntityQueriesProperties struct { + // List of the data sources that are required to run the query + DataSources []*string `json:"dataSources,omitempty"` + + // The query display name + DisplayName *string `json:"displayName,omitempty"` + + // The type of the query's source entity + InputEntityType *EntityType `json:"inputEntityType,omitempty"` + + // List of the fields of the source entity that are required to run the query + InputFields []*string `json:"inputFields,omitempty"` + + // List of the desired output types to be constructed from the result + OutputEntityTypes []*EntityType `json:"outputEntityTypes,omitempty"` + + // The template query string to be parsed and formatted + QueryTemplate *string `json:"queryTemplate,omitempty"` +} + +// ExpansionEntityQuery - Represents Expansion entity query. +type ExpansionEntityQuery struct { + // REQUIRED; the entity query kind + Kind *EntityQueryKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Expansion entity query properties + Properties *ExpansionEntityQueriesProperties `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"` +} + +// 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, + } +} + +// 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. + Count *int32 `json:"count,omitempty"` + + // REQUIRED; The kind of the aggregated entity. + EntityKind *EntityKind `json:"entityKind,omitempty"` + + // The common type of the aggregation. (for e.g. entity field name) + AggregationType *string `json:"aggregationType,omitempty"` + + // The display name of the aggregation by type. + DisplayName *string `json:"displayName,omitempty"` +} + +// ExpansionResultsMetadata - Expansion result metadata. +type ExpansionResultsMetadata struct { + // Information of the aggregated nodes in the expansion result. + Aggregations []*ExpansionResultAggregation `json:"aggregations,omitempty"` +} + +// EyesOn - Settings with single toggle. +type EyesOn struct { + // REQUIRED; The kind of the setting + Kind *SettingKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // EyesOn properties + Properties *EyesOnSettingsProperties `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"` +} + +// 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, + } +} + +// EyesOnSettingsProperties - EyesOn property bag. +type EyesOnSettingsProperties struct { + // READ-ONLY; Determines whether the setting is enable or disabled. + IsEnabled *bool `json:"isEnabled,omitempty" azure:"ro"` +} + +// FieldMapping - A single field mapping of the mapped entity +type FieldMapping struct { + // the column name to be mapped to the identifier + ColumnName *string `json:"columnName,omitempty"` + + // the V3 identifier of the entity + Identifier *string `json:"identifier,omitempty"` +} + +// FileEntity - Represents a file entity. +type FileEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // File entity properties + Properties *FileEntityProperties `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"` +} + +// 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, + } +} + +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The full path to the file. + Directory *string `json:"directory,omitempty" azure:"ro"` + + // READ-ONLY; The file hash entity identifiers associated with this file + FileHashEntityIDs []*string `json:"fileHashEntityIds,omitempty" azure:"ro"` + + // READ-ONLY; The file name without path (some alerts might not include path). + FileName *string `json:"fileName,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; The Host entity id which the file belongs to + HostEntityID *string `json:"hostEntityId,omitempty" azure:"ro"` +} + +// FileHashEntity - Represents a file hash entity. +type FileHashEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // FileHash entity properties + Properties *FileHashEntityProperties `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"` +} + +// 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, + } +} + +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The hash algorithm type. + Algorithm *FileHashAlgorithm `json:"algorithm,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; The file hash value. + HashValue *string `json:"hashValue,omitempty" azure:"ro"` +} + +// FusionAlertRule - Represents Fusion alert rule. +type FusionAlertRule struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Fusion alert rule properties + Properties *FusionAlertRuleProperties `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"` +} + +// 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, + } +} + +// FusionAlertRuleProperties - Fusion alert rule base property bag. +type FusionAlertRuleProperties struct { + // REQUIRED; The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + + // REQUIRED; Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,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"` + + // READ-ONLY; The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; The last time that this alert has been modified. + LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` + + // READ-ONLY; The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty" azure:"ro"` + + // READ-ONLY; The tactics of the alert rule + Tactics []*AttackTactic `json:"tactics,omitempty" azure:"ro"` + + // READ-ONLY; The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty" azure:"ro"` +} + +// FusionAlertRuleTemplate - Represents Fusion alert rule template. +type FusionAlertRuleTemplate struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` + + // Fusion alert rule template properties + Properties *FusionAlertRuleTemplateProperties `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"` +} + +// 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, + } +} + +// FusionAlertRuleTemplateProperties - Fusion alert rule template properties +type FusionAlertRuleTemplateProperties struct { + // the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + + // The description of the alert rule template. + Description *string `json:"description,omitempty"` + + // The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + + // 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 template + Tactics []*AttackTactic `json:"tactics,omitempty"` + + // The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty"` + + // READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *time.Time `json:"createdDateUTC,omitempty" azure:"ro"` + + // READ-ONLY; The time that this alert rule template was last updated. + LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` +} + +// FusionScenarioExclusionPattern - Represents a Fusion scenario exclusion patterns in Fusion detection. +type FusionScenarioExclusionPattern struct { + // REQUIRED; DateTime when scenario exclusion pattern is added in UTC. + DateAddedInUTC *string `json:"dateAddedInUTC,omitempty"` + + // REQUIRED; Scenario exclusion pattern. + ExclusionPattern *string `json:"exclusionPattern,omitempty"` +} + +// FusionSourceSettings - Represents a supported source signal configuration in Fusion detection. +type FusionSourceSettings struct { + // REQUIRED; Determines whether this source signal is enabled or disabled in Fusion detection. + Enabled *bool `json:"enabled,omitempty"` + + // REQUIRED; Name of the Fusion source signal. Refer to Fusion alert rule template for supported values. + SourceName *string `json:"sourceName,omitempty"` + + // Configuration for all source subtypes under this source signal consumed in fusion detection. + SourceSubTypes []*FusionSourceSubTypeSetting `json:"sourceSubTypes,omitempty"` +} + +// 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. + Enabled *bool `json:"enabled,omitempty"` + + // REQUIRED; Severity configuration for a source subtype consumed in fusion detection. + SeverityFilters *FusionSubTypeSeverityFilter `json:"severityFilters,omitempty"` + + // REQUIRED; The Name of the source subtype under a given source signal in Fusion detection. Refer to Fusion alert rule template + // for supported values. + SourceSubTypeName *string `json:"sourceSubTypeName,omitempty"` + + // READ-ONLY; The display name of source subtype under a source signal consumed in Fusion detection. + SourceSubTypeDisplayName *string `json:"sourceSubTypeDisplayName,omitempty" azure:"ro"` +} + +// FusionSubTypeSeverityFilter - Represents severity configuration for a source subtype consumed in Fusion detection. +type FusionSubTypeSeverityFilter struct { + // Individual Severity configuration settings for a given source subtype consumed in Fusion detection. + Filters []*FusionSubTypeSeverityFiltersItem `json:"filters,omitempty"` + + // READ-ONLY; Determines whether this source subtype supports severity configuration or not. + IsSupported *bool `json:"isSupported,omitempty" azure:"ro"` +} + +// 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. + Enabled *bool `json:"enabled,omitempty"` + + // REQUIRED; The Severity for a given source subtype consumed in Fusion detection. + Severity *AlertSeverity `json:"severity,omitempty"` +} + +// FusionTemplateSourceSetting - Represents a source signal consumed in Fusion detection. +type FusionTemplateSourceSetting struct { + // REQUIRED; The name of a source signal consumed in Fusion detection. + SourceName *string `json:"sourceName,omitempty"` + + // All supported source subtypes under this source signal consumed in fusion detection. + SourceSubTypes []*FusionTemplateSourceSubType `json:"sourceSubTypes,omitempty"` +} + +// 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. + SeverityFilter *FusionTemplateSubTypeSeverityFilter `json:"severityFilter,omitempty"` + + // REQUIRED; The name of source subtype under a source signal consumed in Fusion detection. + SourceSubTypeName *string `json:"sourceSubTypeName,omitempty"` + + // READ-ONLY; The display name of source subtype under a source signal consumed in Fusion detection. + SourceSubTypeDisplayName *string `json:"sourceSubTypeDisplayName,omitempty" azure:"ro"` +} + +// FusionTemplateSubTypeSeverityFilter - Represents severity configurations available for a source subtype consumed in Fusion +// detection. +type FusionTemplateSubTypeSeverityFilter struct { + // REQUIRED; Determines whether severity configuration is supported for this source subtype consumed in Fusion detection. + IsSupported *bool `json:"isSupported,omitempty"` + + // List of all supported severities for this source subtype consumed in Fusion detection. + SeverityFilters []*AlertSeverity `json:"severityFilters,omitempty"` +} + +// GeoLocation - The geo-location context attached to the ip entity +type GeoLocation struct { + // READ-ONLY; Autonomous System Number + Asn *int32 `json:"asn,omitempty" azure:"ro"` + + // READ-ONLY; City name + City *string `json:"city,omitempty" azure:"ro"` + + // READ-ONLY; The country code according to ISO 3166 format + CountryCode *string `json:"countryCode,omitempty" azure:"ro"` + + // READ-ONLY; Country name according to ISO 3166 Alpha 2: the lowercase of the English Short Name + CountryName *string `json:"countryName,omitempty" azure:"ro"` + + // READ-ONLY; The longitude of the identified location, expressed as a floating point number with range of -180 to 180, with + // positive numbers representing East and negative numbers representing West. Latitude and + // longitude are derived from the city or postal code. + Latitude *float64 `json:"latitude,omitempty" azure:"ro"` + + // READ-ONLY; The latitude of the identified location, expressed as a floating point number with range of - 90 to 90, with + // positive numbers representing North and negative numbers representing South. Latitude and + // longitude are derived from the city or postal code. + Longitude *float64 `json:"longitude,omitempty" azure:"ro"` + + // READ-ONLY; State name + State *string `json:"state,omitempty" azure:"ro"` +} + +// GetInsightsErrorKind - GetInsights Query Errors. +type GetInsightsErrorKind struct { + // REQUIRED; the error message + ErrorMessage *string `json:"errorMessage,omitempty"` + + // REQUIRED; the query kind + Kind *GetInsightsError `json:"kind,omitempty"` + + // the query id + QueryID *string `json:"queryId,omitempty"` +} + +// GetInsightsResultsMetadata - Get Insights result metadata. +type GetInsightsResultsMetadata struct { + // REQUIRED; the total items found for the insights request + TotalCount *int32 `json:"totalCount,omitempty"` + + // information about the failed queries + Errors []*GetInsightsErrorKind `json:"errors,omitempty"` +} + +// GetQueriesResponse - Retrieve queries for entity result operation response. +type GetQueriesResponse struct { + // The query result values. + Value []EntityQueryItemClassification `json:"value,omitempty"` +} + +// 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 +type GraphQueries struct { + // The base query for the graph + BaseQuery *string `json:"baseQuery,omitempty"` + + // The legend for the graph + Legend *string `json:"legend,omitempty"` + + // the metric that the query is checking + MetricName *string `json:"metricName,omitempty"` +} + +// GroupingConfiguration - Grouping configuration property bag. +type GroupingConfiguration struct { + // REQUIRED; Grouping enabled + Enabled *bool `json:"enabled,omitempty"` + + // REQUIRED; Limit the group to alerts created within the lookback duration (in ISO 8601 duration format) + LookbackDuration *string `json:"lookbackDuration,omitempty"` + + // REQUIRED; Grouping matching method. When method is Selected at least one of groupByEntities, groupByAlertDetails, groupByCustomDetails + // must be provided and not empty. + MatchingMethod *MatchingMethod `json:"matchingMethod,omitempty"` + + // REQUIRED; Re-open closed matching incidents + ReopenClosedIncident *bool `json:"reopenClosedIncident,omitempty"` + + // A list of alert details to group by (when matchingMethod is Selected) + GroupByAlertDetails []*AlertDetail `json:"groupByAlertDetails,omitempty"` + + // A list of custom details keys to group by (when matchingMethod is Selected). Only keys defined in the current alert rule + // may be used. + GroupByCustomDetails []*string `json:"groupByCustomDetails,omitempty"` + + // A list of entity types to group by (when matchingMethod is Selected). Only entities defined in the current alert rule may + // be used. + GroupByEntities []*EntityMappingType `json:"groupByEntities,omitempty"` +} + +// HostEntity - Represents a host entity. +type HostEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // Host entity properties + Properties *HostEntityProperties `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"` +} + +// 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, + } +} + +// HostEntityProperties - Host entity property bag. +type HostEntityProperties struct { + // The operating system type. + OSFamily *OSFamily `json:"osFamily,omitempty"` + + // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The azure resource id of the VM. + AzureID *string `json:"azureID,omitempty" azure:"ro"` + + // READ-ONLY; The DNS domain that this host belongs to. Should contain the compete DNS suffix for the domain + DNSDomain *string `json:"dnsDomain,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; The hostname without the domain suffix. + HostName *string `json:"hostName,omitempty" azure:"ro"` + + // READ-ONLY; Determines whether this host belongs to a domain. + IsDomainJoined *bool `json:"isDomainJoined,omitempty" azure:"ro"` + + // READ-ONLY; The host name (pre-windows2000). + NetBiosName *string `json:"netBiosName,omitempty" azure:"ro"` + + // READ-ONLY; The NT domain that this host belongs to. + NtDomain *string `json:"ntDomain,omitempty" azure:"ro"` + + // READ-ONLY; A free text representation of the operating system. This field is meant to hold specific versions the are more + // fine grained than OSFamily or future values not supported by OSFamily enumeration + OSVersion *string `json:"osVersion,omitempty" azure:"ro"` + + // READ-ONLY; The OMS agent id, if the host has OMS agent installed. + OmsAgentID *string `json:"omsAgentID,omitempty" azure:"ro"` +} + +// HuntingBookmark - Represents a Hunting bookmark entity. +type HuntingBookmark struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // HuntingBookmark entity properties + Properties *HuntingBookmarkProperties `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"` +} + +// 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, + } +} + +// HuntingBookmarkProperties - Describes bookmark properties +type HuntingBookmarkProperties struct { + // REQUIRED; The display name of the bookmark + DisplayName *string `json:"displayName,omitempty"` + + // REQUIRED; The query of the bookmark. + Query *string `json:"query,omitempty"` + + // The time the bookmark was created + Created *time.Time `json:"created,omitempty"` + + // Describes a user that created the bookmark + CreatedBy *UserInfo `json:"createdBy,omitempty"` + + // The time of the event + EventTime *time.Time `json:"eventTime,omitempty"` + + // Describes an incident that relates to bookmark + IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` + + // List of labels relevant to this bookmark + Labels []*string `json:"labels,omitempty"` + + // The notes of the bookmark + Notes *string `json:"notes,omitempty"` + + // The query result of the bookmark. + QueryResult *string `json:"queryResult,omitempty"` + + // The last time the bookmark was updated + Updated *time.Time `json:"updated,omitempty"` + + // Describes a user that updated the bookmark + UpdatedBy *UserInfo `json:"updatedBy,omitempty"` + + // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` +} + +// IPEntity - Represents an ip entity. +type IPEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // Ip entity properties + Properties *IPEntityProperties `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"` +} + +// 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, + } +} + +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The IP address as string, e.g. 127.0.0.1 (either in Ipv4 or Ipv6) + Address *string `json:"address,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; The geo-location context attached to the ip entity + Location *GeoLocation `json:"location,omitempty" azure:"ro"` + + // READ-ONLY; A list of TI contexts attached to the ip entity. + ThreatIntelligence []*ThreatIntelligence `json:"threatIntelligence,omitempty" azure:"ro"` +} + +// IPGeodataClientGetOptions contains the optional parameters for the IPGeodataClient.Get method. +type IPGeodataClientGetOptions struct { + // placeholder for future optional parameters +} + +// Incident - Represents an incident in Azure Security Insights. +type Incident struct { + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Incident properties + Properties *IncidentProperties `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"` +} + +// IncidentAdditionalData - Incident additional data property bag. +type IncidentAdditionalData struct { + // READ-ONLY; List of product names of alerts in the incident + AlertProductNames []*string `json:"alertProductNames,omitempty" azure:"ro"` + + // READ-ONLY; The number of alerts in the incident + AlertsCount *int32 `json:"alertsCount,omitempty" azure:"ro"` + + // READ-ONLY; The number of bookmarks in the incident + BookmarksCount *int32 `json:"bookmarksCount,omitempty" azure:"ro"` + + // READ-ONLY; The number of comments in the incident + CommentsCount *int32 `json:"commentsCount,omitempty" azure:"ro"` + + // READ-ONLY; The provider incident url to the incident in Microsoft 365 Defender portal + ProviderIncidentURL *string `json:"providerIncidentUrl,omitempty" azure:"ro"` + + // READ-ONLY; The tactics associated with incident + Tactics []*AttackTactic `json:"tactics,omitempty" azure:"ro"` + + // READ-ONLY; The techniques associated with incident's tactics' + Techniques []*string `json:"techniques,omitempty" azure:"ro"` +} + +// IncidentAlertList - List of incident alerts. +type IncidentAlertList struct { + // REQUIRED; Array of incident alerts. + Value []*SecurityAlert `json:"value,omitempty"` +} + +// IncidentBookmarkList - List of incident bookmarks. +type IncidentBookmarkList struct { + // REQUIRED; Array of incident bookmarks. + Value []*HuntingBookmark `json:"value,omitempty"` +} + +// IncidentComment - Represents an incident comment +type IncidentComment struct { + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Incident comment properties + Properties *IncidentCommentProperties `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"` +} + +// IncidentCommentList - List of incident comments. +type IncidentCommentList struct { + // REQUIRED; Array of comments. + Value []*IncidentComment `json:"value,omitempty"` + + // READ-ONLY; URL to fetch the next set of comments. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// IncidentCommentProperties - Incident comment property bag. +type IncidentCommentProperties struct { + // REQUIRED; The comment message Message *string `json:"message,omitempty"` - // READ-ONLY; Describes the client that created the comment - Author *ClientInfo `json:"author,omitempty" azure:"ro"` + // READ-ONLY; Describes the client that created the comment + Author *ClientInfo `json:"author,omitempty" azure:"ro"` + + // READ-ONLY; The time the comment was created + CreatedTimeUTC *time.Time `json:"createdTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; The time the comment was updated + LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` +} + +// IncidentCommentsClientCreateOrUpdateOptions contains the optional parameters for the IncidentCommentsClient.CreateOrUpdate +// method. +type IncidentCommentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// IncidentCommentsClientDeleteOptions contains the optional parameters for the IncidentCommentsClient.Delete method. +type IncidentCommentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// IncidentCommentsClientGetOptions contains the optional parameters for the IncidentCommentsClient.Get method. +type IncidentCommentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// IncidentCommentsClientListOptions contains the optional parameters for the IncidentCommentsClient.List method. +type IncidentCommentsClientListOptions struct { + // Filters the results, based on a Boolean condition. Optional. + Filter *string + // Sorts the results. Optional. + Orderby *string + // 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 + // Returns only the first n results. Optional. + Top *int32 +} + +// IncidentConfiguration - Incident Configuration property bag. +type IncidentConfiguration struct { + // REQUIRED; Create incidents from alerts triggered by this analytics rule + CreateIncident *bool `json:"createIncident,omitempty"` + + // Set how the alerts that are triggered by this analytics rule, are grouped into incidents + GroupingConfiguration *GroupingConfiguration `json:"groupingConfiguration,omitempty"` +} + +// IncidentEntitiesResponse - The incident related entities response. +type IncidentEntitiesResponse struct { + // Array of the incident related entities. + Entities []EntityClassification `json:"entities,omitempty"` + + // The metadata from the incident related entities results. + MetaData []*IncidentEntitiesResultsMetadata `json:"metaData,omitempty"` +} + +// 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. + Count *int32 `json:"count,omitempty"` + + // REQUIRED; The kind of the aggregated entity. + EntityKind *EntityKind `json:"entityKind,omitempty"` +} + +// IncidentInfo - Describes related incident information for the bookmark +type IncidentInfo struct { + // Incident Id + IncidentID *string `json:"incidentId,omitempty"` + + // Relation Name + RelationName *string `json:"relationName,omitempty"` + + // The severity of the incident + Severity *IncidentSeverity `json:"severity,omitempty"` + + // The title of the incident + Title *string `json:"title,omitempty"` +} + +// IncidentLabel - Represents an incident label +type IncidentLabel struct { + // REQUIRED; The name of the label + LabelName *string `json:"labelName,omitempty"` + + // READ-ONLY; The type of the label + LabelType *IncidentLabelType `json:"labelType,omitempty" azure:"ro"` +} + +// IncidentList - List all the incidents. +type IncidentList struct { + // REQUIRED; Array of incidents. + Value []*Incident `json:"value,omitempty"` + + // READ-ONLY; URL to fetch the next set of incidents. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// IncidentOwnerInfo - Information on the user an incident is assigned to +type IncidentOwnerInfo struct { + // The name of the user the incident is assigned to. + AssignedTo *string `json:"assignedTo,omitempty"` + + // The email of the user the incident is assigned to. + Email *string `json:"email,omitempty"` + + // 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"` +} + +// IncidentProperties - Describes incident properties +type IncidentProperties struct { + // REQUIRED; The severity of the incident + Severity *IncidentSeverity `json:"severity,omitempty"` + + // REQUIRED; The status of the incident + Status *IncidentStatus `json:"status,omitempty"` + + // REQUIRED; The title of the incident + Title *string `json:"title,omitempty"` + + // The reason the incident was closed + Classification *IncidentClassification `json:"classification,omitempty"` + + // Describes the reason the incident was closed + ClassificationComment *string `json:"classificationComment,omitempty"` + + // The classification reason the incident was closed with + ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` + + // The description of the incident + Description *string `json:"description,omitempty"` + + // The time of the first activity in the incident + FirstActivityTimeUTC *time.Time `json:"firstActivityTimeUtc,omitempty"` + + // List of labels relevant to this incident + Labels []*IncidentLabel `json:"labels,omitempty"` + + // The time of the last activity in the incident + LastActivityTimeUTC *time.Time `json:"lastActivityTimeUtc,omitempty"` + + // Describes a user that the incident is assigned to + Owner *IncidentOwnerInfo `json:"owner,omitempty"` + + // The incident ID assigned by the incident provider + ProviderIncidentID *string `json:"providerIncidentId,omitempty"` + + // The name of the source provider that generated the incident + ProviderName *string `json:"providerName,omitempty"` + + // Describes a team for the incident + TeamInformation *TeamInformation `json:"teamInformation,omitempty"` + + // READ-ONLY; Additional data on the incident + AdditionalData *IncidentAdditionalData `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The time the incident was created + CreatedTimeUTC *time.Time `json:"createdTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; A sequential number + IncidentNumber *int32 `json:"incidentNumber,omitempty" azure:"ro"` + + // READ-ONLY; The deep-link url to the incident in Azure portal + IncidentURL *string `json:"incidentUrl,omitempty" azure:"ro"` + + // READ-ONLY; The last time the incident was updated + LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; List of resource ids of Analytic rules related to the incident + RelatedAnalyticRuleIDs []*string `json:"relatedAnalyticRuleIds,omitempty" azure:"ro"` +} + +type IncidentPropertiesAction struct { + // The reason the incident was closed + Classification *IncidentClassification `json:"classification,omitempty"` + + // Describes the reason the incident was closed. + ClassificationComment *string `json:"classificationComment,omitempty"` + + // The classification reason the incident was closed with + ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` + + // List of labels to add to the incident. + Labels []*IncidentLabel `json:"labels,omitempty"` + + // Information on the user an incident is assigned to + Owner *IncidentOwnerInfo `json:"owner,omitempty"` + + // The severity of the incident + Severity *IncidentSeverity `json:"severity,omitempty"` + + // The status of the incident + Status *IncidentStatus `json:"status,omitempty"` +} + +// IncidentRelationsClientCreateOrUpdateOptions contains the optional parameters for the IncidentRelationsClient.CreateOrUpdate +// method. +type IncidentRelationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// IncidentRelationsClientDeleteOptions contains the optional parameters for the IncidentRelationsClient.Delete method. +type IncidentRelationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// IncidentRelationsClientGetOptions contains the optional parameters for the IncidentRelationsClient.Get method. +type IncidentRelationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// IncidentRelationsClientListOptions contains the optional parameters for the IncidentRelationsClient.List method. +type IncidentRelationsClientListOptions struct { + // Filters the results, based on a Boolean condition. Optional. + Filter *string + // Sorts the results. Optional. + Orderby *string + // 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 + // Returns only the first n results. Optional. + Top *int32 +} + +// IncidentsClientCreateOrUpdateOptions contains the optional parameters for the IncidentsClient.CreateOrUpdate method. +type IncidentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// IncidentsClientCreateTeamOptions contains the optional parameters for the IncidentsClient.CreateTeam method. +type IncidentsClientCreateTeamOptions struct { + // placeholder for future optional parameters +} + +// IncidentsClientDeleteOptions contains the optional parameters for the IncidentsClient.Delete method. +type IncidentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// IncidentsClientGetOptions contains the optional parameters for the IncidentsClient.Get method. +type IncidentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// IncidentsClientListAlertsOptions contains the optional parameters for the IncidentsClient.ListAlerts method. +type IncidentsClientListAlertsOptions struct { + // placeholder for future optional parameters +} + +// IncidentsClientListBookmarksOptions contains the optional parameters for the IncidentsClient.ListBookmarks method. +type IncidentsClientListBookmarksOptions struct { + // placeholder for future optional parameters +} + +// IncidentsClientListEntitiesOptions contains the optional parameters for the IncidentsClient.ListEntities method. +type IncidentsClientListEntitiesOptions struct { + // placeholder for future optional parameters +} + +// IncidentsClientListOptions contains the optional parameters for the IncidentsClient.List method. +type IncidentsClientListOptions struct { + // Filters the results, based on a Boolean condition. Optional. + Filter *string + // Sorts the results. Optional. + Orderby *string + // 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 + // Returns only the first n results. Optional. + 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 + Kind *EntityQueryKind `json:"kind,omitempty"` + + // Query Template ARM Name + Name *string `json:"name,omitempty"` + + // Properties bag for InsightQueryItem + Properties *InsightQueryItemProperties `json:"properties,omitempty"` + + // ARM Type + Type *string `json:"type,omitempty"` + + // READ-ONLY; Query Template ARM ID + 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, + } +} + +// InsightQueryItemProperties - Represents Insight Query. +type InsightQueryItemProperties struct { + // The activity query definitions. + AdditionalQuery *InsightQueryItemPropertiesAdditionalQuery `json:"additionalQuery,omitempty"` + + // The base query of the insight. + BaseQuery *string `json:"baseQuery,omitempty"` + + // The insight chart query. + ChartQuery interface{} `json:"chartQuery,omitempty"` + + // Data types for template + DataTypes []*EntityQueryItemPropertiesDataTypesItem `json:"dataTypes,omitempty"` + + // The insight chart query. + DefaultTimeRange *InsightQueryItemPropertiesDefaultTimeRange `json:"defaultTimeRange,omitempty"` + + // The insight description. + Description *string `json:"description,omitempty"` + + // The insight display name. + DisplayName *string `json:"displayName,omitempty"` + + // The query applied only to entities matching to all filters + EntitiesFilter interface{} `json:"entitiesFilter,omitempty"` + + // The type of the entity + InputEntityType *EntityType `json:"inputEntityType,omitempty"` + + // The insight chart query. + ReferenceTimeRange *InsightQueryItemPropertiesReferenceTimeRange `json:"referenceTimeRange,omitempty"` + + // Data types for template + RequiredInputFieldsSets [][]*string `json:"requiredInputFieldsSets,omitempty"` + + // The insight table query. + TableQuery *InsightQueryItemPropertiesTableQuery `json:"tableQuery,omitempty"` +} + +// InsightQueryItemPropertiesAdditionalQuery - The activity query definitions. +type InsightQueryItemPropertiesAdditionalQuery struct { + // The insight query. + Query *string `json:"query,omitempty"` + + // The insight text. + Text *string `json:"text,omitempty"` +} + +// InsightQueryItemPropertiesDefaultTimeRange - The insight chart query. +type InsightQueryItemPropertiesDefaultTimeRange struct { + // The padding for the end time of the query. + AfterRange *string `json:"afterRange,omitempty"` + + // The padding for the start time of the query. + BeforeRange *string `json:"beforeRange,omitempty"` +} + +// InsightQueryItemPropertiesReferenceTimeRange - The insight chart query. +type InsightQueryItemPropertiesReferenceTimeRange struct { + // Additional query time for looking back. + BeforeRange *string `json:"beforeRange,omitempty"` +} + +// InsightQueryItemPropertiesTableQuery - The insight table query. +type InsightQueryItemPropertiesTableQuery struct { + // List of insight column definitions. + ColumnsDefinitions []*InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem `json:"columnsDefinitions,omitempty"` + + // List of insight queries definitions. + QueriesDefinitions []*InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem `json:"queriesDefinitions,omitempty"` +} + +type InsightQueryItemPropertiesTableQueryColumnsDefinitionsItem struct { + // Insight column header. + Header *string `json:"header,omitempty"` + + // Insights Column type. + OutputType *OutputType `json:"outputType,omitempty"` + + // Is query supports deep-link. + SupportDeepLink *bool `json:"supportDeepLink,omitempty"` +} + +type InsightQueryItemPropertiesTableQueryQueriesDefinitionsItem struct { + // Insight column header. + Filter *string `json:"filter,omitempty"` + + // Insight column header. + LinkColumnsDefinitions []*InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem `json:"linkColumnsDefinitions,omitempty"` + + // Insight column header. + Project *string `json:"project,omitempty"` + + // Insight column header. + Summarize *string `json:"summarize,omitempty"` +} + +type InsightQueryItemPropertiesTableQueryQueriesDefinitionsPropertiesItemsItem struct { + // Insight Link Definition Projected Name. + ProjectedName *string `json:"projectedName,omitempty"` + + // Insight Link Definition Query. + Query *string `json:"Query,omitempty"` +} + +// InsightsTableResult - Query results for table insights query. +type InsightsTableResult struct { + // Columns Metadata of the table + Columns []*InsightsTableResultColumnsItem `json:"columns,omitempty"` + + // Rows data of the table + Rows [][]*string `json:"rows,omitempty"` +} + +type InsightsTableResultColumnsItem struct { + // the name of the colum + Name *string `json:"name,omitempty"` + + // the type of the colum + Type *string `json:"type,omitempty"` +} + +// InstructionSteps - Instruction steps to enable the connector +type InstructionSteps struct { + // Instruction step description + Description *string `json:"description,omitempty"` + + // Instruction step details + Instructions []*InstructionStepsInstructionsItem `json:"instructions,omitempty"` + + // Instruction step title + Title *string `json:"title,omitempty"` +} + +type InstructionStepsInstructionsItem struct { + // REQUIRED; The kind of the setting + Type *SettingType `json:"type,omitempty"` + + // The parameters for the setting + 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"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type IoTCheckRequirements. +func (i *IoTCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: i.Kind, + } +} + +// 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"` +} + +// 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, + } +} + +// 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. + Kind *EntityKind `json:"kind,omitempty"` + + // IoTDevice entity properties + Properties *IoTDeviceEntityProperties `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"` +} + +// 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, + } +} + +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The ID of the IoT Device in the IoT Hub + DeviceID *string `json:"deviceId,omitempty" azure:"ro"` + + // READ-ONLY; The friendly name of the device + DeviceName *string `json:"deviceName,omitempty" azure:"ro"` + + // READ-ONLY; The type of the device + DeviceType *string `json:"deviceType,omitempty" azure:"ro"` + + // READ-ONLY; The ID of the edge device + EdgeID *string `json:"edgeId,omitempty" azure:"ro"` + + // READ-ONLY; The firmware version of the device + FirmwareVersion *string `json:"firmwareVersion,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; The Host entity id of this device + HostEntityID *string `json:"hostEntityId,omitempty" azure:"ro"` + + // READ-ONLY; The IP entity if of this device + IPAddressEntityID *string `json:"ipAddressEntityId,omitempty" azure:"ro"` + + // READ-ONLY; The AzureResource entity id of the IoT Hub + IotHubEntityID *string `json:"iotHubEntityId,omitempty" azure:"ro"` + + // READ-ONLY; The ID of the security agent running on the device + IotSecurityAgentID *string `json:"iotSecurityAgentId,omitempty" azure:"ro"` + + // READ-ONLY; The MAC address of the device + MacAddress *string `json:"macAddress,omitempty" azure:"ro"` + + // READ-ONLY; The model of the device + Model *string `json:"model,omitempty" azure:"ro"` + + // READ-ONLY; The operating system of the device + OperatingSystem *string `json:"operatingSystem,omitempty" azure:"ro"` + + // READ-ONLY; A list of protocols of the IoTDevice entity. + Protocols []*string `json:"protocols,omitempty" azure:"ro"` + + // READ-ONLY; The serial number of the device + SerialNumber *string `json:"serialNumber,omitempty" azure:"ro"` + + // READ-ONLY; The source of the device + Source *string `json:"source,omitempty" azure:"ro"` + + // READ-ONLY; A list of TI contexts attached to the IoTDevice entity. + ThreatIntelligence []*ThreatIntelligence `json:"threatIntelligence,omitempty" azure:"ro"` + + // READ-ONLY; The vendor of the device + Vendor *string `json:"vendor,omitempty" azure:"ro"` +} + +// LastDataReceivedDataType - Data type for last data received +type LastDataReceivedDataType struct { + // Query for indicate last data received + LastDataReceivedQuery *string `json:"lastDataReceivedQuery,omitempty"` + + // Name of the data type to show in the graph. can be use with {{graphQueriesTableName}} placeholder + Name *string `json:"name,omitempty"` +} + +// MCASCheckRequirements - Represents MCAS (Microsoft Cloud App Security) requirements check request. +type MCASCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // MCAS (Microsoft Cloud App Security) requirements check properties. + Properties *MCASCheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MCASCheckRequirements. +func (m *MCASCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} + +// MCASCheckRequirementsProperties - MCAS (Microsoft Cloud App Security) requirements check properties. +type MCASCheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// MCASDataConnector - Represents MCAS (Microsoft Cloud App Security) data connector. +type MCASDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // MCAS (Microsoft Cloud App Security) data connector properties. + Properties *MCASDataConnectorProperties `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"` +} + +// 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, + } +} + +// MCASDataConnectorDataTypes - The available data types for MCAS (Microsoft Cloud App Security) data connector. +type MCASDataConnectorDataTypes struct { + // REQUIRED; Alerts data type connection. + Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` + + // Discovery log data type connection. + DiscoveryLogs *DataConnectorDataTypeCommon `json:"discoveryLogs,omitempty"` +} + +// MCASDataConnectorProperties - MCAS (Microsoft Cloud App Security) data connector properties. +type MCASDataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *MCASDataConnectorDataTypes `json:"dataTypes,omitempty"` + + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// MDATPCheckRequirements - Represents MDATP (Microsoft Defender Advanced Threat Protection) requirements check request. +type MDATPCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // MDATP (Microsoft Defender Advanced Threat Protection) requirements check properties. + Properties *MDATPCheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MDATPCheckRequirements. +func (m *MDATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} + +// 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. + TenantID *string `json:"tenantId,omitempty"` +} + +// MDATPDataConnector - Represents MDATP (Microsoft Defender Advanced Threat Protection) data connector. +type MDATPDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. + Properties *MDATPDataConnectorProperties `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"` +} + +// 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, + } +} + +// 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. + TenantID *string `json:"tenantId,omitempty"` + + // The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// MLBehaviorAnalyticsAlertRule - Represents MLBehaviorAnalytics alert rule. +type MLBehaviorAnalyticsAlertRule struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // MLBehaviorAnalytics alert rule properties + Properties *MLBehaviorAnalyticsAlertRuleProperties `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"` +} + +// 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, + } +} + +// MLBehaviorAnalyticsAlertRuleProperties - MLBehaviorAnalytics alert rule base property bag. +type MLBehaviorAnalyticsAlertRuleProperties struct { + // REQUIRED; The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + + // REQUIRED; Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + + // READ-ONLY; The description of the alert rule. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; The last time that this alert rule has been modified. + LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` + + // READ-ONLY; The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty" azure:"ro"` + + // READ-ONLY; The tactics of the alert rule + Tactics []*AttackTactic `json:"tactics,omitempty" azure:"ro"` + + // READ-ONLY; The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty" azure:"ro"` +} + +// MLBehaviorAnalyticsAlertRuleTemplate - Represents MLBehaviorAnalytics alert rule template. +type MLBehaviorAnalyticsAlertRuleTemplate struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` + + // MLBehaviorAnalytics alert rule template properties. + Properties *MLBehaviorAnalyticsAlertRuleTemplateProperties `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"` +} + +// 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, + } +} + +// MLBehaviorAnalyticsAlertRuleTemplateProperties - MLBehaviorAnalytics alert rule template properties. +type MLBehaviorAnalyticsAlertRuleTemplateProperties struct { + // REQUIRED; The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty"` + + // the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + + // The description of the alert rule template. + Description *string `json:"description,omitempty"` + + // The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + + // The required data sources for this template + RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + + // The alert rule template status. + Status *TemplateStatus `json:"status,omitempty"` + + // The tactics of the alert rule + Tactics []*AttackTactic `json:"tactics,omitempty"` + + // The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty"` + + // 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. + LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` +} + +// MSTICheckRequirements - Represents Microsoft Threat Intelligence requirements check request. +type MSTICheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Microsoft Threat Intelligence requirements check properties. + Properties *MSTICheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MSTICheckRequirements. +func (m *MSTICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} + +// MSTICheckRequirementsProperties - Microsoft Threat Intelligence requirements check properties. +type MSTICheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// MSTIDataConnector - Represents Microsoft Threat Intelligence data connector. +type MSTIDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Microsoft Threat Intelligence data connector properties. + Properties *MSTIDataConnectorProperties `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"` +} + +// 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, + } +} + +// 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. + BingSafetyPhishingURL *MSTIDataConnectorDataTypesBingSafetyPhishingURL `json:"bingSafetyPhishingURL,omitempty"` - // READ-ONLY; The time the comment was created - CreatedTimeUTC *time.Time `json:"createdTimeUtc,omitempty" azure:"ro"` + // REQUIRED; Data type for Microsoft Threat Intelligence Platforms data connector. + MicrosoftEmergingThreatFeed *MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed `json:"microsoftEmergingThreatFeed,omitempty"` +} - // READ-ONLY; The time the comment was updated - LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` +// MSTIDataConnectorDataTypesBingSafetyPhishingURL - Data type for Microsoft Threat Intelligence Platforms data connector. +type MSTIDataConnectorDataTypesBingSafetyPhishingURL struct { + // REQUIRED; lookback period + LookbackPeriod *string `json:"lookbackPeriod,omitempty"` + + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` } -// IncidentCommentsClientCreateOrUpdateOptions contains the optional parameters for the IncidentCommentsClient.CreateOrUpdate -// method. -type IncidentCommentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed - Data type for Microsoft Threat Intelligence Platforms data connector. +type MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed struct { + // REQUIRED; lookback period + LookbackPeriod *string `json:"lookbackPeriod,omitempty"` + + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` } -// IncidentCommentsClientDeleteOptions contains the optional parameters for the IncidentCommentsClient.Delete method. -type IncidentCommentsClientDeleteOptions struct { - // placeholder for future optional parameters +// MSTIDataConnectorProperties - Microsoft Threat Intelligence data connector properties. +type MSTIDataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *MSTIDataConnectorDataTypes `json:"dataTypes,omitempty"` + + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` } -// IncidentCommentsClientGetOptions contains the optional parameters for the IncidentCommentsClient.Get method. -type IncidentCommentsClientGetOptions struct { - // placeholder for future optional parameters +// MTPCheckRequirementsProperties - MTP (Microsoft Threat Protection) requirements check properties. +type MTPCheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` } -// IncidentCommentsClientListOptions contains the optional parameters for the IncidentCommentsClient.List method. -type IncidentCommentsClientListOptions struct { - // Filters the results, based on a Boolean condition. Optional. - Filter *string - // Sorts the results. Optional. - Orderby *string - // 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 - // Returns only the first n results. Optional. - Top *int32 +// MTPDataConnector - Represents MTP (Microsoft Threat Protection) data connector. +type MTPDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // MTP (Microsoft Threat Protection) data connector properties. + Properties *MTPDataConnectorProperties `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"` } -// IncidentConfiguration - Incident Configuration property bag. -type IncidentConfiguration struct { - // REQUIRED; Create incidents from alerts triggered by this analytics rule - CreateIncident *bool `json:"createIncident,omitempty"` +// 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, + } +} - // Set how the alerts that are triggered by this analytics rule, are grouped into incidents - GroupingConfiguration *GroupingConfiguration `json:"groupingConfiguration,omitempty"` +// 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. + Incidents *MTPDataConnectorDataTypesIncidents `json:"incidents,omitempty"` } -// IncidentEntitiesResponse - The incident related entities response. -type IncidentEntitiesResponse struct { - // Array of the incident related entities. - Entities []EntityClassification `json:"entities,omitempty"` +// MTPDataConnectorDataTypesIncidents - Data type for Microsoft Threat Protection Platforms data connector. +type MTPDataConnectorDataTypesIncidents struct { + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` +} - // The metadata from the incident related entities results. - MetaData []*IncidentEntitiesResultsMetadata `json:"metaData,omitempty"` +// MTPDataConnectorProperties - MTP (Microsoft Threat Protection) data connector properties. +type MTPDataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *MTPDataConnectorDataTypes `json:"dataTypes,omitempty"` + + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` } -// 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. - Count *int32 `json:"count,omitempty"` +// MailClusterEntity - Represents a mail cluster entity. +type MailClusterEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // Mail cluster entity properties + Properties *MailClusterEntityProperties `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"` +} + +// 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, + } +} + +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The cluster group + ClusterGroup *string `json:"clusterGroup,omitempty" azure:"ro"` + + // READ-ONLY; The cluster query end time + ClusterQueryEndTime *time.Time `json:"clusterQueryEndTime,omitempty" azure:"ro"` + + // READ-ONLY; The cluster query start time + ClusterQueryStartTime *time.Time `json:"clusterQueryStartTime,omitempty" azure:"ro"` + + // READ-ONLY; The id of the cluster source + ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty" azure:"ro"` + + // READ-ONLY; The type of the cluster source + ClusterSourceType *string `json:"clusterSourceType,omitempty" azure:"ro"` + + // READ-ONLY; Count of mail messages by DeliveryStatus string representation + CountByDeliveryStatus interface{} `json:"countByDeliveryStatus,omitempty" azure:"ro"` + + // READ-ONLY; Count of mail messages by ProtectionStatus string representation + CountByProtectionStatus interface{} `json:"countByProtectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Count of mail messages by ThreatType string representation + CountByThreatType interface{} `json:"countByThreatType,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Is this a volume anomaly mail cluster + IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty" azure:"ro"` + + // READ-ONLY; The number of mail messages that are part of the mail cluster + MailCount *int32 `json:"mailCount,omitempty" azure:"ro"` + + // READ-ONLY; The mail message IDs that are part of the mail cluster + NetworkMessageIDs []*string `json:"networkMessageIds,omitempty" azure:"ro"` + + // READ-ONLY; The query that was used to identify the messages of the mail cluster + Query *string `json:"query,omitempty" azure:"ro"` + + // READ-ONLY; The query time + QueryTime *time.Time `json:"queryTime,omitempty" azure:"ro"` + + // READ-ONLY; The source of the mail cluster (default is 'O365 ATP') + Source *string `json:"source,omitempty" azure:"ro"` + + // READ-ONLY; The threats of mail messages that are part of the mail cluster + Threats []*string `json:"threats,omitempty" azure:"ro"` +} + +// MailMessageEntity - Represents a mail message entity. +type MailMessageEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` + + // Mail message entity properties + Properties *MailMessageEntityProperties `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"` +} + +// 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, + } +} + +// MailMessageEntityProperties - Mail message entity property bag. +type MailMessageEntityProperties struct { + // The directionality of this mail message + AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` + + // The bodyFingerprintBin1 + BodyFingerprintBin1 *int32 `json:"bodyFingerprintBin1,omitempty"` + + // The bodyFingerprintBin2 + BodyFingerprintBin2 *int32 `json:"bodyFingerprintBin2,omitempty"` + + // The bodyFingerprintBin3 + BodyFingerprintBin3 *int32 `json:"bodyFingerprintBin3,omitempty"` + + // The bodyFingerprintBin4 + BodyFingerprintBin4 *int32 `json:"bodyFingerprintBin4,omitempty"` + + // The bodyFingerprintBin5 + BodyFingerprintBin5 *int32 `json:"bodyFingerprintBin5,omitempty"` + + // The delivery action of this mail message like Delivered, Blocked, Replaced etc + DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + + // The delivery location of this mail message like Inbox, JunkFolder etc + DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + + // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + + // READ-ONLY; The File entity ids of this mail message's attachments + FileEntityIDs []*string `json:"fileEntityIds,omitempty" azure:"ro"` + + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; The internet message id of this mail message + InternetMessageID *string `json:"internetMessageId,omitempty" azure:"ro"` + + // READ-ONLY; The language of this mail message + Language *string `json:"language,omitempty" azure:"ro"` + + // READ-ONLY; The network message id of this mail message + NetworkMessageID *string `json:"networkMessageId,omitempty" azure:"ro"` + + // READ-ONLY; The p1 sender's email address + P1Sender *string `json:"p1Sender,omitempty" azure:"ro"` + + // READ-ONLY; The p1 sender's display name + P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty" azure:"ro"` + + // READ-ONLY; The p1 sender's domain + P1SenderDomain *string `json:"p1SenderDomain,omitempty" azure:"ro"` - // REQUIRED; The kind of the aggregated entity. - EntityKind *EntityKindEnum `json:"entityKind,omitempty"` -} + // READ-ONLY; The p2 sender's email address + P2Sender *string `json:"p2Sender,omitempty" azure:"ro"` -// IncidentInfo - Describes related incident information for the bookmark -type IncidentInfo struct { - // Incident Id - IncidentID *string `json:"incidentId,omitempty"` + // READ-ONLY; The p2 sender's display name + P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty" azure:"ro"` - // Relation Name - RelationName *string `json:"relationName,omitempty"` + // READ-ONLY; The p2 sender's domain + P2SenderDomain *string `json:"p2SenderDomain,omitempty" azure:"ro"` - // The severity of the incident - Severity *IncidentSeverity `json:"severity,omitempty"` + // READ-ONLY; The receive date of this message + ReceiveDate *time.Time `json:"receiveDate,omitempty" azure:"ro"` - // The title of the incident - Title *string `json:"title,omitempty"` -} + // READ-ONLY; The recipient of this mail message. Note that in case of multiple recipients the mail message is forked and + // each copy has one recipient + Recipient *string `json:"recipient,omitempty" azure:"ro"` -// IncidentLabel - Represents an incident label -type IncidentLabel struct { - // REQUIRED; The name of the label - LabelName *string `json:"labelName,omitempty"` + // READ-ONLY; The sender's IP address + SenderIP *string `json:"senderIP,omitempty" azure:"ro"` - // READ-ONLY; The type of the label - LabelType *IncidentLabelType `json:"labelType,omitempty" azure:"ro"` -} + // READ-ONLY; The subject of this mail message + Subject *string `json:"subject,omitempty" azure:"ro"` -// IncidentList - List all the incidents. -type IncidentList struct { - // REQUIRED; Array of incidents. - Value []*Incident `json:"value,omitempty"` + // READ-ONLY; The threat detection methods + ThreatDetectionMethods []*string `json:"threatDetectionMethods,omitempty" azure:"ro"` - // READ-ONLY; URL to fetch the next set of incidents. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + // READ-ONLY; The threats of this mail message + Threats []*string `json:"threats,omitempty" azure:"ro"` + + // READ-ONLY; The Urls contained in this mail message + Urls []*string `json:"urls,omitempty" azure:"ro"` } -// IncidentOwnerInfo - Information on the user an incident is assigned to -type IncidentOwnerInfo struct { - // The name of the user the incident is assigned to. - AssignedTo *string `json:"assignedTo,omitempty"` +// MailboxEntity - Represents a mailbox entity. +type MailboxEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` - // The email of the user the incident is assigned to. - Email *string `json:"email,omitempty"` + // Mailbox entity properties + Properties *MailboxEntityProperties `json:"properties,omitempty"` - // The object id of the user the incident is assigned to. - ObjectID *string `json:"objectId,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"` - // The user principal name of the user the incident is assigned to. - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` -// IncidentOwnerInfoAutoGenerated - Information on the user an incident is assigned to -type IncidentOwnerInfoAutoGenerated struct { - // The name of the user the incident is assigned to. - AssignedTo *string `json:"assignedTo,omitempty"` + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // The email of the user the incident is assigned to. - Email *string `json:"email,omitempty"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} - // The object id of the user the incident is assigned to. - ObjectID *string `json:"objectId,omitempty"` +// 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, + } +} - // The type of the owner the incident is assigned to. - OwnerType *OwnerType `json:"ownerType,omitempty"` +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` - // The user principal name of the user the incident is assigned to. - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} + // READ-ONLY; The mailbox's display name + DisplayName *string `json:"displayName,omitempty" azure:"ro"` -// IncidentProperties - Describes incident properties -type IncidentProperties struct { - // REQUIRED; The severity of the incident - Severity *IncidentSeverity `json:"severity,omitempty"` + // READ-ONLY; The AzureAD identifier of mailbox. Similar to AadUserId in account entity but this property is specific to mailbox + // object on office side + ExternalDirectoryObjectID *string `json:"externalDirectoryObjectId,omitempty" azure:"ro"` - // REQUIRED; The status of the incident - Status *IncidentStatus `json:"status,omitempty"` + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` - // REQUIRED; The title of the incident - Title *string `json:"title,omitempty"` + // READ-ONLY; The mailbox's primary address + MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty" azure:"ro"` - // The reason the incident was closed - Classification *IncidentClassification `json:"classification,omitempty"` + // READ-ONLY; The mailbox's UPN + Upn *string `json:"upn,omitempty" azure:"ro"` +} - // Describes the reason the incident was closed - ClassificationComment *string `json:"classificationComment,omitempty"` +// MalwareEntity - Represents a malware entity. +type MalwareEntity struct { + // REQUIRED; The kind of the entity. + Kind *EntityKind `json:"kind,omitempty"` - // The classification reason the incident was closed with - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` + // File entity properties + Properties *MalwareEntityProperties `json:"properties,omitempty"` - // The description of the incident - Description *string `json:"description,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"` - // The time of the first activity in the incident - FirstActivityTimeUTC *time.Time `json:"firstActivityTimeUtc,omitempty"` + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` - // List of labels relevant to this incident - Labels []*IncidentLabel `json:"labels,omitempty"` + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // The time of the last activity in the incident - LastActivityTimeUTC *time.Time `json:"lastActivityTimeUtc,omitempty"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} - // Describes a user that the incident is assigned to - Owner *IncidentOwnerInfo `json:"owner,omitempty"` +// 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, + } +} - // READ-ONLY; Additional data on the incident - AdditionalData *IncidentAdditionalData `json:"additionalData,omitempty" azure:"ro"` +// 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. + AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` - // READ-ONLY; The time the incident was created - CreatedTimeUTC *time.Time `json:"createdTimeUtc,omitempty" azure:"ro"` + // READ-ONLY; The malware category by the vendor, e.g. Trojan + Category *string `json:"category,omitempty" azure:"ro"` - // READ-ONLY; A sequential number - IncidentNumber *int32 `json:"incidentNumber,omitempty" azure:"ro"` + // READ-ONLY; List of linked file entity identifiers on which the malware was found + FileEntityIDs []*string `json:"fileEntityIds,omitempty" azure:"ro"` - // READ-ONLY; The deep-link url to the incident in Azure portal - IncidentURL *string `json:"incidentUrl,omitempty" azure:"ro"` + // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property + // is optional and might be system generated. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` - // READ-ONLY; The last time the incident was updated - LastModifiedTimeUTC *time.Time `json:"lastModifiedTimeUtc,omitempty" azure:"ro"` + // READ-ONLY; The malware name by the vendor, e.g. Win32/Toga!rfn + MalwareName *string `json:"malwareName,omitempty" azure:"ro"` - // READ-ONLY; List of resource ids of Analytic rules related to the incident - RelatedAnalyticRuleIDs []*string `json:"relatedAnalyticRuleIds,omitempty" azure:"ro"` + // READ-ONLY; List of linked process entity identifiers on which the malware was found. + ProcessEntityIDs []*string `json:"processEntityIds,omitempty" azure:"ro"` } -type IncidentPropertiesAction struct { - // The reason the incident was closed - Classification *IncidentClassification `json:"classification,omitempty"` - - // Describes the reason the incident was closed - ClassificationComment *string `json:"classificationComment,omitempty"` +type ManualTriggerRequestBody struct { + LogicAppsResourceID *string `json:"logicAppsResourceId,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} - // The classification reason the incident was closed with - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` +// MetadataAuthor - Publisher or creator of the content item. +type MetadataAuthor struct { + // Email of author contact + Email *string `json:"email,omitempty"` - // List of labels to add to the incident - Labels []*IncidentLabel `json:"labels,omitempty"` + // Link for author/vendor page + Link *string `json:"link,omitempty"` - // Information on the user an incident is assigned to - Owner *IncidentOwnerInfoAutoGenerated `json:"owner,omitempty"` + // Name of the author. Company or person. + Name *string `json:"name,omitempty"` +} - // The severity of the incident - Severity *IncidentSeverity `json:"severity,omitempty"` +// MetadataCategories - ies for the solution content item +type MetadataCategories struct { + // domain for the solution content item + Domains []*string `json:"domains,omitempty"` - // The status of the incident - Status *IncidentStatus `json:"status,omitempty"` + // Industry verticals for the solution content item + Verticals []*string `json:"verticals,omitempty"` } -// IncidentRelationsClientCreateOrUpdateOptions contains the optional parameters for the IncidentRelationsClient.CreateOrUpdate -// method. -type IncidentRelationsClientCreateOrUpdateOptions struct { +// MetadataClientCreateOptions contains the optional parameters for the MetadataClient.Create method. +type MetadataClientCreateOptions struct { // placeholder for future optional parameters } -// IncidentRelationsClientDeleteOptions contains the optional parameters for the IncidentRelationsClient.Delete method. -type IncidentRelationsClientDeleteOptions struct { +// MetadataClientDeleteOptions contains the optional parameters for the MetadataClient.Delete method. +type MetadataClientDeleteOptions struct { // placeholder for future optional parameters } -// IncidentRelationsClientGetOptions contains the optional parameters for the IncidentRelationsClient.Get method. -type IncidentRelationsClientGetOptions struct { +// MetadataClientGetOptions contains the optional parameters for the MetadataClient.Get method. +type MetadataClientGetOptions struct { // placeholder for future optional parameters } -// IncidentRelationsClientListOptions contains the optional parameters for the IncidentRelationsClient.List method. -type IncidentRelationsClientListOptions struct { +// MetadataClientListOptions contains the optional parameters for the MetadataClient.List method. +type MetadataClientListOptions struct { // Filters the results, based on a Boolean condition. Optional. Filter *string // Sorts the results. Optional. Orderby *string - // 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 + // Used to skip n elements in the OData query (offset). Returns a nextLink to the next page of results if there are any left. + Skip *int32 // Returns only the first n results. Optional. Top *int32 } -// IncidentsClientCreateOrUpdateOptions contains the optional parameters for the IncidentsClient.CreateOrUpdate method. -type IncidentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// IncidentsClientDeleteOptions contains the optional parameters for the IncidentsClient.Delete method. -type IncidentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// IncidentsClientGetOptions contains the optional parameters for the IncidentsClient.Get method. -type IncidentsClientGetOptions struct { +// MetadataClientUpdateOptions contains the optional parameters for the MetadataClient.Update method. +type MetadataClientUpdateOptions struct { // placeholder for future optional parameters } -// IncidentsClientListAlertsOptions contains the optional parameters for the IncidentsClient.ListAlerts method. -type IncidentsClientListAlertsOptions struct { - // placeholder for future optional parameters -} +// MetadataDependencies - 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 dependencies. +type MetadataDependencies struct { + // Id of the content item we depend on + ContentID *string `json:"contentId,omitempty"` -// IncidentsClientListBookmarksOptions contains the optional parameters for the IncidentsClient.ListBookmarks method. -type IncidentsClientListBookmarksOptions struct { - // placeholder for future optional parameters -} + // This is the list of dependencies we must fulfill, according to the AND/OR operator + Criteria []*MetadataDependencies `json:"criteria,omitempty"` -// IncidentsClientListEntitiesOptions contains the optional parameters for the IncidentsClient.ListEntities method. -type IncidentsClientListEntitiesOptions struct { - // placeholder for future optional parameters -} + // Type of the content item we depend on + Kind *Kind `json:"kind,omitempty"` -// IncidentsClientListOptions contains the optional parameters for the IncidentsClient.List method. -type IncidentsClientListOptions struct { - // Filters the results, based on a Boolean condition. Optional. - Filter *string - // Sorts the results. Optional. - Orderby *string - // 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 - // Returns only the first n results. Optional. - Top *int32 + // Name of the content item + Name *string `json:"name,omitempty"` + + // Operator used for list of dependencies in criteria array. + Operator *Operator `json:"operator,omitempty"` + + // Version of the the content item we depend on. Can be blank, * or missing to indicate any version fulfills the dependency. + // If version does not match our defined numeric format then an exact match is + // required. + Version *string `json:"version,omitempty"` } -// IoTDeviceEntity - Represents an IoT device entity. -type IoTDeviceEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// MetadataList - List of all the metadata. +type MetadataList struct { + // REQUIRED; Array of metadata. + Value []*MetadataModel `json:"value,omitempty"` - // IoTDevice entity properties - Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` + // READ-ONLY; URL to fetch the next page of metadata. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// MetadataModel - Metadata resource definition. +type MetadataModel struct { + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Metadata properties + Properties *MetadataProperties `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"` @@ -1983,184 +5340,199 @@ 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, - } +// MetadataPatch - Metadata patch request body. +type MetadataPatch struct { + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Metadata patch request body + Properties *MetadataPropertiesPatch `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"` } -// 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. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` +// MetadataProperties - Metadata property bag. +type MetadataProperties struct { + // REQUIRED; The kind of content the metadata is for. + Kind *Kind `json:"kind,omitempty"` - // READ-ONLY; The ID of the IoT Device in the IoT Hub - DeviceID *string `json:"deviceId,omitempty" azure:"ro"` + // REQUIRED; Full parent resource ID of the content item the metadata is for. This is the full resource ID including the scope + // (subscription and resource group) + ParentID *string `json:"parentId,omitempty"` - // READ-ONLY; The friendly name of the device - DeviceName *string `json:"deviceName,omitempty" azure:"ro"` + // The creator of the content item. + Author *MetadataAuthor `json:"author,omitempty"` - // READ-ONLY; The type of the device - DeviceType *string `json:"deviceType,omitempty" azure:"ro"` + // Categories for the solution content item + Categories *MetadataCategories `json:"categories,omitempty"` - // READ-ONLY; The ID of the edge device - EdgeID *string `json:"edgeId,omitempty" azure:"ro"` + // Static ID for the content. Used to identify dependencies and content from solutions or community. Hard-coded/static for + // out of the box content and solutions. Dynamic for user-created. This is the + // resource name + ContentID *string `json:"contentId,omitempty"` - // READ-ONLY; The firmware version of the device - FirmwareVersion *string `json:"firmwareVersion,omitempty" azure:"ro"` + // Schema version of the content. Can be used to distinguish between different flow based on the schema version + ContentSchemaVersion *string `json:"contentSchemaVersion,omitempty"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + // The custom version of the content. A optional free text + CustomVersion *string `json:"customVersion,omitempty"` - // READ-ONLY; The Host entity id of this device - HostEntityID *string `json:"hostEntityId,omitempty" azure:"ro"` + // 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. + Dependencies *MetadataDependencies `json:"dependencies,omitempty"` - // READ-ONLY; The IP entity if of this device - IPAddressEntityID *string `json:"ipAddressEntityId,omitempty" azure:"ro"` + // first publish date solution content item + FirstPublishDate *time.Time `json:"firstPublishDate,omitempty"` - // READ-ONLY; The AzureResource entity id of the IoT Hub - IotHubEntityID *string `json:"iotHubEntityId,omitempty" azure:"ro"` + // the icon identifier. this id can later be fetched from the solution template + Icon *string `json:"icon,omitempty"` - // READ-ONLY; The ID of the security agent running on the device - IotSecurityAgentID *string `json:"iotSecurityAgentId,omitempty" azure:"ro"` + // last publish date for the solution content item + LastPublishDate *time.Time `json:"lastPublishDate,omitempty"` - // READ-ONLY; The MAC address of the device - MacAddress *string `json:"macAddress,omitempty" azure:"ro"` + // preview image file names. These will be taken from the solution artifacts + PreviewImages []*string `json:"previewImages,omitempty"` - // READ-ONLY; The model of the device - Model *string `json:"model,omitempty" azure:"ro"` + // preview image file names. These will be taken from the solution artifacts. used for dark theme support + PreviewImagesDark []*string `json:"previewImagesDark,omitempty"` - // READ-ONLY; The operating system of the device - OperatingSystem *string `json:"operatingSystem,omitempty" azure:"ro"` + // Providers for the solution content item + Providers []*string `json:"providers,omitempty"` - // READ-ONLY; A list of protocols of the IoTDevice entity. - Protocols []*string `json:"protocols,omitempty" azure:"ro"` + // Source of the content. This is where/how it was created. + Source *MetadataSource `json:"source,omitempty"` - // READ-ONLY; The serial number of the device - SerialNumber *string `json:"serialNumber,omitempty" azure:"ro"` + // Support information for the metadata - type, name, contact information + Support *MetadataSupport `json:"support,omitempty"` - // READ-ONLY; The source of the device - Source *string `json:"source,omitempty" azure:"ro"` + // the tactics the resource covers + ThreatAnalysisTactics []*string `json:"threatAnalysisTactics,omitempty"` - // READ-ONLY; A list of TI contexts attached to the IoTDevice entity. - ThreatIntelligence []*ThreatIntelligence `json:"threatIntelligence,omitempty" azure:"ro"` + // the techniques the resource covers, these have to be aligned with the tactics being used + ThreatAnalysisTechniques []*string `json:"threatAnalysisTechniques,omitempty"` - // READ-ONLY; The vendor of the device - Vendor *string `json:"vendor,omitempty" azure:"ro"` + // 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"` } -// MCASDataConnector - Represents MCAS (Microsoft Cloud App Security) data connector. -type MCASDataConnector struct { - // REQUIRED; The data connector kind - Kind *DataConnectorKind `json:"kind,omitempty"` +// MetadataPropertiesPatch - Metadata property bag for patch requests. This is the same as the MetadataProperties, but with +// nothing required +type MetadataPropertiesPatch struct { + // The creator of the content item. + Author *MetadataAuthor `json:"author,omitempty"` - // Etag of the azure resource - Etag *string `json:"etag,omitempty"` + // Categories for the solution content item + Categories *MetadataCategories `json:"categories,omitempty"` - // MCAS (Microsoft Cloud App Security) data connector properties. - Properties *MCASDataConnectorProperties `json:"properties,omitempty"` + // Static ID for the content. Used to identify dependencies and content from solutions or community. Hard-coded/static for + // out of the box content and solutions. Dynamic for user-created. This is the + // resource name + ContentID *string `json:"contentId,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"` + // Schema version of the content. Can be used to distinguish between different flow based on the schema version + ContentSchemaVersion *string `json:"contentSchemaVersion,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The custom version of the content. A optional free text + CustomVersion *string `json:"customVersion,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // 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. + Dependencies *MetadataDependencies `json:"dependencies,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} + // first publish date solution content item + FirstPublishDate *time.Time `json:"firstPublishDate,omitempty"` -// 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, - } -} + // the icon identifier. this id can later be fetched from the solution template + Icon *string `json:"icon,omitempty"` -// MCASDataConnectorDataTypes - The available data types for MCAS (Microsoft Cloud App Security) data connector. -type MCASDataConnectorDataTypes struct { - // Alerts data type connection. - Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` + // The kind of content the metadata is for. + Kind *Kind `json:"kind,omitempty"` - // Discovery log data type connection. - DiscoveryLogs *DataConnectorDataTypeCommon `json:"discoveryLogs,omitempty"` -} + // last publish date for the solution content item + LastPublishDate *time.Time `json:"lastPublishDate,omitempty"` -// MCASDataConnectorProperties - MCAS (Microsoft Cloud App Security) data connector properties. -type MCASDataConnectorProperties struct { - // The available data types for the connector. - DataTypes *MCASDataConnectorDataTypes `json:"dataTypes,omitempty"` + // Full parent resource ID of the content item the metadata is for. This is the full resource ID including the scope (subscription + // and resource group) + ParentID *string `json:"parentId,omitempty"` - // The tenant id to connect to, and get the data from. - TenantID *string `json:"tenantId,omitempty"` -} + // preview image file names. These will be taken from the solution artifacts + PreviewImages []*string `json:"previewImages,omitempty"` -// MDATPDataConnector - Represents MDATP (Microsoft Defender Advanced Threat Protection) data connector. -type MDATPDataConnector struct { - // REQUIRED; The data connector kind - Kind *DataConnectorKind `json:"kind,omitempty"` + // preview image file names. These will be taken from the solution artifacts. used for dark theme support + PreviewImagesDark []*string `json:"previewImagesDark,omitempty"` - // Etag of the azure resource - Etag *string `json:"etag,omitempty"` + // Providers for the solution content item + Providers []*string `json:"providers,omitempty"` - // MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. - Properties *MDATPDataConnectorProperties `json:"properties,omitempty"` + // Source of the content. This is where/how it was created. + Source *MetadataSource `json:"source,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"` + // Support information for the metadata - type, name, contact information + Support *MetadataSupport `json:"support,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // the tactics the resource covers + ThreatAnalysisTactics []*string `json:"threatAnalysisTactics,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // the techniques the resource covers, these have to be aligned with the tactics being used + ThreatAnalysisTechniques []*string `json:"threatAnalysisTechniques,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // 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"` } -// 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, - } +// MetadataSource - The original source of the content item, where it comes from. +type MetadataSource struct { + // REQUIRED; Source type of the content + Kind *SourceKind `json:"kind,omitempty"` + + // Name of the content source. The repo name, solution name, LA workspace name etc. + Name *string `json:"name,omitempty"` + + // ID of the content source. The solution ID, workspace ID, etc + SourceID *string `json:"sourceId,omitempty"` } -// MDATPDataConnectorProperties - MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. -type MDATPDataConnectorProperties struct { - // The available data types for the connector. - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +// MetadataSupport - Support information for the content item. +type MetadataSupport struct { + // REQUIRED; Type of support for content item + Tier *SupportTier `json:"tier,omitempty"` - // The tenant id to connect to, and get the data from. - TenantID *string `json:"tenantId,omitempty"` + // Email of support contact + Email *string `json:"email,omitempty"` + + // Link for support help, like to support page to open a ticket etc. + Link *string `json:"link,omitempty"` + + // Name of the support contact. Company or person. + Name *string `json:"name,omitempty"` } -// MailClusterEntity - Represents a mail cluster entity. -type MailClusterEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// MicrosoftSecurityIncidentCreationAlertRule - Represents MicrosoftSecurityIncidentCreation rule. +type MicrosoftSecurityIncidentCreationAlertRule struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` - // Mail cluster entity properties - Properties *MailClusterEntityProperties `json:"properties,omitempty"` + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // MicrosoftSecurityIncidentCreation rule properties + Properties *MicrosoftSecurityIncidentCreationAlertRuleProperties `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"` @@ -2175,10 +5547,11 @@ 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{ +// 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, @@ -2186,68 +5559,58 @@ func (m *MailClusterEntity) GetEntity() *Entity { } } -// 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. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` - - // READ-ONLY; The cluster group - ClusterGroup *string `json:"clusterGroup,omitempty" azure:"ro"` - - // READ-ONLY; The cluster query end time - ClusterQueryEndTime *time.Time `json:"clusterQueryEndTime,omitempty" azure:"ro"` - - // READ-ONLY; The cluster query start time - ClusterQueryStartTime *time.Time `json:"clusterQueryStartTime,omitempty" azure:"ro"` - - // READ-ONLY; The id of the cluster source - ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty" azure:"ro"` - - // READ-ONLY; The type of the cluster source - ClusterSourceType *string `json:"clusterSourceType,omitempty" azure:"ro"` +// MicrosoftSecurityIncidentCreationAlertRuleCommonProperties - MicrosoftSecurityIncidentCreation rule common property bag. +type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties struct { + // REQUIRED; The alerts' productName on which the cases will be generated + ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` - // READ-ONLY; Count of mail messages by DeliveryStatus string representation - CountByDeliveryStatus interface{} `json:"countByDeliveryStatus,omitempty" azure:"ro"` + // the alerts' displayNames on which the cases will not be generated + DisplayNamesExcludeFilter []*string `json:"displayNamesExcludeFilter,omitempty"` - // READ-ONLY; Count of mail messages by ProtectionStatus string representation - CountByProtectionStatus interface{} `json:"countByProtectionStatus,omitempty" azure:"ro"` + // the alerts' displayNames on which the cases will be generated + DisplayNamesFilter []*string `json:"displayNamesFilter,omitempty"` - // READ-ONLY; Count of mail messages by ThreatType string representation - CountByThreatType interface{} `json:"countByThreatType,omitempty" azure:"ro"` + // the alerts' severities on which the cases will be generated + SeveritiesFilter []*AlertSeverity `json:"severitiesFilter,omitempty"` +} - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` +// MicrosoftSecurityIncidentCreationAlertRuleProperties - MicrosoftSecurityIncidentCreation rule property bag. +type MicrosoftSecurityIncidentCreationAlertRuleProperties struct { + // REQUIRED; The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` - // READ-ONLY; Is this a volume anomaly mail cluster - IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty" azure:"ro"` + // REQUIRED; Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` - // READ-ONLY; The number of mail messages that are part of the mail cluster - MailCount *int32 `json:"mailCount,omitempty" azure:"ro"` + // REQUIRED; The alerts' productName on which the cases will be generated + ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` - // READ-ONLY; The mail message IDs that are part of the mail cluster - NetworkMessageIDs []*string `json:"networkMessageIds,omitempty" azure:"ro"` + // The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - // READ-ONLY; The query that was used to identify the messages of the mail cluster - Query *string `json:"query,omitempty" azure:"ro"` + // The description of the alert rule. + Description *string `json:"description,omitempty"` - // READ-ONLY; The query time - QueryTime *time.Time `json:"queryTime,omitempty" azure:"ro"` + // the alerts' displayNames on which the cases will not be generated + DisplayNamesExcludeFilter []*string `json:"displayNamesExcludeFilter,omitempty"` - // READ-ONLY; The source of the mail cluster (default is 'O365 ATP') - Source *string `json:"source,omitempty" azure:"ro"` + // the alerts' displayNames on which the cases will be generated + DisplayNamesFilter []*string `json:"displayNamesFilter,omitempty"` - // READ-ONLY; The threats of mail messages that are part of the mail cluster - Threats []*string `json:"threats,omitempty" azure:"ro"` -} + // the alerts' severities on which the cases will be generated + SeveritiesFilter []*AlertSeverity `json:"severitiesFilter,omitempty"` -// MailMessageEntity - Represents a mail message entity. -type MailMessageEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + // READ-ONLY; The last time that this alert has been modified. + LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` +} - // Mail message entity properties - Properties *MailMessageEntityProperties `json:"properties,omitempty"` +// MicrosoftSecurityIncidentCreationAlertRuleTemplate - Represents MicrosoftSecurityIncidentCreation rule template. +type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` + + // MicrosoftSecurityIncidentCreation rule template properties + Properties *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `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"` @@ -2262,9 +5625,9 @@ 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{ +// GetAlertRuleTemplate implements the AlertRuleTemplateClassification interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplate) GetAlertRuleTemplate() *AlertRuleTemplate { + return &AlertRuleTemplate{ Kind: m.Kind, ID: m.ID, Name: m.Name, @@ -2273,99 +5636,152 @@ func (m *MailMessageEntity) GetEntity() *Entity { } } -// MailMessageEntityProperties - Mail message entity property bag. -type MailMessageEntityProperties struct { - // The directionality of this mail message - AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` +// MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - MicrosoftSecurityIncidentCreation rule template properties +type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { + // the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` - // The bodyFingerprintBin1 - BodyFingerprintBin1 *int32 `json:"bodyFingerprintBin1,omitempty"` + // The description of the alert rule template. + Description *string `json:"description,omitempty"` - // The bodyFingerprintBin2 - BodyFingerprintBin2 *int32 `json:"bodyFingerprintBin2,omitempty"` + // The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` - // The bodyFingerprintBin3 - BodyFingerprintBin3 *int32 `json:"bodyFingerprintBin3,omitempty"` + // the alerts' displayNames on which the cases will not be generated + DisplayNamesExcludeFilter []*string `json:"displayNamesExcludeFilter,omitempty"` - // The bodyFingerprintBin4 - BodyFingerprintBin4 *int32 `json:"bodyFingerprintBin4,omitempty"` + // the alerts' displayNames on which the cases will be generated + DisplayNamesFilter []*string `json:"displayNamesFilter,omitempty"` - // The bodyFingerprintBin5 - BodyFingerprintBin5 *int32 `json:"bodyFingerprintBin5,omitempty"` + // The alerts' productName on which the cases will be generated + ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` - // The delivery action of this mail message like Delivered, Blocked, Replaced etc - DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` + // The required data sources for this template + RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - // The delivery location of this mail message like Inbox, JunkFolder etc - DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` + // the alerts' severities on which the cases will be generated + SeveritiesFilter []*AlertSeverity `json:"severitiesFilter,omitempty"` - // READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + // The alert rule template status. + Status *TemplateStatus `json:"status,omitempty"` - // READ-ONLY; The File entity ids of this mail message's attachments - FileEntityIDs []*string `json:"fileEntityIds,omitempty" azure:"ro"` + // READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *time.Time `json:"createdDateUTC,omitempty" azure:"ro"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + // READ-ONLY; The last time that this alert rule template has been updated. + LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` +} - // READ-ONLY; The internet message id of this mail message - InternetMessageID *string `json:"internetMessageId,omitempty" azure:"ro"` +// MtpCheckRequirements - Represents MTP (Microsoft Threat Protection) requirements check request. +type MtpCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` - // READ-ONLY; The language of this mail message - Language *string `json:"language,omitempty" azure:"ro"` + // MTP (Microsoft Threat Protection) requirements check properties. + Properties *MTPCheckRequirementsProperties `json:"properties,omitempty"` +} - // READ-ONLY; The network message id of this mail message - NetworkMessageID *string `json:"networkMessageId,omitempty" azure:"ro"` +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type MtpCheckRequirements. +func (m *MtpCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: m.Kind, + } +} - // READ-ONLY; The p1 sender's email address - P1Sender *string `json:"p1Sender,omitempty" azure:"ro"` +// NrtAlertRule - Represents NRT alert rule. +type NrtAlertRule struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` - // READ-ONLY; The p1 sender's display name - P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty" azure:"ro"` + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` - // READ-ONLY; The p1 sender's domain - P1SenderDomain *string `json:"p1SenderDomain,omitempty" azure:"ro"` + // NRT alert rule properties + Properties *NrtAlertRuleProperties `json:"properties,omitempty"` - // READ-ONLY; The p2 sender's email address - P2Sender *string `json:"p2Sender,omitempty" azure:"ro"` + // 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 p2 sender's display name - P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty" azure:"ro"` + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The p2 sender's domain - P2SenderDomain *string `json:"p2SenderDomain,omitempty" azure:"ro"` + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // READ-ONLY; The receive date of this message - ReceiveDate *time.Time `json:"receiveDate,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"` +} - // READ-ONLY; The recipient of this mail message. Note that in case of multiple recipients the mail message is forked and - // each copy has one recipient - Recipient *string `json:"recipient,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, + } +} - // READ-ONLY; The sender's IP address - SenderIP *string `json:"senderIP,omitempty" azure:"ro"` +// NrtAlertRuleProperties - Nrt alert rule base property bag. +type NrtAlertRuleProperties struct { + // REQUIRED; The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` - // READ-ONLY; The subject of this mail message - Subject *string `json:"subject,omitempty" azure:"ro"` + // REQUIRED; Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` - // READ-ONLY; The threat detection methods - ThreatDetectionMethods []*string `json:"threatDetectionMethods,omitempty" azure:"ro"` + // REQUIRED; The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` - // READ-ONLY; The threats of this mail message - Threats []*string `json:"threats,omitempty" azure:"ro"` + // REQUIRED; The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty"` - // READ-ONLY; The Urls contained in this mail message - Urls []*string `json:"urls,omitempty" azure:"ro"` + // 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 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"` } -// MailboxEntity - Represents a mailbox entity. -type MailboxEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` +// NrtAlertRuleTemplate - Represents NRT alert rule template. +type NrtAlertRuleTemplate struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` - // Mailbox entity properties - Properties *MailboxEntityProperties `json:"properties,omitempty"` + // NRT alert rule template properties + Properties *NrtAlertRuleTemplateProperties `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"` @@ -2380,104 +5796,109 @@ 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, +// 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, } } -// 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. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` +// NrtAlertRuleTemplateProperties - NRT alert rule template properties +type NrtAlertRuleTemplateProperties struct { + // The alert details override settings + AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - // READ-ONLY; The mailbox's display name - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + // the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` - // READ-ONLY; The AzureAD identifier of mailbox. Similar to AadUserId in account entity but this property is specific to mailbox - // object on office side - ExternalDirectoryObjectID *string `json:"externalDirectoryObjectId,omitempty" azure:"ro"` + // Dictionary of string key-value pairs of columns to be attached to the alert + CustomDetails map[string]*string `json:"customDetails,omitempty"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + // The description of the alert rule template. + Description *string `json:"description,omitempty"` - // READ-ONLY; The mailbox's primary address - MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty" azure:"ro"` + // The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` - // READ-ONLY; The mailbox's UPN - Upn *string `json:"upn,omitempty" azure:"ro"` -} + // Array of the entity mappings of the alert rule + EntityMappings []*EntityMapping `json:"entityMappings,omitempty"` -// MalwareEntity - Represents a malware entity. -type MalwareEntity struct { - // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + // The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` - // File entity properties - Properties *MalwareEntityProperties `json:"properties,omitempty"` + // The required data sources for this template + RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,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"` + // The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The alert rule template status. + Status *TemplateStatus `json:"status,omitempty"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // The tactics of the alert rule + Tactics []*AttackTactic `json:"tactics,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` -} + // The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty"` -// 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, - } -} + // The version of this template - in format , where all are numbers. For example . + Version *string `json:"version,omitempty"` -// 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. - AdditionalData map[string]interface{} `json:"additionalData,omitempty" azure:"ro"` + // READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *time.Time `json:"createdDateUTC,omitempty" azure:"ro"` - // READ-ONLY; The malware category by the vendor, e.g. Trojan - Category *string `json:"category,omitempty" azure:"ro"` + // READ-ONLY; The last time that this alert rule template has been updated. + LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` +} - // READ-ONLY; List of linked file entity identifiers on which the malware was found - FileEntityIDs []*string `json:"fileEntityIds,omitempty" azure:"ro"` +// Office365ProjectCheckRequirements - Represents Office365 Project requirements check request. +type Office365ProjectCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` - // READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property - // is optional and might be system generated. - FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + // Office365 Project requirements check properties. + Properties *Office365ProjectCheckRequirementsProperties `json:"properties,omitempty"` +} - // READ-ONLY; The malware name by the vendor, e.g. Win32/Toga!rfn - MalwareName *string `json:"malwareName,omitempty" azure:"ro"` +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type Office365ProjectCheckRequirements. +func (o *Office365ProjectCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} + +// Office365ProjectCheckRequirementsProperties - Office365 Project requirements check properties. +type Office365ProjectCheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} - // READ-ONLY; List of linked process entity identifiers on which the malware was found. - ProcessEntityIDs []*string `json:"processEntityIds,omitempty" azure:"ro"` +// Office365ProjectConnectorDataTypes - The available data types for Office Microsoft Project data connector. +type Office365ProjectConnectorDataTypes struct { + // REQUIRED; Logs data type. + Logs *Office365ProjectConnectorDataTypesLogs `json:"logs,omitempty"` } -// MicrosoftSecurityIncidentCreationAlertRule - Represents MicrosoftSecurityIncidentCreation rule. -type MicrosoftSecurityIncidentCreationAlertRule struct { - // REQUIRED; The alert rule kind - Kind *AlertRuleKind `json:"kind,omitempty"` +// Office365ProjectConnectorDataTypesLogs - Logs data type. +type Office365ProjectConnectorDataTypesLogs struct { + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` +} + +// Office365ProjectDataConnector - Represents Office Microsoft Project data connector. +type Office365ProjectDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` // Etag of the azure resource Etag *string `json:"etag,omitempty"` - // MicrosoftSecurityIncidentCreation rule properties - Properties *MicrosoftSecurityIncidentCreationAlertRuleProperties `json:"properties,omitempty"` + // Office Microsoft Project data connector properties. + Properties *Office365ProjectDataConnectorProperties `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"` @@ -2492,70 +5913,59 @@ 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, +// 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, } } -// MicrosoftSecurityIncidentCreationAlertRuleCommonProperties - MicrosoftSecurityIncidentCreation rule common property bag. -type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties struct { - // REQUIRED; The alerts' productName on which the cases will be generated - ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` - - // the alerts' displayNames on which the cases will not be generated - DisplayNamesExcludeFilter []*string `json:"displayNamesExcludeFilter,omitempty"` - - // the alerts' displayNames on which the cases will be generated - DisplayNamesFilter []*string `json:"displayNamesFilter,omitempty"` +// Office365ProjectDataConnectorProperties - Office Microsoft Project data connector properties. +type Office365ProjectDataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *Office365ProjectConnectorDataTypes `json:"dataTypes,omitempty"` - // the alerts' severities on which the cases will be generated - SeveritiesFilter []*AlertSeverity `json:"severitiesFilter,omitempty"` + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` } -// MicrosoftSecurityIncidentCreationAlertRuleProperties - MicrosoftSecurityIncidentCreation rule property bag. -type MicrosoftSecurityIncidentCreationAlertRuleProperties 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 alerts' productName on which the cases will be generated - ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` - - // The Name of the alert rule template used to create this rule. - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - - // The description of the alert rule. - Description *string `json:"description,omitempty"` - - // the alerts' displayNames on which the cases will not be generated - DisplayNamesExcludeFilter []*string `json:"displayNamesExcludeFilter,omitempty"` +// OfficeATPCheckRequirements - Represents OfficeATP (Office 365 Advanced Threat Protection) requirements check request. +type OfficeATPCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` - // the alerts' displayNames on which the cases will be generated - DisplayNamesFilter []*string `json:"displayNamesFilter,omitempty"` + // OfficeATP (Office 365 Advanced Threat Protection) requirements check properties. + Properties *OfficeATPCheckRequirementsProperties `json:"properties,omitempty"` +} - // the alerts' severities on which the cases will be generated - SeveritiesFilter []*AlertSeverity `json:"severitiesFilter,omitempty"` +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficeATPCheckRequirements. +func (o *OfficeATPCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} - // READ-ONLY; The last time that this alert has been modified. - LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` +// 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. + TenantID *string `json:"tenantId,omitempty"` } -// MicrosoftSecurityIncidentCreationAlertRuleTemplate - Represents MicrosoftSecurityIncidentCreation rule template. -type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { - // REQUIRED; The alert rule kind - Kind *AlertRuleKind `json:"kind,omitempty"` +// OfficeATPDataConnector - Represents OfficeATP (Office 365 Advanced Threat Protection) data connector. +type OfficeATPDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` - // MicrosoftSecurityIncidentCreation rule template properties - Properties *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `json:"properties,omitempty"` + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // OfficeATP (Office 365 Advanced Threat Protection) data connector properties. + Properties *OfficeATPDataConnectorProperties `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"` @@ -2570,51 +5980,76 @@ 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, +// 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, } } -// MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - MicrosoftSecurityIncidentCreation rule template properties -type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { - // REQUIRED; The alerts' productName on which the cases will be generated - ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` +// 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. + TenantID *string `json:"tenantId,omitempty"` - // the number of alert rules that were created by this template - AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} - // The description of the alert rule template. - Description *string `json:"description,omitempty"` +// OfficeConsent - Consent for Office365 tenant that already made. +type OfficeConsent struct { + // Office consent properties + Properties *OfficeConsentProperties `json:"properties,omitempty"` - // The display name for alert rule template. - DisplayName *string `json:"displayName,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"` - // the alerts' displayNames on which the cases will not be generated - DisplayNamesExcludeFilter []*string `json:"displayNamesExcludeFilter,omitempty"` + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` - // the alerts' displayNames on which the cases will be generated - DisplayNamesFilter []*string `json:"displayNamesFilter,omitempty"` + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // The required data connectors for this template - RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} - // the alerts' severities on which the cases will be generated - SeveritiesFilter []*AlertSeverity `json:"severitiesFilter,omitempty"` +// OfficeConsentList - List of all the office365 consents. +type OfficeConsentList struct { + // REQUIRED; Array of the consents. + Value []*OfficeConsent `json:"value,omitempty"` - // The alert rule template status. - Status *TemplateStatus `json:"status,omitempty"` + // READ-ONLY; URL to fetch the next set of office consents. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} - // READ-ONLY; The time that this alert rule template has been added. - CreatedDateUTC *time.Time `json:"createdDateUTC,omitempty" azure:"ro"` +// OfficeConsentProperties - Consent property bag. +type OfficeConsentProperties struct { + // Help to easily cascade among the data layers. + ConsentID *string `json:"consentId,omitempty"` - // READ-ONLY; The time that this alert rule template was last updated. - LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` + // The tenantId of the Office365 with the consent. + TenantID *string `json:"tenantId,omitempty"` +} + +// OfficeConsentsClientDeleteOptions contains the optional parameters for the OfficeConsentsClient.Delete method. +type OfficeConsentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// OfficeConsentsClientGetOptions contains the optional parameters for the OfficeConsentsClient.Get method. +type OfficeConsentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OfficeConsentsClientListOptions contains the optional parameters for the OfficeConsentsClient.List method. +type OfficeConsentsClientListOptions struct { + // placeholder for future optional parameters } // OfficeDataConnector - Represents office data connector. @@ -2655,40 +6090,186 @@ func (o *OfficeDataConnector) GetDataConnector() *DataConnector { // OfficeDataConnectorDataTypes - The available data types for office data connector. type OfficeDataConnectorDataTypes struct { - // Exchange data type connection. + // REQUIRED; Exchange data type connection. Exchange *OfficeDataConnectorDataTypesExchange `json:"exchange,omitempty"` - // SharePoint data type connection. + // REQUIRED; SharePoint data type connection. SharePoint *OfficeDataConnectorDataTypesSharePoint `json:"sharePoint,omitempty"` - // Teams data type connection. + // REQUIRED; Teams data type connection. Teams *OfficeDataConnectorDataTypesTeams `json:"teams,omitempty"` } // OfficeDataConnectorDataTypesExchange - Exchange data type connection. type OfficeDataConnectorDataTypesExchange struct { - // Describe whether this data type connection is enabled or not. + // REQUIRED; Describe whether this data type connection is enabled or not. State *DataTypeState `json:"state,omitempty"` } // OfficeDataConnectorDataTypesSharePoint - SharePoint data type connection. type OfficeDataConnectorDataTypesSharePoint struct { - // Describe whether this data type connection is enabled or not. + // REQUIRED; Describe whether this data type connection is enabled or not. State *DataTypeState `json:"state,omitempty"` } // OfficeDataConnectorDataTypesTeams - Teams data type connection. type OfficeDataConnectorDataTypesTeams struct { - // Describe whether this data type connection is enabled or not. + // REQUIRED; Describe whether this data type connection is enabled or not. State *DataTypeState `json:"state,omitempty"` } // OfficeDataConnectorProperties - Office data connector properties. type OfficeDataConnectorProperties struct { - // The available data types for the connector. + // REQUIRED; The available data types for the connector. DataTypes *OfficeDataConnectorDataTypes `json:"dataTypes,omitempty"` - // The tenant id to connect to, and get the data from. + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// OfficeIRMCheckRequirements - Represents OfficeIRM (Microsoft Insider Risk Management) requirements check request. +type OfficeIRMCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // OfficeIRM (Microsoft Insider Risk Management) requirements check properties. + Properties *OfficeIRMCheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficeIRMCheckRequirements. +func (o *OfficeIRMCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} + +// OfficeIRMCheckRequirementsProperties - OfficeIRM (Microsoft Insider Risk Management) requirements check properties. +type OfficeIRMCheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// OfficeIRMDataConnector - Represents OfficeIRM (Microsoft Insider Risk Management) data connector. +type OfficeIRMDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // OfficeIRM (Microsoft Insider Risk Management) data connector properties. + Properties *OfficeIRMDataConnectorProperties `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"` +} + +// 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, + } +} + +// OfficeIRMDataConnectorProperties - OfficeIRM (Microsoft Insider Risk Management) data connector properties. +type OfficeIRMDataConnectorProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` + + // The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// OfficePowerBICheckRequirements - Represents Office PowerBI requirements check request. +type OfficePowerBICheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Office Power BI requirements check properties. + Properties *OfficePowerBICheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type OfficePowerBICheckRequirements. +func (o *OfficePowerBICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: o.Kind, + } +} + +// OfficePowerBICheckRequirementsProperties - Office PowerBI requirements check properties. +type OfficePowerBICheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// OfficePowerBIConnectorDataTypes - The available data types for Office Microsoft PowerBI data connector. +type OfficePowerBIConnectorDataTypes struct { + // REQUIRED; Logs data type. + Logs *OfficePowerBIConnectorDataTypesLogs `json:"logs,omitempty"` +} + +// OfficePowerBIConnectorDataTypesLogs - Logs data type. +type OfficePowerBIConnectorDataTypesLogs struct { + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` +} + +// OfficePowerBIDataConnector - Represents Office Microsoft PowerBI data connector. +type OfficePowerBIDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Office Microsoft PowerBI data connector properties. + Properties *OfficePowerBIDataConnectorProperties `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"` +} + +// 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, + } +} + +// OfficePowerBIDataConnectorProperties - Office Microsoft PowerBI data connector properties. +type OfficePowerBIDataConnectorProperties struct { + // REQUIRED; The available data types for the connector. + DataTypes *OfficePowerBIConnectorDataTypes `json:"dataTypes,omitempty"` + + // REQUIRED; The tenant id to connect to, and get the data from. TenantID *string `json:"tenantId,omitempty"` } @@ -2727,27 +6308,61 @@ type OperationsClientListOptions struct { // placeholder for future optional parameters } -// OperationsList - Lists the operations available in the SecurityInsights RP. -type OperationsList struct { - // REQUIRED; Array of operations - Value []*Operation `json:"value,omitempty"` +// OperationsList - Lists the operations available in the SecurityInsights RP. +type OperationsList struct { + // REQUIRED; Array of operations + Value []*Operation `json:"value,omitempty"` + + // READ-ONLY; URL to fetch the next set of operations. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// Permissions required for the connector +type Permissions struct { + // Customs permissions required for the connector + Customs []*PermissionsCustomsItem `json:"customs,omitempty"` + + // Resource provider permissions required for the connector + ResourceProvider []*PermissionsResourceProviderItem `json:"resourceProvider,omitempty"` +} + +type PermissionsCustomsItem struct { + // Customs permissions description + Description *string `json:"description,omitempty"` + + // Customs permissions name + Name *string `json:"name,omitempty"` +} + +type PermissionsResourceProviderItem struct { + // Permission description text + PermissionsDisplayText *string `json:"permissionsDisplayText,omitempty"` - // READ-ONLY; URL to fetch the next set of operations. - NextLink *string `json:"nextLink,omitempty" azure:"ro"` + // Provider name + Provider *ProviderName `json:"provider,omitempty"` + + // Permission provider display name + ProviderDisplayName *string `json:"providerDisplayName,omitempty"` + + // Required permissions for the connector + RequiredPermissions *RequiredPermissions `json:"requiredPermissions,omitempty"` + + // Permission provider scope + Scope *PermissionProviderScope `json:"scope,omitempty"` } type PlaybookActionProperties struct { - // REQUIRED; The resource id of the playbook resource + // The resource id of the playbook resource. LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` - // The tenant id of the playbook resource + // The tenant id of the playbook resource. TenantID *string `json:"tenantId,omitempty"` } // ProcessEntity - Represents a process entity. type ProcessEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // Process entity properties Properties *ProcessEntityProperties `json:"properties,omitempty"` @@ -2813,6 +6428,55 @@ type ProcessEntityProperties struct { ProcessID *string `json:"processId,omitempty" azure:"ro"` } +// ProductSettingsClientDeleteOptions contains the optional parameters for the ProductSettingsClient.Delete method. +type ProductSettingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProductSettingsClientGetOptions contains the optional parameters for the ProductSettingsClient.Get method. +type ProductSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProductSettingsClientListOptions contains the optional parameters for the ProductSettingsClient.List method. +type ProductSettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// ProductSettingsClientUpdateOptions contains the optional parameters for the ProductSettingsClient.Update method. +type ProductSettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// PropertyArrayChangedConditionProperties - Describes an automation rule condition that evaluates an array property's value +// change +type PropertyArrayChangedConditionProperties struct { + // REQUIRED + ConditionType *ConditionType `json:"conditionType,omitempty"` + ConditionProperties *AutomationRulePropertyArrayChangedValuesCondition `json:"conditionProperties,omitempty"` +} + +// GetAutomationRuleCondition implements the AutomationRuleConditionClassification interface for type PropertyArrayChangedConditionProperties. +func (p *PropertyArrayChangedConditionProperties) GetAutomationRuleCondition() *AutomationRuleCondition { + return &AutomationRuleCondition{ + ConditionType: p.ConditionType, + } +} + +// PropertyChangedConditionProperties - Describes an automation rule condition that evaluates a property's value change +type PropertyChangedConditionProperties struct { + // REQUIRED + ConditionType *ConditionType `json:"conditionType,omitempty"` + ConditionProperties *AutomationRulePropertyValuesChangedCondition `json:"conditionProperties,omitempty"` +} + +// GetAutomationRuleCondition implements the AutomationRuleConditionClassification interface for type PropertyChangedConditionProperties. +func (p *PropertyChangedConditionProperties) GetAutomationRuleCondition() *AutomationRuleCondition { + return &AutomationRuleCondition{ + ConditionType: p.ConditionType, + } +} + // PropertyConditionProperties - Describes an automation rule condition that evaluates a property's value type PropertyConditionProperties struct { // REQUIRED @@ -2827,10 +6491,31 @@ func (p *PropertyConditionProperties) GetAutomationRuleCondition() *AutomationRu } } +// QueryBasedAlertRuleTemplateProperties - Query based alert rule template base property bag. +type QueryBasedAlertRuleTemplateProperties 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 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 version of this template - in format , where all are numbers. For example . + Version *string `json:"version,omitempty"` +} + // RegistryKeyEntity - Represents a registry key entity. type RegistryKeyEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // RegistryKey entity properties Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` @@ -2878,7 +6563,7 @@ type RegistryKeyEntityProperties struct { // RegistryValueEntity - Represents a registry value entity. type RegistryValueEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // RegistryKey entity properties Properties *RegistryValueEntityProperties `json:"properties,omitempty"` @@ -2975,6 +6660,72 @@ type RelationProperties struct { RelatedResourceType *string `json:"relatedResourceType,omitempty" azure:"ro"` } +// Repo - Represents a repository. +type Repo struct { + // Array of branches. + Branches []*string `json:"branches,omitempty"` + + // The name of the repository. + FullName *string `json:"fullName,omitempty"` + + // The url to access the repository. + URL *string `json:"url,omitempty"` +} + +// RepoList - List all the source controls. +type RepoList struct { + // REQUIRED; Array of repositories. + Value []*Repo `json:"value,omitempty"` + + // READ-ONLY; URL to fetch the next set of repositories. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// Repository - metadata of a repository. +type Repository struct { + // Branch name of repository. + Branch *string `json:"branch,omitempty"` + + // Url to access repository action logs. + DeploymentLogsURL *string `json:"deploymentLogsUrl,omitempty"` + + // Display url of repository. + DisplayURL *string `json:"displayUrl,omitempty"` + + // Dictionary of source control content type and path mapping. + PathMapping []*ContentPathMap `json:"pathMapping,omitempty"` + + // Url of repository. + URL *string `json:"url,omitempty"` +} + +// 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 +type RequiredPermissions struct { + // action permission + Action *bool `json:"action,omitempty"` + + // delete permission + Delete *bool `json:"delete,omitempty"` + + // read permission + Read *bool `json:"read,omitempty"` + + // write permission + Write *bool `json:"write,omitempty"` +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -2990,6 +6741,24 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ResourceProvider - Resource provider permissions required for the connector +type ResourceProvider struct { + // Permission description text + PermissionsDisplayText *string `json:"permissionsDisplayText,omitempty"` + + // Provider name + Provider *ProviderName `json:"provider,omitempty"` + + // Permission provider display name + ProviderDisplayName *string `json:"providerDisplayName,omitempty"` + + // Required permissions for the connector + RequiredPermissions *RequiredPermissions `json:"requiredPermissions,omitempty"` + + // Permission provider scope + Scope *PermissionProviderScope `json:"scope,omitempty"` +} + // ResourceWithEtag - An azure resource object with an Etag property type ResourceWithEtag struct { // Etag of the azure resource @@ -3008,9 +6777,18 @@ type ResourceWithEtag struct { Type *string `json:"type,omitempty" azure:"ro"` } +// SampleQueries - The sample queries for the connector +type SampleQueries struct { + // The sample query description + Description *string `json:"description,omitempty"` + + // the sample query + Query *string `json:"query,omitempty"` +} + // ScheduledAlertRule - Represents scheduled alert rule. type ScheduledAlertRule struct { - // REQUIRED; The alert rule kind + // REQUIRED; The kind of the alert rule Kind *AlertRuleKind `json:"kind,omitempty"` // Etag of the azure resource @@ -3127,6 +6905,9 @@ type ScheduledAlertRuleProperties struct { // 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"` @@ -3142,7 +6923,7 @@ type ScheduledAlertRuleProperties struct { // ScheduledAlertRuleTemplate - Represents scheduled alert rule template. type ScheduledAlertRuleTemplate struct { - // REQUIRED; The alert rule kind + // REQUIRED; The kind of the alert rule Kind *AlertRuleKind `json:"kind,omitempty"` // Scheduled alert rule template properties @@ -3216,6 +6997,9 @@ type ScheduledAlertRuleTemplateProperties struct { // The tactics of the alert rule template Tactics []*AttackTactic `json:"tactics,omitempty"` + // The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty"` + // The operation against the threshold that triggers alert rule. TriggerOperator *TriggerOperator `json:"triggerOperator,omitempty"` @@ -3235,7 +7019,7 @@ type ScheduledAlertRuleTemplateProperties struct { // SecurityAlert - Represents a security alert entity. type SecurityAlert struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // SecurityAlert entity properties Properties *SecurityAlertProperties `json:"properties,omitempty"` @@ -3359,10 +7143,50 @@ type SecurityAlertPropertiesConfidenceReasonsItem struct { ReasonType *string `json:"reasonType,omitempty" azure:"ro"` } +// SecurityAlertTimelineItem - Represents security alert timeline item. +type SecurityAlertTimelineItem struct { + // REQUIRED; The name of the alert type. + AlertType *string `json:"alertType,omitempty"` + + // REQUIRED; The alert azure resource id. + AzureResourceID *string `json:"azureResourceId,omitempty"` + + // REQUIRED; The alert name. + DisplayName *string `json:"displayName,omitempty"` + + // REQUIRED; The alert end time. + EndTimeUTC *time.Time `json:"endTimeUtc,omitempty"` + + // REQUIRED; The entity query kind type. + Kind *EntityTimelineKind `json:"kind,omitempty"` + + // REQUIRED; The alert severity. + Severity *AlertSeverity `json:"severity,omitempty"` + + // REQUIRED; The alert start time. + StartTimeUTC *time.Time `json:"startTimeUtc,omitempty"` + + // REQUIRED; The alert generated time. + TimeGenerated *time.Time `json:"timeGenerated,omitempty"` + + // The alert description. + Description *string `json:"description,omitempty"` + + // The alert product name. + ProductName *string `json:"productName,omitempty"` +} + +// GetEntityTimelineItem implements the EntityTimelineItemClassification interface for type SecurityAlertTimelineItem. +func (s *SecurityAlertTimelineItem) GetEntityTimelineItem() *EntityTimelineItem { + return &EntityTimelineItem{ + Kind: s.Kind, + } +} + // SecurityGroupEntity - Represents a security group entity. type SecurityGroupEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // SecurityGroup entity properties Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` @@ -3410,6 +7234,83 @@ type SecurityGroupEntityProperties struct { Sid *string `json:"sid,omitempty" azure:"ro"` } +// SecurityMLAnalyticsSettingClassification provides polymorphic access to related types. +// Call the interface's GetSecurityMLAnalyticsSetting() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AnomalySecurityMLAnalyticsSettings, *SecurityMLAnalyticsSetting +type SecurityMLAnalyticsSettingClassification interface { + // GetSecurityMLAnalyticsSetting returns the SecurityMLAnalyticsSetting content of the underlying type. + GetSecurityMLAnalyticsSetting() *SecurityMLAnalyticsSetting +} + +// SecurityMLAnalyticsSetting - Security ML Analytics Setting +type SecurityMLAnalyticsSetting struct { + // REQUIRED; The kind of security ML Analytics Settings + Kind *SecurityMLAnalyticsSettingsKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,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"` +} + +// GetSecurityMLAnalyticsSetting implements the SecurityMLAnalyticsSettingClassification interface for type SecurityMLAnalyticsSetting. +func (s *SecurityMLAnalyticsSetting) GetSecurityMLAnalyticsSetting() *SecurityMLAnalyticsSetting { + return s +} + +// SecurityMLAnalyticsSettingsClientCreateOrUpdateOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.CreateOrUpdate +// method. +type SecurityMLAnalyticsSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// SecurityMLAnalyticsSettingsClientDeleteOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.Delete +// method. +type SecurityMLAnalyticsSettingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SecurityMLAnalyticsSettingsClientGetOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.Get +// method. +type SecurityMLAnalyticsSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecurityMLAnalyticsSettingsClientListOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.List +// method. +type SecurityMLAnalyticsSettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// SecurityMLAnalyticsSettingsDataSource - security ml analytics settings data sources +type SecurityMLAnalyticsSettingsDataSource struct { + // The connector id that provides the following data types + ConnectorID *string `json:"connectorId,omitempty"` + + // The data types used by the security ml analytics settings + DataTypes []*string `json:"dataTypes,omitempty"` +} + +// SecurityMLAnalyticsSettingsList - List all the SecurityMLAnalyticsSettings +type SecurityMLAnalyticsSettingsList struct { + // REQUIRED; Array of SecurityMLAnalyticsSettings + Value []SecurityMLAnalyticsSettingClassification `json:"value,omitempty"` + + // READ-ONLY; URL to fetch the next set of SecurityMLAnalyticsSettings. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + // SentinelOnboardingState - Sentinel onboarding state type SentinelOnboardingState struct { // Etag of the azure resource @@ -3431,46 +7332,171 @@ type SentinelOnboardingState struct { Type *string `json:"type,omitempty" azure:"ro"` } -// SentinelOnboardingStateProperties - The Sentinel onboarding state properties -type SentinelOnboardingStateProperties struct { - // Flag that indicates the status of the CMK setting - CustomerManagedKey *bool `json:"customerManagedKey,omitempty"` -} +// SentinelOnboardingStateProperties - The Sentinel onboarding state properties +type SentinelOnboardingStateProperties struct { + // Flag that indicates the status of the CMK setting + CustomerManagedKey *bool `json:"customerManagedKey,omitempty"` +} + +// SentinelOnboardingStatesClientCreateOptions contains the optional parameters for the SentinelOnboardingStatesClient.Create +// method. +type SentinelOnboardingStatesClientCreateOptions struct { + // The Sentinel onboarding state parameter + SentinelOnboardingStateParameter *SentinelOnboardingState +} + +// SentinelOnboardingStatesClientDeleteOptions contains the optional parameters for the SentinelOnboardingStatesClient.Delete +// method. +type SentinelOnboardingStatesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SentinelOnboardingStatesClientGetOptions contains the optional parameters for the SentinelOnboardingStatesClient.Get method. +type SentinelOnboardingStatesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SentinelOnboardingStatesClientListOptions contains the optional parameters for the SentinelOnboardingStatesClient.List +// method. +type SentinelOnboardingStatesClientListOptions struct { + // placeholder for future optional parameters +} + +// SentinelOnboardingStatesList - List of the Sentinel onboarding states +type SentinelOnboardingStatesList struct { + // REQUIRED; Array of Sentinel onboarding states + Value []*SentinelOnboardingState `json:"value,omitempty"` +} + +// SettingList - List of all the settings. +type SettingList struct { + // REQUIRED; Array of settings. + Value []SettingsClassification `json:"value,omitempty"` +} + +// 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: +// - *Anomalies, *EntityAnalytics, *EyesOn, *Settings, *Ueba +type SettingsClassification interface { + // GetSettings returns the Settings content of the underlying type. + GetSettings() *Settings +} + +// Settings - The Setting. +type Settings struct { + // REQUIRED; The kind of the setting + Kind *SettingKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,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"` +} + +// 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 + Etag *string `json:"etag,omitempty"` + + // source control properties + Properties *SourceControlProperties `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"` +} + +// SourceControlClientListRepositoriesOptions contains the optional parameters for the SourceControlClient.ListRepositories +// method. +type SourceControlClientListRepositoriesOptions struct { + // placeholder for future optional parameters +} + +// SourceControlList - List all the source controls. +type SourceControlList struct { + // REQUIRED; Array of source controls. + Value []*SourceControl `json:"value,omitempty"` + + // READ-ONLY; URL to fetch the next set of source controls. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` +} + +// SourceControlProperties - Describes source control properties +type SourceControlProperties struct { + // REQUIRED; Array of source control content types. + ContentTypes []*ContentType `json:"contentTypes,omitempty"` + + // REQUIRED; The display name of the source control + DisplayName *string `json:"displayName,omitempty"` + + // REQUIRED; The repository type of the source control + RepoType *RepoType `json:"repoType,omitempty"` + + // REQUIRED; Repository metadata. + Repository *Repository `json:"repository,omitempty"` + + // A description of the source control + Description *string `json:"description,omitempty"` + + // The id (a Guid) of the source control + ID *string `json:"id,omitempty"` + + // 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"` -// SentinelOnboardingStatesClientCreateOptions contains the optional parameters for the SentinelOnboardingStatesClient.Create -// method. -type SentinelOnboardingStatesClientCreateOptions struct { - // The Sentinel onboarding state parameter - SentinelOnboardingStateParameter *SentinelOnboardingState + // The version number associated with the source control + Version *Version `json:"version,omitempty"` } -// SentinelOnboardingStatesClientDeleteOptions contains the optional parameters for the SentinelOnboardingStatesClient.Delete -// method. -type SentinelOnboardingStatesClientDeleteOptions struct { +// SourceControlsClientCreateOptions contains the optional parameters for the SourceControlsClient.Create method. +type SourceControlsClientCreateOptions struct { // placeholder for future optional parameters } -// SentinelOnboardingStatesClientGetOptions contains the optional parameters for the SentinelOnboardingStatesClient.Get method. -type SentinelOnboardingStatesClientGetOptions struct { +// SourceControlsClientDeleteOptions contains the optional parameters for the SourceControlsClient.Delete method. +type SourceControlsClientDeleteOptions struct { // placeholder for future optional parameters } -// SentinelOnboardingStatesClientListOptions contains the optional parameters for the SentinelOnboardingStatesClient.List -// method. -type SentinelOnboardingStatesClientListOptions struct { +// SourceControlsClientGetOptions contains the optional parameters for the SourceControlsClient.Get method. +type SourceControlsClientGetOptions struct { // placeholder for future optional parameters } -// SentinelOnboardingStatesList - List of the Sentinel onboarding states -type SentinelOnboardingStatesList struct { - // REQUIRED; Array of Sentinel onboarding states - Value []*SentinelOnboardingState `json:"value,omitempty"` +// SourceControlsClientListOptions contains the optional parameters for the SourceControlsClient.List method. +type SourceControlsClientListOptions struct { + // placeholder for future optional parameters } // SubmissionMailEntity - Represents a submission mail entity. type SubmissionMailEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // Submission mail entity properties Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` @@ -3560,6 +7586,28 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } +// TICheckRequirements - Threat Intelligence Platforms data connector check requirements +type TICheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Threat Intelligence Platforms data connector check required properties + Properties *TICheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type TICheckRequirements. +func (t *TICheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: t.Kind, + } +} + +// TICheckRequirementsProperties - Threat Intelligence Platforms data connector required properties. +type TICheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + // TIDataConnector - Represents threat intelligence data connector. type TIDataConnector struct { // REQUIRED; The data connector kind @@ -3598,28 +7646,61 @@ func (t *TIDataConnector) GetDataConnector() *DataConnector { // TIDataConnectorDataTypes - The available data types for TI (Threat Intelligence) data connector. type TIDataConnectorDataTypes struct { - // Data type for indicators connection. + // REQUIRED; Data type for indicators connection. Indicators *TIDataConnectorDataTypesIndicators `json:"indicators,omitempty"` } // TIDataConnectorDataTypesIndicators - Data type for indicators connection. type TIDataConnectorDataTypesIndicators struct { - // Describe whether this data type connection is enabled or not. + // REQUIRED; Describe whether this data type connection is enabled or not. State *DataTypeState `json:"state,omitempty"` } // TIDataConnectorProperties - TI (Threat Intelligence) data connector properties. type TIDataConnectorProperties struct { - // The available data types for the connector. + // REQUIRED; The available data types for the connector. DataTypes *TIDataConnectorDataTypes `json:"dataTypes,omitempty"` - // The tenant id to connect to, and get the data from. + // REQUIRED; The tenant id to connect to, and get the data from. TenantID *string `json:"tenantId,omitempty"` // The lookback period for the feed to be imported. TipLookbackPeriod *time.Time `json:"tipLookbackPeriod,omitempty"` } +// TeamInformation - Describes team information +type TeamInformation struct { + // READ-ONLY; The description of the team + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; The name of the team + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The primary channel URL of the team + PrimaryChannelURL *string `json:"primaryChannelUrl,omitempty" azure:"ro"` + + // READ-ONLY; The time the team was created + TeamCreationTimeUTC *time.Time `json:"teamCreationTimeUtc,omitempty" azure:"ro"` + + // READ-ONLY; Team ID + TeamID *string `json:"teamId,omitempty" azure:"ro"` +} + +// TeamProperties - Describes team properties +type TeamProperties struct { + // REQUIRED; The name of the team + TeamName *string `json:"teamName,omitempty"` + + // List of group IDs to add their members to the team + GroupIDs []*string `json:"groupIds,omitempty"` + + // List of member IDs to add to the team + MemberIDs []*string `json:"memberIds,omitempty"` + + // The description of the team + TeamDescription *string `json:"teamDescription,omitempty"` +} + // ThreatIntelligence property bag. type ThreatIntelligence struct { // READ-ONLY; Confidence (must be between 0 and 1) @@ -3641,6 +7722,134 @@ type ThreatIntelligence struct { ThreatType *string `json:"threatType,omitempty" azure:"ro"` } +// ThreatIntelligenceAlertRule - Represents Threat Intelligence alert rule. +type ThreatIntelligenceAlertRule struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Threat Intelligence alert rule properties + Properties *ThreatIntelligenceAlertRuleProperties `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"` +} + +// 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, + } +} + +// ThreatIntelligenceAlertRuleProperties - Threat Intelligence alert rule base property bag. +type ThreatIntelligenceAlertRuleProperties struct { + // REQUIRED; The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + + // REQUIRED; Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + + // READ-ONLY; The description of the alert rule. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; The last time that this alert has been modified. + LastModifiedUTC *time.Time `json:"lastModifiedUtc,omitempty" azure:"ro"` + + // READ-ONLY; The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty" azure:"ro"` + + // READ-ONLY; The tactics of the alert rule + Tactics []*AttackTactic `json:"tactics,omitempty" azure:"ro"` + + // READ-ONLY; The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty" azure:"ro"` +} + +// ThreatIntelligenceAlertRuleTemplate - Represents Threat Intelligence alert rule template. +type ThreatIntelligenceAlertRuleTemplate struct { + // REQUIRED; The kind of the alert rule + Kind *AlertRuleKind `json:"kind,omitempty"` + + // Threat Intelligence alert rule template properties + Properties *ThreatIntelligenceAlertRuleTemplateProperties `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"` +} + +// 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, + } +} + +// ThreatIntelligenceAlertRuleTemplateProperties - Threat Intelligence alert rule template properties +type ThreatIntelligenceAlertRuleTemplateProperties struct { + // REQUIRED; The severity for alerts created by this alert rule. + Severity *AlertSeverity `json:"severity,omitempty"` + + // the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + + // The description of the alert rule template. + Description *string `json:"description,omitempty"` + + // The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + + // The required data sources for this template + RequiredDataConnectors []*AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + + // The alert rule template status. + Status *TemplateStatus `json:"status,omitempty"` + + // The tactics of the alert rule + Tactics []*AttackTactic `json:"tactics,omitempty"` + + // The techniques of the alert rule + Techniques []*string `json:"techniques,omitempty"` + + // 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. + LastUpdatedDateUTC *time.Time `json:"lastUpdatedDateUTC,omitempty" azure:"ro"` +} + // ThreatIntelligenceAppendTags - Array of tags to be appended to the threat intelligence indicator. type ThreatIntelligenceAppendTags struct { // List of tags to be appended. @@ -3770,7 +7979,7 @@ type ThreatIntelligenceIndicatorMetricsClientListOptions struct { // ThreatIntelligenceIndicatorModel - Threat intelligence indicator entity. type ThreatIntelligenceIndicatorModel struct { // REQUIRED; The kind of the entity. - Kind *ThreatIntelligenceResourceInnerKind `json:"kind,omitempty"` + Kind *ThreatIntelligenceResourceKindEnum `json:"kind,omitempty"` // Etag of the azure resource Etag *string `json:"etag,omitempty"` @@ -3924,7 +8133,7 @@ type ThreatIntelligenceInformationClassification interface { // ThreatIntelligenceInformation - Threat intelligence information object. type ThreatIntelligenceInformation struct { // REQUIRED; The kind of the entity. - Kind *ThreatIntelligenceResourceInnerKind `json:"kind,omitempty"` + Kind *ThreatIntelligenceResourceKindEnum `json:"kind,omitempty"` // Etag of the azure resource Etag *string `json:"etag,omitempty"` @@ -4025,13 +8234,149 @@ type ThreatIntelligenceSortingCriteria struct { ItemKey *string `json:"itemKey,omitempty"` // Sorting order (ascending/descending/unsorted). - SortOrder *ThreatIntelligenceSortingOrder `json:"sortOrder,omitempty"` + SortOrder *ThreatIntelligenceSortingCriteriaEnum `json:"sortOrder,omitempty"` +} + +// TiTaxiiCheckRequirements - Threat Intelligence TAXII data connector check requirements +type TiTaxiiCheckRequirements struct { + // REQUIRED; Describes the kind of connector to be checked. + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Threat Intelligence TAXII check required properties. + Properties *TiTaxiiCheckRequirementsProperties `json:"properties,omitempty"` +} + +// GetDataConnectorsCheckRequirements implements the DataConnectorsCheckRequirementsClassification interface for type TiTaxiiCheckRequirements. +func (t *TiTaxiiCheckRequirements) GetDataConnectorsCheckRequirements() *DataConnectorsCheckRequirements { + return &DataConnectorsCheckRequirements{ + Kind: t.Kind, + } +} + +// TiTaxiiCheckRequirementsProperties - Threat Intelligence TAXII data connector required properties. +type TiTaxiiCheckRequirementsProperties struct { + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// TiTaxiiDataConnector - Data connector to pull Threat intelligence data from TAXII 2.0/2.1 server +type TiTaxiiDataConnector struct { + // REQUIRED; The data connector kind + Kind *DataConnectorKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Threat intelligence TAXII data connector properties. + Properties *TiTaxiiDataConnectorProperties `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"` +} + +// 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, + } +} + +// TiTaxiiDataConnectorDataTypes - The available data types for Threat Intelligence TAXII data connector. +type TiTaxiiDataConnectorDataTypes struct { + // REQUIRED; Data type for TAXII connector. + TaxiiClient *TiTaxiiDataConnectorDataTypesTaxiiClient `json:"taxiiClient,omitempty"` +} + +// TiTaxiiDataConnectorDataTypesTaxiiClient - Data type for TAXII connector. +type TiTaxiiDataConnectorDataTypesTaxiiClient struct { + // REQUIRED; Describe whether this data type connection is enabled or not. + State *DataTypeState `json:"state,omitempty"` +} + +// TiTaxiiDataConnectorProperties - Threat Intelligence TAXII data connector properties. +type TiTaxiiDataConnectorProperties struct { + // REQUIRED; The available data types for Threat Intelligence TAXII data connector. + DataTypes *TiTaxiiDataConnectorDataTypes `json:"dataTypes,omitempty"` + + // REQUIRED; The polling frequency for the TAXII server. + PollingFrequency *PollingFrequency `json:"pollingFrequency,omitempty"` + + // REQUIRED; The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` + + // The collection id of the TAXII server. + CollectionID *string `json:"collectionId,omitempty"` + + // The friendly name for the TAXII server. + FriendlyName *string `json:"friendlyName,omitempty"` + + // The password for the TAXII server. + Password *string `json:"password,omitempty"` + + // The lookback period for the TAXII server. + TaxiiLookbackPeriod *time.Time `json:"taxiiLookbackPeriod,omitempty"` + + // The API root for the TAXII server. + TaxiiServer *string `json:"taxiiServer,omitempty"` + + // The userName for the TAXII server. + UserName *string `json:"userName,omitempty"` + + // The workspace id. + WorkspaceID *string `json:"workspaceId,omitempty"` +} + +// TimelineAggregation - timeline aggregation information per kind +type TimelineAggregation struct { + // REQUIRED; the total items found for a kind + Count *int32 `json:"count,omitempty"` + + // REQUIRED; the query kind + Kind *EntityTimelineKind `json:"kind,omitempty"` +} + +// TimelineError - Timeline Query Errors. +type TimelineError struct { + // REQUIRED; the error message + ErrorMessage *string `json:"errorMessage,omitempty"` + + // REQUIRED; the query kind + Kind *EntityTimelineKind `json:"kind,omitempty"` + + // the query id + QueryID *string `json:"queryId,omitempty"` +} + +// TimelineResultsMetadata - Expansion result metadata. +type TimelineResultsMetadata struct { + // REQUIRED; timeline aggregation per kind + Aggregations []*TimelineAggregation `json:"aggregations,omitempty"` + + // REQUIRED; the total items found for the timeline request + TotalCount *int32 `json:"totalCount,omitempty"` + + // information about the failure queries + Errors []*TimelineError `json:"errors,omitempty"` } // URLEntity - Represents a url entity. type URLEntity struct { // REQUIRED; The kind of the entity. - Kind *EntityKindEnum `json:"kind,omitempty"` + Kind *EntityKind `json:"kind,omitempty"` // Url entity properties Properties *URLEntityProperties `json:"properties,omitempty"` @@ -4073,6 +8418,48 @@ type URLEntityProperties struct { URL *string `json:"url,omitempty" azure:"ro"` } +// Ueba - Settings with single toggle. +type Ueba struct { + // REQUIRED; The kind of the setting + Kind *SettingKind `json:"kind,omitempty"` + + // Etag of the azure resource + Etag *string `json:"etag,omitempty"` + + // Ueba properties + Properties *UebaProperties `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"` +} + +// 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, + } +} + +// UebaProperties - Ueba property bag. +type UebaProperties struct { + // The relevant data sources that enriched by ueba + DataSources []*UebaDataSources `json:"dataSources,omitempty"` +} + // UserInfo - User information that made some action type UserInfo struct { // The object id of the user. @@ -4106,7 +8493,7 @@ type Watchlist struct { Type *string `json:"type,omitempty" azure:"ro"` } -// WatchlistItem - Represents a Watchlist Item in Azure Security Insights. +// WatchlistItem - Represents a Watchlist item in Azure Security Insights. type WatchlistItem struct { // Etag of the azure resource Etag *string `json:"etag,omitempty"` @@ -4132,14 +8519,14 @@ type WatchlistItemList struct { // REQUIRED; Array of watchlist items. Value []*WatchlistItem `json:"value,omitempty"` - // READ-ONLY; URL to fetch the next set of watchlist items. + // READ-ONLY; URL to fetch the next set of watchlist item. NextLink *string `json:"nextLink,omitempty" azure:"ro"` } // 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"` @@ -4148,7 +8535,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"` @@ -4215,10 +8602,7 @@ 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. For now, only text/csv is valid + // The content type of the raw content. Example : text/csv or text/tsv ContentType *string `json:"contentType,omitempty"` // The time the watchlist was created @@ -4239,12 +8623,19 @@ type WatchlistProperties struct { // List of labels relevant to this watchlist Labels []*string `json:"labels,omitempty"` - // The number of lines in a csv content to skip before the header + // The number of lines in a csv/tsv content to skip before the header NumberOfLinesToSkip *int32 `json:"numberOfLinesToSkip,omitempty"` - // The raw content that represents to watchlist items to create. Example : This line will be skipped header1,header2 value1,value2 + // The raw content that represents to watchlist items to create. In case of csv/tsv content type, it's the content of the + // 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"` @@ -4254,8 +8645,8 @@ type WatchlistProperties struct { // Describes a user that updated the watchlist UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - // The status of the Watchlist upload : New, InProgress or Complete. Note : When a Watchlist upload status is InProgress, - // the Watchlist cannot be deleted + // The status of the Watchlist upload : New, InProgress or Complete. Pls note : When a Watchlist upload status is equal to + // InProgress, the Watchlist cannot be deleted UploadStatus *string `json:"uploadStatus,omitempty"` // The alias of the watchlist @@ -4290,3 +8681,18 @@ type WatchlistsClientListOptions struct { // specifies a starting point to use for subsequent calls. Optional. SkipToken *string } + +// 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"` + + // 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 index e5efea9eb76a..1ff395cfcc16 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models_serde.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_models_serde.go @@ -15,6 +15,37 @@ import ( "reflect" ) +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AADDataConnector. func (a AADDataConnector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -66,6 +97,37 @@ func (a *AADDataConnector) UnmarshalJSON(data []byte) error { return nil } +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AATPDataConnector. func (a AATPDataConnector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -117,6 +179,37 @@ func (a *AATPDataConnector) UnmarshalJSON(data []byte) error { return nil } +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ASCDataConnector. func (a ASCDataConnector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -172,7 +265,7 @@ func (a *ASCDataConnector) UnmarshalJSON(data []byte) error { func (a AccountEntity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", a.ID) - objectMap["kind"] = EntityKindEnumAccount + objectMap["kind"] = EntityKindAccount populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "systemData", a.SystemData) @@ -235,16 +328,21 @@ func (a AccountEntityProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplateDataSource. -func (a AlertRuleTemplateDataSource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ActivityCustomEntityQuery. +func (a ActivityCustomEntityQuery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "connectorId", a.ConnectorID) - populate(objectMap, "dataTypes", a.DataTypes) + 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 AlertRuleTemplatesList. -func (a *AlertRuleTemplatesList) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -252,11 +350,26 @@ func (a *AlertRuleTemplatesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) + case "etag": + err = unpopulate(val, "Etag", &a.Etag) delete(rawMsg, key) - case "value": - a.Value, err = unmarshalAlertRuleTemplateClassificationArray(val) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -266,8 +379,25 @@ func (a *AlertRuleTemplatesList) UnmarshalJSON(data []byte) error { return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertRulesList. -func (a *AlertRulesList) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -275,11 +405,38 @@ func (a *AlertRulesList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) + case "content": + err = unpopulate(val, "Content", &a.Content) delete(rawMsg, key) - case "value": - a.Value, err = unmarshalAlertRuleClassificationArray(val) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, "CreatedTimeUTC", &a.CreatedTimeUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + case "entitiesFilter": + err = unpopulate(val, "EntitiesFilter", &a.EntitiesFilter) + delete(rawMsg, key) + case "inputEntityType": + err = unpopulate(val, "InputEntityType", &a.InputEntityType) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedTimeUTC", &a.LastModifiedTimeUTC) + delete(rawMsg, key) + case "queryDefinitions": + err = unpopulate(val, "QueryDefinitions", &a.QueryDefinitions) + delete(rawMsg, key) + case "requiredInputFieldsSets": + err = unpopulate(val, "RequiredInputFieldsSets", &a.RequiredInputFieldsSets) + delete(rawMsg, key) + case "templateName": + err = unpopulate(val, "TemplateName", &a.TemplateName) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &a.Title) delete(rawMsg, key) } if err != nil { @@ -289,17 +446,21 @@ func (a *AlertRulesList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleModifyPropertiesAction. -func (a AutomationRuleModifyPropertiesAction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQuery. +func (a ActivityEntityQuery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actionConfiguration", a.ActionConfiguration) - objectMap["actionType"] = ActionTypeModifyProperties - populate(objectMap, "order", a.Order) + 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 AutomationRuleModifyPropertiesAction. -func (a *AutomationRuleModifyPropertiesAction) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -307,14 +468,26 @@ func (a *AutomationRuleModifyPropertiesAction) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "actionConfiguration": - err = unpopulate(val, "ActionConfiguration", &a.ActionConfiguration) + case "etag": + err = unpopulate(val, "Etag", &a.Etag) delete(rawMsg, key) - case "actionType": - err = unpopulate(val, "ActionType", &a.ActionType) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &a.Order) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -324,22 +497,20 @@ func (a *AutomationRuleModifyPropertiesAction) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleProperties. -func (a AutomationRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueryTemplate. +func (a ActivityEntityQueryTemplate) 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) + 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 AutomationRuleProperties. -func (a *AutomationRuleProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -347,29 +518,23 @@ func (a *AutomationRuleProperties) UnmarshalJSON(data []byte) error { 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, "CreatedBy", &a.CreatedBy) - delete(rawMsg, key) - case "createdTimeUtc": - err = unpopulateTimeRFC3339(val, "CreatedTimeUTC", &a.CreatedTimeUTC) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &a.LastModifiedBy) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "lastModifiedTimeUtc": - err = unpopulateTimeRFC3339(val, "LastModifiedTimeUTC", &a.LastModifiedTimeUTC) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &a.Order) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) - case "triggeringLogic": - err = unpopulate(val, "TriggeringLogic", &a.TriggeringLogic) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -379,26 +544,22 @@ func (a *AutomationRuleProperties) UnmarshalJSON(data []byte) error { 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) -} - -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleRunPlaybookAction. -func (a AutomationRuleRunPlaybookAction) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ActivityEntityQueryTemplateProperties. +func (a ActivityEntityQueryTemplateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "actionConfiguration", a.ActionConfiguration) - objectMap["actionType"] = ActionTypeRunPlaybook - populate(objectMap, "order", a.Order) + 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) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleRunPlaybookAction. -func (a *AutomationRuleRunPlaybookAction) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -406,36 +567,61 @@ func (a *AutomationRuleRunPlaybookAction) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionConfiguration": - err = unpopulate(val, "ActionConfiguration", &a.ActionConfiguration) + case "bucketEndTimeUTC": + err = unpopulateTimeRFC3339(val, "BucketEndTimeUTC", &a.BucketEndTimeUTC) delete(rawMsg, key) - case "actionType": - err = unpopulate(val, "ActionType", &a.ActionType) + case "bucketStartTimeUTC": + err = unpopulateTimeRFC3339(val, "BucketStartTimeUTC", &a.BucketStartTimeUTC) delete(rawMsg, key) - case "order": - err = unpopulate(val, "Order", &a.Order) + case "content": + err = unpopulate(val, "Content", &a.Content) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } + case "firstActivityTimeUTC": + err = unpopulateTimeRFC3339(val, "FirstActivityTimeUTC", &a.FirstActivityTimeUTC) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "lastActivityTimeUTC": + err = unpopulateTimeRFC3339(val, "LastActivityTimeUTC", &a.LastActivityTimeUTC) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, "QueryID", &a.QueryID) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &a.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } return nil } -// MarshalJSON implements the json.Marshaller interface for type AutomationRuleTriggeringLogic. -func (a AutomationRuleTriggeringLogic) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AlertRuleTemplateDataSource. +func (a AlertRuleTemplateDataSource) 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) + populate(objectMap, "connectorId", a.ConnectorID) + populate(objectMap, "dataTypes", a.DataTypes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AutomationRuleTriggeringLogic. -func (a *AutomationRuleTriggeringLogic) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -443,20 +629,26 @@ func (a *AutomationRuleTriggeringLogic) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "conditions": - a.Conditions, err = unmarshalAutomationRuleConditionClassificationArray(val) + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &a.AlertRulesCreatedByTemplateCount) delete(rawMsg, key) - case "expirationTimeUtc": - err = unpopulateTimeRFC3339(val, "ExpirationTimeUTC", &a.ExpirationTimeUTC) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &a.CreatedDateUTC) delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &a.IsEnabled) + case "description": + err = unpopulate(val, "Description", &a.Description) delete(rawMsg, key) - case "triggersOn": - err = unpopulate(val, "TriggersOn", &a.TriggersOn) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) delete(rawMsg, key) - case "triggersWhen": - err = unpopulate(val, "TriggersWhen", &a.TriggersWhen) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &a.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &a.RequiredDataConnectors) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) delete(rawMsg, key) } if err != nil { @@ -466,12 +658,117 @@ func (a *AutomationRuleTriggeringLogic) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AwsCloudTrailDataConnector. -func (a AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &a.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &a.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &a.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &a.RequiredDataConnectors) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &a.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &a.Techniques) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + a.Value, err = unmarshalAlertRuleTemplateClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + a.Value, err = unmarshalAlertRuleClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// 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"] = DataConnectorKindAmazonWebServicesCloudTrail + objectMap["kind"] = SettingKindAnomalies populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "systemData", a.SystemData) @@ -479,8 +776,8 @@ func (a AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AwsCloudTrailDataConnector. -func (a *AwsCloudTrailDataConnector) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -517,11 +814,12 @@ func (a *AwsCloudTrailDataConnector) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureResourceEntity. -func (a AzureResourceEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AnomalySecurityMLAnalyticsSettings. +func (a AnomalySecurityMLAnalyticsSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + populate(objectMap, "etag", a.Etag) populate(objectMap, "id", a.ID) - objectMap["kind"] = EntityKindEnumAzureResource + objectMap["kind"] = SecurityMLAnalyticsSettingsKindAnomaly populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) populate(objectMap, "systemData", a.SystemData) @@ -529,8 +827,8 @@ func (a AzureResourceEntity) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceEntity. -func (a *AzureResourceEntity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AnomalySecurityMLAnalyticsSettings. +func (a *AnomalySecurityMLAnalyticsSettings) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -538,6 +836,9 @@ func (a *AzureResourceEntity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &a.Etag) + delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) @@ -564,1083 +865,3995 @@ func (a *AzureResourceEntity) UnmarshalJSON(data []byte) error { 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 BookmarkProperties. -func (b BookmarkProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AnomalySecurityMLAnalyticsSettingsProperties. +func (a AnomalySecurityMLAnalyticsSettingsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "created", b.Created) - populate(objectMap, "createdBy", b.CreatedBy) - populate(objectMap, "displayName", b.DisplayName) - 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) - populateTimeRFC3339(objectMap, "updated", b.Updated) - populate(objectMap, "updatedBy", b.UpdatedBy) + populate(objectMap, "anomalySettingsVersion", a.AnomalySettingsVersion) + populate(objectMap, "anomalyVersion", a.AnomalyVersion) + populate(objectMap, "customizableObservations", &a.CustomizableObservations) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "frequency", a.Frequency) + populate(objectMap, "isDefaultSettings", a.IsDefaultSettings) + populateTimeRFC3339(objectMap, "lastModifiedUtc", a.LastModifiedUTC) + populate(objectMap, "requiredDataConnectors", a.RequiredDataConnectors) + populate(objectMap, "settingsDefinitionId", a.SettingsDefinitionID) + populate(objectMap, "settingsStatus", a.SettingsStatus) + populate(objectMap, "tactics", a.Tactics) + populate(objectMap, "techniques", a.Techniques) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BookmarkProperties. -func (b *BookmarkProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AnomalySecurityMLAnalyticsSettingsProperties. +func (a *AnomalySecurityMLAnalyticsSettingsProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "created": - err = unpopulateTimeRFC3339(val, "Created", &b.Created) + case "anomalySettingsVersion": + err = unpopulate(val, "AnomalySettingsVersion", &a.AnomalySettingsVersion) delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &b.CreatedBy) + case "anomalyVersion": + err = unpopulate(val, "AnomalyVersion", &a.AnomalyVersion) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &b.DisplayName) + case "customizableObservations": + err = unpopulate(val, "CustomizableObservations", &a.CustomizableObservations) delete(rawMsg, key) - case "eventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &b.EventTime) + case "description": + err = unpopulate(val, "Description", &a.Description) delete(rawMsg, key) - case "incidentInfo": - err = unpopulate(val, "IncidentInfo", &b.IncidentInfo) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &b.Labels) + case "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) delete(rawMsg, key) - case "notes": - err = unpopulate(val, "Notes", &b.Notes) + case "frequency": + err = unpopulate(val, "Frequency", &a.Frequency) delete(rawMsg, key) - case "query": - err = unpopulate(val, "Query", &b.Query) + case "isDefaultSettings": + err = unpopulate(val, "IsDefaultSettings", &a.IsDefaultSettings) delete(rawMsg, key) - case "queryEndTime": - err = unpopulateTimeRFC3339(val, "QueryEndTime", &b.QueryEndTime) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &a.LastModifiedUTC) delete(rawMsg, key) - case "queryResult": - err = unpopulate(val, "QueryResult", &b.QueryResult) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &a.RequiredDataConnectors) delete(rawMsg, key) - case "queryStartTime": - err = unpopulateTimeRFC3339(val, "QueryStartTime", &b.QueryStartTime) + case "settingsDefinitionId": + err = unpopulate(val, "SettingsDefinitionID", &a.SettingsDefinitionID) delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, "Updated", &b.Updated) + case "settingsStatus": + err = unpopulate(val, "SettingsStatus", &a.SettingsStatus) delete(rawMsg, key) - case "updatedBy": - err = unpopulate(val, "UpdatedBy", &b.UpdatedBy) + case "tactics": + err = unpopulate(val, "Tactics", &a.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &a.Techniques) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// 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"] = EntityKindEnumCloudApplication - 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 { +// UnmarshalJSON implements the json.Unmarshaller interface for type AnomalyTimelineItem. +func (a *AnomalyTimelineItem) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) + case "azureResourceId": + err = unpopulate(val, "AzureResourceID", &a.AzureResourceID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulateTimeRFC3339(val, "EndTimeUTC", &a.EndTimeUTC) + delete(rawMsg, key) + case "intent": + err = unpopulate(val, "Intent", &a.Intent) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &c.Kind) + err = unpopulate(val, "Kind", &a.Kind) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) + case "productName": + err = unpopulate(val, "ProductName", &a.ProductName) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "reasons": + err = unpopulate(val, "Reasons", &a.Reasons) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, "StartTimeUTC", &a.StartTimeUTC) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "techniques": + err = unpopulate(val, "Techniques", &a.Techniques) + delete(rawMsg, key) + case "timeGenerated": + err = unpopulateTimeRFC3339(val, "TimeGenerated", &a.TimeGenerated) + delete(rawMsg, key) + case "vendor": + err = unpopulate(val, "Vendor", &a.Vendor) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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) -} - -// MarshalJSON implements the json.Marshaller interface for type DNSEntity. -func (d DNSEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleModifyPropertiesAction. +func (a AutomationRuleModifyPropertiesAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - objectMap["kind"] = EntityKindEnumDNSResolution - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "systemData", d.SystemData) - populate(objectMap, "type", d.Type) + 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 DNSEntity. -func (d *DNSEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &d.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "actionConfiguration": + err = unpopulate(val, "ActionConfiguration", &a.ActionConfiguration) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &d.SystemData) + case "actionType": + err = unpopulate(val, "ActionType", &a.ActionType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "order": + err = unpopulate(val, "Order", &a.Order) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DNSEntityProperties. -func (d DNSEntityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleProperties. +func (a AutomationRuleProperties) 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) + 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 DataConnectorList. -func (d *DataConnectorList) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "actions": + a.Actions, err = unmarshalAutomationRuleActionClassificationArray(val) delete(rawMsg, key) - case "value": - d.Value, err = unmarshalDataConnectorClassificationArray(val) + case "createdBy": + err = unpopulate(val, "CreatedBy", &a.CreatedBy) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, "CreatedTimeUTC", &a.CreatedTimeUTC) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &a.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedTimeUTC", &a.LastModifiedTimeUTC) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &a.Order) + delete(rawMsg, key) + case "triggeringLogic": + err = unpopulate(val, "TriggeringLogic", &a.TriggeringLogic) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EntityCommonProperties. -func (e EntityCommonProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutomationRulePropertyValuesChangedCondition. +func (a AutomationRulePropertyValuesChangedCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "additionalData", e.AdditionalData) - populate(objectMap, "friendlyName", e.FriendlyName) + populate(objectMap, "changeType", a.ChangeType) + populate(objectMap, "operator", a.Operator) + populate(objectMap, "propertyName", a.PropertyName) + populate(objectMap, "propertyValues", a.PropertyValues) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type EntityMapping. -func (e EntityMapping) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutomationRulePropertyValuesCondition. +func (a AutomationRulePropertyValuesCondition) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "entityType", e.EntityType) - populate(objectMap, "fieldMappings", e.FieldMappings) + populate(objectMap, "operator", a.Operator) + populate(objectMap, "propertyName", a.PropertyName) + populate(objectMap, "propertyValues", a.PropertyValues) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type FileEntity. -func (f FileEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleRunPlaybookAction. +func (a AutomationRuleRunPlaybookAction) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - objectMap["kind"] = EntityKindEnumFile - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) + 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 FileEntity. -func (f *FileEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) + case "actionConfiguration": + err = unpopulate(val, "ActionConfiguration", &a.ActionConfiguration) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &f.SystemData) + case "actionType": + err = unpopulate(val, "ActionType", &a.ActionType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) + case "order": + err = unpopulate(val, "Order", &a.Order) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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) -} - -// MarshalJSON implements the json.Marshaller interface for type FileHashEntity. -func (f FileHashEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AutomationRuleTriggeringLogic. +func (a AutomationRuleTriggeringLogic) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - objectMap["kind"] = EntityKindEnumFileHash - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "systemData", f.SystemData) - populate(objectMap, "type", f.Type) + 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 FileHashEntity. -func (f *FileHashEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &f.Kind) + case "conditions": + a.Conditions, err = unmarshalAutomationRuleConditionClassificationArray(val) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) + case "expirationTimeUtc": + err = unpopulateTimeRFC3339(val, "ExpirationTimeUTC", &a.ExpirationTimeUTC) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &a.IsEnabled) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &f.SystemData) + case "triggersOn": + err = unpopulate(val, "TriggersOn", &a.TriggersOn) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) + case "triggersWhen": + err = unpopulate(val, "TriggersWhen", &a.TriggersWhen) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, 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) -} - -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRule. -func (f FusionAlertRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsCloudTrailCheckRequirements. +func (a AwsCloudTrailCheckRequirements) 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) + objectMap["kind"] = DataConnectorKindAmazonWebServicesCloudTrail return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRule. -func (f *FusionAlertRule) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &f.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) + err = unpopulate(val, "Kind", &a.Kind) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleProperties. -func (f FusionAlertRuleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsCloudTrailDataConnector. +func (a AwsCloudTrailDataConnector) 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, "severity", f.Severity) - populate(objectMap, "tactics", f.Tactics) + 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 FusionAlertRuleProperties. -func (f *FusionAlertRuleProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "alertRuleTemplateName": - err = unpopulate(val, "AlertRuleTemplateName", &f.AlertRuleTemplateName) + case "etag": + err = unpopulate(val, "Etag", &a.Etag) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &f.Description) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &f.DisplayName) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &f.Enabled) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &f.LastModifiedUTC) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &f.Severity) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) - case "tactics": - err = unpopulate(val, "Tactics", &f.Tactics) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleTemplate. -func (f FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsS3CheckRequirements. +func (a AwsS3CheckRequirements) 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) + objectMap["kind"] = DataConnectorKindAmazonWebServicesS3 return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FusionAlertRuleTemplate. -func (f *FusionAlertRuleTemplate) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &f.ID) - delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &f.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &f.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &f.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &f.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &f.Type) + err = unpopulate(val, "Kind", &a.Kind) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FusionAlertRuleTemplateProperties. -func (f FusionAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsS3DataConnector. +func (a AwsS3DataConnector) 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, "status", f.Status) - populate(objectMap, "tactics", f.Tactics) + 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 FusionAlertRuleTemplateProperties. -func (f *FusionAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &f.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &f.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &f.Description) + case "etag": + err = unpopulate(val, "Etag", &a.Etag) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &f.DisplayName) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &f.LastUpdatedDateUTC) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, "RequiredDataConnectors", &f.RequiredDataConnectors) + case "name": + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &f.Severity) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &f.Status) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) - case "tactics": - err = unpopulate(val, "Tactics", &f.Tactics) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GroupingConfiguration. -func (g GroupingConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AwsS3DataConnectorProperties. +func (a AwsS3DataConnectorProperties) 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) + populate(objectMap, "dataTypes", a.DataTypes) + populate(objectMap, "destinationTable", a.DestinationTable) + populate(objectMap, "roleArn", a.RoleArn) + populate(objectMap, "sqsUrls", a.SqsUrls) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type HostEntity. -func (h HostEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureResourceEntity. +func (a AzureResourceEntity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", h.ID) - objectMap["kind"] = EntityKindEnumHost - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "type", h.Type) + 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 HostEntity. -func (h *HostEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &h.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &h.Kind) + err = unpopulate(val, "Kind", &a.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &h.Name) + err = unpopulate(val, "Name", &a.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &h.Properties) + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &h.SystemData) + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &h.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HostEntityProperties. -func (h HostEntityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureResourceEntityProperties. +func (a AzureResourceEntityProperties) 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) + 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 HuntingBookmark. -func (h HuntingBookmark) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BookmarkEntityMappings. +func (b BookmarkEntityMappings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", h.ID) - objectMap["kind"] = EntityKindEnumBookmark - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "type", h.Type) + populate(objectMap, "entityType", b.EntityType) + populate(objectMap, "fieldMappings", b.FieldMappings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HuntingBookmark. -func (h *HuntingBookmark) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &h.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &h.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &h.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &h.Properties) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &b.EndTime) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &h.SystemData) + case "expansionId": + err = unpopulate(val, "ExpansionID", &b.ExpansionID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &h.Type) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &b.StartTime) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, 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) +// 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 fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "edges": + err = unpopulate(val, "Edges", &b.Edges) + delete(rawMsg, key) + case "entities": + b.Entities, err = unmarshalEntityClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// 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 HuntingBookmarkProperties. -func (h *HuntingBookmarkProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "additionalData": - err = unpopulate(val, "AdditionalData", &h.AdditionalData) - delete(rawMsg, key) case "created": - err = unpopulateTimeRFC3339(val, "Created", &h.Created) + err = unpopulateTimeRFC3339(val, "Created", &b.Created) delete(rawMsg, key) case "createdBy": - err = unpopulate(val, "CreatedBy", &h.CreatedBy) + err = unpopulate(val, "CreatedBy", &b.CreatedBy) delete(rawMsg, key) case "displayName": - err = unpopulate(val, "DisplayName", &h.DisplayName) + err = unpopulate(val, "DisplayName", &b.DisplayName) delete(rawMsg, key) - case "eventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &h.EventTime) + case "entityMappings": + err = unpopulate(val, "EntityMappings", &b.EntityMappings) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &h.FriendlyName) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &b.EventTime) delete(rawMsg, key) case "incidentInfo": - err = unpopulate(val, "IncidentInfo", &h.IncidentInfo) + err = unpopulate(val, "IncidentInfo", &b.IncidentInfo) delete(rawMsg, key) case "labels": - err = unpopulate(val, "Labels", &h.Labels) + err = unpopulate(val, "Labels", &b.Labels) delete(rawMsg, key) case "notes": - err = unpopulate(val, "Notes", &h.Notes) + err = unpopulate(val, "Notes", &b.Notes) delete(rawMsg, key) case "query": - err = unpopulate(val, "Query", &h.Query) + err = unpopulate(val, "Query", &b.Query) + delete(rawMsg, key) + case "queryEndTime": + err = unpopulateTimeRFC3339(val, "QueryEndTime", &b.QueryEndTime) delete(rawMsg, key) case "queryResult": - err = unpopulate(val, "QueryResult", &h.QueryResult) + err = unpopulate(val, "QueryResult", &b.QueryResult) + delete(rawMsg, key) + case "queryStartTime": + err = unpopulateTimeRFC3339(val, "QueryStartTime", &b.QueryStartTime) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &b.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &b.Techniques) delete(rawMsg, key) case "updated": - err = unpopulateTimeRFC3339(val, "Updated", &h.Updated) + err = unpopulateTimeRFC3339(val, "Updated", &b.Updated) delete(rawMsg, key) case "updatedBy": - err = unpopulate(val, "UpdatedBy", &h.UpdatedBy) + err = unpopulate(val, "UpdatedBy", &b.UpdatedBy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IPEntity. -func (i IPEntity) MarshalJSON() ([]byte, error) { +// 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 fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "azureResourceId": + err = unpopulate(val, "AzureResourceID", &b.AzureResourceID) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &b.CreatedBy) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &b.DisplayName) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulateTimeRFC3339(val, "EndTimeUTC", &b.EndTimeUTC) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &b.EventTime) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &b.Kind) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &b.Labels) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, "Notes", &b.Notes) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, "StartTimeUTC", &b.StartTimeUTC) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CloudApplicationEntity. +func (c CloudApplicationEntity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = EntityKindEnumIP - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) + 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 IPEntity. -func (i *IPEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &i.ID) + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &i.Kind) + err = unpopulate(val, "Kind", &c.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &i.Name) + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &i.Properties) + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &i.SystemData) + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &i.Type) + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, 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) { +// MarshalJSON implements the json.Marshaller interface for type CloudApplicationEntityProperties. +func (c CloudApplicationEntityProperties) 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, "tactics", i.Tactics) + 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) } -// MarshalJSON implements the json.Marshaller interface for type IncidentCommentProperties. -func (i IncidentCommentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CodelessAPIPollingDataConnector. +func (c CodelessAPIPollingDataConnector) 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) + 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 IncidentCommentProperties. -func (i *IncidentCommentProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "author": - err = unpopulate(val, "Author", &i.Author) + case "etag": + err = unpopulate(val, "Etag", &c.Etag) delete(rawMsg, key) - case "createdTimeUtc": - err = unpopulateTimeRFC3339(val, "CreatedTimeUTC", &i.CreatedTimeUTC) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "lastModifiedTimeUtc": - err = unpopulateTimeRFC3339(val, "LastModifiedTimeUTC", &i.LastModifiedTimeUTC) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &i.Message) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type IncidentEntitiesResponse. -func (i *IncidentEntitiesResponse) UnmarshalJSON(data []byte) error { +// 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "entities": - i.Entities, err = unmarshalEntityClassificationArray(val) + case "etag": + err = unpopulate(val, "Etag", &c.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, 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) +} + +// 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + d.Value, err = unmarshalDataConnectorClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deploymentId": + err = unpopulate(val, "DeploymentID", &d.DeploymentID) + delete(rawMsg, key) + case "deploymentLogsUrl": + err = unpopulate(val, "DeploymentLogsURL", &d.DeploymentLogsURL) + delete(rawMsg, key) + case "deploymentResult": + err = unpopulate(val, "DeploymentResult", &d.DeploymentResult) + delete(rawMsg, key) + case "deploymentState": + err = unpopulate(val, "DeploymentState", &d.DeploymentState) + delete(rawMsg, key) + case "deploymentTime": + err = unpopulateTimeRFC3339(val, "DeploymentTime", &d.DeploymentTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &d.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "created": + err = unpopulateTimeRFC3339(val, "Created", &e.Created) + delete(rawMsg, key) + case "domain": + err = unpopulate(val, "Domain", &e.Domain) + delete(rawMsg, key) + case "expires": + err = unpopulateTimeRFC3339(val, "Expires", &e.Expires) + delete(rawMsg, key) + case "parsedWhois": + err = unpopulate(val, "ParsedWhois", &e.ParsedWhois) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &e.Server) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, "Updated", &e.Updated) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, 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 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) + delete(rawMsg, key) + case "expansionId": + err = unpopulate(val, "ExpansionID", &e.ExpansionID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "edges": + err = unpopulate(val, "Edges", &e.Edges) + delete(rawMsg, key) + case "entities": + e.Entities, err = unmarshalEntityClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addDefaultExtendedTimeRange": + err = unpopulate(val, "AddDefaultExtendedTimeRange", &e.AddDefaultExtendedTimeRange) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) + delete(rawMsg, key) + case "insightQueryIds": + err = unpopulate(val, "InsightQueryIDs", &e.InsightQueryIDs) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityQueryClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityQueryTemplateClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) + delete(rawMsg, key) + case "kinds": + err = unpopulate(val, "Kinds", &e.Kinds) + delete(rawMsg, key) + case "numberOfBucket": + err = unpopulate(val, "NumberOfBucket", &e.NumberOfBucket) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "metaData": + err = unpopulate(val, "MetaData", &e.MetaData) + delete(rawMsg, key) + case "value": + e.Value, err = unmarshalEntityTimelineItemClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &e.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &e.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &f.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRuleTemplateName": + err = unpopulate(val, "AlertRuleTemplateName", &f.AlertRuleTemplateName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &f.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &f.Enabled) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &f.LastModifiedUTC) + delete(rawMsg, key) + case "scenarioExclusionPatterns": + err = unpopulate(val, "ScenarioExclusionPatterns", &f.ScenarioExclusionPatterns) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &f.Severity) + delete(rawMsg, key) + case "sourceSettings": + err = unpopulate(val, "SourceSettings", &f.SourceSettings) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &f.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &f.Techniques) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &f.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &f.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, 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 fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &f.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &f.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &f.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &f.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &f.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &f.Severity) + delete(rawMsg, key) + case "sourceSettings": + err = unpopulate(val, "SourceSettings", &f.SourceSettings) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &f.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &f.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &f.Techniques) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", g, 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 fmt.Errorf("unmarshalling type %T: %v", g, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &h.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &h.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &h.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, 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 fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, "AdditionalData", &h.AdditionalData) + delete(rawMsg, key) + case "created": + err = unpopulateTimeRFC3339(val, "Created", &h.Created) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &h.CreatedBy) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &h.DisplayName) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &h.EventTime) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &h.FriendlyName) + delete(rawMsg, key) + case "incidentInfo": + err = unpopulate(val, "IncidentInfo", &h.IncidentInfo) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &h.Labels) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, "Notes", &h.Notes) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &h.Query) + delete(rawMsg, key) + case "queryResult": + err = unpopulate(val, "QueryResult", &h.QueryResult) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, "Updated", &h.Updated) + delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, "UpdatedBy", &h.UpdatedBy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, 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 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, "Author", &i.Author) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, "CreatedTimeUTC", &i.CreatedTimeUTC) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedTimeUTC", &i.LastModifiedTimeUTC) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &i.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, 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, "MetaData", &i.MetaData) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, "AdditionalData", &i.AdditionalData) + delete(rawMsg, key) + case "classification": + err = unpopulate(val, "Classification", &i.Classification) + delete(rawMsg, key) + case "classificationComment": + err = unpopulate(val, "ClassificationComment", &i.ClassificationComment) + delete(rawMsg, key) + case "classificationReason": + err = unpopulate(val, "ClassificationReason", &i.ClassificationReason) + delete(rawMsg, key) + case "createdTimeUtc": + err = unpopulateTimeRFC3339(val, "CreatedTimeUTC", &i.CreatedTimeUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "firstActivityTimeUtc": + err = unpopulateTimeRFC3339(val, "FirstActivityTimeUTC", &i.FirstActivityTimeUTC) + delete(rawMsg, key) + case "incidentNumber": + err = unpopulate(val, "IncidentNumber", &i.IncidentNumber) + delete(rawMsg, key) + case "incidentUrl": + err = unpopulate(val, "IncidentURL", &i.IncidentURL) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &i.Labels) + delete(rawMsg, key) + case "lastActivityTimeUtc": + err = unpopulateTimeRFC3339(val, "LastActivityTimeUTC", &i.LastActivityTimeUTC) + delete(rawMsg, key) + case "lastModifiedTimeUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedTimeUTC", &i.LastModifiedTimeUTC) + delete(rawMsg, key) + case "owner": + err = unpopulate(val, "Owner", &i.Owner) + delete(rawMsg, key) + case "providerIncidentId": + err = unpopulate(val, "ProviderIncidentID", &i.ProviderIncidentID) + delete(rawMsg, key) + case "providerName": + err = unpopulate(val, "ProviderName", &i.ProviderName) + delete(rawMsg, key) + case "relatedAnalyticRuleIds": + err = unpopulate(val, "RelatedAnalyticRuleIDs", &i.RelatedAnalyticRuleIDs) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &i.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "teamInformation": + err = unpopulate(val, "TeamInformation", &i.TeamInformation) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &i.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &i.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &i.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &i.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRuleTemplateName": + err = unpopulate(val, "AlertRuleTemplateName", &m.AlertRuleTemplateName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &m.LastModifiedUTC) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &m.Severity) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &m.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &m.Techniques) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &m.AlertRulesCreatedByTemplateCount) + delete(rawMsg, key) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &m.CreatedDateUTC) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &m.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &m.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &m.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &m.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &m.Techniques) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, "AdditionalData", &m.AdditionalData) + delete(rawMsg, key) + case "clusterGroup": + err = unpopulate(val, "ClusterGroup", &m.ClusterGroup) + delete(rawMsg, key) + case "clusterQueryEndTime": + err = unpopulateTimeRFC3339(val, "ClusterQueryEndTime", &m.ClusterQueryEndTime) + delete(rawMsg, key) + case "clusterQueryStartTime": + err = unpopulateTimeRFC3339(val, "ClusterQueryStartTime", &m.ClusterQueryStartTime) + delete(rawMsg, key) + case "clusterSourceIdentifier": + err = unpopulate(val, "ClusterSourceIdentifier", &m.ClusterSourceIdentifier) + delete(rawMsg, key) + case "clusterSourceType": + err = unpopulate(val, "ClusterSourceType", &m.ClusterSourceType) + delete(rawMsg, key) + case "countByDeliveryStatus": + err = unpopulate(val, "CountByDeliveryStatus", &m.CountByDeliveryStatus) + delete(rawMsg, key) + case "countByProtectionStatus": + err = unpopulate(val, "CountByProtectionStatus", &m.CountByProtectionStatus) + delete(rawMsg, key) + case "countByThreatType": + err = unpopulate(val, "CountByThreatType", &m.CountByThreatType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &m.FriendlyName) + delete(rawMsg, key) + case "isVolumeAnomaly": + err = unpopulate(val, "IsVolumeAnomaly", &m.IsVolumeAnomaly) + delete(rawMsg, key) + case "mailCount": + err = unpopulate(val, "MailCount", &m.MailCount) + delete(rawMsg, key) + case "networkMessageIds": + err = unpopulate(val, "NetworkMessageIDs", &m.NetworkMessageIDs) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &m.Query) + delete(rawMsg, key) + case "queryTime": + err = unpopulateTimeRFC3339(val, "QueryTime", &m.QueryTime) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &m.Source) + delete(rawMsg, key) + case "threats": + err = unpopulate(val, "Threats", &m.Threats) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, "AdditionalData", &m.AdditionalData) + delete(rawMsg, key) + case "antispamDirection": + err = unpopulate(val, "AntispamDirection", &m.AntispamDirection) + delete(rawMsg, key) + case "bodyFingerprintBin1": + err = unpopulate(val, "BodyFingerprintBin1", &m.BodyFingerprintBin1) + delete(rawMsg, key) + case "bodyFingerprintBin2": + err = unpopulate(val, "BodyFingerprintBin2", &m.BodyFingerprintBin2) + delete(rawMsg, key) + case "bodyFingerprintBin3": + err = unpopulate(val, "BodyFingerprintBin3", &m.BodyFingerprintBin3) + delete(rawMsg, key) + case "bodyFingerprintBin4": + err = unpopulate(val, "BodyFingerprintBin4", &m.BodyFingerprintBin4) + delete(rawMsg, key) + case "bodyFingerprintBin5": + err = unpopulate(val, "BodyFingerprintBin5", &m.BodyFingerprintBin5) delete(rawMsg, key) - case "metaData": - err = unpopulate(val, "MetaData", &i.MetaData) + case "deliveryAction": + err = unpopulate(val, "DeliveryAction", &m.DeliveryAction) + delete(rawMsg, key) + case "deliveryLocation": + err = unpopulate(val, "DeliveryLocation", &m.DeliveryLocation) + delete(rawMsg, key) + case "fileEntityIds": + err = unpopulate(val, "FileEntityIDs", &m.FileEntityIDs) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &m.FriendlyName) + delete(rawMsg, key) + case "internetMessageId": + err = unpopulate(val, "InternetMessageID", &m.InternetMessageID) + delete(rawMsg, key) + case "language": + err = unpopulate(val, "Language", &m.Language) + delete(rawMsg, key) + case "networkMessageId": + err = unpopulate(val, "NetworkMessageID", &m.NetworkMessageID) + delete(rawMsg, key) + case "p1Sender": + err = unpopulate(val, "P1Sender", &m.P1Sender) + delete(rawMsg, key) + case "p1SenderDisplayName": + err = unpopulate(val, "P1SenderDisplayName", &m.P1SenderDisplayName) + delete(rawMsg, key) + case "p1SenderDomain": + err = unpopulate(val, "P1SenderDomain", &m.P1SenderDomain) + delete(rawMsg, key) + case "p2Sender": + err = unpopulate(val, "P2Sender", &m.P2Sender) + delete(rawMsg, key) + case "p2SenderDisplayName": + err = unpopulate(val, "P2SenderDisplayName", &m.P2SenderDisplayName) + delete(rawMsg, key) + case "p2SenderDomain": + err = unpopulate(val, "P2SenderDomain", &m.P2SenderDomain) + delete(rawMsg, key) + case "receiveDate": + err = unpopulateTimeRFC3339(val, "ReceiveDate", &m.ReceiveDate) + delete(rawMsg, key) + case "recipient": + err = unpopulate(val, "Recipient", &m.Recipient) + delete(rawMsg, key) + case "senderIP": + err = unpopulate(val, "SenderIP", &m.SenderIP) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &m.Subject) + delete(rawMsg, key) + case "threatDetectionMethods": + err = unpopulate(val, "ThreatDetectionMethods", &m.ThreatDetectionMethods) + delete(rawMsg, key) + case "threats": + err = unpopulate(val, "Threats", &m.Threats) + delete(rawMsg, key) + case "urls": + err = unpopulate(val, "Urls", &m.Urls) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IncidentProperties. -func (i IncidentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MailboxEntity. +func (m MailboxEntity) 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, "relatedAnalyticRuleIds", i.RelatedAnalyticRuleIDs) - populate(objectMap, "severity", i.Severity) - populate(objectMap, "status", i.Status) - populate(objectMap, "title", i.Title) + 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "author": + err = unpopulate(val, "Author", &m.Author) + delete(rawMsg, key) + case "categories": + err = unpopulate(val, "Categories", &m.Categories) + delete(rawMsg, key) + case "contentId": + err = unpopulate(val, "ContentID", &m.ContentID) + delete(rawMsg, key) + case "contentSchemaVersion": + err = unpopulate(val, "ContentSchemaVersion", &m.ContentSchemaVersion) + delete(rawMsg, key) + case "customVersion": + err = unpopulate(val, "CustomVersion", &m.CustomVersion) + delete(rawMsg, key) + case "dependencies": + err = unpopulate(val, "Dependencies", &m.Dependencies) + delete(rawMsg, key) + case "firstPublishDate": + err = unpopulateDateType(val, "FirstPublishDate", &m.FirstPublishDate) + delete(rawMsg, key) + case "icon": + err = unpopulate(val, "Icon", &m.Icon) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "lastPublishDate": + err = unpopulateDateType(val, "LastPublishDate", &m.LastPublishDate) + delete(rawMsg, key) + case "parentId": + err = unpopulate(val, "ParentID", &m.ParentID) + delete(rawMsg, key) + case "previewImages": + err = unpopulate(val, "PreviewImages", &m.PreviewImages) + delete(rawMsg, key) + case "previewImagesDark": + err = unpopulate(val, "PreviewImagesDark", &m.PreviewImagesDark) + delete(rawMsg, key) + case "providers": + err = unpopulate(val, "Providers", &m.Providers) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &m.Source) + delete(rawMsg, key) + case "support": + err = unpopulate(val, "Support", &m.Support) + delete(rawMsg, key) + case "threatAnalysisTactics": + err = unpopulate(val, "ThreatAnalysisTactics", &m.ThreatAnalysisTactics) + delete(rawMsg, key) + case "threatAnalysisTechniques": + err = unpopulate(val, "ThreatAnalysisTechniques", &m.ThreatAnalysisTechniques) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 IncidentProperties. -func (i *IncidentProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "additionalData": - err = unpopulate(val, "AdditionalData", &i.AdditionalData) + case "author": + err = unpopulate(val, "Author", &m.Author) delete(rawMsg, key) - case "classification": - err = unpopulate(val, "Classification", &i.Classification) + case "categories": + err = unpopulate(val, "Categories", &m.Categories) delete(rawMsg, key) - case "classificationComment": - err = unpopulate(val, "ClassificationComment", &i.ClassificationComment) + case "contentId": + err = unpopulate(val, "ContentID", &m.ContentID) delete(rawMsg, key) - case "classificationReason": - err = unpopulate(val, "ClassificationReason", &i.ClassificationReason) + case "contentSchemaVersion": + err = unpopulate(val, "ContentSchemaVersion", &m.ContentSchemaVersion) delete(rawMsg, key) - case "createdTimeUtc": - err = unpopulateTimeRFC3339(val, "CreatedTimeUTC", &i.CreatedTimeUTC) + case "customVersion": + err = unpopulate(val, "CustomVersion", &m.CustomVersion) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &i.Description) + case "dependencies": + err = unpopulate(val, "Dependencies", &m.Dependencies) delete(rawMsg, key) - case "firstActivityTimeUtc": - err = unpopulateTimeRFC3339(val, "FirstActivityTimeUTC", &i.FirstActivityTimeUTC) + case "firstPublishDate": + err = unpopulateDateType(val, "FirstPublishDate", &m.FirstPublishDate) delete(rawMsg, key) - case "incidentNumber": - err = unpopulate(val, "IncidentNumber", &i.IncidentNumber) + case "icon": + err = unpopulate(val, "Icon", &m.Icon) delete(rawMsg, key) - case "incidentUrl": - err = unpopulate(val, "IncidentURL", &i.IncidentURL) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &i.Labels) + case "lastPublishDate": + err = unpopulateDateType(val, "LastPublishDate", &m.LastPublishDate) delete(rawMsg, key) - case "lastActivityTimeUtc": - err = unpopulateTimeRFC3339(val, "LastActivityTimeUTC", &i.LastActivityTimeUTC) + case "parentId": + err = unpopulate(val, "ParentID", &m.ParentID) delete(rawMsg, key) - case "lastModifiedTimeUtc": - err = unpopulateTimeRFC3339(val, "LastModifiedTimeUTC", &i.LastModifiedTimeUTC) + case "previewImages": + err = unpopulate(val, "PreviewImages", &m.PreviewImages) delete(rawMsg, key) - case "owner": - err = unpopulate(val, "Owner", &i.Owner) + case "previewImagesDark": + err = unpopulate(val, "PreviewImagesDark", &m.PreviewImagesDark) delete(rawMsg, key) - case "relatedAnalyticRuleIds": - err = unpopulate(val, "RelatedAnalyticRuleIDs", &i.RelatedAnalyticRuleIDs) + case "providers": + err = unpopulate(val, "Providers", &m.Providers) delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &i.Severity) + case "source": + err = unpopulate(val, "Source", &m.Source) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &i.Status) + case "support": + err = unpopulate(val, "Support", &m.Support) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &i.Title) + case "threatAnalysisTactics": + err = unpopulate(val, "ThreatAnalysisTactics", &m.ThreatAnalysisTactics) + delete(rawMsg, key) + case "threatAnalysisTechniques": + err = unpopulate(val, "ThreatAnalysisTechniques", &m.ThreatAnalysisTechniques) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &m.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, 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) -} - -// MarshalJSON implements the json.Marshaller interface for type IoTDeviceEntity. -func (i IoTDeviceEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRule. +func (m MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - objectMap["kind"] = EntityKindEnumIoTDevice - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "type", i.Type) + 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 IoTDeviceEntity. -func (i *IoTDeviceEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &m.Etag) + delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &i.ID) + err = unpopulate(val, "ID", &m.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &i.Kind) + err = unpopulate(val, "Kind", &m.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &i.Name) + err = unpopulate(val, "Name", &m.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &i.Properties) + err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &i.SystemData) + err = unpopulate(val, "SystemData", &m.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &i.Type) + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IoTDeviceEntityProperties. -func (i IoTDeviceEntityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties. +func (m MicrosoftSecurityIncidentCreationAlertRuleCommonProperties) 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) + 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 MCASDataConnector. -func (m MCASDataConnector) MarshalJSON() ([]byte, error) { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertRuleTemplateName": + err = unpopulate(val, "AlertRuleTemplateName", &m.AlertRuleTemplateName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) + delete(rawMsg, key) + case "displayNamesExcludeFilter": + err = unpopulate(val, "DisplayNamesExcludeFilter", &m.DisplayNamesExcludeFilter) + delete(rawMsg, key) + case "displayNamesFilter": + err = unpopulate(val, "DisplayNamesFilter", &m.DisplayNamesFilter) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &m.Enabled) + delete(rawMsg, key) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &m.LastModifiedUTC) + delete(rawMsg, key) + case "productFilter": + err = unpopulate(val, "ProductFilter", &m.ProductFilter) + delete(rawMsg, key) + case "severitiesFilter": + err = unpopulate(val, "SeveritiesFilter", &m.SeveritiesFilter) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (m MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "etag", m.Etag) populate(objectMap, "id", m.ID) - objectMap["kind"] = DataConnectorKindMicrosoftCloudAppSecurity + objectMap["kind"] = AlertRuleKindMicrosoftSecurityIncidentCreation populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) populate(objectMap, "systemData", m.SystemData) @@ -1648,8 +4861,60 @@ func (m MCASDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MCASDataConnector. -func (m *MCASDataConnector) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, 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 fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1657,26 +4922,38 @@ func (m *MCASDataConnector) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &m.Etag) + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &m.AlertRulesCreatedByTemplateCount) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &m.CreatedDateUTC) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &m.Kind) + case "description": + err = unpopulate(val, "Description", &m.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + case "displayName": + err = unpopulate(val, "DisplayName", &m.DisplayName) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &m.Properties) + case "displayNamesExcludeFilter": + err = unpopulate(val, "DisplayNamesExcludeFilter", &m.DisplayNamesExcludeFilter) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + case "displayNamesFilter": + err = unpopulate(val, "DisplayNamesFilter", &m.DisplayNamesFilter) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &m.LastUpdatedDateUTC) + delete(rawMsg, key) + case "productFilter": + err = unpopulate(val, "ProductFilter", &m.ProductFilter) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &m.RequiredDataConnectors) + delete(rawMsg, key) + case "severitiesFilter": + err = unpopulate(val, "SeveritiesFilter", &m.SeveritiesFilter) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) delete(rawMsg, key) } if err != nil { @@ -1686,21 +4963,16 @@ func (m *MCASDataConnector) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MDATPDataConnector. -func (m MDATPDataConnector) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MtpCheckRequirements. +func (m MtpCheckRequirements) 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) + objectMap["kind"] = DataConnectorKindMicrosoftThreatProtection 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 { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1708,27 +4980,12 @@ func (m *MDATPDataConnector) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &m.Etag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) case "kind": err = unpopulate(val, "Kind", &m.Kind) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) case "properties": err = unpopulate(val, "Properties", &m.Properties) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1737,680 +4994,608 @@ func (m *MDATPDataConnector) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type MailClusterEntity. -func (m MailClusterEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRule. +func (n NrtAlertRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindEnumMailCluster - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + 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 MailClusterEntity. -func (m *MailClusterEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &n.Etag) + delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &m.ID) + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &m.Kind) + err = unpopulate(val, "Kind", &n.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MailClusterEntityProperties. -func (m MailClusterEntityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleProperties. +func (n NrtAlertRuleProperties) 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) + 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 MailClusterEntityProperties. -func (m *MailClusterEntityProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "additionalData": - err = unpopulate(val, "AdditionalData", &m.AdditionalData) - delete(rawMsg, key) - case "clusterGroup": - err = unpopulate(val, "ClusterGroup", &m.ClusterGroup) + case "alertDetailsOverride": + err = unpopulate(val, "AlertDetailsOverride", &n.AlertDetailsOverride) delete(rawMsg, key) - case "clusterQueryEndTime": - err = unpopulateTimeRFC3339(val, "ClusterQueryEndTime", &m.ClusterQueryEndTime) + case "alertRuleTemplateName": + err = unpopulate(val, "AlertRuleTemplateName", &n.AlertRuleTemplateName) delete(rawMsg, key) - case "clusterQueryStartTime": - err = unpopulateTimeRFC3339(val, "ClusterQueryStartTime", &m.ClusterQueryStartTime) + case "customDetails": + err = unpopulate(val, "CustomDetails", &n.CustomDetails) delete(rawMsg, key) - case "clusterSourceIdentifier": - err = unpopulate(val, "ClusterSourceIdentifier", &m.ClusterSourceIdentifier) + case "description": + err = unpopulate(val, "Description", &n.Description) delete(rawMsg, key) - case "clusterSourceType": - err = unpopulate(val, "ClusterSourceType", &m.ClusterSourceType) + case "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) delete(rawMsg, key) - case "countByDeliveryStatus": - err = unpopulate(val, "CountByDeliveryStatus", &m.CountByDeliveryStatus) + case "enabled": + err = unpopulate(val, "Enabled", &n.Enabled) delete(rawMsg, key) - case "countByProtectionStatus": - err = unpopulate(val, "CountByProtectionStatus", &m.CountByProtectionStatus) + case "entityMappings": + err = unpopulate(val, "EntityMappings", &n.EntityMappings) delete(rawMsg, key) - case "countByThreatType": - err = unpopulate(val, "CountByThreatType", &m.CountByThreatType) + case "incidentConfiguration": + err = unpopulate(val, "IncidentConfiguration", &n.IncidentConfiguration) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &n.LastModifiedUTC) delete(rawMsg, key) - case "isVolumeAnomaly": - err = unpopulate(val, "IsVolumeAnomaly", &m.IsVolumeAnomaly) + case "query": + err = unpopulate(val, "Query", &n.Query) delete(rawMsg, key) - case "mailCount": - err = unpopulate(val, "MailCount", &m.MailCount) + case "severity": + err = unpopulate(val, "Severity", &n.Severity) delete(rawMsg, key) - case "networkMessageIds": - err = unpopulate(val, "NetworkMessageIDs", &m.NetworkMessageIDs) + case "suppressionDuration": + err = unpopulate(val, "SuppressionDuration", &n.SuppressionDuration) delete(rawMsg, key) - case "query": - err = unpopulate(val, "Query", &m.Query) + case "suppressionEnabled": + err = unpopulate(val, "SuppressionEnabled", &n.SuppressionEnabled) delete(rawMsg, key) - case "queryTime": - err = unpopulateTimeRFC3339(val, "QueryTime", &m.QueryTime) + case "tactics": + err = unpopulate(val, "Tactics", &n.Tactics) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &m.Source) + case "techniques": + err = unpopulate(val, "Techniques", &n.Techniques) delete(rawMsg, key) - case "threats": - err = unpopulate(val, "Threats", &m.Threats) + case "templateVersion": + err = unpopulate(val, "TemplateVersion", &n.TemplateVersion) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MailMessageEntity. -func (m MailMessageEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleTemplate. +func (n NrtAlertRuleTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindEnumMailMessage - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + 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 MailMessageEntity. -func (m *MailMessageEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { case "id": - err = unpopulate(val, "ID", &m.ID) + err = unpopulate(val, "ID", &n.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &m.Kind) + err = unpopulate(val, "Kind", &n.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &n.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "SystemData", &n.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MailMessageEntityProperties. -func (m MailMessageEntityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type NrtAlertRuleTemplateProperties. +func (n NrtAlertRuleTemplateProperties) 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) + 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 MailMessageEntityProperties. -func (m *MailMessageEntityProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } for key, val := range rawMsg { var err error switch key { - case "additionalData": - err = unpopulate(val, "AdditionalData", &m.AdditionalData) - delete(rawMsg, key) - case "antispamDirection": - err = unpopulate(val, "AntispamDirection", &m.AntispamDirection) - delete(rawMsg, key) - case "bodyFingerprintBin1": - err = unpopulate(val, "BodyFingerprintBin1", &m.BodyFingerprintBin1) - delete(rawMsg, key) - case "bodyFingerprintBin2": - err = unpopulate(val, "BodyFingerprintBin2", &m.BodyFingerprintBin2) - delete(rawMsg, key) - case "bodyFingerprintBin3": - err = unpopulate(val, "BodyFingerprintBin3", &m.BodyFingerprintBin3) - delete(rawMsg, key) - case "bodyFingerprintBin4": - err = unpopulate(val, "BodyFingerprintBin4", &m.BodyFingerprintBin4) - delete(rawMsg, key) - case "bodyFingerprintBin5": - err = unpopulate(val, "BodyFingerprintBin5", &m.BodyFingerprintBin5) - delete(rawMsg, key) - case "deliveryAction": - err = unpopulate(val, "DeliveryAction", &m.DeliveryAction) - delete(rawMsg, key) - case "deliveryLocation": - err = unpopulate(val, "DeliveryLocation", &m.DeliveryLocation) - delete(rawMsg, key) - case "fileEntityIds": - err = unpopulate(val, "FileEntityIDs", &m.FileEntityIDs) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) - delete(rawMsg, key) - case "internetMessageId": - err = unpopulate(val, "InternetMessageID", &m.InternetMessageID) - delete(rawMsg, key) - case "language": - err = unpopulate(val, "Language", &m.Language) + case "alertDetailsOverride": + err = unpopulate(val, "AlertDetailsOverride", &n.AlertDetailsOverride) delete(rawMsg, key) - case "networkMessageId": - err = unpopulate(val, "NetworkMessageID", &m.NetworkMessageID) + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &n.AlertRulesCreatedByTemplateCount) delete(rawMsg, key) - case "p1Sender": - err = unpopulate(val, "P1Sender", &m.P1Sender) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &n.CreatedDateUTC) delete(rawMsg, key) - case "p1SenderDisplayName": - err = unpopulate(val, "P1SenderDisplayName", &m.P1SenderDisplayName) + case "customDetails": + err = unpopulate(val, "CustomDetails", &n.CustomDetails) delete(rawMsg, key) - case "p1SenderDomain": - err = unpopulate(val, "P1SenderDomain", &m.P1SenderDomain) + case "description": + err = unpopulate(val, "Description", &n.Description) delete(rawMsg, key) - case "p2Sender": - err = unpopulate(val, "P2Sender", &m.P2Sender) + case "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) delete(rawMsg, key) - case "p2SenderDisplayName": - err = unpopulate(val, "P2SenderDisplayName", &m.P2SenderDisplayName) + case "entityMappings": + err = unpopulate(val, "EntityMappings", &n.EntityMappings) delete(rawMsg, key) - case "p2SenderDomain": - err = unpopulate(val, "P2SenderDomain", &m.P2SenderDomain) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &n.LastUpdatedDateUTC) delete(rawMsg, key) - case "receiveDate": - err = unpopulateTimeRFC3339(val, "ReceiveDate", &m.ReceiveDate) + case "query": + err = unpopulate(val, "Query", &n.Query) delete(rawMsg, key) - case "recipient": - err = unpopulate(val, "Recipient", &m.Recipient) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &n.RequiredDataConnectors) delete(rawMsg, key) - case "senderIP": - err = unpopulate(val, "SenderIP", &m.SenderIP) + case "severity": + err = unpopulate(val, "Severity", &n.Severity) delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &m.Subject) + case "status": + err = unpopulate(val, "Status", &n.Status) delete(rawMsg, key) - case "threatDetectionMethods": - err = unpopulate(val, "ThreatDetectionMethods", &m.ThreatDetectionMethods) + case "tactics": + err = unpopulate(val, "Tactics", &n.Tactics) delete(rawMsg, key) - case "threats": - err = unpopulate(val, "Threats", &m.Threats) + case "techniques": + err = unpopulate(val, "Techniques", &n.Techniques) delete(rawMsg, key) - case "urls": - err = unpopulate(val, "Urls", &m.Urls) + case "version": + err = unpopulate(val, "Version", &n.Version) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", n, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MailboxEntity. -func (m MailboxEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Office365ProjectCheckRequirements. +func (o Office365ProjectCheckRequirements) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindEnumMailbox - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + objectMap["kind"] = DataConnectorKindOffice365Project + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MailboxEntity. -func (m *MailboxEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &m.ID) - delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &m.Kind) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) -} - -// MarshalJSON implements the json.Marshaller interface for type MalwareEntity. -func (m MalwareEntity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Office365ProjectDataConnector. +func (o Office365ProjectDataConnector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - objectMap["kind"] = EntityKindEnumMalware - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "systemData", m.SystemData) - populate(objectMap, "type", m.Type) + 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 MalwareEntity. -func (m *MalwareEntity) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &o.Etag) + delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &m.ID) + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &m.Kind) + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "SystemData", &o.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MalwareEntityProperties. -func (m MalwareEntityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OfficeATPCheckRequirements. +func (o OfficeATPCheckRequirements) 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) + objectMap["kind"] = DataConnectorKindOfficeATP + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRule. -func (m MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { +// 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 fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &o.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OfficeATPDataConnector. +func (o OfficeATPDataConnector) 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) + 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 MicrosoftSecurityIncidentCreationAlertRule. -func (m *MicrosoftSecurityIncidentCreationAlertRule) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { case "etag": - err = unpopulate(val, "Etag", &m.Etag) + err = unpopulate(val, "Etag", &o.Etag) delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &m.ID) + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &m.Kind) + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "SystemData", &o.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, 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) { +// MarshalJSON implements the json.Marshaller interface for type OfficeDataConnector. +func (o OfficeDataConnector) 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) + 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 MicrosoftSecurityIncidentCreationAlertRuleProperties. -func (m *MicrosoftSecurityIncidentCreationAlertRuleProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "alertRuleTemplateName": - err = unpopulate(val, "AlertRuleTemplateName", &m.AlertRuleTemplateName) + case "etag": + err = unpopulate(val, "Etag", &o.Etag) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &m.Description) + case "id": + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &m.DisplayName) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) - case "displayNamesExcludeFilter": - err = unpopulate(val, "DisplayNamesExcludeFilter", &m.DisplayNamesExcludeFilter) + case "name": + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) - case "displayNamesFilter": - err = unpopulate(val, "DisplayNamesFilter", &m.DisplayNamesFilter) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &m.Enabled) + case "systemData": + err = unpopulate(val, "SystemData", &o.SystemData) delete(rawMsg, key) - case "lastModifiedUtc": - err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &m.LastModifiedUTC) + case "type": + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) - case "productFilter": - err = unpopulate(val, "ProductFilter", &m.ProductFilter) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) - case "severitiesFilter": - err = unpopulate(val, "SeveritiesFilter", &m.SeveritiesFilter) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplate. -func (m MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OfficeIRMDataConnector. +func (o OfficeIRMDataConnector) 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) + 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 MicrosoftSecurityIncidentCreationAlertRuleTemplate. -func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplate) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { + case "etag": + err = unpopulate(val, "Etag", &o.Etag) + delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &m.ID) + err = unpopulate(val, "ID", &o.ID) delete(rawMsg, key) case "kind": - err = unpopulate(val, "Kind", &m.Kind) + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &m.Name) + err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) case "properties": - err = unpopulate(val, "Properties", &m.Properties) + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) case "systemData": - err = unpopulate(val, "SystemData", &m.SystemData) + err = unpopulate(val, "SystemData", &o.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &m.Type) + err = unpopulate(val, "Type", &o.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties. -func (m MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OfficePowerBICheckRequirements. +func (o OfficePowerBICheckRequirements) 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) + objectMap["kind"] = DataConnectorKindOfficePowerBI + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties. -func (m *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } for key, val := range rawMsg { var err error switch key { - case "alertRulesCreatedByTemplateCount": - err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &m.AlertRulesCreatedByTemplateCount) - delete(rawMsg, key) - case "createdDateUTC": - err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &m.CreatedDateUTC) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &m.DisplayName) - delete(rawMsg, key) - case "displayNamesExcludeFilter": - err = unpopulate(val, "DisplayNamesExcludeFilter", &m.DisplayNamesExcludeFilter) - delete(rawMsg, key) - case "displayNamesFilter": - err = unpopulate(val, "DisplayNamesFilter", &m.DisplayNamesFilter) - delete(rawMsg, key) - case "lastUpdatedDateUTC": - err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &m.LastUpdatedDateUTC) - delete(rawMsg, key) - case "productFilter": - err = unpopulate(val, "ProductFilter", &m.ProductFilter) - delete(rawMsg, key) - case "requiredDataConnectors": - err = unpopulate(val, "RequiredDataConnectors", &m.RequiredDataConnectors) - delete(rawMsg, key) - case "severitiesFilter": - err = unpopulate(val, "SeveritiesFilter", &m.SeveritiesFilter) + case "kind": + err = unpopulate(val, "Kind", &o.Kind) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", o, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type OfficeDataConnector. -func (o OfficeDataConnector) MarshalJSON() ([]byte, error) { +// 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"] = DataConnectorKindOffice365 + objectMap["kind"] = DataConnectorKindOfficePowerBI populate(objectMap, "name", o.Name) populate(objectMap, "properties", o.Properties) populate(objectMap, "systemData", o.SystemData) @@ -2418,8 +5603,8 @@ func (o OfficeDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OfficeDataConnector. -func (o *OfficeDataConnector) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -2456,11 +5641,19 @@ func (o *OfficeDataConnector) UnmarshalJSON(data []byte) error { return nil } +// 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) +} + // 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"] = EntityKindEnumProcess + objectMap["kind"] = EntityKindProcess populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) populate(objectMap, "systemData", p.SystemData) @@ -2570,6 +5763,68 @@ func (p *ProcessEntityProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type PropertyArrayChangedConditionProperties. +func (p PropertyArrayChangedConditionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "conditionProperties", p.ConditionProperties) + objectMap["conditionType"] = ConditionTypePropertyArrayChanged + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertyArrayChangedConditionProperties. +func (p *PropertyArrayChangedConditionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "conditionProperties": + err = unpopulate(val, "ConditionProperties", &p.ConditionProperties) + delete(rawMsg, key) + case "conditionType": + err = unpopulate(val, "ConditionType", &p.ConditionType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PropertyChangedConditionProperties. +func (p PropertyChangedConditionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "conditionProperties", p.ConditionProperties) + objectMap["conditionType"] = ConditionTypePropertyChanged + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PropertyChangedConditionProperties. +func (p *PropertyChangedConditionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "conditionProperties": + err = unpopulate(val, "ConditionProperties", &p.ConditionProperties) + delete(rawMsg, key) + case "conditionType": + err = unpopulate(val, "ConditionType", &p.ConditionType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PropertyConditionProperties. func (p PropertyConditionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2601,11 +5856,23 @@ func (p *PropertyConditionProperties) UnmarshalJSON(data []byte) error { 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) +} + // 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"] = EntityKindEnumRegistryKey + objectMap["kind"] = EntityKindRegistryKey populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) populate(objectMap, "systemData", r.SystemData) @@ -2662,7 +5929,7 @@ func (r RegistryKeyEntityProperties) MarshalJSON() ([]byte, error) { func (r RegistryValueEntity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", r.ID) - objectMap["kind"] = EntityKindEnumRegistryValue + objectMap["kind"] = EntityKindRegistryValue populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) populate(objectMap, "systemData", r.SystemData) @@ -2717,6 +5984,17 @@ func (r RegistryValueEntityProperties) MarshalJSON() ([]byte, error) { 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) +} + // MarshalJSON implements the json.Marshaller interface for type ScheduledAlertRule. func (s ScheduledAlertRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -2804,6 +6082,7 @@ func (s ScheduledAlertRuleProperties) MarshalJSON() ([]byte, error) { 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) @@ -2870,6 +6149,9 @@ func (s *ScheduledAlertRuleProperties) UnmarshalJSON(data []byte) error { case "tactics": err = unpopulate(val, "Tactics", &s.Tactics) delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &s.Techniques) + delete(rawMsg, key) case "templateVersion": err = unpopulate(val, "TemplateVersion", &s.TemplateVersion) delete(rawMsg, key) @@ -2953,6 +6235,7 @@ func (s ScheduledAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { 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) @@ -3016,6 +6299,9 @@ func (s *ScheduledAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error case "tactics": err = unpopulate(val, "Tactics", &s.Tactics) delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &s.Techniques) + delete(rawMsg, key) case "triggerOperator": err = unpopulate(val, "TriggerOperator", &s.TriggerOperator) delete(rawMsg, key) @@ -3037,7 +6323,7 @@ func (s *ScheduledAlertRuleTemplateProperties) UnmarshalJSON(data []byte) error func (s SecurityAlert) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - objectMap["kind"] = EntityKindEnumSecurityAlert + objectMap["kind"] = EntityKindSecurityAlert populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "systemData", s.SystemData) @@ -3211,11 +6497,58 @@ func (s *SecurityAlertProperties) UnmarshalJSON(data []byte) error { return nil } +// 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 fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertType": + err = unpopulate(val, "AlertType", &s.AlertType) + delete(rawMsg, key) + case "azureResourceId": + err = unpopulate(val, "AzureResourceID", &s.AzureResourceID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "endTimeUtc": + err = unpopulateTimeRFC3339(val, "EndTimeUTC", &s.EndTimeUTC) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "productName": + err = unpopulate(val, "ProductName", &s.ProductName) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &s.Severity) + delete(rawMsg, key) + case "startTimeUtc": + err = unpopulateTimeRFC3339(val, "StartTimeUTC", &s.StartTimeUTC) + delete(rawMsg, key) + case "timeGenerated": + err = unpopulateTimeRFC3339(val, "TimeGenerated", &s.TimeGenerated) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // 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"] = EntityKindEnumSecurityGroup + objectMap["kind"] = EntityKindSecurityGroup populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "systemData", s.SystemData) @@ -3258,14 +6591,80 @@ func (s *SecurityGroupEntity) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityGroupEntityProperties. -func (s SecurityGroupEntityProperties) MarshalJSON() ([]byte, error) { +// 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 SecurityMLAnalyticsSettingsDataSource. +func (s SecurityMLAnalyticsSettingsDataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connectorId", s.ConnectorID) + populate(objectMap, "dataTypes", s.DataTypes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityMLAnalyticsSettingsList. +func (s *SecurityMLAnalyticsSettingsList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + s.Value, err = unmarshalSecurityMLAnalyticsSettingClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", s, 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 fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SourceControlProperties. +func (s SourceControlProperties) 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) + 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) } @@ -3273,7 +6672,7 @@ func (s SecurityGroupEntityProperties) MarshalJSON() ([]byte, error) { func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "id", s.ID) - objectMap["kind"] = EntityKindEnumSubmissionMail + objectMap["kind"] = EntityKindSubmissionMail populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "systemData", s.SystemData) @@ -3367,79 +6766,354 @@ func (s *SubmissionMailEntityProperties) UnmarshalJSON(data []byte) error { case "subject": err = unpopulate(val, "Subject", &s.Subject) delete(rawMsg, key) - case "submissionDate": - err = unpopulateTimeRFC3339(val, "SubmissionDate", &s.SubmissionDate) + case "submissionDate": + err = unpopulateTimeRFC3339(val, "SubmissionDate", &s.SubmissionDate) + delete(rawMsg, key) + case "submissionId": + err = unpopulate(val, "SubmissionID", &s.SubmissionID) + delete(rawMsg, key) + case "submitter": + err = unpopulate(val, "Submitter", &s.Submitter) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, 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 fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &t.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &t.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dataTypes": + err = unpopulate(val, "DataTypes", &t.DataTypes) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &t.TenantID) + delete(rawMsg, key) + case "tipLookbackPeriod": + err = unpopulateTimeRFC3339(val, "TipLookbackPeriod", &t.TipLookbackPeriod) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &t.Description) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "primaryChannelUrl": + err = unpopulate(val, "PrimaryChannelURL", &t.PrimaryChannelURL) + delete(rawMsg, key) + case "teamCreationTimeUtc": + err = unpopulateTimeRFC3339(val, "TeamCreationTimeUTC", &t.TeamCreationTimeUTC) + delete(rawMsg, key) + case "teamId": + err = unpopulate(val, "TeamID", &t.TeamID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, 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) +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &t.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &t.Kind) delete(rawMsg, key) - case "submissionId": - err = unpopulate(val, "SubmissionID", &s.SubmissionID) + case "name": + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "submitter": - err = unpopulate(val, "Submitter", &s.Submitter) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleProperties. +func (t ThreatIntelligenceAlertRuleProperties) 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) + 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 SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + case "alertRuleTemplateName": + err = unpopulate(val, "AlertRuleTemplateName", &t.AlertRuleTemplateName) delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) + case "description": + err = unpopulate(val, "Description", &t.Description) delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) + case "displayName": + err = unpopulate(val, "DisplayName", &t.DisplayName) delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + case "enabled": + err = unpopulate(val, "Enabled", &t.Enabled) delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + case "lastModifiedUtc": + err = unpopulateTimeRFC3339(val, "LastModifiedUTC", &t.LastModifiedUTC) delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + case "severity": + err = unpopulate(val, "Severity", &t.Severity) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &t.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &t.Techniques) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TIDataConnector. -func (t TIDataConnector) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleTemplate. +func (t ThreatIntelligenceAlertRuleTemplate) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "etag", t.Etag) populate(objectMap, "id", t.ID) - objectMap["kind"] = DataConnectorKindThreatIntelligence + objectMap["kind"] = AlertRuleKindThreatIntelligence populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) populate(objectMap, "systemData", t.SystemData) @@ -3447,8 +7121,8 @@ func (t TIDataConnector) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type TIDataConnector. -func (t *TIDataConnector) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -3456,9 +7130,6 @@ func (t *TIDataConnector) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &t.Etag) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &t.ID) delete(rawMsg, key) @@ -3485,17 +7156,24 @@ func (t *TIDataConnector) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TIDataConnectorProperties. -func (t TIDataConnectorProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ThreatIntelligenceAlertRuleTemplateProperties. +func (t ThreatIntelligenceAlertRuleTemplateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "dataTypes", t.DataTypes) - populate(objectMap, "tenantId", t.TenantID) - populateTimeRFC3339(objectMap, "tipLookbackPeriod", t.TipLookbackPeriod) + 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 TIDataConnectorProperties. -func (t *TIDataConnectorProperties) UnmarshalJSON(data []byte) error { +// 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 fmt.Errorf("unmarshalling type %T: %v", t, err) @@ -3503,14 +7181,35 @@ func (t *TIDataConnectorProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dataTypes": - err = unpopulate(val, "DataTypes", &t.DataTypes) + case "alertRulesCreatedByTemplateCount": + err = unpopulate(val, "AlertRulesCreatedByTemplateCount", &t.AlertRulesCreatedByTemplateCount) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &t.TenantID) + case "createdDateUTC": + err = unpopulateTimeRFC3339(val, "CreatedDateUTC", &t.CreatedDateUTC) delete(rawMsg, key) - case "tipLookbackPeriod": - err = unpopulateTimeRFC3339(val, "TipLookbackPeriod", &t.TipLookbackPeriod) + case "description": + err = unpopulate(val, "Description", &t.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &t.DisplayName) + delete(rawMsg, key) + case "lastUpdatedDateUTC": + err = unpopulateTimeRFC3339(val, "LastUpdatedDateUTC", &t.LastUpdatedDateUTC) + delete(rawMsg, key) + case "requiredDataConnectors": + err = unpopulate(val, "RequiredDataConnectors", &t.RequiredDataConnectors) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &t.Severity) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &t.Status) + delete(rawMsg, key) + case "tactics": + err = unpopulate(val, "Tactics", &t.Tactics) + delete(rawMsg, key) + case "techniques": + err = unpopulate(val, "Techniques", &t.Techniques) delete(rawMsg, key) } if err != nil { @@ -3571,7 +7270,7 @@ func (t ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "etag", t.Etag) populate(objectMap, "id", t.ID) - objectMap["kind"] = ThreatIntelligenceResourceInnerKindIndicator + objectMap["kind"] = ThreatIntelligenceResourceKindEnumIndicator populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) populate(objectMap, "systemData", t.SystemData) @@ -3684,11 +7383,156 @@ func (t ThreatIntelligenceParsedPattern) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "kind": + err = unpopulate(val, "Kind", &t.Kind) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &t.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &t.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &t.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, 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 fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "collectionId": + err = unpopulate(val, "CollectionID", &t.CollectionID) + delete(rawMsg, key) + case "dataTypes": + err = unpopulate(val, "DataTypes", &t.DataTypes) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &t.FriendlyName) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &t.Password) + delete(rawMsg, key) + case "pollingFrequency": + err = unpopulate(val, "PollingFrequency", &t.PollingFrequency) + delete(rawMsg, key) + case "taxiiLookbackPeriod": + err = unpopulateTimeRFC3339(val, "TaxiiLookbackPeriod", &t.TaxiiLookbackPeriod) + delete(rawMsg, key) + case "taxiiServer": + err = unpopulate(val, "TaxiiServer", &t.TaxiiServer) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &t.TenantID) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &t.UserName) + delete(rawMsg, key) + case "workspaceId": + err = unpopulate(val, "WorkspaceID", &t.WorkspaceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // 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"] = EntityKindEnumURL + objectMap["kind"] = EntityKindURL populate(objectMap, "name", u.Name) populate(objectMap, "properties", u.Properties) populate(objectMap, "systemData", u.SystemData) @@ -3740,14 +7584,72 @@ func (u URLEntityProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// 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 fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &u.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &u.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &u.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, 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 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, "entityMapping", w.EntityMapping) populate(objectMap, "isDeleted", w.IsDeleted) - populate(objectMap, "itemsKeyValue", &w.ItemsKeyValue) + populate(objectMap, "itemsKeyValue", w.ItemsKeyValue) populate(objectMap, "tenantId", w.TenantID) populateTimeRFC3339(objectMap, "updated", w.Updated) populate(objectMap, "updatedBy", w.UpdatedBy) @@ -3819,6 +7721,7 @@ func (w WatchlistProperties) MarshalJSON() ([]byte, error) { 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) @@ -3877,6 +7780,9 @@ func (w *WatchlistProperties) UnmarshalJSON(data []byte) error { case "source": err = unpopulate(val, "Source", &w.Source) delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &w.SourceType) + delete(rawMsg, key) case "tenantId": err = unpopulate(val, "TenantID", &w.TenantID) delete(rawMsg, key) diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_officeconsents_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_officeconsents_client.go new file mode 100644 index 000000000000..1d5b25e9fb2e --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_officeconsents_client.go @@ -0,0 +1,237 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// OfficeConsentsClient contains the methods for the OfficeConsents group. +// Don't use this type directly, use NewOfficeConsentsClient() instead. +type OfficeConsentsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewOfficeConsentsClient creates a new instance of OfficeConsentsClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Delete - Delete the office365 consent. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// consentID - consent ID +// options - OfficeConsentsClientDeleteOptions contains the optional parameters for the OfficeConsentsClient.Delete method. +func (client *OfficeConsentsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, consentID string, options *OfficeConsentsClientDeleteOptions) (OfficeConsentsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, consentID, options) + if err != nil { + return OfficeConsentsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OfficeConsentsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return OfficeConsentsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return OfficeConsentsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *OfficeConsentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, consentID string, options *OfficeConsentsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}" + 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 consentID == "" { + return nil, errors.New("parameter consentID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{consentId}", url.PathEscape(consentID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets an office365 consent. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// consentID - consent ID +// options - OfficeConsentsClientGetOptions contains the optional parameters for the OfficeConsentsClient.Get method. +func (client *OfficeConsentsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, consentID string, options *OfficeConsentsClientGetOptions) (OfficeConsentsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, consentID, options) + if err != nil { + return OfficeConsentsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return OfficeConsentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OfficeConsentsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *OfficeConsentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, consentID string, options *OfficeConsentsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents/{consentId}" + 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 consentID == "" { + return nil, errors.New("parameter consentID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{consentId}", url.PathEscape(consentID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *OfficeConsentsClient) getHandleResponse(resp *http.Response) (OfficeConsentsClientGetResponse, error) { + result := OfficeConsentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OfficeConsent); err != nil { + return OfficeConsentsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all office365 consents. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// 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) NewListPager(resourceGroupName string, workspaceName string, options *OfficeConsentsClientListOptions) *runtime.Pager[OfficeConsentsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OfficeConsentsClientListResponse]{ + More: func(page OfficeConsentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *OfficeConsentsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *OfficeConsentsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/officeConsents" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OfficeConsentsClient) listHandleResponse(resp *http.Response) (OfficeConsentsClientListResponse, error) { + result := OfficeConsentsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OfficeConsentList); err != nil { + return OfficeConsentsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go index e3facbe50e3f..dd47a1d25fa3 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all operations available Azure Security Insights Resource Provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go index 7fd07c046aea..39781f1084de 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_polymorphic_helpers.go @@ -22,10 +22,16 @@ func unmarshalAlertRuleClassification(rawMsg json.RawMessage) (AlertRuleClassifi switch m["kind"] { case string(AlertRuleKindFusion): b = &FusionAlertRule{} + case string(AlertRuleKindMLBehaviorAnalytics): + b = &MLBehaviorAnalyticsAlertRule{} case string(AlertRuleKindMicrosoftSecurityIncidentCreation): b = &MicrosoftSecurityIncidentCreationAlertRule{} + case string(AlertRuleKindNRT): + b = &NrtAlertRule{} case string(AlertRuleKindScheduled): b = &ScheduledAlertRule{} + case string(AlertRuleKindThreatIntelligence): + b = &ThreatIntelligenceAlertRule{} default: b = &AlertRule{} } @@ -63,10 +69,16 @@ func unmarshalAlertRuleTemplateClassification(rawMsg json.RawMessage) (AlertRule switch m["kind"] { case string(AlertRuleKindFusion): b = &FusionAlertRuleTemplate{} + case string(AlertRuleKindMLBehaviorAnalytics): + b = &MLBehaviorAnalyticsAlertRuleTemplate{} case string(AlertRuleKindMicrosoftSecurityIncidentCreation): b = &MicrosoftSecurityIncidentCreationAlertRuleTemplate{} + case string(AlertRuleKindNRT): + b = &NrtAlertRuleTemplate{} case string(AlertRuleKindScheduled): b = &ScheduledAlertRuleTemplate{} + case string(AlertRuleKindThreatIntelligence): + b = &ThreatIntelligenceAlertRuleTemplate{} default: b = &AlertRuleTemplate{} } @@ -143,6 +155,10 @@ func unmarshalAutomationRuleConditionClassification(rawMsg json.RawMessage) (Aut switch m["conditionType"] { case string(ConditionTypeProperty): b = &PropertyConditionProperties{} + case string(ConditionTypePropertyArrayChanged): + b = &PropertyArrayChangedConditionProperties{} + case string(ConditionTypePropertyChanged): + b = &PropertyChangedConditionProperties{} default: b = &AutomationRuleCondition{} } @@ -178,22 +194,46 @@ func unmarshalDataConnectorClassification(rawMsg json.RawMessage) (DataConnector } var b DataConnectorClassification switch m["kind"] { + case string(DataConnectorKindAPIPolling): + b = &CodelessAPIPollingDataConnector{} case string(DataConnectorKindAmazonWebServicesCloudTrail): b = &AwsCloudTrailDataConnector{} + case string(DataConnectorKindAmazonWebServicesS3): + b = &AwsS3DataConnector{} case string(DataConnectorKindAzureActiveDirectory): b = &AADDataConnector{} case string(DataConnectorKindAzureAdvancedThreatProtection): b = &AATPDataConnector{} case string(DataConnectorKindAzureSecurityCenter): b = &ASCDataConnector{} + case string(DataConnectorKindDynamics365): + b = &Dynamics365DataConnector{} + case string(DataConnectorKindGenericUI): + b = &CodelessUIDataConnector{} + case string(DataConnectorKindIOT): + b = &IoTDataConnector{} case string(DataConnectorKindMicrosoftCloudAppSecurity): b = &MCASDataConnector{} case string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection): b = &MDATPDataConnector{} + case string(DataConnectorKindMicrosoftThreatIntelligence): + b = &MSTIDataConnector{} + case string(DataConnectorKindMicrosoftThreatProtection): + b = &MTPDataConnector{} case string(DataConnectorKindOffice365): b = &OfficeDataConnector{} + case string(DataConnectorKindOffice365Project): + b = &Office365ProjectDataConnector{} + case string(DataConnectorKindOfficeATP): + b = &OfficeATPDataConnector{} + case string(DataConnectorKindOfficeIRM): + b = &OfficeIRMDataConnector{} + case string(DataConnectorKindOfficePowerBI): + b = &OfficePowerBIDataConnector{} case string(DataConnectorKindThreatIntelligence): b = &TIDataConnector{} + case string(DataConnectorKindThreatIntelligenceTaxii): + b = &TiTaxiiDataConnector{} default: b = &DataConnector{} } @@ -229,47 +269,47 @@ func unmarshalEntityClassification(rawMsg json.RawMessage) (EntityClassification } var b EntityClassification switch m["kind"] { - case string(EntityKindEnumAccount): + case string(EntityKindAccount): b = &AccountEntity{} - case string(EntityKindEnumAzureResource): + case string(EntityKindAzureResource): b = &AzureResourceEntity{} - case string(EntityKindEnumBookmark): + case string(EntityKindBookmark): b = &HuntingBookmark{} - case string(EntityKindEnumCloudApplication): + case string(EntityKindCloudApplication): b = &CloudApplicationEntity{} - case string(EntityKindEnumDNSResolution): + case string(EntityKindDNSResolution): b = &DNSEntity{} - case string(EntityKindEnumFile): + case string(EntityKindFile): b = &FileEntity{} - case string(EntityKindEnumFileHash): + case string(EntityKindFileHash): b = &FileHashEntity{} - case string(EntityKindEnumHost): + case string(EntityKindHost): b = &HostEntity{} - case string(EntityKindEnumIoTDevice): + case string(EntityKindIoTDevice): b = &IoTDeviceEntity{} - case string(EntityKindEnumIP): + case string(EntityKindIP): b = &IPEntity{} - case string(EntityKindEnumMailCluster): + case string(EntityKindMailCluster): b = &MailClusterEntity{} - case string(EntityKindEnumMailMessage): + case string(EntityKindMailMessage): b = &MailMessageEntity{} - case string(EntityKindEnumMailbox): + case string(EntityKindMailbox): b = &MailboxEntity{} - case string(EntityKindEnumMalware): + case string(EntityKindMalware): b = &MalwareEntity{} - case string(EntityKindEnumProcess): + case string(EntityKindProcess): b = &ProcessEntity{} - case string(EntityKindEnumRegistryKey): + case string(EntityKindRegistryKey): b = &RegistryKeyEntity{} - case string(EntityKindEnumRegistryValue): + case string(EntityKindRegistryValue): b = &RegistryValueEntity{} - case string(EntityKindEnumSecurityAlert): + case string(EntityKindSecurityAlert): b = &SecurityAlert{} - case string(EntityKindEnumSecurityGroup): + case string(EntityKindSecurityGroup): b = &SecurityGroupEntity{} - case string(EntityKindEnumSubmissionMail): + case string(EntityKindSubmissionMail): b = &SubmissionMailEntity{} - case string(EntityKindEnumURL): + case string(EntityKindURL): b = &URLEntity{} default: b = &Entity{} @@ -296,6 +336,242 @@ func unmarshalEntityClassificationArray(rawMsg json.RawMessage) ([]EntityClassif return fArray, nil } +func unmarshalEntityQueryClassification(rawMsg json.RawMessage) (EntityQueryClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EntityQueryClassification + switch m["kind"] { + case string(EntityQueryKindActivity): + b = &ActivityEntityQuery{} + case string(EntityQueryKindExpansion): + b = &ExpansionEntityQuery{} + default: + b = &EntityQuery{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalEntityQueryClassificationArray(rawMsg json.RawMessage) ([]EntityQueryClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]EntityQueryClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalEntityQueryClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalEntityQueryItemClassification(rawMsg json.RawMessage) (EntityQueryItemClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EntityQueryItemClassification + switch m["kind"] { + case string(EntityQueryKindInsight): + b = &InsightQueryItem{} + default: + b = &EntityQueryItem{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalEntityQueryItemClassificationArray(rawMsg json.RawMessage) ([]EntityQueryItemClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]EntityQueryItemClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalEntityQueryItemClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalEntityQueryTemplateClassification(rawMsg json.RawMessage) (EntityQueryTemplateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EntityQueryTemplateClassification + switch m["kind"] { + case string(EntityQueryTemplateKindActivity): + b = &ActivityEntityQueryTemplate{} + default: + b = &EntityQueryTemplate{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalEntityQueryTemplateClassificationArray(rawMsg json.RawMessage) ([]EntityQueryTemplateClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]EntityQueryTemplateClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalEntityQueryTemplateClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalEntityTimelineItemClassification(rawMsg json.RawMessage) (EntityTimelineItemClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b EntityTimelineItemClassification + switch m["kind"] { + case string(EntityTimelineKindActivity): + b = &ActivityTimelineItem{} + case string(EntityTimelineKindAnomaly): + b = &AnomalyTimelineItem{} + case string(EntityTimelineKindBookmark): + b = &BookmarkTimelineItem{} + case string(EntityTimelineKindSecurityAlert): + b = &SecurityAlertTimelineItem{} + default: + b = &EntityTimelineItem{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalEntityTimelineItemClassificationArray(rawMsg json.RawMessage) ([]EntityTimelineItemClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]EntityTimelineItemClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalEntityTimelineItemClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalSecurityMLAnalyticsSettingClassification(rawMsg json.RawMessage) (SecurityMLAnalyticsSettingClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SecurityMLAnalyticsSettingClassification + switch m["kind"] { + case string(SecurityMLAnalyticsSettingsKindAnomaly): + b = &AnomalySecurityMLAnalyticsSettings{} + default: + b = &SecurityMLAnalyticsSetting{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalSecurityMLAnalyticsSettingClassificationArray(rawMsg json.RawMessage) ([]SecurityMLAnalyticsSettingClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]SecurityMLAnalyticsSettingClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalSecurityMLAnalyticsSettingClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + +func unmarshalSettingsClassification(rawMsg json.RawMessage) (SettingsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]interface{} + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b SettingsClassification + switch m["kind"] { + case string(SettingKindAnomalies): + b = &Anomalies{} + case string(SettingKindEntityAnalytics): + b = &EntityAnalytics{} + case string(SettingKindEyesOn): + b = &EyesOn{} + case string(SettingKindUeba): + b = &Ueba{} + default: + b = &Settings{} + } + return b, json.Unmarshal(rawMsg, b) +} + +func unmarshalSettingsClassificationArray(rawMsg json.RawMessage) ([]SettingsClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]SettingsClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalSettingsClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + func unmarshalThreatIntelligenceInformationClassification(rawMsg json.RawMessage) (ThreatIntelligenceInformationClassification, error) { if rawMsg == nil { return nil, nil @@ -306,7 +582,7 @@ func unmarshalThreatIntelligenceInformationClassification(rawMsg json.RawMessage } var b ThreatIntelligenceInformationClassification switch m["kind"] { - case string(ThreatIntelligenceResourceInnerKindIndicator): + case string(ThreatIntelligenceResourceKindEnumIndicator): b = &ThreatIntelligenceIndicatorModel{} default: b = &ThreatIntelligenceInformation{} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_productsettings_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_productsettings_client.go new file mode 100644 index 000000000000..c84f02a16951 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_productsettings_client.go @@ -0,0 +1,286 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// ProductSettingsClient contains the methods for the ProductSettings group. +// Don't use this type directly, use NewProductSettingsClient() instead. +type ProductSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewProductSettingsClient creates a new instance of ProductSettingsClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Delete - Delete setting of the product. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// settingsName - The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba +// options - ProductSettingsClientDeleteOptions contains the optional parameters for the ProductSettingsClient.Delete method. +func (client *ProductSettingsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, settingsName string, options *ProductSettingsClientDeleteOptions) (ProductSettingsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, settingsName, options) + if err != nil { + return ProductSettingsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductSettingsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ProductSettingsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ProductSettingsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ProductSettingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, settingsName string, options *ProductSettingsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}" + 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 settingsName == "" { + return nil, errors.New("parameter settingsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingsName}", url.PathEscape(settingsName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a setting. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// settingsName - The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba +// options - ProductSettingsClientGetOptions contains the optional parameters for the ProductSettingsClient.Get method. +func (client *ProductSettingsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, settingsName string, options *ProductSettingsClientGetOptions) (ProductSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, settingsName, options) + if err != nil { + return ProductSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ProductSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, settingsName string, options *ProductSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}" + 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 settingsName == "" { + return nil, errors.New("parameter settingsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingsName}", url.PathEscape(settingsName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ProductSettingsClient) getHandleResponse(resp *http.Response) (ProductSettingsClientGetResponse, error) { + result := ProductSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return ProductSettingsClientGetResponse{}, err + } + return result, nil +} + +// List - List of all the settings +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// options - ProductSettingsClientListOptions contains the optional parameters for the ProductSettingsClient.List method. +func (client *ProductSettingsClient) List(ctx context.Context, resourceGroupName string, workspaceName string, options *ProductSettingsClientListOptions) (ProductSettingsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, resourceGroupName, workspaceName, options) + if err != nil { + return ProductSettingsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductSettingsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductSettingsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *ProductSettingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *ProductSettingsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ProductSettingsClient) listHandleResponse(resp *http.Response) (ProductSettingsClientListResponse, error) { + result := ProductSettingsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SettingList); err != nil { + return ProductSettingsClientListResponse{}, err + } + return result, nil +} + +// Update - Updates setting. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// settingsName - The setting name. Supports - Anomalies, EyesOn, EntityAnalytics, Ueba +// settings - The setting +// options - ProductSettingsClientUpdateOptions contains the optional parameters for the ProductSettingsClient.Update method. +func (client *ProductSettingsClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, settingsName string, settings SettingsClassification, options *ProductSettingsClientUpdateOptions) (ProductSettingsClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, workspaceName, settingsName, settings, options) + if err != nil { + return ProductSettingsClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductSettingsClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductSettingsClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *ProductSettingsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, settingsName string, settings SettingsClassification, options *ProductSettingsClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}" + 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 settingsName == "" { + return nil, errors.New("parameter settingsName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingsName}", url.PathEscape(settingsName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, settings) +} + +// updateHandleResponse handles the Update response. +func (client *ProductSettingsClient) updateHandleResponse(resp *http.Response) (ProductSettingsClientUpdateResponse, error) { + result := ProductSettingsClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return ProductSettingsClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go index 33dd820192b6..879da0f7f931 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_response_types.go @@ -109,6 +109,31 @@ type AutomationRulesClientListResponse struct { AutomationRulesList } +// BookmarkClientExpandResponse contains the response from method BookmarkClient.Expand. +type BookmarkClientExpandResponse struct { + BookmarkExpandResponse +} + +// BookmarkRelationsClientCreateOrUpdateResponse contains the response from method BookmarkRelationsClient.CreateOrUpdate. +type BookmarkRelationsClientCreateOrUpdateResponse struct { + Relation +} + +// BookmarkRelationsClientDeleteResponse contains the response from method BookmarkRelationsClient.Delete. +type BookmarkRelationsClientDeleteResponse struct { + // placeholder for future response values +} + +// BookmarkRelationsClientGetResponse contains the response from method BookmarkRelationsClient.Get. +type BookmarkRelationsClientGetResponse struct { + Relation +} + +// BookmarkRelationsClientListResponse contains the response from method BookmarkRelationsClient.List. +type BookmarkRelationsClientListResponse struct { + RelationList +} + // BookmarksClientCreateOrUpdateResponse contains the response from method BookmarksClient.CreateOrUpdate. type BookmarksClientCreateOrUpdateResponse struct { Bookmark @@ -129,6 +154,16 @@ type BookmarksClientListResponse struct { BookmarkList } +// DataConnectorsCheckRequirementsClientPostResponse contains the response from method DataConnectorsCheckRequirementsClient.Post. +type DataConnectorsCheckRequirementsClientPostResponse struct { + DataConnectorRequirementsState +} + +// DataConnectorsClientConnectResponse contains the response from method DataConnectorsClient.Connect. +type DataConnectorsClientConnectResponse struct { + // placeholder for future response values +} + // DataConnectorsClientCreateOrUpdateResponse contains the response from method DataConnectorsClient.CreateOrUpdate. type DataConnectorsClientCreateOrUpdateResponse struct { DataConnectorClassification @@ -149,6 +184,11 @@ type DataConnectorsClientDeleteResponse struct { // placeholder for future response values } +// DataConnectorsClientDisconnectResponse contains the response from method DataConnectorsClient.Disconnect. +type DataConnectorsClientDisconnectResponse struct { + // placeholder for future response values +} + // DataConnectorsClientGetResponse contains the response from method DataConnectorsClient.Get. type DataConnectorsClientGetResponse struct { DataConnectorClassification @@ -169,6 +209,126 @@ type DataConnectorsClientListResponse struct { DataConnectorList } +// DomainWhoisClientGetResponse contains the response from method DomainWhoisClient.Get. +type DomainWhoisClientGetResponse struct { + EnrichmentDomainWhois +} + +// EntitiesClientExpandResponse contains the response from method EntitiesClient.Expand. +type EntitiesClientExpandResponse struct { + EntityExpandResponse +} + +// EntitiesClientGetInsightsResponse contains the response from method EntitiesClient.GetInsights. +type EntitiesClientGetInsightsResponse struct { + EntityGetInsightsResponse +} + +// EntitiesClientGetResponse contains the response from method EntitiesClient.Get. +type EntitiesClientGetResponse struct { + EntityClassification +} + +// 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 + } + e.EntityClassification = res + return nil +} + +// EntitiesClientListResponse contains the response from method EntitiesClient.List. +type EntitiesClientListResponse struct { + EntityList +} + +// EntitiesClientQueriesResponse contains the response from method EntitiesClient.Queries. +type EntitiesClientQueriesResponse struct { + GetQueriesResponse +} + +// EntitiesGetTimelineClientListResponse contains the response from method EntitiesGetTimelineClient.List. +type EntitiesGetTimelineClientListResponse struct { + EntityTimelineResponse +} + +// EntitiesRelationsClientListResponse contains the response from method EntitiesRelationsClient.List. +type EntitiesRelationsClientListResponse struct { + RelationList +} + +// EntityQueriesClientCreateOrUpdateResponse contains the response from method EntityQueriesClient.CreateOrUpdate. +type EntityQueriesClientCreateOrUpdateResponse struct { + EntityQueryClassification +} + +// 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 + } + e.EntityQueryClassification = res + return nil +} + +// EntityQueriesClientDeleteResponse contains the response from method EntityQueriesClient.Delete. +type EntityQueriesClientDeleteResponse struct { + // placeholder for future response values +} + +// EntityQueriesClientGetResponse contains the response from method EntityQueriesClient.Get. +type EntityQueriesClientGetResponse struct { + EntityQueryClassification +} + +// 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 + } + e.EntityQueryClassification = res + return nil +} + +// EntityQueriesClientListResponse contains the response from method EntityQueriesClient.List. +type EntityQueriesClientListResponse struct { + EntityQueryList +} + +// EntityQueryTemplatesClientGetResponse contains the response from method EntityQueryTemplatesClient.Get. +type EntityQueryTemplatesClientGetResponse struct { + EntityQueryTemplateClassification +} + +// 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 + } + e.EntityQueryTemplateClassification = res + return nil +} + +// EntityQueryTemplatesClientListResponse contains the response from method EntityQueryTemplatesClient.List. +type EntityQueryTemplatesClientListResponse struct { + EntityQueryTemplateList +} + +// EntityRelationsClientGetRelationResponse contains the response from method EntityRelationsClient.GetRelation. +type EntityRelationsClientGetRelationResponse struct { + Relation +} + +// IPGeodataClientGetResponse contains the response from method IPGeodataClient.Get. +type IPGeodataClientGetResponse struct { + EnrichmentIPGeodata +} + // IncidentCommentsClientCreateOrUpdateResponse contains the response from method IncidentCommentsClient.CreateOrUpdate. type IncidentCommentsClientCreateOrUpdateResponse struct { IncidentComment @@ -214,6 +374,11 @@ type IncidentsClientCreateOrUpdateResponse struct { Incident } +// IncidentsClientCreateTeamResponse contains the response from method IncidentsClient.CreateTeam. +type IncidentsClientCreateTeamResponse struct { + TeamInformation +} + // IncidentsClientDeleteResponse contains the response from method IncidentsClient.Delete. type IncidentsClientDeleteResponse struct { // placeholder for future response values @@ -244,11 +409,137 @@ type IncidentsClientListResponse 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 { + MetadataModel +} + +// MetadataClientDeleteResponse contains the response from method MetadataClient.Delete. +type MetadataClientDeleteResponse struct { + // placeholder for future response values +} + +// MetadataClientGetResponse contains the response from method MetadataClient.Get. +type MetadataClientGetResponse struct { + MetadataModel +} + +// MetadataClientListResponse contains the response from method MetadataClient.List. +type MetadataClientListResponse struct { + MetadataList +} + +// MetadataClientUpdateResponse contains the response from method MetadataClient.Update. +type MetadataClientUpdateResponse struct { + MetadataModel +} + +// OfficeConsentsClientDeleteResponse contains the response from method OfficeConsentsClient.Delete. +type OfficeConsentsClientDeleteResponse struct { + // placeholder for future response values +} + +// OfficeConsentsClientGetResponse contains the response from method OfficeConsentsClient.Get. +type OfficeConsentsClientGetResponse struct { + OfficeConsent +} + +// OfficeConsentsClientListResponse contains the response from method OfficeConsentsClient.List. +type OfficeConsentsClientListResponse struct { + OfficeConsentList +} + // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { OperationsList } +// ProductSettingsClientDeleteResponse contains the response from method ProductSettingsClient.Delete. +type ProductSettingsClientDeleteResponse struct { + // placeholder for future response values +} + +// ProductSettingsClientGetResponse contains the response from method ProductSettingsClient.Get. +type ProductSettingsClientGetResponse struct { + SettingsClassification +} + +// 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 + } + p.SettingsClassification = res + return nil +} + +// ProductSettingsClientListResponse contains the response from method ProductSettingsClient.List. +type ProductSettingsClientListResponse struct { + SettingList +} + +// ProductSettingsClientUpdateResponse contains the response from method ProductSettingsClient.Update. +type ProductSettingsClientUpdateResponse struct { + SettingsClassification +} + +// 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 + } + p.SettingsClassification = res + return nil +} + +// SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse contains the response from method SecurityMLAnalyticsSettingsClient.CreateOrUpdate. +type SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse struct { + SecurityMLAnalyticsSettingClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse. +func (s *SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalSecurityMLAnalyticsSettingClassification(data) + if err != nil { + return err + } + s.SecurityMLAnalyticsSettingClassification = res + return nil +} + +// SecurityMLAnalyticsSettingsClientDeleteResponse contains the response from method SecurityMLAnalyticsSettingsClient.Delete. +type SecurityMLAnalyticsSettingsClientDeleteResponse struct { + // placeholder for future response values +} + +// SecurityMLAnalyticsSettingsClientGetResponse contains the response from method SecurityMLAnalyticsSettingsClient.Get. +type SecurityMLAnalyticsSettingsClientGetResponse struct { + SecurityMLAnalyticsSettingClassification +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityMLAnalyticsSettingsClientGetResponse. +func (s *SecurityMLAnalyticsSettingsClientGetResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalSecurityMLAnalyticsSettingClassification(data) + if err != nil { + return err + } + s.SecurityMLAnalyticsSettingClassification = res + return nil +} + +// SecurityMLAnalyticsSettingsClientListResponse contains the response from method SecurityMLAnalyticsSettingsClient.List. +type SecurityMLAnalyticsSettingsClientListResponse struct { + SecurityMLAnalyticsSettingsList +} + // SentinelOnboardingStatesClientCreateResponse contains the response from method SentinelOnboardingStatesClient.Create. type SentinelOnboardingStatesClientCreateResponse struct { SentinelOnboardingState @@ -269,6 +560,31 @@ type SentinelOnboardingStatesClientListResponse struct { SentinelOnboardingStatesList } +// SourceControlClientListRepositoriesResponse contains the response from method SourceControlClient.ListRepositories. +type SourceControlClientListRepositoriesResponse struct { + RepoList +} + +// SourceControlsClientCreateResponse contains the response from method SourceControlsClient.Create. +type SourceControlsClientCreateResponse struct { + SourceControl +} + +// SourceControlsClientDeleteResponse contains the response from method SourceControlsClient.Delete. +type SourceControlsClientDeleteResponse struct { + // placeholder for future response values +} + +// SourceControlsClientGetResponse contains the response from method SourceControlsClient.Get. +type SourceControlsClientGetResponse struct { + SourceControl +} + +// SourceControlsClientListResponse contains the response from method SourceControlsClient.List. +type SourceControlsClientListResponse struct { + SourceControlList +} + // ThreatIntelligenceIndicatorClientAppendTagsResponse contains the response from method ThreatIntelligenceIndicatorClient.AppendTags. type ThreatIntelligenceIndicatorClientAppendTagsResponse struct { // placeholder for future response values @@ -377,11 +693,14 @@ type WatchlistItemsClientListResponse struct { // WatchlistsClientCreateOrUpdateResponse contains the response from method WatchlistsClient.CreateOrUpdate. type WatchlistsClientCreateOrUpdateResponse 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 { - // placeholder for future response values + // AzureAsyncOperation contains the information returned from the Azure-AsyncOperation header response. + AzureAsyncOperation *string } // WatchlistsClientGetResponse contains the response from method WatchlistsClient.Get. diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_securitymlanalyticssettings_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_securitymlanalyticssettings_client.go new file mode 100644 index 000000000000..406c9e68fe67 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_securitymlanalyticssettings_client.go @@ -0,0 +1,303 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// SecurityMLAnalyticsSettingsClient contains the methods for the SecurityMLAnalyticsSettings group. +// Don't use this type directly, use NewSecurityMLAnalyticsSettingsClient() instead. +type SecurityMLAnalyticsSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSecurityMLAnalyticsSettingsClient creates a new instance of SecurityMLAnalyticsSettingsClient with the specified values. +// 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 NewSecurityMLAnalyticsSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityMLAnalyticsSettingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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 := &SecurityMLAnalyticsSettingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates the Security ML Analytics Settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// settingsResourceName - Security ML Analytics Settings resource name +// securityMLAnalyticsSetting - The security ML Analytics setting +// options - SecurityMLAnalyticsSettingsClientCreateOrUpdateOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.CreateOrUpdate +// method. +func (client *SecurityMLAnalyticsSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, settingsResourceName string, securityMLAnalyticsSetting SecurityMLAnalyticsSettingClassification, options *SecurityMLAnalyticsSettingsClientCreateOrUpdateOptions) (SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, workspaceName, settingsResourceName, securityMLAnalyticsSetting, options) + if err != nil { + return SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *SecurityMLAnalyticsSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, settingsResourceName string, securityMLAnalyticsSetting SecurityMLAnalyticsSettingClassification, options *SecurityMLAnalyticsSettingsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}" + 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 settingsResourceName == "" { + return nil, errors.New("parameter settingsResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingsResourceName}", url.PathEscape(settingsResourceName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, securityMLAnalyticsSetting) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *SecurityMLAnalyticsSettingsClient) createOrUpdateHandleResponse(resp *http.Response) (SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse, error) { + result := SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return SecurityMLAnalyticsSettingsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete the Security ML Analytics Settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// settingsResourceName - Security ML Analytics Settings resource name +// options - SecurityMLAnalyticsSettingsClientDeleteOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.Delete +// method. +func (client *SecurityMLAnalyticsSettingsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, settingsResourceName string, options *SecurityMLAnalyticsSettingsClientDeleteOptions) (SecurityMLAnalyticsSettingsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, settingsResourceName, options) + if err != nil { + return SecurityMLAnalyticsSettingsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SecurityMLAnalyticsSettingsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return SecurityMLAnalyticsSettingsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return SecurityMLAnalyticsSettingsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SecurityMLAnalyticsSettingsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, settingsResourceName string, options *SecurityMLAnalyticsSettingsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}" + 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 settingsResourceName == "" { + return nil, errors.New("parameter settingsResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingsResourceName}", url.PathEscape(settingsResourceName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the Security ML Analytics Settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// settingsResourceName - Security ML Analytics Settings resource name +// options - SecurityMLAnalyticsSettingsClientGetOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.Get +// method. +func (client *SecurityMLAnalyticsSettingsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, settingsResourceName string, options *SecurityMLAnalyticsSettingsClientGetOptions) (SecurityMLAnalyticsSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, settingsResourceName, options) + if err != nil { + return SecurityMLAnalyticsSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SecurityMLAnalyticsSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityMLAnalyticsSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SecurityMLAnalyticsSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, settingsResourceName string, options *SecurityMLAnalyticsSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/{settingsResourceName}" + 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 settingsResourceName == "" { + return nil, errors.New("parameter settingsResourceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingsResourceName}", url.PathEscape(settingsResourceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SecurityMLAnalyticsSettingsClient) getHandleResponse(resp *http.Response) (SecurityMLAnalyticsSettingsClientGetResponse, error) { + result := SecurityMLAnalyticsSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return SecurityMLAnalyticsSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all Security ML Analytics Settings. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// options - SecurityMLAnalyticsSettingsClientListOptions contains the optional parameters for the SecurityMLAnalyticsSettingsClient.List +// method. +func (client *SecurityMLAnalyticsSettingsClient) NewListPager(resourceGroupName string, workspaceName string, options *SecurityMLAnalyticsSettingsClientListOptions) *runtime.Pager[SecurityMLAnalyticsSettingsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SecurityMLAnalyticsSettingsClientListResponse]{ + More: func(page SecurityMLAnalyticsSettingsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SecurityMLAnalyticsSettingsClientListResponse) (SecurityMLAnalyticsSettingsClientListResponse, 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 SecurityMLAnalyticsSettingsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SecurityMLAnalyticsSettingsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SecurityMLAnalyticsSettingsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *SecurityMLAnalyticsSettingsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *SecurityMLAnalyticsSettingsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SecurityMLAnalyticsSettingsClient) listHandleResponse(resp *http.Response) (SecurityMLAnalyticsSettingsClientListResponse, error) { + result := SecurityMLAnalyticsSettingsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SecurityMLAnalyticsSettingsList); err != nil { + return SecurityMLAnalyticsSettingsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go index 52d1b7bdaca8..a9fb104e4e16 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sentinelonboardingstates_client.go @@ -56,7 +56,7 @@ func NewSentinelOnboardingStatesClient(subscriptionID string, credential azcore. // Create - Create Sentinel onboarding state // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // sentinelOnboardingStateName - The Sentinel onboarding state name. Supports - default @@ -101,7 +101,7 @@ func (client *SentinelOnboardingStatesClient) createCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.SentinelOnboardingStateParameter != nil { @@ -121,7 +121,7 @@ func (client *SentinelOnboardingStatesClient) createHandleResponse(resp *http.Re // Delete - Delete Sentinel onboarding state // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // sentinelOnboardingStateName - The Sentinel onboarding state name. Supports - default @@ -166,7 +166,7 @@ func (client *SentinelOnboardingStatesClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,7 +174,7 @@ func (client *SentinelOnboardingStatesClient) deleteCreateRequest(ctx context.Co // Get - Get Sentinel onboarding state // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // sentinelOnboardingStateName - The Sentinel onboarding state name. Supports - default @@ -219,7 +219,7 @@ func (client *SentinelOnboardingStatesClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,7 +236,7 @@ func (client *SentinelOnboardingStatesClient) getHandleResponse(resp *http.Respo // List - Gets all Sentinel onboarding states // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - SentinelOnboardingStatesClientListOptions contains the optional parameters for the SentinelOnboardingStatesClient.List @@ -276,7 +276,7 @@ func (client *SentinelOnboardingStatesClient) listCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrol_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrol_client.go new file mode 100644 index 000000000000..44ab451b7c57 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrol_client.go @@ -0,0 +1,126 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// SourceControlClient contains the methods for the SourceControl group. +// Don't use this type directly, use NewSourceControlClient() instead. +type SourceControlClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSourceControlClient creates a new instance of SourceControlClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// NewListRepositoriesPager - Gets a list of repositories metadata. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// repoType - The repo type. +// options - SourceControlClientListRepositoriesOptions contains the optional parameters for the SourceControlClient.ListRepositories +// method. +func (client *SourceControlClient) NewListRepositoriesPager(resourceGroupName string, workspaceName string, repoType RepoType, options *SourceControlClientListRepositoriesOptions) *runtime.Pager[SourceControlClientListRepositoriesResponse] { + return runtime.NewPager(runtime.PagingHandler[SourceControlClientListRepositoriesResponse]{ + More: func(page SourceControlClientListRepositoriesResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *SourceControlClient) listRepositoriesCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, repoType RepoType, options *SourceControlClientListRepositoriesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/listRepositories" + 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)) + 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-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, repoType) +} + +// listRepositoriesHandleResponse handles the ListRepositories response. +func (client *SourceControlClient) listRepositoriesHandleResponse(resp *http.Response) (SourceControlClientListRepositoriesResponse, error) { + result := SourceControlClientListRepositoriesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.RepoList); err != nil { + return SourceControlClientListRepositoriesResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrols_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrols_client.go new file mode 100644 index 000000000000..0fb473103c49 --- /dev/null +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_sourcecontrols_client.go @@ -0,0 +1,299 @@ +//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 ( + "context" + "errors" + "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" + "net/url" + "strings" +) + +// SourceControlsClient contains the methods for the SourceControls group. +// Don't use this type directly, use NewSourceControlsClient() instead. +type SourceControlsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSourceControlsClient creates a new instance of SourceControlsClient with the specified values. +// 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, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.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: ep, + pl: pl, + } + return client, nil +} + +// Create - Creates a source control. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// sourceControlID - Source control Id +// sourceControl - The SourceControl +// options - SourceControlsClientCreateOptions contains the optional parameters for the SourceControlsClient.Create method. +func (client *SourceControlsClient) Create(ctx context.Context, resourceGroupName string, workspaceName string, sourceControlID string, sourceControl SourceControl, options *SourceControlsClientCreateOptions) (SourceControlsClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, workspaceName, sourceControlID, sourceControl, options) + if err != nil { + return SourceControlsClientCreateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SourceControlsClientCreateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return SourceControlsClientCreateResponse{}, runtime.NewResponseError(resp) + } + return client.createHandleResponse(resp) +} + +// createCreateRequest creates the Create request. +func (client *SourceControlsClient) createCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, sourceControlID string, sourceControl SourceControl, options *SourceControlsClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}" + 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 sourceControlID == "" { + return nil, errors.New("parameter sourceControlID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sourceControlId}", url.PathEscape(sourceControlID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, sourceControl) +} + +// createHandleResponse handles the Create response. +func (client *SourceControlsClient) createHandleResponse(resp *http.Response) (SourceControlsClientCreateResponse, error) { + result := SourceControlsClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SourceControl); err != nil { + return SourceControlsClientCreateResponse{}, err + } + return result, nil +} + +// Delete - Delete a source control. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// sourceControlID - Source control Id +// options - SourceControlsClientDeleteOptions contains the optional parameters for the SourceControlsClient.Delete method. +func (client *SourceControlsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, sourceControlID string, options *SourceControlsClientDeleteOptions) (SourceControlsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, sourceControlID, options) + if err != nil { + return SourceControlsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SourceControlsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return SourceControlsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return SourceControlsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *SourceControlsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, sourceControlID string, options *SourceControlsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}" + 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 sourceControlID == "" { + return nil, errors.New("parameter sourceControlID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sourceControlId}", url.PathEscape(sourceControlID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a source control byt its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// resourceGroupName - The name of the resource group. The name is case insensitive. +// workspaceName - The name of the workspace. +// sourceControlID - Source control Id +// options - SourceControlsClientGetOptions contains the optional parameters for the SourceControlsClient.Get method. +func (client *SourceControlsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, sourceControlID string, options *SourceControlsClientGetOptions) (SourceControlsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, sourceControlID, options) + if err != nil { + return SourceControlsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SourceControlsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SourceControlsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *SourceControlsClient) getCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, sourceControlID string, options *SourceControlsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}" + 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 sourceControlID == "" { + return nil, errors.New("parameter sourceControlID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{sourceControlId}", url.PathEscape(sourceControlID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *SourceControlsClient) getHandleResponse(resp *http.Response) (SourceControlsClientGetResponse, error) { + result := SourceControlsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SourceControl); err != nil { + return SourceControlsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets all source controls, without source control items. +// If the operation fails it returns an *azcore.ResponseError type. +// Generated from API version 2022-05-01-preview +// 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) NewListPager(resourceGroupName string, workspaceName string, options *SourceControlsClientListOptions) *runtime.Pager[SourceControlsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[SourceControlsClientListResponse]{ + More: func(page SourceControlsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + 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. +func (client *SourceControlsClient) listCreateRequest(ctx context.Context, resourceGroupName string, workspaceName string, options *SourceControlsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols" + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *SourceControlsClient) listHandleResponse(resp *http.Response) (SourceControlsClientListResponse, error) { + result := SourceControlsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SourceControlList); err != nil { + return SourceControlsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go index e938b8506a7b..7e7f314c3fd5 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicator_client.go @@ -56,7 +56,7 @@ func NewThreatIntelligenceIndicatorClient(subscriptionID string, credential azco // AppendTags - Append tags to a threat intelligence indicator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // name - Threat intelligence indicator name field. @@ -102,7 +102,7 @@ func (client *ThreatIntelligenceIndicatorClient) appendTagsCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, threatIntelligenceAppendTags) @@ -110,7 +110,7 @@ func (client *ThreatIntelligenceIndicatorClient) appendTagsCreateRequest(ctx con // Create - Update a threat Intelligence indicator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // name - Threat intelligence indicator name field. @@ -156,7 +156,7 @@ func (client *ThreatIntelligenceIndicatorClient) createCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, threatIntelligenceProperties) @@ -173,7 +173,7 @@ func (client *ThreatIntelligenceIndicatorClient) createHandleResponse(resp *http // CreateIndicator - Create a new threat intelligence indicator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // threatIntelligenceProperties - Properties of threat intelligence indicators to create and update. @@ -214,7 +214,7 @@ func (client *ThreatIntelligenceIndicatorClient) createIndicatorCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, threatIntelligenceProperties) @@ -231,7 +231,7 @@ func (client *ThreatIntelligenceIndicatorClient) createIndicatorHandleResponse(r // Delete - Delete a threat intelligence indicator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // name - Threat intelligence indicator name field. @@ -276,7 +276,7 @@ func (client *ThreatIntelligenceIndicatorClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *ThreatIntelligenceIndicatorClient) deleteCreateRequest(ctx context // Get - View a threat intelligence indicator by name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // name - Threat intelligence indicator name field. @@ -329,7 +329,7 @@ func (client *ThreatIntelligenceIndicatorClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,7 +346,7 @@ func (client *ThreatIntelligenceIndicatorClient) getHandleResponse(resp *http.Re // NewQueryIndicatorsPager - Query threat intelligence indicators as per filtering criteria. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // threatIntelligenceFilteringCriteria - Filtering criteria for querying threat intelligence indicators. @@ -400,7 +400,7 @@ func (client *ThreatIntelligenceIndicatorClient) queryIndicatorsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, threatIntelligenceFilteringCriteria) @@ -417,7 +417,7 @@ func (client *ThreatIntelligenceIndicatorClient) queryIndicatorsHandleResponse(r // ReplaceTags - Replace tags added to a threat intelligence indicator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // name - Threat intelligence indicator name field. @@ -463,7 +463,7 @@ func (client *ThreatIntelligenceIndicatorClient) replaceTagsCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, threatIntelligenceReplaceTags) diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go index d30f7b6badf1..6eae22aa50dc 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicatormetrics_client.go @@ -56,7 +56,7 @@ func NewThreatIntelligenceIndicatorMetricsClient(subscriptionID string, credenti // List - Get threat intelligence indicators metrics (Indicators counts by Type, Threat Type, Source). // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - ThreatIntelligenceIndicatorMetricsClientListOptions contains the optional parameters for the ThreatIntelligenceIndicatorMetricsClient.List @@ -96,7 +96,7 @@ func (client *ThreatIntelligenceIndicatorMetricsClient) listCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go index 491eee2829b1..df93e12c970e 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_threatintelligenceindicators_client.go @@ -57,7 +57,7 @@ func NewThreatIntelligenceIndicatorsClient(subscriptionID string, credential azc // NewListPager - Get all threat intelligence indicators. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. // options - ThreatIntelligenceIndicatorsClientListOptions contains the optional parameters for the ThreatIntelligenceIndicatorsClient.List @@ -110,19 +110,19 @@ func (client *ThreatIntelligenceIndicatorsClient) listCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } if options != nil && options.Top != nil { reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) } if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - if options != nil && options.Orderby != nil { - reqQP.Set("$orderby", *options.Orderby) - } req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go index 38cb0f2d1794..bea60fa242e9 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlistitems_client.go @@ -54,13 +54,13 @@ func NewWatchlistItemsClient(subscriptionID string, credential azcore.TokenCrede return client, nil } -// CreateOrUpdate - Create or update a watchlist item. +// CreateOrUpdate - Creates or updates a watchlist item. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. -// watchlistAlias - The watchlist alias -// watchlistItemID - The watchlist item id (GUID) +// watchlistAlias - Watchlist Alias +// watchlistItemID - Watchlist Item Id (GUID) // watchlistItem - The watchlist item // options - WatchlistItemsClientCreateOrUpdateOptions contains the optional parameters for the WatchlistItemsClient.CreateOrUpdate // method. @@ -107,7 +107,7 @@ func (client *WatchlistItemsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, watchlistItem) @@ -124,11 +124,11 @@ func (client *WatchlistItemsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Delete a watchlist item. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. -// watchlistAlias - The watchlist alias -// watchlistItemID - The watchlist item id (GUID) +// watchlistAlias - Watchlist Alias +// watchlistItemID - Watchlist Item Id (GUID) // options - WatchlistItemsClientDeleteOptions contains the optional parameters for the WatchlistItemsClient.Delete method. func (client *WatchlistItemsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, watchlistAlias string, watchlistItemID string, options *WatchlistItemsClientDeleteOptions) (WatchlistItemsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, watchlistAlias, watchlistItemID, options) @@ -173,19 +173,19 @@ func (client *WatchlistItemsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a watchlist item. +// Get - Gets a watchlist, without its watchlist items. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. -// watchlistAlias - The watchlist alias -// watchlistItemID - The watchlist item id (GUID) +// watchlistAlias - Watchlist Alias +// watchlistItemID - Watchlist Item Id (GUID) // options - WatchlistItemsClientGetOptions contains the optional parameters for the WatchlistItemsClient.Get method. func (client *WatchlistItemsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, watchlistAlias string, watchlistItemID string, options *WatchlistItemsClientGetOptions) (WatchlistItemsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, watchlistAlias, watchlistItemID, options) @@ -230,7 +230,7 @@ func (client *WatchlistItemsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,12 +245,12 @@ func (client *WatchlistItemsClient) getHandleResponse(resp *http.Response) (Watc return result, nil } -// NewListPager - Get all watchlist Items. +// NewListPager - Gets all watchlist Items. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. -// watchlistAlias - The watchlist alias +// watchlistAlias - Watchlist Alias // options - WatchlistItemsClientListOptions contains the optional parameters for the WatchlistItemsClient.List method. func (client *WatchlistItemsClient) NewListPager(resourceGroupName string, workspaceName string, watchlistAlias string, options *WatchlistItemsClientListOptions) *runtime.Pager[WatchlistItemsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[WatchlistItemsClientListResponse]{ @@ -304,7 +304,7 @@ func (client *WatchlistItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } diff --git a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go index 03e317165503..6770819081d5 100644 --- a/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go +++ b/sdk/resourcemanager/securityinsights/armsecurityinsights/zz_generated_watchlists_client.go @@ -55,13 +55,16 @@ func NewWatchlistsClient(subscriptionID string, credential azcore.TokenCredentia } // 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 rawContent and -// contentType properties. +// 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. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. -// watchlistAlias - The watchlist alias +// watchlistAlias - Watchlist Alias // watchlist - The watchlist // options - WatchlistsClientCreateOrUpdateOptions contains the optional parameters for the WatchlistsClient.CreateOrUpdate // method. @@ -104,7 +107,7 @@ func (client *WatchlistsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, watchlist) @@ -113,6 +116,9 @@ func (client *WatchlistsClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *WatchlistsClient) createOrUpdateHandleResponse(resp *http.Response) (WatchlistsClientCreateOrUpdateResponse, error) { 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 } @@ -121,10 +127,10 @@ func (client *WatchlistsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Delete a watchlist. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. -// watchlistAlias - The watchlist alias +// watchlistAlias - Watchlist Alias // options - WatchlistsClientDeleteOptions contains the optional parameters for the WatchlistsClient.Delete method. func (client *WatchlistsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, watchlistAlias string, options *WatchlistsClientDeleteOptions) (WatchlistsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, workspaceName, watchlistAlias, options) @@ -138,7 +144,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{}, nil + return client.deleteHandleResponse(resp) } // deleteCreateRequest creates the Delete request. @@ -165,18 +171,27 @@ func (client *WatchlistsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Get a watchlist, without its watchlist items. +// 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. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // resourceGroupName - The name of the resource group. The name is case insensitive. // workspaceName - The name of the workspace. -// watchlistAlias - The watchlist alias +// watchlistAlias - Watchlist Alias // options - WatchlistsClientGetOptions contains the optional parameters for the WatchlistsClient.Get method. func (client *WatchlistsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, watchlistAlias string, options *WatchlistsClientGetOptions) (WatchlistsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, workspaceName, watchlistAlias, options) @@ -217,7 +232,7 @@ func (client *WatchlistsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,9 +247,9 @@ func (client *WatchlistsClient) getHandleResponse(resp *http.Response) (Watchlis return result, nil } -// NewListPager - Get all watchlists, without watchlist items. +// NewListPager - Gets all watchlists, without watchlist items. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-10-01 +// Generated from API version 2022-05-01-preview // 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. @@ -286,7 +301,7 @@ func (client *WatchlistsClient) listCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-10-01") + reqQP.Set("api-version", "2022-05-01-preview") if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } diff --git a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md index 99208ceeaa53..ab64e99a1103 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md +++ b/sdk/resourcemanager/servicebus/armservicebus/CHANGELOG.md @@ -1,5 +1,26 @@ # Release History +## 2.0.0-beta.1 (2022-05-19) +### Breaking Changes + +- Type of `Encryption.KeySource` has been changed from `*string` to `*KeySource` + +### Features Added + +- New const `KeySourceMicrosoftKeyVault` +- New const `TLSVersionOne0` +- New const `TLSVersionOne1` +- New const `PublicNetworkAccessDisabled` +- New const `PublicNetworkAccessEnabled` +- New const `PublicNetworkAccessSecuredByPerimeter` +- New const `TLSVersionOne2` +- New function `PossibleKeySourceValues() []KeySource` +- New function `PossiblePublicNetworkAccessValues() []PublicNetworkAccess` +- New function `PossibleTLSVersionValues() []TLSVersion` +- New field `MinimumTLSVersion` in struct `SBNamespaceProperties` +- New field `PublicNetworkAccess` in struct `SBNamespaceProperties` + + ## 1.0.0 (2022-05-17) ### Breaking Changes diff --git a/sdk/resourcemanager/servicebus/armservicebus/autorest.md b/sdk/resourcemanager/servicebus/armservicebus/autorest.md index 56a30a6efda9..8ed43674f92b 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/autorest.md +++ b/sdk/resourcemanager/servicebus/armservicebus/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-2021-11 require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/servicebus/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/servicebus/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/2f2b633d940230cbbd5bcf1339a2e1c48674e4a2/specification/servicebus/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go index 02592d6fb798..d69968e05f8a 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_disasterrecoveryconfigs_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasList.json func ExampleDisasterRecoveryConfigsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleDisasterRecoveryConfigsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasCreate.json func ExampleDisasterRecoveryConfigsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -72,7 +72,7 @@ func ExampleDisasterRecoveryConfigsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasDelete.json func ExampleDisasterRecoveryConfigsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -93,7 +93,7 @@ func ExampleDisasterRecoveryConfigsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasGet.json func ExampleDisasterRecoveryConfigsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -116,7 +116,7 @@ func ExampleDisasterRecoveryConfigsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBEHAliasBreakPairing.json func ExampleDisasterRecoveryConfigsClient_BreakPairing() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -137,7 +137,7 @@ func ExampleDisasterRecoveryConfigsClient_BreakPairing() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasFailOver.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasFailOver.json func ExampleDisasterRecoveryConfigsClient_FailOver() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -158,7 +158,7 @@ func ExampleDisasterRecoveryConfigsClient_FailOver() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListAll.json func ExampleDisasterRecoveryConfigsClient_NewListAuthorizationRulesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -185,7 +185,7 @@ func ExampleDisasterRecoveryConfigsClient_NewListAuthorizationRulesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleGet.json func ExampleDisasterRecoveryConfigsClient_GetAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -209,7 +209,7 @@ func ExampleDisasterRecoveryConfigsClient_GetAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasAuthorizationRuleListKey.json func ExampleDisasterRecoveryConfigsClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -233,7 +233,7 @@ func ExampleDisasterRecoveryConfigsClient_ListKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/disasterRecoveryConfigs/SBAliasCheckNameAvailability.json func ExampleDisasterRecoveryConfigsClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go index fb4b4c78e11e..1a4f778a74de 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_migrationconfigs_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationList.json func ExampleMigrationConfigsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExampleMigrationConfigsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCreateAndStartMigration.json func ExampleMigrationConfigsClient_BeginCreateAndStartMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -76,7 +76,7 @@ func ExampleMigrationConfigsClient_BeginCreateAndStartMigration() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationDelete.json func ExampleMigrationConfigsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleMigrationConfigsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationGet.json func ExampleMigrationConfigsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -120,7 +120,7 @@ func ExampleMigrationConfigsClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationCompleteMigration.json func ExampleMigrationConfigsClient_CompleteMigration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -141,7 +141,7 @@ func ExampleMigrationConfigsClient_CompleteMigration() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Migrationconfigurations/SBMigrationconfigurationRevert.json func ExampleMigrationConfigsClient_Revert() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go index 4d3777dc1c59..58d0d2ef2c59 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_namespaces_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceList.json func ExampleNamespacesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleNamespacesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceListByResourceGroup.json func ExampleNamespacesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -66,7 +66,7 @@ func ExampleNamespacesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceCreate.json func ExampleNamespacesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExampleNamespacesClient_BeginCreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceDelete.json func ExampleNamespacesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -127,7 +127,7 @@ func ExampleNamespacesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceGet.json func ExampleNamespacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -149,7 +149,7 @@ func ExampleNamespacesClient_Get() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceUpdate.json func ExampleNamespacesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -178,7 +178,7 @@ func ExampleNamespacesClient_Update() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetCreate.json func ExampleNamespacesClient_CreateOrUpdateNetworkRuleSet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -245,7 +245,7 @@ func ExampleNamespacesClient_CreateOrUpdateNetworkRuleSet() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetGet.json func ExampleNamespacesClient_GetNetworkRuleSet() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -267,7 +267,7 @@ func ExampleNamespacesClient_GetNetworkRuleSet() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/VirtualNetworkRule/SBNetworkRuleSetList.json func ExampleNamespacesClient_NewListNetworkRuleSetsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -293,7 +293,7 @@ func ExampleNamespacesClient_NewListNetworkRuleSetsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListAll.json func ExampleNamespacesClient_NewListAuthorizationRulesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -319,7 +319,7 @@ func ExampleNamespacesClient_NewListAuthorizationRulesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleCreate.json func ExampleNamespacesClient_CreateOrUpdateAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -349,7 +349,7 @@ func ExampleNamespacesClient_CreateOrUpdateAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleDelete.json func ExampleNamespacesClient_DeleteAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -370,7 +370,7 @@ func ExampleNamespacesClient_DeleteAuthorizationRule() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleGet.json func ExampleNamespacesClient_GetAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -393,7 +393,7 @@ func ExampleNamespacesClient_GetAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleListKey.json func ExampleNamespacesClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -416,7 +416,7 @@ func ExampleNamespacesClient_ListKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceAuthorizationRuleRegenerateKey.json func ExampleNamespacesClient_RegenerateKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -442,7 +442,7 @@ func ExampleNamespacesClient_RegenerateKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/SBNameSpaceCheckNameAvailability.json func ExampleNamespacesClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_operations_client_test.go index 82e0717a6223..584820b45791 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_operations_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/SBOperations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/SBOperations_List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go index 59df9ecaff83..ee9fb221384c 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privateendpointconnections_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionList.json func ExamplePrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -43,7 +43,7 @@ func ExamplePrivateEndpointConnectionsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionCreate.json func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -78,7 +78,7 @@ func ExamplePrivateEndpointConnectionsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionDelete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -103,7 +103,7 @@ func ExamplePrivateEndpointConnectionsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateEndPointConnectionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateEndPointConnectionGet.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go index dbd544be7da4..35980761c4ce 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_privatelinkresources_client_test.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/NameSpaces/PrivateLinkResourcesGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/NameSpaces/PrivateLinkResourcesGet.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go index 435481117740..3820afae01bf 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_queues_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListAll.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleListAll.json func ExampleQueuesClient_NewListAuthorizationRulesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -44,7 +44,7 @@ func ExampleQueuesClient_NewListAuthorizationRulesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleCreate.json func ExampleQueuesClient_CreateOrUpdateAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleQueuesClient_CreateOrUpdateAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleDelete.json func ExampleQueuesClient_DeleteAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleQueuesClient_DeleteAuthorizationRule() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleGet.json func ExampleQueuesClient_GetAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -121,7 +121,7 @@ func ExampleQueuesClient_GetAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleListKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleListKey.json func ExampleQueuesClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleQueuesClient_ListKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueAuthorizationRuleRegenerateKey.json func ExampleQueuesClient_RegenerateKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -172,7 +172,7 @@ func ExampleQueuesClient_RegenerateKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueListByNameSpace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueListByNameSpace.json func ExampleQueuesClient_NewListByNamespacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -200,7 +200,7 @@ func ExampleQueuesClient_NewListByNamespacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueCreate.json func ExampleQueuesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -228,7 +228,7 @@ func ExampleQueuesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueDelete.json func ExampleQueuesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -249,7 +249,7 @@ func ExampleQueuesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Queues/SBQueueGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Queues/SBQueueGet.json func ExampleQueuesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go index 919884fdc694..75b629d5d917 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_rules_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleListBySubscription.json func ExampleRulesClient_NewListBySubscriptionsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -47,7 +47,7 @@ func ExampleRulesClient_NewListBySubscriptionsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleCreate_CorrelationFilter.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleCreate_CorrelationFilter.json func ExampleRulesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -82,7 +82,7 @@ func ExampleRulesClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleDelete.json func ExampleRulesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -105,7 +105,7 @@ func ExampleRulesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Rules/RuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Rules/RuleGet.json func ExampleRulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go index b29699160918..2ed747d9ee19 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_subscriptions_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionListByTopic.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionListByTopic.json func ExampleSubscriptionsClient_NewListByTopicPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -46,7 +46,7 @@ func ExampleSubscriptionsClient_NewListByTopicPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionCreate.json func ExampleSubscriptionsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleSubscriptionsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionDelete.json func ExampleSubscriptionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -97,7 +97,7 @@ func ExampleSubscriptionsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Subscriptions/SBSubscriptionGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Subscriptions/SBSubscriptionGet.json func ExampleSubscriptionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go index 20cf210f6a2e..9b3f7e833b44 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go +++ b/sdk/resourcemanager/servicebus/armservicebus/ze_generated_example_topics_client_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/servicebus/armservicebus" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleListAll.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleListAll.json func ExampleTopicsClient_NewListAuthorizationRulesPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -44,7 +44,7 @@ func ExampleTopicsClient_NewListAuthorizationRulesPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleCreate.json func ExampleTopicsClient_CreateOrUpdateAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleTopicsClient_CreateOrUpdateAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleGet.json func ExampleTopicsClient_GetAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -99,7 +99,7 @@ func ExampleTopicsClient_GetAuthorizationRule() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleDelete.json func ExampleTopicsClient_DeleteAuthorizationRule() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -121,7 +121,7 @@ func ExampleTopicsClient_DeleteAuthorizationRule() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleListKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleListKey.json func ExampleTopicsClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleTopicsClient_ListKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicAuthorizationRuleRegenerateKey.json func ExampleTopicsClient_RegenerateKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -172,7 +172,7 @@ func ExampleTopicsClient_RegenerateKeys() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicListByNameSpace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicListByNameSpace.json func ExampleTopicsClient_NewListByNamespacePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -200,7 +200,7 @@ func ExampleTopicsClient_NewListByNamespacePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicCreate.json func ExampleTopicsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -228,7 +228,7 @@ func ExampleTopicsClient_CreateOrUpdate() { _ = res } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicDelete.json func ExampleTopicsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -249,7 +249,7 @@ func ExampleTopicsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/stable/2021-11-01/examples/Topics/SBTopicGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/examples/Topics/SBTopicGet.json func ExampleTopicsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go index a4118d364e61..37c14db45b59 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_constants.go @@ -10,23 +10,23 @@ package armservicebus const ( moduleName = "armservicebus" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) type AccessRights string const ( + AccessRightsListen AccessRights = "Listen" AccessRightsManage AccessRights = "Manage" AccessRightsSend AccessRights = "Send" - AccessRightsListen AccessRights = "Listen" ) // PossibleAccessRightsValues returns the possible values for the AccessRights const type. func PossibleAccessRightsValues() []AccessRights { return []AccessRights{ + AccessRightsListen, AccessRightsManage, AccessRightsSend, - AccessRightsListen, } } @@ -124,15 +124,29 @@ func PossibleEntityStatusValues() []EntityStatus { type FilterType string const ( - FilterTypeSQLFilter FilterType = "SqlFilter" FilterTypeCorrelationFilter FilterType = "CorrelationFilter" + FilterTypeSQLFilter FilterType = "SqlFilter" ) // PossibleFilterTypeValues returns the possible values for the FilterType const type. func PossibleFilterTypeValues() []FilterType { return []FilterType{ - FilterTypeSQLFilter, FilterTypeCorrelationFilter, + FilterTypeSQLFilter, + } +} + +// KeySource - Enumerates the possible value of keySource for Encryption +type KeySource string + +const ( + KeySourceMicrosoftKeyVault KeySource = "Microsoft.KeyVault" +) + +// PossibleKeySourceValues returns the possible values for the KeySource const type. +func PossibleKeySourceValues() []KeySource { + return []KeySource{ + KeySourceMicrosoftKeyVault, } } @@ -156,19 +170,19 @@ func PossibleKeyTypeValues() []KeyType { type ManagedServiceIdentityType string const ( + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" - ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" ) // PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { return []ManagedServiceIdentityType{ + ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned, - ManagedServiceIdentityTypeUserAssigned, ManagedServiceIdentityTypeSystemAssignedUserAssigned, - ManagedServiceIdentityTypeNone, + ManagedServiceIdentityTypeUserAssigned, } } @@ -225,16 +239,34 @@ type ProvisioningStateDR string const ( ProvisioningStateDRAccepted ProvisioningStateDR = "Accepted" - ProvisioningStateDRSucceeded ProvisioningStateDR = "Succeeded" ProvisioningStateDRFailed ProvisioningStateDR = "Failed" + ProvisioningStateDRSucceeded ProvisioningStateDR = "Succeeded" ) // PossibleProvisioningStateDRValues returns the possible values for the ProvisioningStateDR const type. func PossibleProvisioningStateDRValues() []ProvisioningStateDR { return []ProvisioningStateDR{ ProvisioningStateDRAccepted, - ProvisioningStateDRSucceeded, ProvisioningStateDRFailed, + ProvisioningStateDRSucceeded, + } +} + +// PublicNetworkAccess - This determines if traffic is allowed over public network. By default it is enabled. +type PublicNetworkAccess string + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" +) + +// PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{ + PublicNetworkAccessDisabled, + PublicNetworkAccessEnabled, + PublicNetworkAccessSecuredByPerimeter, } } @@ -277,16 +309,16 @@ type SKUName string const ( SKUNameBasic SKUName = "Basic" - SKUNameStandard SKUName = "Standard" SKUNamePremium SKUName = "Premium" + SKUNameStandard SKUName = "Standard" ) // PossibleSKUNameValues returns the possible values for the SKUName const type. func PossibleSKUNameValues() []SKUName { return []SKUName{ SKUNameBasic, - SKUNameStandard, SKUNamePremium, + SKUNameStandard, } } @@ -295,16 +327,34 @@ type SKUTier string const ( SKUTierBasic SKUTier = "Basic" - SKUTierStandard SKUTier = "Standard" SKUTierPremium SKUTier = "Premium" + SKUTierStandard SKUTier = "Standard" ) // PossibleSKUTierValues returns the possible values for the SKUTier const type. func PossibleSKUTierValues() []SKUTier { return []SKUTier{ SKUTierBasic, - SKUTierStandard, SKUTierPremium, + SKUTierStandard, + } +} + +// TLSVersion - The minimum TLS version for the cluster to support, e.g. '1.2' +type TLSVersion string + +const ( + TLSVersionOne0 TLSVersion = "1.0" + TLSVersionOne1 TLSVersion = "1.1" + TLSVersionOne2 TLSVersion = "1.2" +) + +// PossibleTLSVersionValues returns the possible values for the TLSVersion const type. +func PossibleTLSVersionValues() []TLSVersion { + return []TLSVersion{ + TLSVersionOne0, + TLSVersionOne1, + TLSVersionOne2, } } @@ -312,22 +362,22 @@ func PossibleSKUTierValues() []SKUTier { type UnavailableReason string const ( - UnavailableReasonNone UnavailableReason = "None" UnavailableReasonInvalidName UnavailableReason = "InvalidName" - UnavailableReasonSubscriptionIsDisabled UnavailableReason = "SubscriptionIsDisabled" - UnavailableReasonNameInUse UnavailableReason = "NameInUse" UnavailableReasonNameInLockdown UnavailableReason = "NameInLockdown" + UnavailableReasonNameInUse UnavailableReason = "NameInUse" + UnavailableReasonNone UnavailableReason = "None" + UnavailableReasonSubscriptionIsDisabled UnavailableReason = "SubscriptionIsDisabled" UnavailableReasonTooManyNamespaceInCurrentSubscription UnavailableReason = "TooManyNamespaceInCurrentSubscription" ) // PossibleUnavailableReasonValues returns the possible values for the UnavailableReason const type. func PossibleUnavailableReasonValues() []UnavailableReason { return []UnavailableReason{ - UnavailableReasonNone, UnavailableReasonInvalidName, - UnavailableReasonSubscriptionIsDisabled, - UnavailableReasonNameInUse, UnavailableReasonNameInLockdown, + UnavailableReasonNameInUse, + UnavailableReasonNone, + UnavailableReasonSubscriptionIsDisabled, UnavailableReasonTooManyNamespaceInCurrentSubscription, } } diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go index feec1088297a..ca08de18c167 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_disasterrecoveryconfigs_client.go @@ -57,7 +57,7 @@ func NewDisasterRecoveryConfigsClient(subscriptionID string, credential azcore.T // BreakPairing - This operation disables the Disaster Recovery and stops replicating changes from primary to secondary namespaces // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -102,7 +102,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,7 +110,7 @@ func (client *DisasterRecoveryConfigsClient) breakPairingCreateRequest(ctx conte // CheckNameAvailability - Check the give namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // parameters - Parameters to check availability of the given namespace name @@ -151,7 +151,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -168,7 +168,7 @@ func (client *DisasterRecoveryConfigsClient) checkNameAvailabilityHandleResponse // CreateOrUpdate - Creates or updates a new Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -214,7 +214,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -231,7 +231,7 @@ func (client *DisasterRecoveryConfigsClient) createOrUpdateHandleResponse(resp * // Delete - Deletes an Alias(Disaster Recovery configuration) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -276,7 +276,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,7 +284,7 @@ func (client *DisasterRecoveryConfigsClient) deleteCreateRequest(ctx context.Con // FailOver - Invokes GEO DR failover and reconfigure the alias to point to the secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -329,7 +329,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -340,7 +340,7 @@ func (client *DisasterRecoveryConfigsClient) failOverCreateRequest(ctx context.C // Get - Retrieves Alias(Disaster Recovery configuration) for primary or secondary namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -385,7 +385,7 @@ func (client *DisasterRecoveryConfigsClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,7 +402,7 @@ func (client *DisasterRecoveryConfigsClient) getHandleResponse(resp *http.Respon // GetAuthorizationRule - Gets an authorization rule for a namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -452,7 +452,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -469,7 +469,7 @@ func (client *DisasterRecoveryConfigsClient) getAuthorizationRuleHandleResponse( // NewListPager - Gets all Alias(Disaster Recovery configurations) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - DisasterRecoveryConfigsClientListOptions contains the optional parameters for the DisasterRecoveryConfigsClient.List @@ -522,7 +522,7 @@ func (client *DisasterRecoveryConfigsClient) listCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -539,7 +539,7 @@ func (client *DisasterRecoveryConfigsClient) listHandleResponse(resp *http.Respo // NewListAuthorizationRulesPager - Gets the authorization rules for a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -597,7 +597,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -614,7 +614,7 @@ func (client *DisasterRecoveryConfigsClient) listAuthorizationRulesHandleRespons // ListKeys - Gets the primary and secondary connection strings for the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // alias - The Disaster Recovery configuration name @@ -664,7 +664,7 @@ func (client *DisasterRecoveryConfigsClient) listKeysCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_migrationconfigs_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_migrationconfigs_client.go index 26ca8c9dcd1f..ffad3adad3e6 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_migrationconfigs_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_migrationconfigs_client.go @@ -59,7 +59,7 @@ func NewMigrationConfigsClient(subscriptionID string, credential azcore.TokenCre // and any entities created after the operation will be under Premium Namespace. CompleteMigration // operation will fail when entity migration is in-progress. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -104,7 +104,7 @@ func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,7 +113,7 @@ func (client *MigrationConfigsClient) completeMigrationCreateRequest(ctx context // BeginCreateAndStartMigration - Creates Migration configuration and starts migration of entities from Standard to Premium // namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -134,7 +134,7 @@ func (client *MigrationConfigsClient) BeginCreateAndStartMigration(ctx context.C // CreateAndStartMigration - Creates Migration configuration and starts migration of entities from Standard to Premium namespace // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *MigrationConfigsClient) createAndStartMigration(ctx context.Context, resourceGroupName string, namespaceName string, configName MigrationConfigurationName, parameters MigrationConfigProperties, options *MigrationConfigsClientBeginCreateAndStartMigrationOptions) (*http.Response, error) { req, err := client.createAndStartMigrationCreateRequest(ctx, resourceGroupName, namespaceName, configName, parameters, options) if err != nil { @@ -174,7 +174,7 @@ func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -182,7 +182,7 @@ func (client *MigrationConfigsClient) createAndStartMigrationCreateRequest(ctx c // Delete - Deletes a MigrationConfiguration // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -226,7 +226,7 @@ func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +234,7 @@ func (client *MigrationConfigsClient) deleteCreateRequest(ctx context.Context, r // Get - Retrieves Migration Config // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -278,7 +278,7 @@ func (client *MigrationConfigsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -295,7 +295,7 @@ func (client *MigrationConfigsClient) getHandleResponse(resp *http.Response) (Mi // NewListPager - Gets all migrationConfigurations // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - MigrationConfigsClientListOptions contains the optional parameters for the MigrationConfigsClient.List method. @@ -347,7 +347,7 @@ func (client *MigrationConfigsClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -364,7 +364,7 @@ func (client *MigrationConfigsClient) listHandleResponse(resp *http.Response) (M // Revert - This operation reverts Migration // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // configName - The configuration name. Should always be "$default". @@ -408,7 +408,7 @@ func (client *MigrationConfigsClient) revertCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go index 3dccd3450b93..d55c108f78fd 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models.go @@ -220,7 +220,7 @@ type DisasterRecoveryConfigsClientListOptions struct { // Encryption - Properties to configure Encryption type Encryption struct { // Enumerates the possible value of keySource for Encryption - KeySource *string `json:"keySource,omitempty"` + KeySource *KeySource `json:"keySource,omitempty"` // Properties of KeyVault KeyVaultProperties []*KeyVaultProperties `json:"keyVaultProperties,omitempty"` @@ -1005,9 +1005,15 @@ type SBNamespaceProperties struct { // Properties of BYOK Encryption description Encryption *Encryption `json:"encryption,omitempty"` + // The minimum TLS version for the cluster to support, e.g. '1.2' + MinimumTLSVersion *TLSVersion `json:"minimumTlsVersion,omitempty"` + // List of private endpoint connections. PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // This determines if traffic is allowed over public network. By default it is enabled. + PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // Enabling this property creates a Premium Service Bus Namespace in regions supported availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go index 0b79b3ec6b4d..362ab1480f2c 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_models_serde.go @@ -102,8 +102,10 @@ func (s SBNamespaceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) populate(objectMap, "encryption", s.Encryption) populate(objectMap, "metricId", s.MetricID) + populate(objectMap, "minimumTlsVersion", s.MinimumTLSVersion) populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) populate(objectMap, "serviceBusEndpoint", s.ServiceBusEndpoint) populate(objectMap, "status", s.Status) populateTimeRFC3339(objectMap, "updatedAt", s.UpdatedAt) @@ -135,12 +137,18 @@ func (s *SBNamespaceProperties) UnmarshalJSON(data []byte) error { case "metricId": err = unpopulate(val, "MetricID", &s.MetricID) delete(rawMsg, key) + case "minimumTlsVersion": + err = unpopulate(val, "MinimumTLSVersion", &s.MinimumTLSVersion) + delete(rawMsg, key) case "privateEndpointConnections": err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) case "serviceBusEndpoint": err = unpopulate(val, "ServiceBusEndpoint", &s.ServiceBusEndpoint) delete(rawMsg, key) diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_namespaces_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_namespaces_client.go index 352706c80329..d74ca90f88bb 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_namespaces_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_namespaces_client.go @@ -57,7 +57,7 @@ func NewNamespacesClient(subscriptionID string, credential azcore.TokenCredentia // CheckNameAvailability - Check the give namespace name availability. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // parameters - Parameters to check availability of the given namespace name // options - NamespacesClientCheckNameAvailabilityOptions contains the optional parameters for the NamespacesClient.CheckNameAvailability // method. @@ -88,7 +88,7 @@ func (client *NamespacesClient) checkNameAvailabilityCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -106,7 +106,7 @@ func (client *NamespacesClient) checkNameAvailabilityHandleResponse(resp *http.R // BeginCreateOrUpdate - Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. // This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name. // parameters - Parameters supplied to create a namespace resource. @@ -127,7 +127,7 @@ func (client *NamespacesClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a service namespace. Once created, this namespace's resource manifest is immutable. // This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *NamespacesClient) createOrUpdate(ctx context.Context, resourceGroupName string, namespaceName string, parameters SBNamespace, options *NamespacesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, namespaceName, parameters, options) if err != nil { @@ -163,7 +163,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -171,7 +171,7 @@ func (client *NamespacesClient) createOrUpdateCreateRequest(ctx context.Context, // CreateOrUpdateAuthorizationRule - Creates or updates an authorization rule for a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -217,7 +217,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -234,7 +234,7 @@ func (client *NamespacesClient) createOrUpdateAuthorizationRuleHandleResponse(re // CreateOrUpdateNetworkRuleSet - Create or update NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // parameters - The Namespace IpFilterRule. @@ -275,7 +275,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -292,7 +292,7 @@ func (client *NamespacesClient) createOrUpdateNetworkRuleSetHandleResponse(resp // BeginDelete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientBeginDeleteOptions contains the optional parameters for the NamespacesClient.BeginDelete method. @@ -310,7 +310,7 @@ func (client *NamespacesClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes an existing namespace. This operation also removes all associated resources under the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *NamespacesClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, options *NamespacesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, options) if err != nil { @@ -346,7 +346,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -354,7 +354,7 @@ func (client *NamespacesClient) deleteCreateRequest(ctx context.Context, resourc // DeleteAuthorizationRule - Deletes a namespace authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -399,7 +399,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -407,7 +407,7 @@ func (client *NamespacesClient) deleteAuthorizationRuleCreateRequest(ctx context // Get - Gets a description for the specified namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientGetOptions contains the optional parameters for the NamespacesClient.Get method. @@ -446,7 +446,7 @@ func (client *NamespacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -463,7 +463,7 @@ func (client *NamespacesClient) getHandleResponse(resp *http.Response) (Namespac // GetAuthorizationRule - Gets an authorization rule for a namespace by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -508,7 +508,7 @@ func (client *NamespacesClient) getAuthorizationRuleCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -525,7 +525,7 @@ func (client *NamespacesClient) getAuthorizationRuleHandleResponse(resp *http.Re // GetNetworkRuleSet - Gets NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientGetNetworkRuleSetOptions contains the optional parameters for the NamespacesClient.GetNetworkRuleSet @@ -565,7 +565,7 @@ func (client *NamespacesClient) getNetworkRuleSetCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -582,7 +582,7 @@ func (client *NamespacesClient) getNetworkRuleSetHandleResponse(resp *http.Respo // NewListPager - Gets all the available namespaces within the subscription, irrespective of the resource groups. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // options - NamespacesClientListOptions contains the optional parameters for the NamespacesClient.List method. func (client *NamespacesClient) NewListPager(options *NamespacesClientListOptions) *runtime.Pager[NamespacesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[NamespacesClientListResponse]{ @@ -624,7 +624,7 @@ func (client *NamespacesClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -641,7 +641,7 @@ func (client *NamespacesClient) listHandleResponse(resp *http.Response) (Namespa // NewListAuthorizationRulesPager - Gets the authorization rules for a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientListAuthorizationRulesOptions contains the optional parameters for the NamespacesClient.ListAuthorizationRules @@ -694,7 +694,7 @@ func (client *NamespacesClient) listAuthorizationRulesCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -711,7 +711,7 @@ func (client *NamespacesClient) listAuthorizationRulesHandleResponse(resp *http. // NewListByResourceGroupPager - Gets the available namespaces within a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // options - NamespacesClientListByResourceGroupOptions contains the optional parameters for the NamespacesClient.ListByResourceGroup // method. @@ -759,7 +759,7 @@ func (client *NamespacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -776,7 +776,7 @@ func (client *NamespacesClient) listByResourceGroupHandleResponse(resp *http.Res // ListKeys - Gets the primary and secondary connection strings for the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -820,7 +820,7 @@ func (client *NamespacesClient) listKeysCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -837,7 +837,7 @@ func (client *NamespacesClient) listKeysHandleResponse(resp *http.Response) (Nam // NewListNetworkRuleSetsPager - Gets list of NetworkRuleSet for a Namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - NamespacesClientListNetworkRuleSetsOptions contains the optional parameters for the NamespacesClient.ListNetworkRuleSets @@ -890,7 +890,7 @@ func (client *NamespacesClient) listNetworkRuleSetsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -907,7 +907,7 @@ func (client *NamespacesClient) listNetworkRuleSetsHandleResponse(resp *http.Res // RegenerateKeys - Regenerates the primary or secondary connection strings for the namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // authorizationRuleName - The authorization rule name. @@ -953,7 +953,7 @@ func (client *NamespacesClient) regenerateKeysCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -971,7 +971,7 @@ func (client *NamespacesClient) regenerateKeysHandleResponse(resp *http.Response // Update - Updates a service namespace. Once created, this namespace's resource manifest is immutable. This operation is // idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // parameters - Parameters supplied to update a namespace resource. @@ -1011,7 +1011,7 @@ func (client *NamespacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go index 93356e2cbc23..4e923bb8e0cf 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_operations_client.go @@ -50,7 +50,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available ServiceBus REST API operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -88,7 +88,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go index 080ef88761a1..586b28922785 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privateendpointconnections_client.go @@ -57,7 +57,7 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // CreateOrUpdate - Creates or updates PrivateEndpointConnections of service namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -103,7 +103,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateHandleResponse(res // BeginDelete - Deletes an existing Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -140,7 +140,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes an existing Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, namespaceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, namespaceName, privateEndpointConnectionName, options) if err != nil { @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +188,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. // Get - Gets a description for the specified Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // privateEndpointConnectionName - The PrivateEndpointConnection name @@ -233,7 +233,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,7 +250,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - Gets the available PrivateEndpointConnections within a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - PrivateEndpointConnectionsClientListOptions contains the optional parameters for the PrivateEndpointConnectionsClient.List @@ -303,7 +303,7 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go index 035aef7cd6df..1baddbf9c02e 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_privatelinkresources_client.go @@ -57,7 +57,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets lists of resources that supports Privatelinks. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get @@ -97,7 +97,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go index 242bdc12f1f8..cda67835859a 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_queues_client.go @@ -58,7 +58,7 @@ func NewQueuesClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates a Service Bus queue. This operation is idempotent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -103,7 +103,7 @@ func (client *QueuesClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *QueuesClient) createOrUpdateHandleResponse(resp *http.Response) (Q // CreateOrUpdateAuthorizationRule - Creates an authorization rule for a queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -171,7 +171,7 @@ func (client *QueuesClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -188,7 +188,7 @@ func (client *QueuesClient) createOrUpdateAuthorizationRuleHandleResponse(resp * // Delete - Deletes a queue from the specified namespace in a resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -232,7 +232,7 @@ func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +240,7 @@ func (client *QueuesClient) deleteCreateRequest(ctx context.Context, resourceGro // DeleteAuthorizationRule - Deletes a queue authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -290,7 +290,7 @@ func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +298,7 @@ func (client *QueuesClient) deleteAuthorizationRuleCreateRequest(ctx context.Con // Get - Returns a description for the specified queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -342,7 +342,7 @@ func (client *QueuesClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,7 +359,7 @@ func (client *QueuesClient) getHandleResponse(resp *http.Response) (QueuesClient // GetAuthorizationRule - Gets an authorization rule for a queue by rule name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -409,7 +409,7 @@ func (client *QueuesClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +426,7 @@ func (client *QueuesClient) getAuthorizationRuleHandleResponse(resp *http.Respon // NewListAuthorizationRulesPager - Gets all authorization rules for a queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -484,7 +484,7 @@ func (client *QueuesClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -501,7 +501,7 @@ func (client *QueuesClient) listAuthorizationRulesHandleResponse(resp *http.Resp // NewListByNamespacePager - Gets the queues within a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - QueuesClientListByNamespaceOptions contains the optional parameters for the QueuesClient.ListByNamespace method. @@ -553,7 +553,7 @@ func (client *QueuesClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -576,7 +576,7 @@ func (client *QueuesClient) listByNamespaceHandleResponse(resp *http.Response) ( // ListKeys - Primary and secondary connection strings to the queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -625,7 +625,7 @@ func (client *QueuesClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -642,7 +642,7 @@ func (client *QueuesClient) listKeysHandleResponse(resp *http.Response) (QueuesC // RegenerateKeys - Regenerates the primary or secondary connection strings to the queue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // queueName - The queue name. @@ -692,7 +692,7 @@ func (client *QueuesClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go index e3d36cdb5e0c..2657027e1988 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_rules_client.go @@ -58,7 +58,7 @@ func NewRulesClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Creates a new rule and updates an existing rule // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -113,7 +113,7 @@ func (client *RulesClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,7 +130,7 @@ func (client *RulesClient) createOrUpdateHandleResponse(resp *http.Response) (Ru // Delete - Deletes an existing rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -184,7 +184,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,7 +192,7 @@ func (client *RulesClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Retrieves the description for the specified rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -246,7 +246,7 @@ func (client *RulesClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,7 +263,7 @@ func (client *RulesClient) getHandleResponse(resp *http.Response) (RulesClientGe // NewListBySubscriptionsPager - List all the rules within given topic-subscription // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -326,7 +326,7 @@ func (client *RulesClient) listBySubscriptionsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go index f289161880ff..0e93db69d1d1 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_subscriptions_client.go @@ -58,7 +58,7 @@ func NewSubscriptionsClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates a topic subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -109,7 +109,7 @@ func (client *SubscriptionsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,7 +126,7 @@ func (client *SubscriptionsClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes a subscription from the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -175,7 +175,7 @@ func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,7 +183,7 @@ func (client *SubscriptionsClient) deleteCreateRequest(ctx context.Context, reso // Get - Returns a subscription description for the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -232,7 +232,7 @@ func (client *SubscriptionsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *SubscriptionsClient) getHandleResponse(resp *http.Response) (Subsc // NewListByTopicPager - List all the subscriptions under a specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -307,7 +307,7 @@ func (client *SubscriptionsClient) listByTopicCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } diff --git a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go index 2ecc268d746c..4a4e12f585ec 100644 --- a/sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go +++ b/sdk/resourcemanager/servicebus/armservicebus/zz_generated_topics_client.go @@ -58,7 +58,7 @@ func NewTopicsClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates a topic in the specified namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -103,7 +103,7 @@ func (client *TopicsClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,7 +120,7 @@ func (client *TopicsClient) createOrUpdateHandleResponse(resp *http.Response) (T // CreateOrUpdateAuthorizationRule - Creates an authorization rule for the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -171,7 +171,7 @@ func (client *TopicsClient) createOrUpdateAuthorizationRuleCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -188,7 +188,7 @@ func (client *TopicsClient) createOrUpdateAuthorizationRuleHandleResponse(resp * // Delete - Deletes a topic from the specified namespace and resource group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -232,7 +232,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +240,7 @@ func (client *TopicsClient) deleteCreateRequest(ctx context.Context, resourceGro // DeleteAuthorizationRule - Deletes a topic authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -290,7 +290,7 @@ func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +298,7 @@ func (client *TopicsClient) deleteAuthorizationRuleCreateRequest(ctx context.Con // Get - Returns a description for the specified topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -342,7 +342,7 @@ func (client *TopicsClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -359,7 +359,7 @@ func (client *TopicsClient) getHandleResponse(resp *http.Response) (TopicsClient // GetAuthorizationRule - Returns the specified authorization rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -409,7 +409,7 @@ func (client *TopicsClient) getAuthorizationRuleCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,7 +426,7 @@ func (client *TopicsClient) getAuthorizationRuleHandleResponse(resp *http.Respon // NewListAuthorizationRulesPager - Gets authorization rules for a topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -484,7 +484,7 @@ func (client *TopicsClient) listAuthorizationRulesCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -501,7 +501,7 @@ func (client *TopicsClient) listAuthorizationRulesHandleResponse(resp *http.Resp // NewListByNamespacePager - Gets all the topics in a namespace. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // options - TopicsClientListByNamespaceOptions contains the optional parameters for the TopicsClient.ListByNamespace method. @@ -553,7 +553,7 @@ func (client *TopicsClient) listByNamespaceCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } @@ -576,7 +576,7 @@ func (client *TopicsClient) listByNamespaceHandleResponse(resp *http.Response) ( // ListKeys - Gets the primary and secondary connection strings for the topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -625,7 +625,7 @@ func (client *TopicsClient) listKeysCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -642,7 +642,7 @@ func (client *TopicsClient) listKeysHandleResponse(resp *http.Response) (TopicsC // RegenerateKeys - Regenerates primary or secondary connection strings for the topic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01 +// Generated from API version 2022-01-01-preview // resourceGroupName - Name of the Resource group within the Azure subscription. // namespaceName - The namespace name // topicName - The topic name. @@ -692,7 +692,7 @@ func (client *TopicsClient) regenerateKeysCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01") + reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters)