diff --git a/sdk/resourcemanager/search/armsearch/CHANGELOG.md b/sdk/resourcemanager/search/armsearch/CHANGELOG.md index 896160c0554d..32a10eecbe55 100644 --- a/sdk/resourcemanager/search/armsearch/CHANGELOG.md +++ b/sdk/resourcemanager/search/armsearch/CHANGELOG.md @@ -1,5 +1,41 @@ # Release History +## 1.4.0-beta.1 (2024-03-22) +### Features Added + +- New value `IdentityTypeSystemAssignedUserAssigned`, `IdentityTypeUserAssigned` added to enum type `IdentityType` +- New value `SearchServiceStatusStopped` added to enum type `SearchServiceStatus` +- New enum type `SearchBypass` with values `SearchBypassAzurePortal`, `SearchBypassNone` +- New enum type `SearchDisabledDataExfiltrationOption` with values `SearchDisabledDataExfiltrationOptionAll` +- New function `*ClientFactory.NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient` +- New function `NewNetworkSecurityPerimeterConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.Get(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error)` +- New function `*NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager(string, string, *NetworkSecurityPerimeterConfigurationsClientListByServiceOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListByServiceResponse]` +- New function `*NetworkSecurityPerimeterConfigurationsClient.BeginReconcile(context.Context, string, string, string, *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error)` +- New struct `NSPConfigAccessRule` +- New struct `NSPConfigAccessRuleProperties` +- New struct `NSPConfigAssociation` +- New struct `NSPConfigNetworkSecurityPerimeterRule` +- New struct `NSPConfigPerimeter` +- New struct `NSPConfigProfile` +- New struct `NSPProvisioningIssue` +- New struct `NSPProvisioningIssueProperties` +- New struct `NetworkSecurityPerimeterConfiguration` +- New struct `NetworkSecurityPerimeterConfigurationListResult` +- New struct `NetworkSecurityPerimeterConfigurationProperties` +- New struct `OperationAvailability` +- New struct `OperationLogsSpecification` +- New struct `OperationMetricDimension` +- New struct `OperationMetricsSpecification` +- New struct `OperationProperties` +- New struct `OperationServiceSpecification` +- New struct `UserAssignedManagedIdentity` +- New field `UserAssignedIdentities` in struct `Identity` +- New field `Bypass` in struct `NetworkRuleSet` +- New field `IsDataAction`, `Origin`, `Properties` in struct `Operation` +- New field `DisabledDataExfiltrationOptions`, `ETag` in struct `ServiceProperties` + + ## 1.3.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/search/armsearch/README.md b/sdk/resourcemanager/search/armsearch/README.md index 5a2428425af4..84b8abf81b89 100644 --- a/sdk/resourcemanager/search/armsearch/README.md +++ b/sdk/resourcemanager/search/armsearch/README.md @@ -57,7 +57,7 @@ clientFactory, err := armsearch.NewClientFactory(, cred, &optio A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory. ```go -client := clientFactory.NewServicesClient() +client := clientFactory.NewAdminKeysClient() ``` ## Fakes diff --git a/sdk/resourcemanager/search/armsearch/adminkeys_client.go b/sdk/resourcemanager/search/armsearch/adminkeys_client.go index 68dd5f935164..f2d2b9c866ea 100644 --- a/sdk/resourcemanager/search/armsearch/adminkeys_client.go +++ b/sdk/resourcemanager/search/armsearch/adminkeys_client.go @@ -44,13 +44,13 @@ func NewAdminKeysClient(subscriptionID string, credential azcore.TokenCredential return client, nil } -// Get - Gets the primary and secondary admin API keys for the specified Azure Cognitive Search service. +// Get - Gets the primary and secondary admin API keys for the specified Azure AI Search service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - AdminKeysClientGetOptions contains the optional parameters for the AdminKeysClient.Get method. @@ -96,12 +96,12 @@ func (client *AdminKeysClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -117,10 +117,10 @@ func (client *AdminKeysClient) getHandleResponse(resp *http.Response) (AdminKeys // Regenerate - Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - keyKind - Specifies which key to regenerate. Valid values include 'primary' and 'secondary'. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -171,12 +171,12 @@ func (client *AdminKeysClient) regenerateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go b/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go index b7a726379e8b..7a0be192ebac 100644 --- a/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchGetAdminKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetAdminKeys.json func ExampleAdminKeysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleAdminKeysClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchRegenerateAdminKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchRegenerateAdminKey.json func ExampleAdminKeysClient_Regenerate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/assets.json b/sdk/resourcemanager/search/armsearch/assets.json index a4d6926058c9..a0439efbdffa 100644 --- a/sdk/resourcemanager/search/armsearch/assets.json +++ b/sdk/resourcemanager/search/armsearch/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "go", "TagPrefix": "go/resourcemanager/search/armsearch", - "Tag": "go/resourcemanager/search/armsearch_284942a788" + "Tag": "go/resourcemanager/search/armsearch_c01924fe6f" } diff --git a/sdk/resourcemanager/search/armsearch/autorest.md b/sdk/resourcemanager/search/armsearch/autorest.md index 5cc0ab5020f9..c968d1fd474f 100644 --- a/sdk/resourcemanager/search/armsearch/autorest.md +++ b/sdk/resourcemanager/search/armsearch/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.3.0 -tag: package-2023-11 +module-version: 1.4.0-beta.1 +tag: package-preview-2024-03 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/search/armsearch/client_factory.go b/sdk/resourcemanager/search/armsearch/client_factory.go index 513ebcada085..1538c1b16c21 100644 --- a/sdk/resourcemanager/search/armsearch/client_factory.go +++ b/sdk/resourcemanager/search/armsearch/client_factory.go @@ -17,8 +17,7 @@ import ( // Don't use this type directly, use NewClientFactory instead. type ClientFactory struct { subscriptionID string - credential azcore.TokenCredential - options *arm.ClientOptions + internal *arm.Client } // NewClientFactory creates a new instance of ClientFactory with the specified values. @@ -28,66 +27,91 @@ type ClientFactory struct { // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { - _, err := arm.NewClient(moduleName, moduleVersion, credential, options) + internal, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { return nil, err } return &ClientFactory{ - subscriptionID: subscriptionID, credential: credential, - options: options.Clone(), + subscriptionID: subscriptionID, + internal: internal, }, nil } // NewAdminKeysClient creates a new instance of AdminKeysClient. func (c *ClientFactory) NewAdminKeysClient() *AdminKeysClient { - subClient, _ := NewAdminKeysClient(c.subscriptionID, c.credential, c.options) - return subClient + return &AdminKeysClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewManagementClient creates a new instance of ManagementClient. func (c *ClientFactory) NewManagementClient() *ManagementClient { - subClient, _ := NewManagementClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ManagementClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient. +func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient { + return &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) - return subClient + return &OperationsClient{ + internal: c.internal, + } } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient. func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient { - subClient, _ := NewPrivateEndpointConnectionsClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateEndpointConnectionsClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient. func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient { - subClient, _ := NewPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &PrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewQueryKeysClient creates a new instance of QueryKeysClient. func (c *ClientFactory) NewQueryKeysClient() *QueryKeysClient { - subClient, _ := NewQueryKeysClient(c.subscriptionID, c.credential, c.options) - return subClient + return &QueryKeysClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewServicesClient creates a new instance of ServicesClient. func (c *ClientFactory) NewServicesClient() *ServicesClient { - subClient, _ := NewServicesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &ServicesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient. func (c *ClientFactory) NewSharedPrivateLinkResourcesClient() *SharedPrivateLinkResourcesClient { - subClient, _ := NewSharedPrivateLinkResourcesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &SharedPrivateLinkResourcesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } // NewUsagesClient creates a new instance of UsagesClient. func (c *ClientFactory) NewUsagesClient() *UsagesClient { - subClient, _ := NewUsagesClient(c.subscriptionID, c.credential, c.options) - return subClient + return &UsagesClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } } diff --git a/sdk/resourcemanager/search/armsearch/constants.go b/sdk/resourcemanager/search/armsearch/constants.go index 531eb5dfe9a3..802ce1f598bf 100644 --- a/sdk/resourcemanager/search/armsearch/constants.go +++ b/sdk/resourcemanager/search/armsearch/constants.go @@ -10,10 +10,10 @@ package armsearch const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" - moduleVersion = "v1.3.0" + moduleVersion = "v1.4.0-beta.1" ) -// AADAuthFailureMode - Describes what response the data plane API of a Search service would send for requests that failed +// AADAuthFailureMode - Describes what response the data plane API of a search service would send for requests that failed // authentication. type AADAuthFailureMode string @@ -72,12 +72,21 @@ func PossibleHostingModeValues() []HostingMode { } } -// IdentityType - The identity type. +// IdentityType - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an identity +// created by the system and a set of user assigned identities. The type 'None' will remove +// all identities from the service. type IdentityType string const ( - IdentityTypeNone IdentityType = "None" + // IdentityTypeNone - Indicates that any identity associated with the search service needs to be removed. + IdentityTypeNone IdentityType = "None" + // IdentityTypeSystemAssigned - Indicates that system-assigned identity for the search service will be enabled. IdentityTypeSystemAssigned IdentityType = "SystemAssigned" + // IdentityTypeSystemAssignedUserAssigned - Indicates that system-assigned identity for the search service will be enabled + // along with the assignment of one or more user assigned identities. + IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned, UserAssigned" + // IdentityTypeUserAssigned - Indicates that one or more user assigned identities will be assigned to the search service. + IdentityTypeUserAssigned IdentityType = "UserAssigned" ) // PossibleIdentityTypeValues returns the possible values for the IdentityType const type. @@ -85,16 +94,18 @@ func PossibleIdentityTypeValues() []IdentityType { return []IdentityType{ IdentityTypeNone, IdentityTypeSystemAssigned, + IdentityTypeSystemAssignedUserAssigned, + IdentityTypeUserAssigned, } } -// PrivateLinkServiceConnectionProvisioningState - The provisioning state of the private link service connection. Can be Updating, -// Deleting, Failed, Succeeded, or Incomplete +// PrivateLinkServiceConnectionProvisioningState - The provisioning state of the private link service connection. Valid values +// are Updating, Deleting, Failed, Succeeded, Incomplete, or Canceled. type PrivateLinkServiceConnectionProvisioningState string const ( // PrivateLinkServiceConnectionProvisioningStateCanceled - Provisioning request for the private link service connection resource - // has been canceled + // has been canceled. PrivateLinkServiceConnectionProvisioningStateCanceled PrivateLinkServiceConnectionProvisioningState = "Canceled" // PrivateLinkServiceConnectionProvisioningStateDeleting - The private link service connection is in the process of being // deleted. @@ -125,8 +136,8 @@ func PossiblePrivateLinkServiceConnectionProvisioningStateValues() []PrivateLink } } -// PrivateLinkServiceConnectionStatus - Status of the the private link service connection. Can be Pending, Approved, Rejected, -// or Disconnected. +// PrivateLinkServiceConnectionStatus - Status of the the private link service connection. Valid values are Pending, Approved, +// Rejected, or Disconnected. type PrivateLinkServiceConnectionStatus string const ( @@ -183,8 +194,11 @@ func PossibleProvisioningStateValues() []ProvisioningState { type PublicNetworkAccess string const ( + // PublicNetworkAccessDisabled - The search service is not accessible from traffic originating from the public internet. Access + // is only permitted over approved private endpoint connections. PublicNetworkAccessDisabled PublicNetworkAccess = "disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "enabled" + // PublicNetworkAccessEnabled - The search service is accessible from traffic originating from the public internet. + PublicNetworkAccessEnabled PublicNetworkAccess = "enabled" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -205,20 +219,20 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { type SKUName string const ( - // SKUNameBasic - Paid tier dedicated service with up to 3 replicas. + // SKUNameBasic - Billable tier for a dedicated service having up to 3 replicas. SKUNameBasic SKUName = "basic" - // SKUNameFree - Free tier, with no SLA guarantees and a subset of features offered to paid tiers. + // SKUNameFree - Free tier, with no SLA guarantees and a subset of the features offered on billable tiers. SKUNameFree SKUName = "free" - // SKUNameStandard - Paid tier dedicated service with up to 12 partitions and 12 replicas. + // SKUNameStandard - Billable tier for a dedicated service having up to 12 partitions and 12 replicas. SKUNameStandard SKUName = "standard" // SKUNameStandard2 - Similar to 'standard', but with more capacity per search unit. SKUNameStandard2 SKUName = "standard2" // SKUNameStandard3 - The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more // indexes if you also set the hostingMode property to 'highDensity'). SKUNameStandard3 SKUName = "standard3" - // SKUNameStorageOptimizedL1 - Paid tier dedicated service that supports 1TB per partition, up to 12 partitions. + // SKUNameStorageOptimizedL1 - Billable tier for a dedicated service that supports 1TB per partition, up to 12 partitions. SKUNameStorageOptimizedL1 SKUName = "storage_optimized_l1" - // SKUNameStorageOptimizedL2 - Paid tier dedicated service that supports 2TB per partition, up to 12 partitions. + // SKUNameStorageOptimizedL2 - Billable tier for a dedicated service that supports 2TB per partition, up to 12 partitions. SKUNameStorageOptimizedL2 SKUName = "storage_optimized_l2" ) @@ -235,17 +249,50 @@ func PossibleSKUNameValues() []SKUName { } } -// SearchEncryptionComplianceStatus - Describes whether the search service is compliant or not with respect to having non -// customer encrypted resources. If a service has more than one non customer encrypted resource and 'Enforcement' is -// 'enabled' then the service will be marked as 'nonCompliant'. +// SearchBypass - Possible origins of inbound traffic that can bypass the rules defined in the 'ipRules' section. +type SearchBypass string + +const ( + // SearchBypassAzurePortal - Indicates that requests originating from the Azure portal can bypass the rules defined in the + // 'ipRules' section. + SearchBypassAzurePortal SearchBypass = "AzurePortal" + // SearchBypassNone - Indicates that no origin can bypass the rules defined in the 'ipRules' section. This is the default. + SearchBypassNone SearchBypass = "None" +) + +// PossibleSearchBypassValues returns the possible values for the SearchBypass const type. +func PossibleSearchBypassValues() []SearchBypass { + return []SearchBypass{ + SearchBypassAzurePortal, + SearchBypassNone, + } +} + +// SearchDisabledDataExfiltrationOption - A specific data exfiltration scenario that is disabled for the service. +type SearchDisabledDataExfiltrationOption string + +const ( + // SearchDisabledDataExfiltrationOptionAll - Indicates that all data exfiltration scenarios are disabled. + SearchDisabledDataExfiltrationOptionAll SearchDisabledDataExfiltrationOption = "All" +) + +// PossibleSearchDisabledDataExfiltrationOptionValues returns the possible values for the SearchDisabledDataExfiltrationOption const type. +func PossibleSearchDisabledDataExfiltrationOptionValues() []SearchDisabledDataExfiltrationOption { + return []SearchDisabledDataExfiltrationOption{ + SearchDisabledDataExfiltrationOptionAll, + } +} + +// SearchEncryptionComplianceStatus - Returns the status of search service compliance with respect to non-CMK-encrypted objects. +// If a service has more than one unencrypted object, and enforcement is enabled, the service is marked as +// noncompliant. type SearchEncryptionComplianceStatus string const ( - // SearchEncryptionComplianceStatusCompliant - Indicates that the search service is compliant, either because number of non - // customer encrypted resources is zero or enforcement is disabled. + // SearchEncryptionComplianceStatusCompliant - Indicates that the search service is compliant, either because the number of + // non-CMK-encrypted objects is zero or enforcement is disabled. SearchEncryptionComplianceStatusCompliant SearchEncryptionComplianceStatus = "Compliant" - // SearchEncryptionComplianceStatusNonCompliant - Indicates that the search service has more than 1 non customer encrypted - // resources. + // SearchEncryptionComplianceStatusNonCompliant - Indicates that the search service has more than one non-CMK-encrypted objects. SearchEncryptionComplianceStatusNonCompliant SearchEncryptionComplianceStatus = "NonCompliant" ) @@ -257,14 +304,16 @@ func PossibleSearchEncryptionComplianceStatusValues() []SearchEncryptionComplian } } -// SearchEncryptionWithCmk - Describes how a search service should enforce having one or more non customer encrypted resources. +// SearchEncryptionWithCmk - Describes how a search service should enforce compliance if it finds objects that aren't encrypted +// with the customer-managed key. type SearchEncryptionWithCmk string const ( - // SearchEncryptionWithCmkDisabled - No enforcement will be made and the search service can have non customer encrypted resources. + // SearchEncryptionWithCmkDisabled - No enforcement of customer-managed key encryption will be made. Only the built-in service-managed + // encryption is used. SearchEncryptionWithCmkDisabled SearchEncryptionWithCmk = "Disabled" - // SearchEncryptionWithCmkEnabled - Search service will be marked as non-compliant if there are one or more non customer encrypted - // resources. + // SearchEncryptionWithCmkEnabled - Search service will be marked as non-compliant if one or more objects aren't encrypted + // with a customer-managed key. SearchEncryptionWithCmkEnabled SearchEncryptionWithCmk = "Enabled" // SearchEncryptionWithCmkUnspecified - Enforcement policy is not explicitly specified, with the behavior being the same as // if it were set to 'Disabled'. @@ -281,18 +330,18 @@ func PossibleSearchEncryptionWithCmkValues() []SearchEncryptionWithCmk { } // SearchSemanticSearch - Sets options that control the availability of semantic search. This configuration is only possible -// for certain Azure Cognitive Search SKUs in certain locations. +// for certain Azure AI Search SKUs in certain locations. type SearchSemanticSearch string const ( - // SearchSemanticSearchDisabled - Indicates that semantic search is disabled for the search service. + // SearchSemanticSearchDisabled - Indicates that semantic reranker is disabled for the search service. This is the default. SearchSemanticSearchDisabled SearchSemanticSearch = "disabled" - // SearchSemanticSearchFree - Enables semantic search on a search service and indicates that it is to be used within the limits - // of the free tier. This would cap the volume of semantic search requests and is offered at no extra charge. This is the - // default for newly provisioned search services. + // SearchSemanticSearchFree - Enables semantic reranker on a search service and indicates that it is to be used within the + // limits of the free plan. The free plan would cap the volume of semantic ranking requests and is offered at no extra charge. + // This is the default for newly provisioned search services. SearchSemanticSearchFree SearchSemanticSearch = "free" - // SearchSemanticSearchStandard - Enables semantic search on a search service as a billable feature, with higher throughput - // and volume of semantic search queries. + // SearchSemanticSearchStandard - Enables semantic reranker on a search service as a billable feature, with higher throughput + // and volume of semantically reranked queries. SearchSemanticSearchStandard SearchSemanticSearch = "standard" ) @@ -311,9 +360,10 @@ func PossibleSearchSemanticSearchValues() []SearchSemanticSearch { // can occur when the underlying search units are not healthy. The search service // is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service // is disabled. In this state, the service will reject all API requests. -// 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, it means -// the Azure Cognitive Search team is actively investigating the underlying -// issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. +// 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If +// your service is in the degraded, disabled, or error states, it means the Azure +// AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable +// based on the number of search units provisioned. type SearchServiceStatus string const ( @@ -329,6 +379,8 @@ const ( SearchServiceStatusProvisioning SearchServiceStatus = "provisioning" // SearchServiceStatusRunning - The search service is running and no provisioning operations are underway. SearchServiceStatusRunning SearchServiceStatus = "running" + // SearchServiceStatusStopped - The search service is in a subscription that's disabled. + SearchServiceStatusStopped SearchServiceStatus = "stopped" ) // PossibleSearchServiceStatusValues returns the possible values for the SearchServiceStatus const type. @@ -340,19 +392,28 @@ func PossibleSearchServiceStatusValues() []SearchServiceStatus { SearchServiceStatusError, SearchServiceStatusProvisioning, SearchServiceStatusRunning, + SearchServiceStatusStopped, } } -// SharedPrivateLinkResourceProvisioningState - The provisioning state of the shared private link resource. Can be Updating, -// Deleting, Failed, Succeeded or Incomplete. +// SharedPrivateLinkResourceProvisioningState - The provisioning state of the shared private link resource. Valid values are +// Updating, Deleting, Failed, Succeeded or Incomplete. type SharedPrivateLinkResourceProvisioningState string const ( - SharedPrivateLinkResourceProvisioningStateDeleting SharedPrivateLinkResourceProvisioningState = "Deleting" - SharedPrivateLinkResourceProvisioningStateFailed SharedPrivateLinkResourceProvisioningState = "Failed" + // SharedPrivateLinkResourceProvisioningStateDeleting - The shared private link resource is in the process of being deleted. + SharedPrivateLinkResourceProvisioningStateDeleting SharedPrivateLinkResourceProvisioningState = "Deleting" + // SharedPrivateLinkResourceProvisioningStateFailed - The shared private link resource has failed to be provisioned or deleted. + SharedPrivateLinkResourceProvisioningStateFailed SharedPrivateLinkResourceProvisioningState = "Failed" + // SharedPrivateLinkResourceProvisioningStateIncomplete - Provisioning request for the shared private link resource has been + // accepted but the process of creation has not commenced yet. SharedPrivateLinkResourceProvisioningStateIncomplete SharedPrivateLinkResourceProvisioningState = "Incomplete" - SharedPrivateLinkResourceProvisioningStateSucceeded SharedPrivateLinkResourceProvisioningState = "Succeeded" - SharedPrivateLinkResourceProvisioningStateUpdating SharedPrivateLinkResourceProvisioningState = "Updating" + // SharedPrivateLinkResourceProvisioningStateSucceeded - The shared private link resource has finished provisioning and is + // ready for approval. + SharedPrivateLinkResourceProvisioningStateSucceeded SharedPrivateLinkResourceProvisioningState = "Succeeded" + // SharedPrivateLinkResourceProvisioningStateUpdating - The shared private link resource is in the process of being created + // along with other resources for it to be fully functional. + SharedPrivateLinkResourceProvisioningStateUpdating SharedPrivateLinkResourceProvisioningState = "Updating" ) // PossibleSharedPrivateLinkResourceProvisioningStateValues returns the possible values for the SharedPrivateLinkResourceProvisioningState const type. @@ -366,14 +427,19 @@ func PossibleSharedPrivateLinkResourceProvisioningStateValues() []SharedPrivateL } } -// SharedPrivateLinkResourceStatus - Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected. +// SharedPrivateLinkResourceStatus - Status of the shared private link resource. Valid values are Pending, Approved, Rejected +// or Disconnected. type SharedPrivateLinkResourceStatus string const ( - SharedPrivateLinkResourceStatusApproved SharedPrivateLinkResourceStatus = "Approved" + // SharedPrivateLinkResourceStatusApproved - The shared private link resource is approved and is ready for use. + SharedPrivateLinkResourceStatusApproved SharedPrivateLinkResourceStatus = "Approved" + // SharedPrivateLinkResourceStatusDisconnected - The shared private link resource has been removed from the service. SharedPrivateLinkResourceStatusDisconnected SharedPrivateLinkResourceStatus = "Disconnected" - SharedPrivateLinkResourceStatusPending SharedPrivateLinkResourceStatus = "Pending" - SharedPrivateLinkResourceStatusRejected SharedPrivateLinkResourceStatus = "Rejected" + // SharedPrivateLinkResourceStatusPending - The shared private link resource has been created and is pending approval. + SharedPrivateLinkResourceStatusPending SharedPrivateLinkResourceStatus = "Pending" + // SharedPrivateLinkResourceStatusRejected - The shared private link resource has been rejected and cannot be used. + SharedPrivateLinkResourceStatusRejected SharedPrivateLinkResourceStatus = "Rejected" ) // PossibleSharedPrivateLinkResourceStatusValues returns the possible values for the SharedPrivateLinkResourceStatus const type. @@ -394,7 +460,7 @@ type UnavailableNameReason string const ( // UnavailableNameReasonAlreadyExists - The search service name is already assigned to a different search service. UnavailableNameReasonAlreadyExists UnavailableNameReason = "AlreadyExists" - // UnavailableNameReasonInvalid - The search service name does not match naming requirements. + // UnavailableNameReasonInvalid - The search service name doesn't match naming requirements. UnavailableNameReasonInvalid UnavailableNameReason = "Invalid" ) diff --git a/sdk/resourcemanager/search/armsearch/fake/networksecurityperimeterconfigurations_server.go b/sdk/resourcemanager/search/armsearch/fake/networksecurityperimeterconfigurations_server.go new file mode 100644 index 000000000000..d98c04efbc5d --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/fake/networksecurityperimeterconfigurations_server.go @@ -0,0 +1,212 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" + "net/http" + "net/url" + "regexp" +) + +// NetworkSecurityPerimeterConfigurationsServer is a fake server for instances of the armsearch.NetworkSecurityPerimeterConfigurationsClient type. +type NetworkSecurityPerimeterConfigurationsServer struct { + // Get is the fake for method NetworkSecurityPerimeterConfigurationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *armsearch.NetworkSecurityPerimeterConfigurationsClientGetOptions) (resp azfake.Responder[armsearch.NetworkSecurityPerimeterConfigurationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListByServicePager is the fake for method NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager + // HTTP status codes to indicate success: http.StatusOK + NewListByServicePager func(resourceGroupName string, searchServiceName string, options *armsearch.NetworkSecurityPerimeterConfigurationsClientListByServiceOptions) (resp azfake.PagerResponder[armsearch.NetworkSecurityPerimeterConfigurationsClientListByServiceResponse]) + + // BeginReconcile is the fake for method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile + // HTTP status codes to indicate success: http.StatusAccepted + BeginReconcile func(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *armsearch.NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (resp azfake.PollerResponder[armsearch.NetworkSecurityPerimeterConfigurationsClientReconcileResponse], errResp azfake.ErrorResponder) +} + +// NewNetworkSecurityPerimeterConfigurationsServerTransport creates a new instance of NetworkSecurityPerimeterConfigurationsServerTransport with the provided implementation. +// The returned NetworkSecurityPerimeterConfigurationsServerTransport instance is connected to an instance of armsearch.NetworkSecurityPerimeterConfigurationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewNetworkSecurityPerimeterConfigurationsServerTransport(srv *NetworkSecurityPerimeterConfigurationsServer) *NetworkSecurityPerimeterConfigurationsServerTransport { + return &NetworkSecurityPerimeterConfigurationsServerTransport{ + srv: srv, + newListByServicePager: newTracker[azfake.PagerResponder[armsearch.NetworkSecurityPerimeterConfigurationsClientListByServiceResponse]](), + beginReconcile: newTracker[azfake.PollerResponder[armsearch.NetworkSecurityPerimeterConfigurationsClientReconcileResponse]](), + } +} + +// NetworkSecurityPerimeterConfigurationsServerTransport connects instances of armsearch.NetworkSecurityPerimeterConfigurationsClient to instances of NetworkSecurityPerimeterConfigurationsServer. +// Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsServerTransport instead. +type NetworkSecurityPerimeterConfigurationsServerTransport struct { + srv *NetworkSecurityPerimeterConfigurationsServer + newListByServicePager *tracker[azfake.PagerResponder[armsearch.NetworkSecurityPerimeterConfigurationsClientListByServiceResponse]] + beginReconcile *tracker[azfake.PollerResponder[armsearch.NetworkSecurityPerimeterConfigurationsClientReconcileResponse]] +} + +// Do implements the policy.Transporter interface for NetworkSecurityPerimeterConfigurationsServerTransport. +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "NetworkSecurityPerimeterConfigurationsClient.Get": + resp, err = n.dispatchGet(req) + case "NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager": + resp, err = n.dispatchNewListByServicePager(req) + case "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile": + resp, err = n.dispatchBeginReconcile(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if n.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Search/searchServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + searchServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("searchServiceName")]) + if err != nil { + return nil, err + } + nspConfigNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nspConfigName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.Get(req.Context(), resourceGroupNameParam, searchServiceNameParam, nspConfigNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).NetworkSecurityPerimeterConfiguration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchNewListByServicePager(req *http.Request) (*http.Response, error) { + if n.srv.NewListByServicePager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListByServicePager not implemented")} + } + newListByServicePager := n.newListByServicePager.get(req) + if newListByServicePager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Search/searchServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + searchServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("searchServiceName")]) + if err != nil { + return nil, err + } + resp := n.srv.NewListByServicePager(resourceGroupNameParam, searchServiceNameParam, nil) + newListByServicePager = &resp + n.newListByServicePager.add(req, newListByServicePager) + server.PagerResponderInjectNextLinks(newListByServicePager, req, func(page *armsearch.NetworkSecurityPerimeterConfigurationsClientListByServiceResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListByServicePager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + n.newListByServicePager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListByServicePager) { + n.newListByServicePager.remove(req) + } + return resp, nil +} + +func (n *NetworkSecurityPerimeterConfigurationsServerTransport) dispatchBeginReconcile(req *http.Request) (*http.Response, error) { + if n.srv.BeginReconcile == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginReconcile not implemented")} + } + beginReconcile := n.beginReconcile.get(req) + if beginReconcile == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Search/searchServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/networkSecurityPerimeterConfigurations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reconcile` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + searchServiceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("searchServiceName")]) + if err != nil { + return nil, err + } + nspConfigNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("nspConfigName")]) + if err != nil { + return nil, err + } + respr, errRespr := n.srv.BeginReconcile(req.Context(), resourceGroupNameParam, searchServiceNameParam, nspConfigNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginReconcile = &respr + n.beginReconcile.add(req, beginReconcile) + } + + resp, err := server.PollerResponderNext(beginReconcile, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + n.beginReconcile.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginReconcile) { + n.beginReconcile.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/search/armsearch/fake/server_factory.go b/sdk/resourcemanager/search/armsearch/fake/server_factory.go index a9dda61c9437..29a400fc0941 100644 --- a/sdk/resourcemanager/search/armsearch/fake/server_factory.go +++ b/sdk/resourcemanager/search/armsearch/fake/server_factory.go @@ -19,15 +19,16 @@ import ( // ServerFactory is a fake server for instances of the armsearch.ClientFactory type. type ServerFactory struct { - AdminKeysServer AdminKeysServer - ManagementServer ManagementServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - QueryKeysServer QueryKeysServer - ServicesServer ServicesServer - SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer - UsagesServer UsagesServer + AdminKeysServer AdminKeysServer + ManagementServer ManagementServer + NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer + OperationsServer OperationsServer + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + PrivateLinkResourcesServer PrivateLinkResourcesServer + QueryKeysServer QueryKeysServer + ServicesServer ServicesServer + SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer + UsagesServer UsagesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -42,17 +43,18 @@ func NewServerFactoryTransport(srv *ServerFactory) *ServerFactoryTransport { // ServerFactoryTransport connects instances of armsearch.ClientFactory to instances of ServerFactory. // Don't use this type directly, use NewServerFactoryTransport instead. type ServerFactoryTransport struct { - srv *ServerFactory - trMu sync.Mutex - trAdminKeysServer *AdminKeysServerTransport - trManagementServer *ManagementServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trQueryKeysServer *QueryKeysServerTransport - trServicesServer *ServicesServerTransport - trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport - trUsagesServer *UsagesServerTransport + srv *ServerFactory + trMu sync.Mutex + trAdminKeysServer *AdminKeysServerTransport + trManagementServer *ManagementServerTransport + trNetworkSecurityPerimeterConfigurationsServer *NetworkSecurityPerimeterConfigurationsServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQueryKeysServer *QueryKeysServerTransport + trServicesServer *ServicesServerTransport + trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport + trUsagesServer *UsagesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -74,6 +76,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "ManagementClient": initServer(s, &s.trManagementServer, func() *ManagementServerTransport { return NewManagementServerTransport(&s.srv.ManagementServer) }) resp, err = s.trManagementServer.Do(req) + case "NetworkSecurityPerimeterConfigurationsClient": + initServer(s, &s.trNetworkSecurityPerimeterConfigurationsServer, func() *NetworkSecurityPerimeterConfigurationsServerTransport { + return NewNetworkSecurityPerimeterConfigurationsServerTransport(&s.srv.NetworkSecurityPerimeterConfigurationsServer) + }) + resp, err = s.trNetworkSecurityPerimeterConfigurationsServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) diff --git a/sdk/resourcemanager/search/armsearch/management_client.go b/sdk/resourcemanager/search/armsearch/management_client.go index 960b76db9ccd..6654a36c6ec9 100644 --- a/sdk/resourcemanager/search/armsearch/management_client.go +++ b/sdk/resourcemanager/search/armsearch/management_client.go @@ -47,9 +47,9 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // UsageBySubscriptionSKU - Gets the quota usage for a search sku in the given subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - location - The unique location name for a Microsoft Azure geographic region. -// - skuName - The unique search service sku name supported by Azure Cognitive Search. +// - skuName - The unique SKU name that identifies a billable tier. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - ManagementClientUsageBySubscriptionSKUOptions contains the optional parameters for the ManagementClient.UsageBySubscriptionSKU @@ -96,12 +96,12 @@ func (client *ManagementClient) usageBySubscriptionSKUCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/search/armsearch/management_client_example_test.go b/sdk/resourcemanager/search/armsearch/management_client_example_test.go index 5a7f460d5f6d..92ea71dfc3c7 100644 --- a/sdk/resourcemanager/search/armsearch/management_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/management_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetQuotaUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsage.json func ExampleManagementClient_UsageBySubscriptionSKU() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/models.go b/sdk/resourcemanager/search/armsearch/models.go index 17e11a26bce6..6cdaf457d10e 100644 --- a/sdk/resourcemanager/search/armsearch/models.go +++ b/sdk/resourcemanager/search/armsearch/models.go @@ -8,7 +8,7 @@ package armsearch -// AdminKeyResult - Response containing the primary and secondary admin API keys for a given Azure Cognitive Search service. +// AdminKeyResult - Response containing the primary and secondary admin API keys for a given Azure AI Search service. type AdminKeyResult struct { // READ-ONLY; The primary admin API key of the search service. PrimaryKey *string @@ -44,46 +44,54 @@ type CheckNameAvailabilityOutput struct { Reason *UnavailableNameReason } -// DataPlaneAADOrAPIKeyAuthOption - Indicates that either the API key or an access token from Azure Active Directory can be -// used for authentication. +// DataPlaneAADOrAPIKeyAuthOption - Indicates that either the API key or an access token from a Microsoft Entra ID tenant +// can be used for authentication. type DataPlaneAADOrAPIKeyAuthOption struct { - // Describes what response the data plane API of a Search service would send for requests that failed authentication. + // Describes what response the data plane API of a search service would send for requests that failed authentication. AADAuthFailureMode *AADAuthFailureMode } -// DataPlaneAuthOptions - Defines the options for how the data plane API of a Search service authenticates requests. This -// cannot be set if 'disableLocalAuth' is set to true. +// DataPlaneAuthOptions - Defines the options for how the search service authenticates a data plane request. This cannot be +// set if 'disableLocalAuth' is set to true. type DataPlaneAuthOptions struct { - // Indicates that either the API key or an access token from Azure Active Directory can be used for authentication. + // Indicates that either the API key or an access token from a Microsoft Entra ID tenant can be used for authentication. AADOrAPIKey *DataPlaneAADOrAPIKeyAuthOption - // Indicates that only the API key needs to be used for authentication. + // Indicates that only the API key can be used for authentication. APIKeyOnly any } // EncryptionWithCmk - Describes a policy that determines how resources within the search service are to be encrypted with -// Customer Managed Keys. +// customer managed keys. type EncryptionWithCmk struct { - // Describes how a search service should enforce having one or more non customer encrypted resources. + // Describes how a search service should enforce compliance if it finds objects that aren't encrypted with the customer-managed + // key. Enforcement *SearchEncryptionWithCmk - // READ-ONLY; Describes whether the search service is compliant or not with respect to having non customer encrypted resources. - // If a service has more than one non customer encrypted resource and 'Enforcement' is - // 'enabled' then the service will be marked as 'nonCompliant'. + // READ-ONLY; Returns the status of search service compliance with respect to non-CMK-encrypted objects. If a service has + // more than one unencrypted object, and enforcement is enabled, the service is marked as + // noncompliant. EncryptionComplianceStatus *SearchEncryptionComplianceStatus } -// IPRule - The IP restriction rule of the Azure Cognitive Search service. +// IPRule - The IP restriction rule of the Azure AI Search service. type IPRule struct { // Value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be allowed. Value *string } -// Identity for the resource. +// Identity - Details about the search service identity. A null value indicates that the search service has no identity assigned. type Identity struct { - // REQUIRED; The identity type. + // REQUIRED; The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an identity + // created by the system and a set of user assigned identities. The type 'None' will remove + // all identities from the service. Type *IdentityType + // The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource + // IDs in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*UserAssignedManagedIdentity + // READ-ONLY; The principal ID of the system-assigned identity of the search service. PrincipalID *string @@ -91,18 +99,83 @@ type Identity struct { TenantID *string } -// ListQueryKeysResult - Response containing the query API keys for a given Azure Cognitive Search service. +// ListQueryKeysResult - Response containing the query API keys for a given Azure AI Search service. type ListQueryKeysResult struct { // READ-ONLY; Request URL that can be used to query next page of query keys. Returned when the total number of requested query // keys exceed maximum page size. NextLink *string - // READ-ONLY; The query keys for the Azure Cognitive Search service. + // READ-ONLY; The query keys for the Azure AI Search service. Value []*QueryKey } -// NetworkRuleSet - Network specific rules that determine how the Azure Cognitive Search service may be reached. +// NSPConfigAccessRule - An access rule for a network security perimeter configuration. +type NSPConfigAccessRule struct { + Name *string + + // The properties for the access rules in a network security perimeter configuration. + Properties *NSPConfigAccessRuleProperties +} + +// NSPConfigAccessRuleProperties - The properties for the access rules in a network security perimeter configuration. +type NSPConfigAccessRuleProperties struct { + AddressPrefixes []*string + Direction *string + FullyQualifiedDomainNames []*string + NetworkSecurityPerimeters []*NSPConfigNetworkSecurityPerimeterRule + Subscriptions []*string +} + +// NSPConfigAssociation - The resource association for the network security perimeter. +type NSPConfigAssociation struct { + AccessMode *string + Name *string +} + +// NSPConfigNetworkSecurityPerimeterRule - The network security perimeter properties present in a configuration rule. +type NSPConfigNetworkSecurityPerimeterRule struct { + ID *string + Location *string + PerimeterGUID *string +} + +// NSPConfigPerimeter - The perimeter for a network security perimeter configuration. +type NSPConfigPerimeter struct { + ID *string + Location *string + PerimeterGUID *string +} + +// NSPConfigProfile - The profile for a network security perimeter configuration. +type NSPConfigProfile struct { + AccessRules []*NSPConfigAccessRule + AccessRulesVersion *string + Name *string +} + +// NSPProvisioningIssue - An object to describe any issues with provisioning network security perimeters to a search service. +type NSPProvisioningIssue struct { + Name *string + + // The properties to describe any issues with provisioning network security perimeters to a search service. + Properties *NSPProvisioningIssueProperties +} + +// NSPProvisioningIssueProperties - The properties to describe any issues with provisioning network security perimeters to +// a search service. +type NSPProvisioningIssueProperties struct { + Description *string + IssueType *string + Severity *string + SuggestedAccessRules []*string + SuggestedResourceIDs []*string +} + +// NetworkRuleSet - Network specific rules that determine how the Azure AI Search service may be reached. type NetworkRuleSet struct { + // Possible origins of inbound traffic that can bypass the rules defined in the 'ipRules' section. + Bypass *SearchBypass + // A list of IP restriction rules that defines the inbound network(s) with allowing access to the search service endpoint. // At the meantime, all other public IP networks are blocked by the firewall. These // restriction rules are applied only when the 'publicNetworkAccess' of the search service is 'enabled'; otherwise, traffic @@ -111,13 +184,72 @@ type NetworkRuleSet struct { IPRules []*IPRule } +// NetworkSecurityPerimeterConfiguration - Network security perimeter configuration for a server. +type NetworkSecurityPerimeterConfiguration struct { + // Resource properties. + Properties *NetworkSecurityPerimeterConfigurationProperties + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// NetworkSecurityPerimeterConfigurationListResult - A list of network security perimeter configurations for a server. +type NetworkSecurityPerimeterConfigurationListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string + + // READ-ONLY; Array of results. + Value []*NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationProperties - The properties of a network security perimeter configuration. +type NetworkSecurityPerimeterConfigurationProperties struct { + // The perimeter for a network security perimeter configuration. + NetworkSecurityPerimeter *NSPConfigPerimeter + + // The profile for a network security perimeter configuration. + Profile *NSPConfigProfile + ProvisioningIssues []*NSPProvisioningIssue + + // The resource association for the network security perimeter. + ResourceAssociation *NSPConfigAssociation + + // READ-ONLY + ProvisioningState *string +} + // Operation - Describes a REST API operation. type Operation struct { // READ-ONLY; The object that describes the operation. Display *OperationDisplay + // READ-ONLY; Describes if the specified operation is a data plane API operation. Operations where this value is not true + // are supported directly by the resource provider. + IsDataAction *bool + // READ-ONLY; The name of the operation. This name is of the form {provider}/{resource}/{operation}. Name *string + + // READ-ONLY; Describes which originating entities are allowed to invoke this operation. + Origin *string + + // READ-ONLY; Describes additional properties for this operation. + Properties *OperationProperties +} + +// OperationAvailability - Describes a particular availability for the metric specification. +type OperationAvailability struct { + // READ-ONLY; The blob duration for the dimension. + BlobDuration *string + + // READ-ONLY; The time grain for the dimension. + TimeGrain *string } // OperationDisplay - The object that describes the operation. @@ -141,13 +273,74 @@ type OperationListResult struct { // READ-ONLY; The URL to get the next set of operation list results, if any. NextLink *string - // READ-ONLY; The list of operations supported by the resource provider. + // READ-ONLY; The list of operations by Azure AI Search, some supported by the resource provider and others by data plane + // APIs. Value []*Operation } -// PrivateEndpointConnection - Describes an existing Private Endpoint connection to the Azure Cognitive Search service. +// OperationLogsSpecification - Specifications of one type of log for this operation. +type OperationLogsSpecification struct { + // READ-ONLY; The blob duration for the log specification. + BlobDuration *string + + // READ-ONLY; The display name of the log specification. + DisplayName *string + + // READ-ONLY; The name of the log specification. + Name *string +} + +// OperationMetricDimension - Describes a particular dimension for the metric specification. +type OperationMetricDimension struct { + // READ-ONLY; The display name of the dimension. + DisplayName *string + + // READ-ONLY; The name of the dimension. + Name *string +} + +// OperationMetricsSpecification - Specifications of one type of metric for this operation. +type OperationMetricsSpecification struct { + // READ-ONLY; The type of aggregation for the metric specification. + AggregationType *string + + // READ-ONLY; Availabilities for the metric specification. + Availabilities []*OperationAvailability + + // READ-ONLY; Dimensions for the metric specification. + Dimensions []*OperationMetricDimension + + // READ-ONLY; The display description of the metric specification. + DisplayDescription *string + + // READ-ONLY; The display name of the metric specification. + DisplayName *string + + // READ-ONLY; The name of the metric specification. + Name *string + + // READ-ONLY; The unit for the metric specification. + Unit *string +} + +// OperationProperties - Describes additional properties for this operation. +type OperationProperties struct { + // READ-ONLY; Specifications of the service for this operation. + ServiceSpecification *OperationServiceSpecification +} + +// OperationServiceSpecification - Specifications of the service for this operation. +type OperationServiceSpecification struct { + // READ-ONLY; Specifications of logs for this operation. + LogSpecifications []*OperationLogsSpecification + + // READ-ONLY; Specifications of metrics for this operation. + MetricSpecifications []*OperationMetricsSpecification +} + +// PrivateEndpointConnection - Describes an existing private endpoint connection to the Azure AI Search service. type PrivateEndpointConnection struct { - // Describes the properties of an existing Private Endpoint connection to the Azure Cognitive Search service. + // Describes the properties of an existing private endpoint connection to the Azure AI Search service. Properties *PrivateEndpointConnectionProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -160,40 +353,41 @@ type PrivateEndpointConnection struct { Type *string } -// PrivateEndpointConnectionListResult - Response containing a list of Private Endpoint connections. +// PrivateEndpointConnectionListResult - Response containing a list of private endpoint connections. type PrivateEndpointConnectionListResult struct { // READ-ONLY; Request URL that can be used to query next page of private endpoint connections. Returned when the total number // of requested private endpoint connections exceed maximum page size. NextLink *string - // READ-ONLY; The list of Private Endpoint connections. + // READ-ONLY; The list of private endpoint connections. Value []*PrivateEndpointConnection } -// PrivateEndpointConnectionProperties - Describes the properties of an existing Private Endpoint connection to the Azure -// Cognitive Search service. +// PrivateEndpointConnectionProperties - Describes the properties of an existing private endpoint connection to the search +// service. type PrivateEndpointConnectionProperties struct { - // The group id from the provider of resource the private link service connection is for. + // The group ID of the Azure resource for which the private link service is for. GroupID *string // The private endpoint resource from Microsoft.Network provider. PrivateEndpoint *PrivateEndpointConnectionPropertiesPrivateEndpoint - // Describes the current state of an existing Private Link Service connection to the Azure Private Endpoint. + // Describes the current state of an existing Azure Private Link service connection to the private endpoint. PrivateLinkServiceConnectionState *PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState - // The provisioning state of the private link service connection. Can be Updating, Deleting, Failed, Succeeded, or Incomplete + // The provisioning state of the private link service connection. Valid values are Updating, Deleting, Failed, Succeeded, + // Incomplete, or Canceled. ProvisioningState *PrivateLinkServiceConnectionProvisioningState } // PrivateEndpointConnectionPropertiesPrivateEndpoint - The private endpoint resource from Microsoft.Network provider. type PrivateEndpointConnectionPropertiesPrivateEndpoint struct { - // The resource id of the private endpoint resource from Microsoft.Network provider. + // The resource ID of the private endpoint resource from Microsoft.Network provider. ID *string } -// PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState - Describes the current state of an existing Private -// Link Service connection to the Azure Private Endpoint. +// PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState - Describes the current state of an existing Azure +// Private Link service connection to the private endpoint. type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState struct { // A description of any extra actions that may be required. ActionsRequired *string @@ -201,11 +395,11 @@ type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState struct // The description for the private link service connection state. Description *string - // Status of the the private link service connection. Can be Pending, Approved, Rejected, or Disconnected. + // Status of the the private link service connection. Valid values are Pending, Approved, Rejected, or Disconnected. Status *PrivateLinkServiceConnectionStatus } -// PrivateLinkResource - Describes a supported private link resource for the Azure Cognitive Search service. +// PrivateLinkResource - Describes a supported private link resource for the Azure AI Search service. type PrivateLinkResource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string @@ -213,16 +407,16 @@ type PrivateLinkResource struct { // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Describes the properties of a supported private link resource for the Azure Cognitive Search service. + // READ-ONLY; Describes the properties of a supported private link resource for the Azure AI Search service. Properties *PrivateLinkResourceProperties // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// PrivateLinkResourceProperties - Describes the properties of a supported private link resource for the Azure Cognitive Search -// service. For a given API version, this represents the 'supported' groupIds when creating a shared private -// link resource. +// PrivateLinkResourceProperties - Describes the properties of a supported private link resource for the Azure AI Search service. +// For a given API version, this represents the 'supported' groupIds when creating a shared private link +// resource. type PrivateLinkResourceProperties struct { // READ-ONLY; The group ID of the private link resource. GroupID *string @@ -233,7 +427,7 @@ type PrivateLinkResourceProperties struct { // READ-ONLY; The list of required DNS zone names of the private link resource. RequiredZoneNames []*string - // READ-ONLY; The list of resources that are onboarded to private link service, that are supported by Azure Cognitive Search. + // READ-ONLY; The list of resources that are onboarded to private link service, that are supported by Azure AI Search. ShareablePrivateLinkResourceTypes []*ShareablePrivateLinkResourceType } @@ -243,54 +437,55 @@ type PrivateLinkResourcesResult struct { Value []*PrivateLinkResource } -// QueryKey - Describes an API key for a given Azure Cognitive Search service that has permissions for query operations only. +// QueryKey - Describes an API key for a given Azure AI Search service that conveys read-only permissions on the docs collection +// of an index. type QueryKey struct { // READ-ONLY; The value of the query API key. Key *string - // READ-ONLY; The name of the query API key; may be empty. + // READ-ONLY; The name of the query API key. Query names are optional, but assigning a name can help you remember how it's + // used. Name *string } -// QuotaUsageResult - Describes the quota usage for a particular sku supported by Azure Cognitive Search. +// QuotaUsageResult - Describes the quota usage for a particular SKU. type QuotaUsageResult struct { - // The currently used up value for the particular search sku. + // The currently used up value for the particular search SKU. CurrentValue *int32 - // The resource id of the quota usage sku endpoint for Microsoft.Search provider. + // The resource ID of the quota usage SKU endpoint for Microsoft.Search provider. ID *string - // The quota limit for the particular search sku. + // The quota limit for the particular search SKU. Limit *int32 - // The unit of measurement for the search sku. + // The unit of measurement for the search SKU. Unit *string - // READ-ONLY; The name of the sku supported by Azure Cognitive Search. + // READ-ONLY; The name of the SKU supported by Azure AI Search. Name *QuotaUsageResultName } -// QuotaUsageResultName - The name of the sku supported by Azure Cognitive Search. +// QuotaUsageResultName - The name of the SKU supported by Azure AI Search. type QuotaUsageResultName struct { - // The localized string value for the sku supported by Azure Cognitive Search. + // The localized string value for the SKU name. LocalizedValue *string - // The sku name supported by Azure Cognitive Search. + // The SKU name supported by Azure AI Search. Value *string } -// QuotaUsagesListResult - Response containing the quota usage information for all the supported skus of Azure Cognitive Search -// service. +// QuotaUsagesListResult - Response containing the quota usage information for all the supported SKUs of Azure AI Search. type QuotaUsagesListResult struct { // READ-ONLY; Request URL that can be used to query next page of quota usages. Returned when the total number of requested // quota usages exceed maximum page size. NextLink *string - // READ-ONLY; The quota usages for the SKUs supported by Azure Cognitive Search. + // READ-ONLY; The quota usages for the SKUs supported by Azure AI Search. Value []*QuotaUsageResult } -// SKU - Defines the SKU of an Azure Cognitive Search Service, which determines price tier and capacity limits. +// SKU - Defines the SKU of a search service, which determines billing rate and capacity limits. type SKU struct { // The SKU of the search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas. // 'standard': Dedicated service with up to 12 partitions and 12 replicas. @@ -302,7 +497,7 @@ type SKU struct { Name *SKUName } -// Service - Describes an Azure Cognitive Search service and its current state. +// Service - Describes an Azure AI Search service and its current state. type Service struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -313,8 +508,8 @@ type Service struct { // Properties of the search service. Properties *ServiceProperties - // The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating - // a new Search Service. + // The SKU of the search service, which determines price tier and capacity limits. This property is required when creating + // a new search service. SKU *SKU // Resource tags. @@ -330,13 +525,13 @@ type Service struct { Type *string } -// ServiceListResult - Response containing a list of Azure Cognitive Search services. +// ServiceListResult - Response containing a list of Azure AI Search services. type ServiceListResult struct { // READ-ONLY; Request URL that can be used to query next page of search services. Returned when the total number of requested // search services exceed maximum page size. NextLink *string - // READ-ONLY; The list of Search services. + // READ-ONLY; The list of search services. Value []*Service } @@ -350,6 +545,11 @@ type ServiceProperties struct { // be set to true if 'dataPlaneAuthOptions' are defined. DisableLocalAuth *bool + // A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported + // value is 'All' to disable all possible data export scenarios with more fine + // grained controls planned for the future. + DisabledDataExfiltrationOptions []*SearchDisabledDataExfiltrationOption + // Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. EncryptionWithCmk *EncryptionWithCmk @@ -359,7 +559,7 @@ type ServiceProperties struct { // 'default'. HostingMode *HostingMode - // Network specific rules that determine how the Azure Cognitive Search service may be reached. + // Network specific rules that determine how the Azure AI Search service may be reached. NetworkRuleSet *NetworkRuleSet // The number of partitions in the search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are @@ -376,11 +576,15 @@ type ServiceProperties struct { // SKUs or between 1 and 3 inclusive for basic SKU. ReplicaCount *int32 - // Sets options that control the availability of semantic search. This configuration is only possible for certain Azure Cognitive + // Sets options that control the availability of semantic search. This configuration is only possible for certain Azure AI // Search SKUs in certain locations. SemanticSearch *SearchSemanticSearch - // READ-ONLY; The list of private endpoint connections to the Azure Cognitive Search service. + // READ-ONLY; A system generated property representing the service's etag that can be for optimistic concurrency control during + // updates. + ETag *string + + // READ-ONLY; The list of private endpoint connections to the Azure AI Search service. PrivateEndpointConnections []*PrivateEndpointConnection // READ-ONLY; The state of the last provisioning operation performed on the search service. Provisioning is an intermediate @@ -392,7 +596,7 @@ type ServiceProperties struct { // because the free service uses capacity that is already set up. ProvisioningState *ProvisioningState - // READ-ONLY; The list of shared private link resources managed by the Azure Cognitive Search service. + // READ-ONLY; The list of shared private link resources managed by the Azure AI Search service. SharedPrivateLinkResources []*SharedPrivateLinkResource // READ-ONLY; The status of the search service. Possible values include: 'running': The search service is running and no provisioning @@ -401,21 +605,22 @@ type ServiceProperties struct { // can occur when the underlying search units are not healthy. The search service // is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service // is disabled. In this state, the service will reject all API requests. - // 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, it means - // the Azure Cognitive Search team is actively investigating the underlying - // issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. + // 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If + // your service is in the degraded, disabled, or error states, it means the Azure + // AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable + // based on the number of search units provisioned. Status *SearchServiceStatus // READ-ONLY; The details of the search service status. StatusDetails *string } -// ServiceUpdate - The parameters used to update an Azure Cognitive Search service. +// ServiceUpdate - The parameters used to update an Azure AI Search service. type ServiceUpdate struct { - // The identity of the resource. + // Details about the search service identity. A null value indicates that the search service has no identity assigned. Identity *Identity - // The geographic location of the resource. This must be one of the supported and registered Azure Geo Regions (for example, + // The geographic location of the resource. This must be one of the supported and registered Azure geo regions (for example, // West US, East US, Southeast Asia, and so forth). This property is required // when creating a new resource. Location *string @@ -423,8 +628,8 @@ type ServiceUpdate struct { // Properties of the search service. Properties *ServiceProperties - // The SKU of the Search Service, which determines price tier and capacity limits. This property is required when creating - // a new Search Service. + // The SKU of the search service, which determines price tier and capacity limits. This property is required when creating + // a new search service. SKU *SKU // Tags to help categorize the resource in the Azure portal. @@ -441,36 +646,35 @@ type ServiceUpdate struct { } // ShareablePrivateLinkResourceProperties - Describes the properties of a resource type that has been onboarded to private -// link service, supported by Azure Cognitive Search. +// link service, supported by Azure AI Search. type ShareablePrivateLinkResourceProperties struct { - // READ-ONLY; The description of the resource type that has been onboarded to private link service, supported by Azure Cognitive + // READ-ONLY; The description of the resource type that has been onboarded to private link service, supported by Azure AI // Search. Description *string // READ-ONLY; The resource provider group id for the resource that has been onboarded to private link service, supported by - // Azure Cognitive Search. + // Azure AI Search. GroupID *string // READ-ONLY; The resource provider type for the resource that has been onboarded to private link service, supported by Azure - // Cognitive Search. + // AI Search. Type *string } // ShareablePrivateLinkResourceType - Describes an resource type that has been onboarded to private link service, supported -// by Azure Cognitive Search. +// by Azure AI Search. type ShareablePrivateLinkResourceType struct { - // READ-ONLY; The name of the resource type that has been onboarded to private link service, supported by Azure Cognitive - // Search. + // READ-ONLY; The name of the resource type that has been onboarded to private link service, supported by Azure AI Search. Name *string // READ-ONLY; Describes the properties of a resource type that has been onboarded to private link service, supported by Azure - // Cognitive Search. + // AI Search. Properties *ShareablePrivateLinkResourceProperties } -// SharedPrivateLinkResource - Describes a Shared Private Link Resource managed by the Azure Cognitive Search service. +// SharedPrivateLinkResource - Describes a shared private link resource managed by the Azure AI Search service. type SharedPrivateLinkResource struct { - // Describes the properties of a Shared Private Link Resource managed by the Azure Cognitive Search service. + // Describes the properties of a shared private link resource managed by the Azure AI Search service. Properties *SharedPrivateLinkResourceProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -483,35 +687,44 @@ type SharedPrivateLinkResource struct { Type *string } -// SharedPrivateLinkResourceListResult - Response containing a list of Shared Private Link Resources. +// SharedPrivateLinkResourceListResult - Response containing a list of shared private link resources. type SharedPrivateLinkResourceListResult struct { // The URL to get the next set of shared private link resources, if there are any. NextLink *string - // READ-ONLY; The list of Shared Private Link Resources. + // READ-ONLY; The list of shared private link resources. Value []*SharedPrivateLinkResource } -// SharedPrivateLinkResourceProperties - Describes the properties of an existing Shared Private Link Resource managed by the -// Azure Cognitive Search service. +// SharedPrivateLinkResourceProperties - Describes the properties of an existing shared private link resource managed by the +// Azure AI Search service. type SharedPrivateLinkResourceProperties struct { - // The group id from the provider of resource the shared private link resource is for. + // The group ID from the provider of resource the shared private link resource is for. GroupID *string - // The resource id of the resource the shared private link resource is for. + // The resource ID of the resource the shared private link resource is for. PrivateLinkResourceID *string - // The provisioning state of the shared private link resource. Can be Updating, Deleting, Failed, Succeeded or Incomplete. + // The provisioning state of the shared private link resource. Valid values are Updating, Deleting, Failed, Succeeded or Incomplete. ProvisioningState *SharedPrivateLinkResourceProvisioningState - // The request message for requesting approval of the shared private link resource. + // The message for requesting approval of the shared private link resource. RequestMessage *string - // Optional. Can be used to specify the Azure Resource Manager location of the resource to which a shared private link is - // to be created. This is only required for those resources whose DNS configuration + // Optional. Can be used to specify the Azure Resource Manager location of the resource for which a shared private link is + // being created. This is only required for those resources whose DNS configuration // are regional (such as Azure Kubernetes Service). ResourceRegion *string - // Status of the shared private link resource. Can be Pending, Approved, Rejected or Disconnected. + // Status of the shared private link resource. Valid values are Pending, Approved, Rejected or Disconnected. Status *SharedPrivateLinkResourceStatus } + +// UserAssignedManagedIdentity - The details of the user assigned managed identity assigned to the search service. +type UserAssignedManagedIdentity struct { + // READ-ONLY; The client ID of user assigned identity. + ClientID *string + + // READ-ONLY; The principal ID of user assigned identity. + PrincipalID *string +} diff --git a/sdk/resourcemanager/search/armsearch/models_serde.go b/sdk/resourcemanager/search/armsearch/models_serde.go index 1ca0c342c271..32cdd69b995d 100644 --- a/sdk/resourcemanager/search/armsearch/models_serde.go +++ b/sdk/resourcemanager/search/armsearch/models_serde.go @@ -234,6 +234,7 @@ func (i Identity) MarshalJSON() ([]byte, error) { populate(objectMap, "principalId", i.PrincipalID) populate(objectMap, "tenantId", i.TenantID) populate(objectMap, "type", i.Type) + populate(objectMap, "userAssignedIdentities", i.UserAssignedIdentities) return json.Marshal(objectMap) } @@ -255,6 +256,9 @@ func (i *Identity) UnmarshalJSON(data []byte) error { case "type": err = unpopulate(val, "Type", &i.Type) delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &i.UserAssignedIdentities) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", i, err) @@ -294,9 +298,294 @@ func (l *ListQueryKeysResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NSPConfigAccessRule. +func (n NSPConfigAccessRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAccessRule. +func (n *NSPConfigAccessRule) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPConfigAccessRuleProperties. +func (n NSPConfigAccessRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAccessRuleProperties. +func (n *NSPConfigAccessRuleProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "addressPrefixes": + err = unpopulate(val, "AddressPrefixes", &n.AddressPrefixes) + delete(rawMsg, key) + case "direction": + err = unpopulate(val, "Direction", &n.Direction) + delete(rawMsg, key) + case "fullyQualifiedDomainNames": + err = unpopulate(val, "FullyQualifiedDomainNames", &n.FullyQualifiedDomainNames) + delete(rawMsg, key) + case "networkSecurityPerimeters": + err = unpopulate(val, "NetworkSecurityPerimeters", &n.NetworkSecurityPerimeters) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &n.Subscriptions) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPConfigAssociation. +func (n NSPConfigAssociation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessMode", n.AccessMode) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAssociation. +func (n *NSPConfigAssociation) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessMode": + err = unpopulate(val, "AccessMode", &n.AccessMode) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPConfigNetworkSecurityPerimeterRule. +func (n NSPConfigNetworkSecurityPerimeterRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigNetworkSecurityPerimeterRule. +func (n *NSPConfigNetworkSecurityPerimeterRule) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPConfigPerimeter. +func (n NSPConfigPerimeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "location", n.Location) + populate(objectMap, "perimeterGuid", n.PerimeterGUID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigPerimeter. +func (n *NSPConfigPerimeter) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "perimeterGuid": + err = unpopulate(val, "PerimeterGUID", &n.PerimeterGUID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPConfigProfile. +func (n NSPConfigProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessRules", n.AccessRules) + populate(objectMap, "accessRulesVersion", n.AccessRulesVersion) + populate(objectMap, "name", n.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigProfile. +func (n *NSPConfigProfile) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessRules": + err = unpopulate(val, "AccessRules", &n.AccessRules) + delete(rawMsg, key) + case "accessRulesVersion": + err = unpopulate(val, "AccessRulesVersion", &n.AccessRulesVersion) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPProvisioningIssue. +func (n NSPProvisioningIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPProvisioningIssue. +func (n *NSPProvisioningIssue) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NSPProvisioningIssueProperties. +func (n NSPProvisioningIssueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "issueType", n.IssueType) + populate(objectMap, "severity", n.Severity) + populate(objectMap, "suggestedAccessRules", n.SuggestedAccessRules) + populate(objectMap, "suggestedResourceIds", n.SuggestedResourceIDs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NSPProvisioningIssueProperties. +func (n *NSPProvisioningIssueProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "issueType": + err = unpopulate(val, "IssueType", &n.IssueType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &n.Severity) + delete(rawMsg, key) + case "suggestedAccessRules": + err = unpopulate(val, "SuggestedAccessRules", &n.SuggestedAccessRules) + delete(rawMsg, key) + case "suggestedResourceIds": + err = unpopulate(val, "SuggestedResourceIDs", &n.SuggestedResourceIDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet. func (n NetworkRuleSet) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "bypass", n.Bypass) populate(objectMap, "ipRules", n.IPRules) return json.Marshal(objectMap) } @@ -310,6 +599,9 @@ func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "bypass": + err = unpopulate(val, "Bypass", &n.Bypass) + delete(rawMsg, key) case "ipRules": err = unpopulate(val, "IPRules", &n.IPRules) delete(rawMsg, key) @@ -321,11 +613,127 @@ func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration. +func (n *NetworkSecurityPerimeterConfiguration) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n NetworkSecurityPerimeterConfigurationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationListResult. +func (n *NetworkSecurityPerimeterConfigurationListResult) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n NetworkSecurityPerimeterConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties. +func (n *NetworkSecurityPerimeterConfigurationProperties) 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", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "networkSecurityPerimeter": + err = unpopulate(val, "NetworkSecurityPerimeter", &n.NetworkSecurityPerimeter) + delete(rawMsg, key) + case "profile": + err = unpopulate(val, "Profile", &n.Profile) + delete(rawMsg, key) + case "provisioningIssues": + err = unpopulate(val, "ProvisioningIssues", &n.ProvisioningIssues) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &n.ProvisioningState) + delete(rawMsg, key) + case "resourceAssociation": + err = unpopulate(val, "ResourceAssociation", &n.ResourceAssociation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) return json.Marshal(objectMap) } @@ -341,9 +749,49 @@ func (o *Operation) UnmarshalJSON(data []byte) error { case "display": err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + 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 OperationAvailability. +func (o OperationAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", o.BlobDuration) + populate(objectMap, "timeGrain", o.TimeGrain) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationAvailability. +func (o *OperationAvailability) 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 "blobDuration": + err = unpopulate(val, "BlobDuration", &o.BlobDuration) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &o.TimeGrain) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -422,6 +870,181 @@ func (o *OperationListResult) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OperationLogsSpecification. +func (o OperationLogsSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", o.BlobDuration) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationLogsSpecification. +func (o *OperationLogsSpecification) 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 "blobDuration": + err = unpopulate(val, "BlobDuration", &o.BlobDuration) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + 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 OperationMetricDimension. +func (o OperationMetricDimension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "name", o.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricDimension. +func (o *OperationMetricDimension) 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 "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + 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 OperationMetricsSpecification. +func (o OperationMetricsSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aggregationType", o.AggregationType) + populate(objectMap, "availabilities", o.Availabilities) + populate(objectMap, "dimensions", o.Dimensions) + populate(objectMap, "displayDescription", o.DisplayDescription) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "name", o.Name) + populate(objectMap, "unit", o.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricsSpecification. +func (o *OperationMetricsSpecification) 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 "aggregationType": + err = unpopulate(val, "AggregationType", &o.AggregationType) + delete(rawMsg, key) + case "availabilities": + err = unpopulate(val, "Availabilities", &o.Availabilities) + delete(rawMsg, key) + case "dimensions": + err = unpopulate(val, "Dimensions", &o.Dimensions) + delete(rawMsg, key) + case "displayDescription": + err = unpopulate(val, "DisplayDescription", &o.DisplayDescription) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &o.Unit) + 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 OperationProperties. +func (o OperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", o.ServiceSpecification) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties. +func (o *OperationProperties) 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 "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &o.ServiceSpecification) + 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 OperationServiceSpecification. +func (o OperationServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logSpecifications", o.LogSpecifications) + populate(objectMap, "metricSpecifications", o.MetricSpecifications) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationServiceSpecification. +func (o *OperationServiceSpecification) 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 "logSpecifications": + err = unpopulate(val, "LogSpecifications", &o.LogSpecifications) + delete(rawMsg, key) + case "metricSpecifications": + err = unpopulate(val, "MetricSpecifications", &o.MetricSpecifications) + 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 PrivateEndpointConnection. func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -952,6 +1575,8 @@ func (s ServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authOptions", s.AuthOptions) populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) + populate(objectMap, "disabledDataExfiltrationOptions", s.DisabledDataExfiltrationOptions) + populate(objectMap, "eTag", s.ETag) populate(objectMap, "encryptionWithCmk", s.EncryptionWithCmk) populate(objectMap, "hostingMode", s.HostingMode) populate(objectMap, "networkRuleSet", s.NetworkRuleSet) @@ -982,6 +1607,12 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) delete(rawMsg, key) + case "disabledDataExfiltrationOptions": + err = unpopulate(val, "DisabledDataExfiltrationOptions", &s.DisabledDataExfiltrationOptions) + delete(rawMsg, key) + case "eTag": + err = unpopulate(val, "ETag", &s.ETag) + delete(rawMsg, key) case "encryptionWithCmk": err = unpopulate(val, "EncryptionWithCmk", &s.EncryptionWithCmk) delete(rawMsg, key) @@ -1264,6 +1895,37 @@ func (s *SharedPrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserAssignedManagedIdentity. +func (u UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedManagedIdentity. +func (u *UserAssignedManagedIdentity) 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 "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + func populate(m map[string]any, k string, v any) { if v == nil { return @@ -1285,7 +1947,7 @@ func populateAny(m map[string]any, k string, v any) { } func unpopulate(data json.RawMessage, fn string, v any) error { - if data == nil { + if data == nil || string(data) == "null" { return nil } if err := json.Unmarshal(data, v); err != nil { diff --git a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go new file mode 100644 index 000000000000..da048df81155 --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go @@ -0,0 +1,269 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsearch + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "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 { + internal *arm.Client + subscriptionID string +} + +// NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values. +// - subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource +// Manager API or the portal. +// - 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) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &NetworkSecurityPerimeterConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets a network security perimeter configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01-preview +// - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the +// Azure Resource Manager API or the portal. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - nspConfigName - The network security configuration name. +// - options - NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) Get(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, searchServiceName, nspConfigName, options) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/networkSecurityPerimeterConfigurations/{nspConfigName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if searchServiceName == "" { + return nil, errors.New("parameter searchServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{searchServiceName}", url.PathEscape(searchServiceName)) + if nspConfigName == "" { + return nil, errors.New("parameter nspConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nspConfigName}", url.PathEscape(nspConfigName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-03-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 *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientGetResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfiguration); err != nil { + return NetworkSecurityPerimeterConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServicePager - Gets a list of network security perimeter configurations for a search service. +// +// Generated from API version 2024-03-01-preview +// - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the +// Azure Resource Manager API or the portal. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - options - NetworkSecurityPerimeterConfigurationsClientListByServiceOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) NewListByServicePager(resourceGroupName string, searchServiceName string, options *NetworkSecurityPerimeterConfigurationsClientListByServiceOptions) *runtime.Pager[NetworkSecurityPerimeterConfigurationsClientListByServiceResponse] { + return runtime.NewPager(runtime.PagingHandler[NetworkSecurityPerimeterConfigurationsClientListByServiceResponse]{ + More: func(page NetworkSecurityPerimeterConfigurationsClientListByServiceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *NetworkSecurityPerimeterConfigurationsClientListByServiceResponse) (NetworkSecurityPerimeterConfigurationsClientListByServiceResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByServiceCreateRequest(ctx, resourceGroupName, searchServiceName, options) + }, nil) + if err != nil { + return NetworkSecurityPerimeterConfigurationsClientListByServiceResponse{}, err + } + return client.listByServiceHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *NetworkSecurityPerimeterConfigurationsClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, options *NetworkSecurityPerimeterConfigurationsClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/networkSecurityPerimeterConfigurations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if searchServiceName == "" { + return nil, errors.New("parameter searchServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{searchServiceName}", url.PathEscape(searchServiceName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *NetworkSecurityPerimeterConfigurationsClient) listByServiceHandleResponse(resp *http.Response) (NetworkSecurityPerimeterConfigurationsClientListByServiceResponse, error) { + result := NetworkSecurityPerimeterConfigurationsClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.NetworkSecurityPerimeterConfigurationListResult); err != nil { + return NetworkSecurityPerimeterConfigurationsClientListByServiceResponse{}, err + } + return result, nil +} + +// BeginReconcile - Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers +// a manual resync with network security perimeter configurations by ensuring the search +// service carries the latest configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01-preview +// - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the +// Azure Resource Manager API or the portal. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - nspConfigName - The network security configuration name. +// - options - NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*runtime.Poller[NetworkSecurityPerimeterConfigurationsClientReconcileResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.reconcile(ctx, resourceGroupName, searchServiceName, nspConfigName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[NetworkSecurityPerimeterConfigurationsClientReconcileResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Reconcile - Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers +// a manual resync with network security perimeter configurations by ensuring the search +// service carries the latest configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-03-01-preview +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) { + var err error + const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.reconcileCreateRequest(ctx, resourceGroupName, searchServiceName, nspConfigName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// reconcileCreateRequest creates the Reconcile request. +func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/networkSecurityPerimeterConfigurations/{nspConfigName}/reconcile" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if searchServiceName == "" { + return nil, errors.New("parameter searchServiceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{searchServiceName}", url.PathEscape(searchServiceName)) + if nspConfigName == "" { + return nil, errors.New("parameter nspConfigName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{nspConfigName}", url.PathEscape(nspConfigName)) + 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.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go new file mode 100644 index 000000000000..aee2ff198987 --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go @@ -0,0 +1,147 @@ +//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. +// DO NOT EDIT. + +package armsearch_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_NewListByServicePager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsearch.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().NewListByServicePager("rg1", "mysearchservice", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.NetworkSecurityPerimeterConfigurationListResult = armsearch.NetworkSecurityPerimeterConfigurationListResult{ + // Value: []*armsearch.NetworkSecurityPerimeterConfiguration{ + // { + // Name: to.Ptr("00000001-2222-3333-4444-111144444444.assoc1"), + // Type: to.Ptr("Microsoft.Search/searchServices/networkSecurityPerimeterConfigurations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/networkSecurityPerimeterConfigurations/00000001-2222-3333-4444-111144444444.assoc1"), + // Properties: &armsearch.NetworkSecurityPerimeterConfigurationProperties{ + // NetworkSecurityPerimeter: &armsearch.NSPConfigPerimeter{ + // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"), + // Location: to.Ptr("westus"), + // }, + // Profile: &armsearch.NSPConfigProfile{ + // Name: to.Ptr("profile1"), + // AccessRules: []*armsearch.NSPConfigAccessRule{ + // { + // Name: to.Ptr("rule1"), + // Properties: &armsearch.NSPConfigAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("148.0.0.0/8"), + // to.Ptr("152.4.6.0/24")}, + // Direction: to.Ptr("Inbound"), + // }, + // }}, + // AccessRulesVersion: to.Ptr("0"), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ResourceAssociation: &armsearch.NSPConfigAssociation{ + // Name: to.Ptr("assoc1"), + // AccessMode: to.Ptr("Enforced"), + // }, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsearch.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().Get(ctx, "rg1", "mysearchservice", "00000001-2222-3333-4444-111144444444.assoc1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.NetworkSecurityPerimeterConfiguration = armsearch.NetworkSecurityPerimeterConfiguration{ + // Name: to.Ptr("00000001-2222-3333-4444-111144444444.assoc1"), + // Type: to.Ptr("Microsoft.Search/searchServices/networkSecurityPerimeterConfigurations"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/networkSecurityPerimeterConfigurations/00000001-2222-3333-4444-111144444444.assoc1"), + // Properties: &armsearch.NetworkSecurityPerimeterConfigurationProperties{ + // NetworkSecurityPerimeter: &armsearch.NSPConfigPerimeter{ + // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"), + // Location: to.Ptr("westus"), + // }, + // Profile: &armsearch.NSPConfigProfile{ + // Name: to.Ptr("profile1"), + // AccessRules: []*armsearch.NSPConfigAccessRule{ + // { + // Name: to.Ptr("rule1"), + // Properties: &armsearch.NSPConfigAccessRuleProperties{ + // AddressPrefixes: []*string{ + // to.Ptr("148.0.0.0/8"), + // to.Ptr("152.4.6.0/24")}, + // Direction: to.Ptr("Inbound"), + // }, + // }}, + // AccessRulesVersion: to.Ptr("0"), + // }, + // ProvisioningState: to.Ptr("Succeeded"), + // ResourceAssociation: &armsearch.NSPConfigAssociation{ + // Name: to.Ptr("assoc1"), + // AccessMode: to.Ptr("Enforced"), + // }, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json +func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginReconcile() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsearch.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().BeginReconcile(ctx, "rg1", "mysearchservice", "00000001-2222-3333-4444-111144444444.assoc1", 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/search/armsearch/operations_client.go b/sdk/resourcemanager/search/armsearch/operations_client.go index cbd3b672d2c5..8c07c3da3834 100644 --- a/sdk/resourcemanager/search/armsearch/operations_client.go +++ b/sdk/resourcemanager/search/armsearch/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.Search provider. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/search/armsearch/operations_client_example_test.go b/sdk/resourcemanager/search/armsearch/operations_client_example_test.go index 46eab812d067..e03f9da21072 100644 --- a/sdk/resourcemanager/search/armsearch/operations_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/OperationsList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -49,6 +49,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/register/action"), @@ -58,6 +60,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/write"), @@ -67,6 +71,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/read"), @@ -76,6 +82,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/delete"), @@ -85,6 +93,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/start/action"), @@ -94,6 +104,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/stop/action"), @@ -103,6 +115,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/listAdminKeys/action"), @@ -112,6 +126,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/regenerateAdminKey/action"), @@ -121,15 +137,19 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/listQueryKeys/action"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of query API keys for the given Azure Search service."), + // Description: to.Ptr("Returns the list of query API keys for the given Azure AI Search service."), // Operation: to.Ptr("Get Query Keys"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("API Keys"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/createQueryKey/action"), @@ -139,6 +159,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Search Services"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/deleteQueryKey/delete"), @@ -148,6 +170,8 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("API Keys"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/checkNameAvailability/action"), @@ -157,141 +181,463 @@ func ExampleOperationsClient_NewListPager() { // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Service Name Availability"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/diagnosticSettings/read"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Gets the diganostic setting read for the resource"), + // Description: to.Ptr("Gets the diganostic setting for the resource."), // Operation: to.Ptr("Get Diagnostic Setting"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Diagnostic Settings"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/diagnosticSettings/write"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diganostic setting for the resource"), + // Description: to.Ptr("Creates or updates the diganostic setting for the resource."), // Operation: to.Ptr("Set Diagnostic Setting"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Diagnostic Settings"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/metricDefinitions/read"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for the search service"), + // Description: to.Ptr("Gets the available metrics for the search service."), // Operation: to.Ptr("Read search service metric definitions"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("The metric definitions for the search service"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("system"), + // Properties: &armsearch.OperationProperties{ + // ServiceSpecification: &armsearch.OperationServiceSpecification{ + // MetricSpecifications: []*armsearch.OperationMetricsSpecification{ + // { + // Name: to.Ptr("SearchLatency"), + // AggregationType: to.Ptr("Average"), + // Availabilities: []*armsearch.OperationAvailability{ + // { + // BlobDuration: to.Ptr("PT1H"), + // TimeGrain: to.Ptr("PT1M"), + // }}, + // DisplayDescription: to.Ptr("Average search latency for the search service"), + // DisplayName: to.Ptr("Search Latency"), + // Unit: to.Ptr("Seconds"), + // }, + // { + // Name: to.Ptr("SearchQueriesPerSecond"), + // AggregationType: to.Ptr("Average"), + // Availabilities: []*armsearch.OperationAvailability{ + // { + // BlobDuration: to.Ptr("PT1H"), + // TimeGrain: to.Ptr("PT1M"), + // }}, + // DisplayDescription: to.Ptr("Search queries per second for the search service."), + // DisplayName: to.Ptr("Search queries per second"), + // Unit: to.Ptr("CountPerSecond"), + // }, + // { + // Name: to.Ptr("ThrottledSearchQueriesPercentage"), + // AggregationType: to.Ptr("Average"), + // Availabilities: []*armsearch.OperationAvailability{ + // { + // BlobDuration: to.Ptr("PT1H"), + // TimeGrain: to.Ptr("PT1M"), + // }}, + // DisplayDescription: to.Ptr("Percentage of search queries that were throttled for the search service."), + // DisplayName: to.Ptr("Throttled search queries percentage"), + // Unit: to.Ptr("Percent"), + // }}, + // }, + // }, // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/logDefinitions/read"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Gets the available logs for the search service"), + // Description: to.Ptr("Gets the available logs for the search service."), // Operation: to.Ptr("Read search service log definitions"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("The log definition for the search service"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("system"), + // Properties: &armsearch.OperationProperties{ + // ServiceSpecification: &armsearch.OperationServiceSpecification{ + // LogSpecifications: []*armsearch.OperationLogsSpecification{ + // { + // Name: to.Ptr("OperationLogs"), + // BlobDuration: to.Ptr("PT1H"), + // DisplayName: to.Ptr("Operation Logs"), + // }}, + // }, + // }, // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/validate/action"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Validates a private endpoint connection create call from NRP side"), + // Description: to.Ptr("Validates a private endpoint connection create call from NRP (Microsoft.Network Resource Provider) side."), // Operation: to.Ptr("Validate Private Endpoint Connection Proxy"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Private Endpoint Connection Proxy"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/write"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates a private endpoint connection proxy with the specified parameters or updates the properties or tags for the specified private endpoint connection proxy"), + // Description: to.Ptr("Creates a private endpoint connection proxy with the specified parameters or updates the properties or tags for the specified private endpoint connection proxy."), // Operation: to.Ptr("Create Private Endpoint Connection Proxy"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Private Endpoint Connection Proxy"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/read"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of private endpoint connection proxies or gets the properties for the specified private endpoint connection proxy"), + // Description: to.Ptr("Returns the list of private endpoint connection proxies or gets the properties for the specified private endpoint connection proxy."), // Operation: to.Ptr("Get Private Endpoint Connection Proxy"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Private Endpoint Connection Proxy"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/delete"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes an existing private endpoint connection proxy"), + // Description: to.Ptr("Deletes an existing private endpoint connection proxy."), // Operation: to.Ptr("Delete Private Endpoint Connection Proxy"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Private Endpoint Connection Proxy"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections/write"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates a private endpoint connections with the specified parameters or updates the properties or tags for the specified private endpoint connections"), + // Description: to.Ptr("Creates a private endpoint connection with the specified parameters or updates the properties or tags for the specified private endpoint connections."), // Operation: to.Ptr("Create Private Endpoint Connection"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Private Endpoint Connection"), // }, + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections/read"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of private endpoint connections or gets the properties for the specified private endpoint connections"), + // Description: to.Ptr("Returns the list of private endpoint connections or gets the properties for the specified private endpoint connection."), // Operation: to.Ptr("Get Private Endpoint Connection"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Private Endpoint Connection"), // }, + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections/delete"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes an existing private endpoint connections"), + // Description: to.Ptr("Deletes an existing private endpoint connection."), // Operation: to.Ptr("Delete Private Endpoint Connection"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Private Endpoint Connection"), // }, + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/write"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates a new shared private link resource with the specified parameters or updates the properties for the specified shared private link resource"), + // Description: to.Ptr("Creates a new shared private link resource with the specified parameters or updates the properties for the specified shared private link resource."), // Operation: to.Ptr("Create Shared Private Link Resource"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Shared Private Link Resource"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/read"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of shared private link resources or gets the properties for the specified shared private link resource"), + // Description: to.Ptr("Returns the list of shared private link resources or gets the properties for the specified shared private link resource."), // Operation: to.Ptr("Get Shared Private Link Resource"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Shared Private Link Resource"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/delete"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes an existing shared private link resource"), + // Description: to.Ptr("Deletes an existing shared private link resource."), // Operation: to.Ptr("Delete Shared Private Link Resource"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Shared Private Link Resource"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), // }, // { // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/operationStatuses/read"), // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Get the details of a long running shared private link resource operation"), + // Description: to.Ptr("Get the details of a long running shared private link resource operation."), // Operation: to.Ptr("Get Operation Status"), // Provider: to.Ptr("Microsoft Search"), // Resource: to.Ptr("Shared Private Link Resource"), // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexes/read"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Return an index or its statistics, return a list of indexes or their statistics, or test the lexical analysis components of an index."), + // Operation: to.Ptr("Read Index"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Indexes"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexes/write"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Create an index or modify its properties."), + // Operation: to.Ptr("Create or Update Index"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Indexes"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexes/delete"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Delete an index."), + // Operation: to.Ptr("Delete Index"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Indexes"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/synonymMaps/read"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Return a synonym map or a list of synonym maps."), + // Operation: to.Ptr("Read Synonym Map"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Synonym Maps"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/synonymMaps/write"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Create a synonym map or modify its properties."), + // Operation: to.Ptr("Create or Update Synonym Map"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Synonym Maps"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/synonymMaps/delete"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Delete a synonym map."), + // Operation: to.Ptr("Delete Synonym Map"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Synonym Maps"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/dataSources/read"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Return a data source or a list of data sources."), + // Operation: to.Ptr("Read Data Source"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Data Sources"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/dataSources/write"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Create a data source or modify its properties."), + // Operation: to.Ptr("Create or Update Data Source"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Data Sources"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/dataSources/delete"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Delete a data source."), + // Operation: to.Ptr("Delete Data Source"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Data Sources"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/skillsets/read"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Return a skillset or a list of skillsets."), + // Operation: to.Ptr("Read Skillset"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Skillsets"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/skillsets/write"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Create a skillset or modify its properties."), + // Operation: to.Ptr("Create or Update Skillset"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Skillsets"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/skillsets/delete"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Delete a skillset."), + // Operation: to.Ptr("Delete Skillset"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Skillsets"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexers/read"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Return an indexer or its status, or return a list of indexers or their statuses."), + // Operation: to.Ptr("Read Indexer"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Indexers"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexers/write"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Create an indexer, modify its properties, or manage its execution."), + // Operation: to.Ptr("Create or Manage Indexer"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Indexers"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexers/delete"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Delete an indexer."), + // Operation: to.Ptr("Delete Indexer"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Indexers"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/read"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Return a debug session or a list of debug sessions."), + // Operation: to.Ptr("Read Debug Session"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Debug Sessions"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/write"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Create a debug session or modify its properties."), + // Operation: to.Ptr("Create or Update Debug Session"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Debug Sessions"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/delete"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Delete a debug session."), + // Operation: to.Ptr("Delete Debug Session"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Debug Sessions"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/execute/action"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Use a debug session, get execution data, or evaluate expressions on it."), + // Operation: to.Ptr("Execute Debug Session"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Debug Sessions"), + // }, + // IsDataAction: to.Ptr(false), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexes/documents/read"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Read documents or suggested query terms from an index."), + // Operation: to.Ptr("Read Documents"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Documents"), + // }, + // IsDataAction: to.Ptr(true), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexes/documents/write"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Upload documents to an index or modify existing documents."), + // Operation: to.Ptr("Write Documents"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Documents"), + // }, + // IsDataAction: to.Ptr(true), + // Origin: to.Ptr("user,system"), + // }, + // { + // Name: to.Ptr("Microsoft.Search/searchServices/indexes/documents/delete"), + // Display: &armsearch.OperationDisplay{ + // Description: to.Ptr("Delete documents from an index."), + // Operation: to.Ptr("Delete Documents"), + // Provider: to.Ptr("Microsoft Search"), + // Resource: to.Ptr("Documents"), + // }, + // IsDataAction: to.Ptr(true), + // Origin: to.Ptr("user,system"), // }}, // } } diff --git a/sdk/resourcemanager/search/armsearch/options.go b/sdk/resourcemanager/search/armsearch/options.go index 03a1099494ab..1de6e7a789df 100644 --- a/sdk/resourcemanager/search/armsearch/options.go +++ b/sdk/resourcemanager/search/armsearch/options.go @@ -24,6 +24,25 @@ type ManagementClientUsageBySubscriptionSKUOptions struct { // placeholder for future optional parameters } +// NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile +// method. +type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get +// method. +type NetworkSecurityPerimeterConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// NetworkSecurityPerimeterConfigurationsClientListByServiceOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager +// method. +type NetworkSecurityPerimeterConfigurationsClientListByServiceOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go index 1f5675afabce..f0a68c27efd8 100644 --- a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go +++ b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go @@ -47,12 +47,12 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // Delete - Disconnects the private endpoint connection and deletes it from the search service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. -// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure Cognitive Search service with -// the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified +// resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete @@ -103,12 +103,12 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -124,12 +124,12 @@ func (client *PrivateEndpointConnectionsClient) deleteHandleResponse(resp *http. // Get - Gets the details of the private endpoint connection to the search service in the given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. -// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure Cognitive Search service with -// the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified +// resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -180,12 +180,12 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -200,10 +200,10 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListByServicePager - Gets a list of all private endpoint connections in the given service. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - PrivateEndpointConnectionsClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServicePager @@ -251,12 +251,12 @@ func (client *PrivateEndpointConnectionsClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -269,15 +269,15 @@ func (client *PrivateEndpointConnectionsClient) listByServiceHandleResponse(resp return result, nil } -// Update - Updates a Private Endpoint connection to the search service in the given resource group. +// Update - Updates a private endpoint connection to the search service in the given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. -// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure Cognitive Search service with -// the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified +// resource group. // - privateEndpointConnection - The definition of the private endpoint connection to update. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -329,12 +329,12 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, privateEndpointConnection); err != nil { return nil, err } diff --git a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go index 18b4f2890046..80dcb67a4911 100644 --- a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/UpdatePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/UpdatePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -32,7 +32,7 @@ func ExamplePrivateEndpointConnectionsClient_Update() { res, err := clientFactory.NewPrivateEndpointConnectionsClient().Update(ctx, "rg1", "mysearchservice", "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546", armsearch.PrivateEndpointConnection{ Properties: &armsearch.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - Description: to.Ptr("Rejected for some reason"), + Description: to.Ptr("Rejected for some reason."), Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusRejected), }, }, @@ -52,7 +52,7 @@ func ExamplePrivateEndpointConnectionsClient_Update() { // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), // }, // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr("Rejected for some reason"), + // Description: to.Ptr("Rejected for some reason."), // ActionsRequired: to.Ptr("None"), // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusRejected), // }, @@ -60,7 +60,7 @@ func ExamplePrivateEndpointConnectionsClient_Update() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/DeletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeletePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExamplePrivateEndpointConnectionsClient_Delete() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/ListPrivateEndpointConnectionsByService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListPrivateEndpointConnectionsByService.json func ExamplePrivateEndpointConnectionsClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go index 122556aa21c8..0a6b65b8fd6c 100644 --- a/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go +++ b/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go @@ -46,10 +46,10 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // NewListSupportedPager - Gets a list of all supported private link resource types for the given service. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - PrivateLinkResourcesClientListSupportedOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListSupportedPager @@ -98,12 +98,12 @@ func (client *PrivateLinkResourcesClient) listSupportedCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go b/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go index 48a803f2255f..9864e62c7c6c 100644 --- a/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/ListSupportedPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSupportedPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -56,7 +56,7 @@ func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { // Name: to.Ptr("blob"), // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ // Type: to.Ptr("Microsoft.Storage/storageAccounts"), - // Description: to.Ptr("Azure Cognitive Search indexers can connect to blobs in Azure Storage for reading data (data source), for writing intermediate results of indexer execution (annotation cache, preview) or for storing any knowledge store projections (preview)"), + // Description: to.Ptr("Azure AI Search indexers can connect to blobs in Azure Storage for reading data from an indexer data source, for writing intermediate results of indexer execution or for storing any knowledge store projections."), // GroupID: to.Ptr("blob"), // }, // }, @@ -64,7 +64,7 @@ func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { // Name: to.Ptr("table"), // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ // Type: to.Ptr("Microsoft.Storage/storageAccounts"), - // Description: to.Ptr("Azure Cognitive Search indexers can connect to tables in Azure Storage for reading data (data source), for writing book-keeping information about intermediate results of indexer execution (annotation cache, preview) or for storing any knowledge store projections (preview)"), + // Description: to.Ptr("Azure AI Search indexers can connect to tables in Azure Storage for reading data from an indexer data source, for writing intermediate results of indexer execution or for storing any knowledge store projections."), // GroupID: to.Ptr("table"), // }, // }, @@ -72,7 +72,7 @@ func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { // Name: to.Ptr("Sql"), // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // Description: to.Ptr("Azure Cognitive Search indexers can connect to CosmosDB using the SQL head for reading data (data source)."), + // Description: to.Ptr("Azure AI Search indexers can connect to Azure Cosmos DB API for NoSQL for reading data from an indexer data source."), // GroupID: to.Ptr("Sql"), // }, // }, @@ -80,7 +80,7 @@ func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { // Name: to.Ptr("plr"), // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ // Type: to.Ptr("Microsoft.Sql/servers"), - // Description: to.Ptr("Azure Cognitive Search indexers can connect to AzureSQL databases in a SQL server for reading data (data source)."), + // Description: to.Ptr("Azure AI Search indexers can connect to Azure SQL database on a server for reading data from an indexer data source."), // GroupID: to.Ptr("sqlServer"), // }, // }, @@ -88,7 +88,7 @@ func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { // Name: to.Ptr("vault"), // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // Description: to.Ptr("Azure Cognitive Search can access keys in Azure Key Vault to encrypt search index and synonym map data"), + // Description: to.Ptr("Azure AI Search can access keys in Azure Key Vault to encrypt sensitive data in a search index and synonym map data."), // GroupID: to.Ptr("vault"), // }, // }, @@ -96,7 +96,7 @@ func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { // Name: to.Ptr("plr"), // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // Description: to.Ptr("Azure Cognitive Search indexers can connect to MySQL databases for reading data (data source, preview)."), + // Description: to.Ptr("Azure AI Search indexers can connect to MySQL databases for reading data from an indexer data source."), // GroupID: to.Ptr("mysqlServer"), // }, // }, @@ -104,7 +104,7 @@ func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { // Name: to.Ptr("site"), // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ // Type: to.Ptr("Microsoft.Web/sites"), - // Description: to.Ptr("Azure Cognitive Search indexers can connect to App Services when executing custom web api skills that can be present in a skillset (optional) attached to the indexer."), + // Description: to.Ptr("For custom skills that connect to an app service, you can specify sites as the group ID."), // GroupID: to.Ptr("sites"), // }, // }}, diff --git a/sdk/resourcemanager/search/armsearch/querykeys_client.go b/sdk/resourcemanager/search/armsearch/querykeys_client.go index d1eb2b5331c8..a85dd39e6c17 100644 --- a/sdk/resourcemanager/search/armsearch/querykeys_client.go +++ b/sdk/resourcemanager/search/armsearch/querykeys_client.go @@ -47,10 +47,10 @@ func NewQueryKeysClient(subscriptionID string, credential azcore.TokenCredential // Create - Generates a new query key for the specified search service. You can create up to 50 query keys per service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - name - The name of the new query API key. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -101,12 +101,12 @@ func (client *QueryKeysClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -123,10 +123,10 @@ func (client *QueryKeysClient) createHandleResponse(resp *http.Response) (QueryK // a query key is to delete and then recreate it. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - key - The query key to be deleted. Query keys are identified by value, not by name. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -176,21 +176,21 @@ func (client *QueryKeysClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// NewListBySearchServicePager - Returns the list of query API keys for the given Azure Cognitive Search service. +// NewListBySearchServicePager - Returns the list of query API keys for the given Azure AI Search service. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - QueryKeysClientListBySearchServiceOptions contains the optional parameters for the QueryKeysClient.NewListBySearchServicePager @@ -238,12 +238,12 @@ func (client *QueryKeysClient) listBySearchServiceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go b/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go index aad3744f52d9..d2270f0ba429 100644 --- a/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateQueryKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateQueryKey.json func ExampleQueryKeysClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,7 +28,7 @@ func ExampleQueryKeysClient_Create() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewQueryKeysClient().Create(ctx, "rg1", "mysearchservice", "Query key for browser-based clients", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) + res, err := clientFactory.NewQueryKeysClient().Create(ctx, "rg1", "mysearchservice", "An API key granting read-only access to the documents collection of an index.", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -36,12 +36,12 @@ func ExampleQueryKeysClient_Create() { _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. // res.QueryKey = armsearch.QueryKey{ - // Name: to.Ptr("Query key for browser-based clients"), + // Name: to.Ptr("An API key granting read-only access to the documents collection of an index."), // Key: to.Ptr(""), // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchListQueryKeysBySearchService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListQueryKeysBySearchService.json func ExampleQueryKeysClient_NewListBySearchServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,7 +77,7 @@ func ExampleQueryKeysClient_NewListBySearchServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchDeleteQueryKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteQueryKey.json func ExampleQueryKeysClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/response_types.go b/sdk/resourcemanager/search/armsearch/responses.go similarity index 71% rename from sdk/resourcemanager/search/armsearch/response_types.go rename to sdk/resourcemanager/search/armsearch/responses.go index a05ef7fff059..6b49eac7fe19 100644 --- a/sdk/resourcemanager/search/armsearch/response_types.go +++ b/sdk/resourcemanager/search/armsearch/responses.go @@ -10,22 +10,39 @@ package armsearch // AdminKeysClientGetResponse contains the response from method AdminKeysClient.Get. type AdminKeysClientGetResponse struct { - // Response containing the primary and secondary admin API keys for a given Azure Cognitive Search service. + // Response containing the primary and secondary admin API keys for a given Azure AI Search service. AdminKeyResult } // AdminKeysClientRegenerateResponse contains the response from method AdminKeysClient.Regenerate. type AdminKeysClientRegenerateResponse struct { - // Response containing the primary and secondary admin API keys for a given Azure Cognitive Search service. + // Response containing the primary and secondary admin API keys for a given Azure AI Search service. AdminKeyResult } // ManagementClientUsageBySubscriptionSKUResponse contains the response from method ManagementClient.UsageBySubscriptionSKU. type ManagementClientUsageBySubscriptionSKUResponse struct { - // Describes the quota usage for a particular sku supported by Azure Cognitive Search. + // Describes the quota usage for a particular SKU. QuotaUsageResult } +// NetworkSecurityPerimeterConfigurationsClientGetResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.Get. +type NetworkSecurityPerimeterConfigurationsClientGetResponse struct { + // Network security perimeter configuration for a server. + NetworkSecurityPerimeterConfiguration +} + +// NetworkSecurityPerimeterConfigurationsClientListByServiceResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager. +type NetworkSecurityPerimeterConfigurationsClientListByServiceResponse struct { + // A list of network security perimeter configurations for a server. + NetworkSecurityPerimeterConfigurationListResult +} + +// NetworkSecurityPerimeterConfigurationsClientReconcileResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile. +type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct { + // placeholder for future response values +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // The result of the request to list REST API operations. It contains a list of operations and a URL to get the next set of @@ -35,25 +52,25 @@ type OperationsClientListResponse struct { // PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. type PrivateEndpointConnectionsClientDeleteResponse struct { - // Describes an existing Private Endpoint connection to the Azure Cognitive Search service. + // Describes an existing private endpoint connection to the Azure AI Search service. PrivateEndpointConnection } // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { - // Describes an existing Private Endpoint connection to the Azure Cognitive Search service. + // Describes an existing private endpoint connection to the Azure AI Search service. PrivateEndpointConnection } // PrivateEndpointConnectionsClientListByServiceResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServicePager. type PrivateEndpointConnectionsClientListByServiceResponse struct { - // Response containing a list of Private Endpoint connections. + // Response containing a list of private endpoint connections. PrivateEndpointConnectionListResult } // PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.Update. type PrivateEndpointConnectionsClientUpdateResponse struct { - // Describes an existing Private Endpoint connection to the Azure Cognitive Search service. + // Describes an existing private endpoint connection to the Azure AI Search service. PrivateEndpointConnection } @@ -65,7 +82,8 @@ type PrivateLinkResourcesClientListSupportedResponse struct { // QueryKeysClientCreateResponse contains the response from method QueryKeysClient.Create. type QueryKeysClientCreateResponse struct { - // Describes an API key for a given Azure Cognitive Search service that has permissions for query operations only. + // Describes an API key for a given Azure AI Search service that conveys read-only permissions on the docs collection of an + // index. QueryKey } @@ -76,7 +94,7 @@ type QueryKeysClientDeleteResponse struct { // QueryKeysClientListBySearchServiceResponse contains the response from method QueryKeysClient.NewListBySearchServicePager. type QueryKeysClientListBySearchServiceResponse struct { - // Response containing the query API keys for a given Azure Cognitive Search service. + // Response containing the query API keys for a given Azure AI Search service. ListQueryKeysResult } @@ -88,7 +106,7 @@ type ServicesClientCheckNameAvailabilityResponse struct { // ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { - // Describes an Azure Cognitive Search service and its current state. + // Describes an Azure AI Search service and its current state. Service } @@ -99,31 +117,31 @@ type ServicesClientDeleteResponse struct { // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { - // Describes an Azure Cognitive Search service and its current state. + // Describes an Azure AI Search service and its current state. Service } // ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager. type ServicesClientListByResourceGroupResponse struct { - // Response containing a list of Azure Cognitive Search services. + // Response containing a list of Azure AI Search services. ServiceListResult } // ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager. type ServicesClientListBySubscriptionResponse struct { - // Response containing a list of Azure Cognitive Search services. + // Response containing a list of Azure AI Search services. ServiceListResult } // ServicesClientUpdateResponse contains the response from method ServicesClient.Update. type ServicesClientUpdateResponse struct { - // Describes an Azure Cognitive Search service and its current state. + // Describes an Azure AI Search service and its current state. Service } // SharedPrivateLinkResourcesClientCreateOrUpdateResponse contains the response from method SharedPrivateLinkResourcesClient.BeginCreateOrUpdate. type SharedPrivateLinkResourcesClientCreateOrUpdateResponse struct { - // Describes a Shared Private Link Resource managed by the Azure Cognitive Search service. + // Describes a shared private link resource managed by the Azure AI Search service. SharedPrivateLinkResource } @@ -134,18 +152,18 @@ type SharedPrivateLinkResourcesClientDeleteResponse struct { // SharedPrivateLinkResourcesClientGetResponse contains the response from method SharedPrivateLinkResourcesClient.Get. type SharedPrivateLinkResourcesClientGetResponse struct { - // Describes a Shared Private Link Resource managed by the Azure Cognitive Search service. + // Describes a shared private link resource managed by the Azure AI Search service. SharedPrivateLinkResource } // SharedPrivateLinkResourcesClientListByServiceResponse contains the response from method SharedPrivateLinkResourcesClient.NewListByServicePager. type SharedPrivateLinkResourcesClientListByServiceResponse struct { - // Response containing a list of Shared Private Link Resources. + // Response containing a list of shared private link resources. SharedPrivateLinkResourceListResult } // UsagesClientListBySubscriptionResponse contains the response from method UsagesClient.NewListBySubscriptionPager. type UsagesClientListBySubscriptionResponse struct { - // Response containing the quota usage information for all the supported skus of Azure Cognitive Search service. + // Response containing the quota usage information for all the supported SKUs of Azure AI Search. QuotaUsagesListResult } diff --git a/sdk/resourcemanager/search/armsearch/services_client.go b/sdk/resourcemanager/search/armsearch/services_client.go index 6e54171b9afd..6edd0ad3eed4 100644 --- a/sdk/resourcemanager/search/armsearch/services_client.go +++ b/sdk/resourcemanager/search/armsearch/services_client.go @@ -48,7 +48,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // must be globally unique since they are part of the service URI (https://.search.windows.net). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - checkNameAvailabilityInput - The resource name and type to check. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -88,12 +88,12 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, checkNameAvailabilityInput); err != nil { return nil, err } @@ -113,14 +113,14 @@ func (client *ServicesClient) checkNameAvailabilityHandleResponse(resp *http.Res // all properties will be updated with the given values. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service to create or update. Search service names must only -// contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, -// cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally -// unique since they are part of the service URI (https://.search.windows.net). -// You cannot change the service name after the service is created. +// - searchServiceName - The name of the Azure AI Search service to create or update. Search service names must only contain +// lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot +// contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique +// since they are part of the service URI (https://.search.windows.net). You +// cannot change the service name after the service is created. // - service - The definition of the search service to create or update. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -147,7 +147,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // all properties will be updated with the given values. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginCreateOrUpdate" @@ -189,12 +189,12 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, service); err != nil { return nil, err } @@ -204,10 +204,10 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // Delete - Deletes a search service in the given resource group, along with its associated resources. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method. @@ -252,22 +252,22 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets the search service with the given name in the given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method. @@ -313,12 +313,12 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -333,7 +333,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListByResourceGroupPager - Gets a list of all Search services in the given resource group. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get @@ -379,12 +379,12 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -399,7 +399,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Gets a list of all Search services in the given subscription. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager @@ -439,12 +439,12 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -460,10 +460,10 @@ func (client *ServicesClient) listBySubscriptionHandleResponse(resp *http.Respon // Update - Updates an existing search service in the given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service to update. +// - searchServiceName - The name of the Azure AI Search service to update. // - service - The definition of the search service to update. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -510,12 +510,12 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, service); err != nil { return nil, err } diff --git a/sdk/resourcemanager/search/armsearch/services_client_example_test.go b/sdk/resourcemanager/search/armsearch/services_client_example_test.go index 6d1b3ff0bf74..075ed1facba5 100644 --- a/sdk/resourcemanager/search/armsearch/services_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/services_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -62,8 +62,20 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -73,6 +85,8 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -82,7 +96,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceAuthOptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOptions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -136,15 +150,26 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOp // AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), // }, // }, + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -154,7 +179,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOp // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisableLocalAuth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -200,15 +225,26 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisabl // }, // Properties: &armsearch.ServiceProperties{ // DisableLocalAuth: to.Ptr(true), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -218,7 +254,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisabl // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -263,8 +299,20 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -274,6 +322,8 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -283,7 +333,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -336,8 +386,112 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, + // HostingMode: to.Ptr(armsearch.HostingModeDefault), + // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // IPRules: []*armsearch.IPRule{ + // { + // Value: to.Ptr("123.4.5.6"), + // }, + // { + // Value: to.Ptr("123.4.6.0/18"), + // }}, + // }, + // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, + // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), + // ReplicaCount: to.Ptr[int32](1), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, + // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), + // StatusDetails: to.Ptr(""), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json +func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsearch.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ + Location: to.Ptr("westus"), + Tags: map[string]*string{ + "app-name": to.Ptr("My e-commerce app"), + }, + Properties: &armsearch.ServiceProperties{ + HostingMode: to.Ptr(armsearch.HostingModeDefault), + NetworkRuleSet: &armsearch.NetworkRuleSet{ + Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), + IPRules: []*armsearch.IPRule{ + { + Value: to.Ptr("123.4.5.6"), + }, + { + Value: to.Ptr("123.4.6.0/18"), + }}, + }, + PartitionCount: to.Ptr[int32](1), + ReplicaCount: to.Ptr[int32](1), + }, + SKU: &armsearch.SKU{ + Name: to.Ptr(armsearch.SKUNameStandard), + }, + }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Service = armsearch.Service{ + // Name: to.Ptr("mysearchservice"), + // Type: to.Ptr("Microsoft.Search/searchServices"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "app-name": to.Ptr("My e-commerce app"), + // }, + // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), // IPRules: []*armsearch.IPRule{ // { // Value: to.Ptr("123.4.5.6"), @@ -352,6 +506,8 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](1), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -361,7 +517,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCmkEnforcement() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -413,12 +569,15 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCm // }, // }, // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -439,7 +598,87 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCm // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateServiceWithIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json +func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDataExfiltration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsearch.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ + Location: to.Ptr("westus"), + Tags: map[string]*string{ + "app-name": to.Ptr("My e-commerce app"), + }, + Properties: &armsearch.ServiceProperties{ + DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, + HostingMode: to.Ptr(armsearch.HostingModeDefault), + PartitionCount: to.Ptr[int32](1), + ReplicaCount: to.Ptr[int32](3), + }, + SKU: &armsearch.SKU{ + Name: to.Ptr(armsearch.SKUNameStandard), + }, + }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Service = armsearch.Service{ + // Name: to.Ptr("mysearchservice"), + // Type: to.Ptr("Microsoft.Search/searchServices"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "app-name": to.Ptr("My e-commerce app"), + // }, + // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, + // HostingMode: to.Ptr(armsearch.HostingModeDefault), + // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), + // IPRules: []*armsearch.IPRule{ + // }, + // }, + // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, + // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), + // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, + // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), + // StatusDetails: to.Ptr(""), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -456,7 +695,10 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId "app-name": to.Ptr("My e-commerce app"), }, Identity: &armsearch.Identity{ - Type: to.Ptr(armsearch.IdentityTypeSystemAssigned), + Type: to.Ptr(armsearch.IdentityTypeSystemAssignedUserAssigned), + UserAssignedIdentities: map[string]*armsearch.UserAssignedManagedIdentity{ + "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": {}, + }, }, Properties: &armsearch.ServiceProperties{ HostingMode: to.Ptr(armsearch.HostingModeDefault), @@ -486,13 +728,31 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId // "app-name": to.Ptr("My e-commerce app"), // }, // Identity: &armsearch.Identity{ - // Type: to.Ptr(armsearch.IdentityTypeSystemAssigned), + // Type: to.Ptr(armsearch.IdentityTypeSystemAssignedUserAssigned), // PrincipalID: to.Ptr("9d1e1f18-2122-4988-a11c-878782e40a5c"), // TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"), + // UserAssignedIdentities: map[string]*armsearch.UserAssignedManagedIdentity{ + // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": &armsearch.UserAssignedManagedIdentity{ + // ClientID: to.Ptr("cd1dcac8-82dd-45b5-9aed-76795d529f6b"), + // PrincipalID: to.Ptr("24e07a75-1286-41e5-a15d-ded85ec3acd7"), + // }, + // }, // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -502,6 +762,8 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -511,7 +773,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCreateOrUpdateWithSemanticSearch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticSearch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -561,12 +823,15 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticS // }, // }, // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -588,7 +853,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticS // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json func ExampleServicesClient_Update_searchUpdateService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -624,8 +889,20 @@ func ExampleServicesClient_Update_searchUpdateService() { // "new-tag": to.Ptr("Adding a new tag"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -635,6 +912,8 @@ func ExampleServicesClient_Update_searchUpdateService() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](2), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -644,7 +923,7 @@ func ExampleServicesClient_Update_searchUpdateService() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceAuthOptions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -690,15 +969,26 @@ func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { // AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), // }, // }, + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](2), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -708,7 +998,7 @@ func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceDisableLocalAuth.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -746,15 +1036,26 @@ func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { // }, // Properties: &armsearch.ServiceProperties{ // DisableLocalAuth: to.Ptr(true), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](2), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), // }, @@ -764,7 +1065,7 @@ func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEndpoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -798,8 +1099,20 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEnd // "new-tag": to.Ptr("Adding a new tag"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -809,6 +1122,8 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEnd // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), // ReplicaCount: to.Ptr[int32](1), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -818,7 +1133,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEnd // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -861,8 +1176,99 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // "new-tag": to.Ptr("Adding a new tag"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, + // HostingMode: to.Ptr(armsearch.HostingModeDefault), + // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // IPRules: []*armsearch.IPRule{ + // { + // Value: to.Ptr("10.2.3.4"), + // }}, + // }, + // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, + // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), + // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, + // Status: to.Ptr(armsearch.SearchServiceStatusRunning), + // StatusDetails: to.Ptr(""), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json +func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsearch.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ + Properties: &armsearch.ServiceProperties{ + NetworkRuleSet: &armsearch.NetworkRuleSet{ + Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), + IPRules: []*armsearch.IPRule{ + { + Value: to.Ptr("123.4.5.6"), + }, + { + Value: to.Ptr("123.4.6.0/18"), + }}, + }, + PartitionCount: to.Ptr[int32](1), + PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), + ReplicaCount: to.Ptr[int32](3), + }, + }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Service = armsearch.Service{ + // Name: to.Ptr("mysearchservice"), + // Type: to.Ptr("Microsoft.Search/searchServices"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "app-name": to.Ptr("My e-commerce app"), + // "new-tag": to.Ptr("Adding a new tag"), + // }, + // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), // IPRules: []*armsearch.IPRule{ // { // Value: to.Ptr("10.2.3.4"), @@ -874,6 +1280,8 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -883,7 +1291,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceToRemoveIdentity.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -915,12 +1323,21 @@ func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { // Location: to.Ptr("westus"), // Tags: map[string]*string{ // }, - // Identity: &armsearch.Identity{ - // Type: to.Ptr(armsearch.IdentityTypeNone), - // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -930,6 +1347,8 @@ func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -939,7 +1358,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceWithCmkEnforcement.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -983,12 +1402,15 @@ func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { // }, // }, // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -1009,7 +1431,79 @@ func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchUpdateServiceWithSemanticSearch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json +func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armsearch.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ + Properties: &armsearch.ServiceProperties{ + DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, + ReplicaCount: to.Ptr[int32](2), + }, + Tags: map[string]*string{ + "app-name": to.Ptr("My e-commerce app"), + "new-tag": to.Ptr("Adding a new tag"), + }, + }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.Service = armsearch.Service{ + // Name: to.Ptr("mysearchservice"), + // Type: to.Ptr("Microsoft.Search/searchServices"), + // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), + // Location: to.Ptr("westus"), + // Tags: map[string]*string{ + // "app-name": to.Ptr("My e-commerce app"), + // "new-tag": to.Ptr("Adding a new tag"), + // }, + // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, + // HostingMode: to.Ptr(armsearch.HostingModeDefault), + // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), + // IPRules: []*armsearch.IPRule{ + // }, + // }, + // PartitionCount: to.Ptr[int32](1), + // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ + // }, + // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), + // ReplicaCount: to.Ptr[int32](2), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, + // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), + // StatusDetails: to.Ptr(""), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1051,12 +1545,15 @@ func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { // }, // }, // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -1078,7 +1575,7 @@ func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchGetService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetService.json func ExampleServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1105,8 +1602,20 @@ func ExampleServicesClient_Get() { // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -1116,6 +1625,8 @@ func ExampleServicesClient_Get() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -1125,7 +1636,7 @@ func ExampleServicesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchDeleteService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteService.json func ExampleServicesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1142,7 +1653,7 @@ func ExampleServicesClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchListServicesByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesByResourceGroup.json func ExampleServicesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1175,8 +1686,20 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -1186,6 +1709,8 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -1202,8 +1727,20 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -1213,6 +1750,8 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](1), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -1224,7 +1763,7 @@ func ExampleServicesClient_NewListByResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchListServicesBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesBySubscription.json func ExampleServicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1257,8 +1796,20 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -1268,6 +1819,8 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -1284,8 +1837,20 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // AuthOptions: &armsearch.DataPlaneAuthOptions{ + // APIKeyOnly: map[string]any{ + // }, + // }, + // DisableLocalAuth: to.Ptr(false), + // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ + // }, + // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ + // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), + // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), + // }, // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ + // Bypass: to.Ptr(armsearch.SearchBypassNone), // IPRules: []*armsearch.IPRule{ // }, // }, @@ -1295,6 +1860,8 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](1), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), // }, @@ -1306,7 +1873,7 @@ func ExampleServicesClient_NewListBySubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/SearchCheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCheckNameAvailability.json func ExampleServicesClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go index 37691173b343..a5ede4001dcc 100644 --- a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go +++ b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go @@ -48,12 +48,12 @@ func NewSharedPrivateLinkResourcesClient(subscriptionID string, credential azcor // in the given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. -// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure Cognitive Search service -// within the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within +// the specified resource group. // - sharedPrivateLinkResource - The definition of the shared private link resource to create or update. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -81,7 +81,7 @@ func (client *SharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context. // given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview func (client *SharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, sharedPrivateLinkResource SharedPrivateLinkResource, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginCreateOrUpdate" @@ -127,12 +127,12 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, sharedPrivateLinkResource); err != nil { return nil, err } @@ -142,12 +142,12 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx // BeginDelete - Initiates the deletion of the shared private link resource from the search service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. -// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure Cognitive Search service -// within the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within +// the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete @@ -173,7 +173,7 @@ func (client *SharedPrivateLinkResourcesClient) BeginDelete(ctx context.Context, // Delete - Initiates the deletion of the shared private link resource from the search service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginDelete" @@ -219,24 +219,24 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets the details of the shared private link resource managed by the search service in the given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. -// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure Cognitive Search service -// within the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. +// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within +// the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get @@ -287,12 +287,12 @@ func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } @@ -307,10 +307,10 @@ func (client *SharedPrivateLinkResourcesClient) getHandleResponse(resp *http.Res // NewListByServicePager - Gets a list of all shared private link resources managed by the given service. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. -// - searchServiceName - The name of the Azure Cognitive Search service associated with the specified resource group. +// - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - SharedPrivateLinkResourcesClientListByServiceOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.NewListByServicePager @@ -358,12 +358,12 @@ func (client *SharedPrivateLinkResourcesClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go index 8ae73ee8301a..b85a8a04d630 100644 --- a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/CreateOrUpdateSharedPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -59,7 +59,7 @@ func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetSharedPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json func ExampleSharedPrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleSharedPrivateLinkResourcesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/DeleteSharedPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -111,7 +111,7 @@ func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/ListSharedPrivateLinkResourcesByService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSharedPrivateLinkResourcesByService.json func ExampleSharedPrivateLinkResourcesClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/usages_client.go b/sdk/resourcemanager/search/armsearch/usages_client.go index 89c82e150148..96ee986676a6 100644 --- a/sdk/resourcemanager/search/armsearch/usages_client.go +++ b/sdk/resourcemanager/search/armsearch/usages_client.go @@ -44,9 +44,9 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } -// NewListBySubscriptionPager - Gets a list of all Search quota usages in the given subscription. +// NewListBySubscriptionPager - Get a list of all Azure AI Search quota usages across the subscription. // -// Generated from API version 2023-11-01 +// Generated from API version 2024-03-01-preview // - location - The unique location name for a Microsoft Azure geographic region. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -91,12 +91,12 @@ func (client *UsagesClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-11-01") + reqQP.Set("api-version", "2024-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { req.Raw().Header["x-ms-client-request-id"] = []string{*searchManagementRequestOptions.ClientRequestID} } - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/search/armsearch/usages_client_example_test.go b/sdk/resourcemanager/search/armsearch/usages_client_example_test.go index 160964623ae9..1d6347e1813c 100644 --- a/sdk/resourcemanager/search/armsearch/usages_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/usages_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/7e29dd59eef13ef347d09e41a63f2585be77b3ca/specification/search/resource-manager/Microsoft.Search/stable/2023-11-01/examples/GetQuotaUsagesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsagesList.json func ExampleUsagesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {