From 5c759612de170008e167ea93bd0178e6598aa5b3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 6 Mar 2025 00:48:26 +0000 Subject: [PATCH] CodeGen from PR 33037 in Azure/azure-rest-api-specs Merge 333fb008ee222bdb661f0826df39a5573884122f into 6043a6aac4f0b1f9ead1360e33c0d5035636c35a --- .../search/armsearch/CHANGELOG.md | 4 + .../search/armsearch/adminkeys_client.go | 23 +- .../adminkeys_client_example_test.go | 66 - .../search/armsearch/autorest.md | 7 +- .../search/armsearch/client_factory.go | 13 +- .../search/armsearch/constants.go | 154 +- .../search/armsearch/fake/adminkeys_server.go | 56 +- .../search/armsearch/fake/internal.go | 8 +- .../armsearch/fake/management_server.go | 52 +- ...ksecurityperimeterconfigurations_server.go | 212 -- .../armsearch/fake/operations_server.go | 52 +- .../fake/privateendpointconnections_server.go | 64 +- .../fake/privatelinkresources_server.go | 52 +- .../search/armsearch/fake/querykeys_server.go | 60 +- .../search/armsearch/fake/server_factory.go | 67 +- .../search/armsearch/fake/services_server.go | 76 +- .../fake/sharedprivatelinkresources_server.go | 70 +- .../search/armsearch/fake/usages_server.go | 52 +- sdk/resourcemanager/search/armsearch/go.mod | 2 +- .../search/armsearch/management_client.go | 13 +- .../management_client_example_test.go | 48 - .../search/armsearch/models.go | 369 +--- .../search/armsearch/models_serde.go | 665 ------ ...ksecurityperimeterconfigurations_client.go | 269 --- ...meterconfigurations_client_example_test.go | 147 -- .../search/armsearch/operations_client.go | 9 +- .../operations_client_example_test.go | 644 ------ .../search/armsearch/options.go | 28 +- .../privateendpointconnections_client.go | 51 +- ...endpointconnections_client_example_test.go | 174 -- .../armsearch/privatelinkresources_client.go | 13 +- ...rivatelinkresources_client_example_test.go | 115 - .../search/armsearch/querykeys_client.go | 31 +- .../querykeys_client_example_test.go | 95 - .../search/armsearch/responses.go | 53 +- .../search/armsearch/services_client.go | 65 +- .../armsearch/services_client_example_test.go | 1902 ----------------- .../sharedprivatelinkresources_client.go | 53 +- ...rivatelinkresources_client_example_test.go | 151 -- .../search/armsearch/usages_client.go | 13 +- .../armsearch/usages_client_example_test.go | 116 - 41 files changed, 674 insertions(+), 5440 deletions(-) delete mode 100644 sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/fake/networksecurityperimeterconfigurations_server.go delete mode 100644 sdk/resourcemanager/search/armsearch/management_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go delete mode 100644 sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/operations_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/services_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go delete mode 100644 sdk/resourcemanager/search/armsearch/usages_client_example_test.go diff --git a/sdk/resourcemanager/search/armsearch/CHANGELOG.md b/sdk/resourcemanager/search/armsearch/CHANGELOG.md index 5fa150e010f0..ebe7d76d4fa2 100644 --- a/sdk/resourcemanager/search/armsearch/CHANGELOG.md +++ b/sdk/resourcemanager/search/armsearch/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 1.3.1 (2025-03-06) +### Other Changes + + ## 1.4.0-beta.2 (2024-06-21) ### Features Added diff --git a/sdk/resourcemanager/search/armsearch/adminkeys_client.go b/sdk/resourcemanager/search/armsearch/adminkeys_client.go index bd6cc2f2dc89..7039eae23937 100644 --- a/sdk/resourcemanager/search/armsearch/adminkeys_client.go +++ b/sdk/resourcemanager/search/armsearch/adminkeys_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type AdminKeysClient struct { // NewAdminKeysClient creates a new instance of AdminKeysClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewAdminKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminKeysClient, error) { @@ -44,13 +41,13 @@ func NewAdminKeysClient(subscriptionID string, credential azcore.TokenCredential return client, nil } -// Get - Gets the primary and secondary admin API keys for the specified Azure AI Search service. +// Get - Gets the primary and secondary admin API keys for the specified search service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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. @@ -77,7 +74,7 @@ func (client *AdminKeysClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *AdminKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *AdminKeysClientGetOptions) (*policy.Request, error) { +func (client *AdminKeysClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *AdminKeysClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listAdminKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -96,7 +93,7 @@ func (client *AdminKeysClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -117,10 +114,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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. @@ -148,7 +145,7 @@ func (client *AdminKeysClient) Regenerate(ctx context.Context, resourceGroupName } // regenerateCreateRequest creates the Regenerate request. -func (client *AdminKeysClient) regenerateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, keyKind AdminKeyKind, searchManagementRequestOptions *SearchManagementRequestOptions, options *AdminKeysClientRegenerateOptions) (*policy.Request, error) { +func (client *AdminKeysClient) regenerateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, keyKind AdminKeyKind, searchManagementRequestOptions *SearchManagementRequestOptions, _ *AdminKeysClientRegenerateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/regenerateAdminKey/{keyKind}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -171,7 +168,7 @@ func (client *AdminKeysClient) regenerateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go b/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go deleted file mode 100644 index 6af57bcfa226..000000000000 --- a/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchGetAdminKeys.json -func ExampleAdminKeysClient_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.NewAdminKeysClient().Get(ctx, "rg1", "mysearchservice", &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.AdminKeyResult = armsearch.AdminKeyResult{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchRegenerateAdminKey.json -func ExampleAdminKeysClient_Regenerate() { - 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.NewAdminKeysClient().Regenerate(ctx, "rg1", "mysearchservice", armsearch.AdminKeyKindPrimary, &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.AdminKeyResult = armsearch.AdminKeyResult{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/search/armsearch/autorest.md b/sdk/resourcemanager/search/armsearch/autorest.md index 9b9e1f3ef894..5b3f2a5e0313 100644 --- a/sdk/resourcemanager/search/armsearch/autorest.md +++ b/sdk/resourcemanager/search/armsearch/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/search/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/search/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.4.0-beta.2 -tag: package-preview-2024-06 +module-version: 1.3.1 ``` \ 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 1538c1b16c21..7ef4b029b285 100644 --- a/sdk/resourcemanager/search/armsearch/client_factory.go +++ b/sdk/resourcemanager/search/armsearch/client_factory.go @@ -1,6 +1,3 @@ -//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. @@ -23,7 +20,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. // - subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource -// Manager API or the portal. +// Manager API, command line tools, or the portal. // - 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) { @@ -53,14 +50,6 @@ func (c *ClientFactory) NewManagementClient() *ManagementClient { } } -// 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 { return &OperationsClient{ diff --git a/sdk/resourcemanager/search/armsearch/constants.go b/sdk/resourcemanager/search/armsearch/constants.go index e857f438ad33..8195bc6a43f3 100644 --- a/sdk/resourcemanager/search/armsearch/constants.go +++ b/sdk/resourcemanager/search/armsearch/constants.go @@ -1,6 +1,3 @@ -//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. @@ -10,7 +7,7 @@ package armsearch const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" - moduleVersion = "v1.4.0-beta.2" + moduleVersion = "v1.3.1" ) // AADAuthFailureMode - Describes what response the data plane API of a search service would send for requests that failed @@ -72,21 +69,12 @@ func PossibleHostingModeValues() []HostingMode { } } -// 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. +// IdentityType - The identity type. type IdentityType string const ( - // 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. + IdentityTypeNone IdentityType = "None" 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. @@ -94,18 +82,16 @@ func PossibleIdentityTypeValues() []IdentityType { return []IdentityType{ IdentityTypeNone, IdentityTypeSystemAssigned, - IdentityTypeSystemAssignedUserAssigned, - IdentityTypeUserAssigned, } } // PrivateLinkServiceConnectionProvisioningState - The provisioning state of the private link service connection. Valid values -// are Updating, Deleting, Failed, Succeeded, Incomplete, or Canceled. +// are Updating, Deleting, Failed, Succeeded, or Incomplete 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. @@ -163,20 +149,20 @@ func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConn // ProvisioningState - The state of the last provisioning operation performed on the search service. Provisioning is an intermediate // state that occurs while service capacity is being established. After capacity is set up, -// provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended +// provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended // polling interval is from 30 seconds to one minute) by using the Get // Search Service operation to see when an operation is completed. If you are using the free service, this value tends to -// come back as 'Succeeded' directly in the call to Create search service. This is +// come back as 'succeeded' directly in the call to Create search service. This is // because the free service uses capacity that is already set up. type ProvisioningState string const ( // ProvisioningStateFailed - The last provisioning operation has failed. - ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateFailed ProvisioningState = "failed" // ProvisioningStateProvisioning - The search service is being provisioned or scaled up or down. - ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateProvisioning ProvisioningState = "provisioning" // ProvisioningStateSucceeded - The last provisioning operation has completed successfully. - ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateSucceeded ProvisioningState = "succeeded" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. @@ -194,11 +180,8 @@ 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 - The search service is accessible from traffic originating from the public internet. - PublicNetworkAccessEnabled PublicNetworkAccess = "enabled" + PublicNetworkAccessEnabled PublicNetworkAccess = "enabled" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -249,54 +232,17 @@ func PossibleSKUNameValues() []SKUName { } } -// 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" - // SearchBypassAzureServices - Indicates that requests originating from Azure trusted services can bypass the rules defined - // in the 'ipRules' section. - SearchBypassAzureServices SearchBypass = "AzureServices" - // 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, - SearchBypassAzureServices, - 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. +// 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'. type SearchEncryptionComplianceStatus string const ( - // SearchEncryptionComplianceStatusCompliant - Indicates that the search service is compliant, either because the number of - // non-CMK-encrypted objects is zero or enforcement is disabled. + // SearchEncryptionComplianceStatusCompliant - Indicates that the search service is compliant, either because number of non-customer-encrypted + // resources is zero or enforcement is disabled. SearchEncryptionComplianceStatusCompliant SearchEncryptionComplianceStatus = "Compliant" - // SearchEncryptionComplianceStatusNonCompliant - Indicates that the search service has more than one non-CMK-encrypted objects. + // SearchEncryptionComplianceStatusNonCompliant - Indicates that the search service has more than one non-customer-encrypted + // resources. SearchEncryptionComplianceStatusNonCompliant SearchEncryptionComplianceStatus = "NonCompliant" ) @@ -308,16 +254,14 @@ func PossibleSearchEncryptionComplianceStatusValues() []SearchEncryptionComplian } } -// SearchEncryptionWithCmk - Describes how a search service should enforce compliance if it finds objects that aren't encrypted -// with the customer-managed key. +// SearchEncryptionWithCmk - Describes how a search service should enforce having one or more non-customer-encrypted resources. type SearchEncryptionWithCmk string const ( - // SearchEncryptionWithCmkDisabled - No enforcement of customer-managed key encryption will be made. Only the built-in service-managed - // encryption is used. + // SearchEncryptionWithCmkDisabled - No enforcement will be made and the search service can have non-customer-encrypted resources. SearchEncryptionWithCmkDisabled SearchEncryptionWithCmk = "Disabled" - // SearchEncryptionWithCmkEnabled - Search service will be marked as non-compliant if one or more objects aren't encrypted - // with a customer-managed key. + // SearchEncryptionWithCmkEnabled - Search service will be marked as non-compliant if there are one or more non-customer-encrypted + // resources. SearchEncryptionWithCmkEnabled SearchEncryptionWithCmk = "Enabled" // SearchEncryptionWithCmkUnspecified - Enforcement policy is not explicitly specified, with the behavior being the same as // if it were set to 'Disabled'. @@ -333,19 +277,19 @@ func PossibleSearchEncryptionWithCmkValues() []SearchEncryptionWithCmk { } } -// SearchSemanticSearch - Sets options that control the availability of semantic search. This configuration is only possible -// for certain Azure AI Search SKUs in certain locations. +// SearchSemanticSearch - Sets options that control the availability of semantic ranking. This configuration is only possible +// for certain search SKUs in certain locations. type SearchSemanticSearch string const ( - // SearchSemanticSearchDisabled - Indicates that semantic reranker is disabled for the search service. This is the default. + // SearchSemanticSearchDisabled - Indicates that semantic ranking is disabled for the search service. SearchSemanticSearchDisabled SearchSemanticSearch = "disabled" - // 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 - Enables semantic ranking 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 ranking requests and is offered at no extra charge. This + // is the default for newly provisioned search services. SearchSemanticSearchFree SearchSemanticSearch = "free" - // SearchSemanticSearchStandard - Enables semantic reranker on a search service as a billable feature, with higher throughput - // and volume of semantically reranked queries. + // SearchSemanticSearchStandard - Enables semantic ranking on a search service as a billable feature, with higher throughput + // and volume of semantic ranking requests. SearchSemanticSearchStandard SearchSemanticSearch = "standard" ) @@ -364,10 +308,9 @@ 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. '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. +// 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, Microsoft +// 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 ( @@ -383,8 +326,6 @@ 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. @@ -396,7 +337,6 @@ func PossibleSearchServiceStatusValues() []SearchServiceStatus { SearchServiceStatusError, SearchServiceStatusProvisioning, SearchServiceStatusRunning, - SearchServiceStatusStopped, } } @@ -405,19 +345,11 @@ func PossibleSearchServiceStatusValues() []SearchServiceStatus { type SharedPrivateLinkResourceProvisioningState string const ( - // 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. + SharedPrivateLinkResourceProvisioningStateDeleting SharedPrivateLinkResourceProvisioningState = "Deleting" + SharedPrivateLinkResourceProvisioningStateFailed SharedPrivateLinkResourceProvisioningState = "Failed" SharedPrivateLinkResourceProvisioningStateIncomplete SharedPrivateLinkResourceProvisioningState = "Incomplete" - // 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" + SharedPrivateLinkResourceProvisioningStateSucceeded SharedPrivateLinkResourceProvisioningState = "Succeeded" + SharedPrivateLinkResourceProvisioningStateUpdating SharedPrivateLinkResourceProvisioningState = "Updating" ) // PossibleSharedPrivateLinkResourceProvisioningStateValues returns the possible values for the SharedPrivateLinkResourceProvisioningState const type. @@ -436,14 +368,10 @@ func PossibleSharedPrivateLinkResourceProvisioningStateValues() []SharedPrivateL type SharedPrivateLinkResourceStatus string const ( - // 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. + SharedPrivateLinkResourceStatusApproved SharedPrivateLinkResourceStatus = "Approved" SharedPrivateLinkResourceStatusDisconnected SharedPrivateLinkResourceStatus = "Disconnected" - // 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" + SharedPrivateLinkResourceStatusPending SharedPrivateLinkResourceStatus = "Pending" + SharedPrivateLinkResourceStatusRejected SharedPrivateLinkResourceStatus = "Rejected" ) // PossibleSharedPrivateLinkResourceStatusValues returns the possible values for the SharedPrivateLinkResourceStatus const type. @@ -464,7 +392,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 doesn't match naming requirements. + // UnavailableNameReasonInvalid - The search service name does not match naming requirements. UnavailableNameReasonInvalid UnavailableNameReason = "Invalid" ) diff --git a/sdk/resourcemanager/search/armsearch/fake/adminkeys_server.go b/sdk/resourcemanager/search/armsearch/fake/adminkeys_server.go index 990043dcb0ee..3b78ee08119b 100644 --- a/sdk/resourcemanager/search/armsearch/fake/adminkeys_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/adminkeys_server.go @@ -1,6 +1,3 @@ -//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. @@ -53,23 +50,42 @@ func (a *AdminKeysServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AdminKeysClient.Get": - resp, err = a.dispatchGet(req) - case "AdminKeysClient.Regenerate": - resp, err = a.dispatchRegenerate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AdminKeysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if adminKeysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = adminKeysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AdminKeysClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AdminKeysClient.Regenerate": + res.resp, res.err = a.dispatchRegenerate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AdminKeysServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -161,3 +177,9 @@ func (a *AdminKeysServerTransport) dispatchRegenerate(req *http.Request) (*http. } return resp, nil } + +// set this to conditionally intercept incoming requests to AdminKeysServerTransport +var adminKeysServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/internal.go b/sdk/resourcemanager/search/armsearch/fake/internal.go index 5a066550a12e..7a734bc1a6cd 100644 --- a/sdk/resourcemanager/search/armsearch/fake/internal.go +++ b/sdk/resourcemanager/search/armsearch/fake/internal.go @@ -1,6 +1,3 @@ -//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. @@ -15,6 +12,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/search/armsearch/fake/management_server.go b/sdk/resourcemanager/search/armsearch/fake/management_server.go index b658d18009a0..12da664dc2ab 100644 --- a/sdk/resourcemanager/search/armsearch/fake/management_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/management_server.go @@ -1,6 +1,3 @@ -//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. @@ -49,21 +46,40 @@ func (m *ManagementServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "ManagementClient.UsageBySubscriptionSKU": - resp, err = m.dispatchUsageBySubscriptionSKU(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *ManagementServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if managementServerTransportInterceptor != nil { + res.resp, res.err, intercepted = managementServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ManagementClient.UsageBySubscriptionSKU": + res.resp, res.err = m.dispatchUsageBySubscriptionSKU(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *ManagementServerTransport) dispatchUsageBySubscriptionSKU(req *http.Request) (*http.Response, error) { @@ -105,3 +121,9 @@ func (m *ManagementServerTransport) dispatchUsageBySubscriptionSKU(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to ManagementServerTransport +var managementServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/networksecurityperimeterconfigurations_server.go b/sdk/resourcemanager/search/armsearch/fake/networksecurityperimeterconfigurations_server.go deleted file mode 100644 index d98c04efbc5d..000000000000 --- a/sdk/resourcemanager/search/armsearch/fake/networksecurityperimeterconfigurations_server.go +++ /dev/null @@ -1,212 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. 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/operations_server.go b/sdk/resourcemanager/search/armsearch/fake/operations_server.go index 83ab81d0ee5f..97b95b65c073 100644 --- a/sdk/resourcemanager/search/armsearch/fake/operations_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/operations_server.go @@ -1,6 +1,3 @@ -//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. @@ -50,21 +47,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -90,3 +106,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/privateendpointconnections_server.go b/sdk/resourcemanager/search/armsearch/fake/privateendpointconnections_server.go index c9dcfcfc35bc..664d57ff92c7 100644 --- a/sdk/resourcemanager/search/armsearch/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/privateendpointconnections_server.go @@ -1,6 +1,3 @@ -//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. @@ -66,27 +63,46 @@ func (p *PrivateEndpointConnectionsServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateEndpointConnectionsClient.Delete": - resp, err = p.dispatchDelete(req) - case "PrivateEndpointConnectionsClient.Get": - resp, err = p.dispatchGet(req) - case "PrivateEndpointConnectionsClient.NewListByServicePager": - resp, err = p.dispatchNewListByServicePager(req) - case "PrivateEndpointConnectionsClient.Update": - resp, err = p.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateEndpointConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateEndpointConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateEndpointConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateEndpointConnectionsClient.Delete": + res.resp, res.err = p.dispatchDelete(req) + case "PrivateEndpointConnectionsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PrivateEndpointConnectionsClient.NewListByServicePager": + res.resp, res.err = p.dispatchNewListByServicePager(req) + case "PrivateEndpointConnectionsClient.Update": + res.resp, res.err = p.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateEndpointConnectionsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { @@ -272,3 +288,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchUpdate(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateEndpointConnectionsServerTransport +var privateEndpointConnectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/privatelinkresources_server.go b/sdk/resourcemanager/search/armsearch/fake/privatelinkresources_server.go index dc8c0eb64031..40d7a378fb3e 100644 --- a/sdk/resourcemanager/search/armsearch/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/privatelinkresources_server.go @@ -1,6 +1,3 @@ -//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. @@ -52,21 +49,40 @@ func (p *PrivateLinkResourcesServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PrivateLinkResourcesClient.NewListSupportedPager": - resp, err = p.dispatchNewListSupportedPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if privateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = privateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PrivateLinkResourcesClient.NewListSupportedPager": + res.resp, res.err = p.dispatchNewListSupportedPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PrivateLinkResourcesServerTransport) dispatchNewListSupportedPager(req *http.Request) (*http.Response, error) { @@ -113,3 +129,9 @@ func (p *PrivateLinkResourcesServerTransport) dispatchNewListSupportedPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to PrivateLinkResourcesServerTransport +var privateLinkResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/querykeys_server.go b/sdk/resourcemanager/search/armsearch/fake/querykeys_server.go index 526b0421f9eb..3d996c39e302 100644 --- a/sdk/resourcemanager/search/armsearch/fake/querykeys_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/querykeys_server.go @@ -1,6 +1,3 @@ -//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. @@ -62,25 +59,44 @@ func (q *QueryKeysServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return q.dispatchToMethodFake(req, method) +} - switch method { - case "QueryKeysClient.Create": - resp, err = q.dispatchCreate(req) - case "QueryKeysClient.Delete": - resp, err = q.dispatchDelete(req) - case "QueryKeysClient.NewListBySearchServicePager": - resp, err = q.dispatchNewListBySearchServicePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (q *QueryKeysServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if queryKeysServerTransportInterceptor != nil { + res.resp, res.err, intercepted = queryKeysServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "QueryKeysClient.Create": + res.resp, res.err = q.dispatchCreate(req) + case "QueryKeysClient.Delete": + res.resp, res.err = q.dispatchDelete(req) + case "QueryKeysClient.NewListBySearchServicePager": + res.resp, res.err = q.dispatchNewListBySearchServicePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (q *QueryKeysServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -218,3 +234,9 @@ func (q *QueryKeysServerTransport) dispatchNewListBySearchServicePager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to QueryKeysServerTransport +var queryKeysServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/server_factory.go b/sdk/resourcemanager/search/armsearch/fake/server_factory.go index 29a400fc0941..ff7b72d6090e 100644 --- a/sdk/resourcemanager/search/armsearch/fake/server_factory.go +++ b/sdk/resourcemanager/search/armsearch/fake/server_factory.go @@ -1,6 +1,3 @@ -//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. @@ -19,16 +16,32 @@ import ( // ServerFactory is a fake server for instances of the armsearch.ClientFactory type. type ServerFactory struct { - AdminKeysServer AdminKeysServer - ManagementServer ManagementServer - NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer - OperationsServer OperationsServer - PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer - PrivateLinkResourcesServer PrivateLinkResourcesServer - QueryKeysServer QueryKeysServer - ServicesServer ServicesServer - SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer - UsagesServer UsagesServer + // AdminKeysServer contains the fakes for client AdminKeysClient + AdminKeysServer AdminKeysServer + + // ManagementServer contains the fakes for client ManagementClient + ManagementServer ManagementServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // PrivateEndpointConnectionsServer contains the fakes for client PrivateEndpointConnectionsClient + PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer + + // PrivateLinkResourcesServer contains the fakes for client PrivateLinkResourcesClient + PrivateLinkResourcesServer PrivateLinkResourcesServer + + // QueryKeysServer contains the fakes for client QueryKeysClient + QueryKeysServer QueryKeysServer + + // ServicesServer contains the fakes for client ServicesClient + ServicesServer ServicesServer + + // SharedPrivateLinkResourcesServer contains the fakes for client SharedPrivateLinkResourcesClient + SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer + + // UsagesServer contains the fakes for client UsagesClient + UsagesServer UsagesServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -43,18 +56,17 @@ 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 - trNetworkSecurityPerimeterConfigurationsServer *NetworkSecurityPerimeterConfigurationsServerTransport - trOperationsServer *OperationsServerTransport - trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport - trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport - trQueryKeysServer *QueryKeysServerTransport - trServicesServer *ServicesServerTransport - trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport - trUsagesServer *UsagesServerTransport + srv *ServerFactory + trMu sync.Mutex + trAdminKeysServer *AdminKeysServerTransport + trManagementServer *ManagementServerTransport + trOperationsServer *OperationsServerTransport + trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport + trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport + trQueryKeysServer *QueryKeysServerTransport + trServicesServer *ServicesServerTransport + trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport + trUsagesServer *UsagesServerTransport } // Do implements the policy.Transporter interface for ServerFactoryTransport. @@ -76,11 +88,6 @@ 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/fake/services_server.go b/sdk/resourcemanager/search/armsearch/fake/services_server.go index 2f9475f201b8..f63882a4e473 100644 --- a/sdk/resourcemanager/search/armsearch/fake/services_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/services_server.go @@ -1,6 +1,3 @@ -//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. @@ -82,33 +79,52 @@ func (s *ServicesServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServicesClient.CheckNameAvailability": - resp, err = s.dispatchCheckNameAvailability(req) - case "ServicesClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "ServicesClient.Delete": - resp, err = s.dispatchDelete(req) - case "ServicesClient.Get": - resp, err = s.dispatchGet(req) - case "ServicesClient.NewListByResourceGroupPager": - resp, err = s.dispatchNewListByResourceGroupPager(req) - case "ServicesClient.NewListBySubscriptionPager": - resp, err = s.dispatchNewListBySubscriptionPager(req) - case "ServicesClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServicesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if servicesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = servicesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServicesClient.CheckNameAvailability": + res.resp, res.err = s.dispatchCheckNameAvailability(req) + case "ServicesClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "ServicesClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "ServicesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServicesClient.NewListByResourceGroupPager": + res.resp, res.err = s.dispatchNewListByResourceGroupPager(req) + case "ServicesClient.NewListBySubscriptionPager": + res.resp, res.err = s.dispatchNewListBySubscriptionPager(req) + case "ServicesClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServicesServerTransport) dispatchCheckNameAvailability(req *http.Request) (*http.Response, error) { @@ -409,3 +425,9 @@ func (s *ServicesServerTransport) dispatchUpdate(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to ServicesServerTransport +var servicesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/sharedprivatelinkresources_server.go b/sdk/resourcemanager/search/armsearch/fake/sharedprivatelinkresources_server.go index 5da0ae7846fb..dab3ef7f81da 100644 --- a/sdk/resourcemanager/search/armsearch/fake/sharedprivatelinkresources_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/sharedprivatelinkresources_server.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type SharedPrivateLinkResourcesServer struct { BeginCreateOrUpdate func(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, sharedPrivateLinkResource armsearch.SharedPrivateLinkResource, searchManagementRequestOptions *armsearch.SearchManagementRequestOptions, options *armsearch.SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (resp azfake.PollerResponder[armsearch.SharedPrivateLinkResourcesClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) // BeginDelete is the fake for method SharedPrivateLinkResourcesClient.BeginDelete - // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent, http.StatusNotFound + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound BeginDelete func(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *armsearch.SearchManagementRequestOptions, options *armsearch.SharedPrivateLinkResourcesClientBeginDeleteOptions) (resp azfake.PollerResponder[armsearch.SharedPrivateLinkResourcesClientDeleteResponse], errResp azfake.ErrorResponder) // Get is the fake for method SharedPrivateLinkResourcesClient.Get @@ -70,27 +67,46 @@ func (s *SharedPrivateLinkResourcesServerTransport) Do(req *http.Request) (*http return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SharedPrivateLinkResourcesClient.BeginCreateOrUpdate": - resp, err = s.dispatchBeginCreateOrUpdate(req) - case "SharedPrivateLinkResourcesClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "SharedPrivateLinkResourcesClient.Get": - resp, err = s.dispatchGet(req) - case "SharedPrivateLinkResourcesClient.NewListByServicePager": - resp, err = s.dispatchNewListByServicePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SharedPrivateLinkResourcesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if sharedPrivateLinkResourcesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sharedPrivateLinkResourcesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SharedPrivateLinkResourcesClient.BeginCreateOrUpdate": + res.resp, res.err = s.dispatchBeginCreateOrUpdate(req) + case "SharedPrivateLinkResourcesClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "SharedPrivateLinkResourcesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SharedPrivateLinkResourcesClient.NewListByServicePager": + res.resp, res.err = s.dispatchNewListByServicePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SharedPrivateLinkResourcesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -196,9 +212,9 @@ func (s *SharedPrivateLinkResourcesServerTransport) dispatchBeginDelete(req *htt return nil, err } - if !contains([]int{http.StatusAccepted, http.StatusNoContent, http.StatusNotFound}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound}, resp.StatusCode) { s.beginDelete.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted, http.StatusNoContent, http.StatusNotFound", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound", resp.StatusCode)} } if !server.PollerResponderMore(beginDelete) { s.beginDelete.remove(req) @@ -298,3 +314,9 @@ func (s *SharedPrivateLinkResourcesServerTransport) dispatchNewListByServicePage } return resp, nil } + +// set this to conditionally intercept incoming requests to SharedPrivateLinkResourcesServerTransport +var sharedPrivateLinkResourcesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/fake/usages_server.go b/sdk/resourcemanager/search/armsearch/fake/usages_server.go index 0c7f039964f9..3ee7476492d3 100644 --- a/sdk/resourcemanager/search/armsearch/fake/usages_server.go +++ b/sdk/resourcemanager/search/armsearch/fake/usages_server.go @@ -1,6 +1,3 @@ -//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. @@ -53,21 +50,40 @@ func (u *UsagesServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return u.dispatchToMethodFake(req, method) +} - switch method { - case "UsagesClient.NewListBySubscriptionPager": - resp, err = u.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (u *UsagesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if usagesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = usagesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "UsagesClient.NewListBySubscriptionPager": + res.resp, res.err = u.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (u *UsagesServerTransport) dispatchNewListBySubscriptionPager(req *http.Request) (*http.Response, error) { @@ -113,3 +129,9 @@ func (u *UsagesServerTransport) dispatchNewListBySubscriptionPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to UsagesServerTransport +var usagesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/search/armsearch/go.mod b/sdk/resourcemanager/search/armsearch/go.mod index 3c9a1476ee51..1f43a2b1d63c 100644 --- a/sdk/resourcemanager/search/armsearch/go.mod +++ b/sdk/resourcemanager/search/armsearch/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/sdk/resourcemanager/search/armsearch/management_client.go b/sdk/resourcemanager/search/armsearch/management_client.go index 7dd8a16e41cf..30e07527992d 100644 --- a/sdk/resourcemanager/search/armsearch/management_client.go +++ b/sdk/resourcemanager/search/armsearch/management_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type ManagementClient struct { // NewManagementClient creates a new instance of ManagementClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error) { @@ -44,10 +41,10 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia return client, nil } -// UsageBySubscriptionSKU - Gets the quota usage for a search sku in the given subscription. +// 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 2024-06-01-preview +// Generated from API version 2025-05-01 // - location - The unique location name for a Microsoft Azure geographic region. // - skuName - The unique SKU name that identifies a billable tier. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get @@ -77,7 +74,7 @@ func (client *ManagementClient) UsageBySubscriptionSKU(ctx context.Context, loca } // usageBySubscriptionSKUCreateRequest creates the UsageBySubscriptionSKU request. -func (client *ManagementClient) usageBySubscriptionSKUCreateRequest(ctx context.Context, location string, skuName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ManagementClientUsageBySubscriptionSKUOptions) (*policy.Request, error) { +func (client *ManagementClient) usageBySubscriptionSKUCreateRequest(ctx context.Context, location string, skuName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ManagementClientUsageBySubscriptionSKUOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/{skuName}" if location == "" { return nil, errors.New("parameter location cannot be empty") @@ -96,7 +93,7 @@ func (client *ManagementClient) usageBySubscriptionSKUCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/management_client_example_test.go b/sdk/resourcemanager/search/armsearch/management_client_example_test.go deleted file mode 100644 index e4d632d6dc49..000000000000 --- a/sdk/resourcemanager/search/armsearch/management_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetQuotaUsage.json -func ExampleManagementClient_UsageBySubscriptionSKU() { - 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.NewManagementClient().UsageBySubscriptionSKU(ctx, "westus", "free", &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.QuotaUsageResult = armsearch.QuotaUsageResult{ - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("F - Free"), - // Value: to.Ptr("free"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/{skuName}"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // } -} diff --git a/sdk/resourcemanager/search/armsearch/models.go b/sdk/resourcemanager/search/armsearch/models.go index a6e161fcc370..665d86b2907c 100644 --- a/sdk/resourcemanager/search/armsearch/models.go +++ b/sdk/resourcemanager/search/armsearch/models.go @@ -1,6 +1,3 @@ -//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. @@ -8,7 +5,7 @@ package armsearch -// AdminKeyResult - Response containing the primary and secondary admin API keys for a given Azure AI Search service. +// AdminKeyResult - Response containing the primary and secondary admin API keys for a given search service. type AdminKeyResult struct { // READ-ONLY; The primary admin API key of the search service. PrimaryKey *string @@ -62,36 +59,29 @@ type DataPlaneAuthOptions struct { } // 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 compliance if it finds objects that aren't encrypted with the customer-managed - // key. + // Describes how a search service should enforce having one or more non-customer-encrypted resources. Enforcement *SearchEncryptionWithCmk - // 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. + // 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'. EncryptionComplianceStatus *SearchEncryptionComplianceStatus } -// IPRule - The IP restriction rule of the Azure AI Search service. +// IPRule - The IP restriction rule of the 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 corresponding to a single IPv4 address (for example, 123.1.2.3) or an IP range in CIDR format (for example, 123.1.2.3/24) + // to be allowed. Value *string } -// Identity - Details about the search service identity. A null value indicates that the search service has no identity assigned. +// Identity for the resource. type Identity struct { - // 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. + // REQUIRED; The identity type. 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 @@ -99,157 +89,31 @@ type Identity struct { TenantID *string } -// ListQueryKeysResult - Response containing the query API keys for a given Azure AI Search service. +// ListQueryKeysResult - Response containing the query API keys for a given 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 AI Search service. + // READ-ONLY; The query keys for the search service. Value []*QueryKey } -// 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. +// NetworkRuleSet - Network-specific rules that determine how the search service can 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 - // over public interface is not allowed even with any public IP rules, and private - // endpoint connections would be the exclusive access method. + // A list of IP restriction rules used for an IP firewall. Any IPs that do not match the rules are blocked by the firewall. + // These rules are only applied when the 'publicNetworkAccess' of the search + // service is 'enabled'. 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. @@ -273,74 +137,13 @@ 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 by Azure AI Search, some supported by the resource provider and others by data plane - // APIs. + // READ-ONLY; The list of operations supported by the resource provider. Value []*Operation } -// 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. +// PrivateEndpointConnection - Describes an existing private endpoint connection to the search service. type PrivateEndpointConnection struct { - // Describes the properties of an existing private endpoint connection to the Azure AI Search service. + // Describes the properties of an existing private endpoint connection to the search service. Properties *PrivateEndpointConnectionProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -353,41 +156,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 search +// PrivateEndpointConnectionProperties - Describes the properties of an existing Private Endpoint connection to the search // service. type PrivateEndpointConnectionProperties struct { - // The group ID of the Azure resource for which the private link service is for. + // The group id from the provider of resource the private link service connection is for. GroupID *string // The private endpoint resource from Microsoft.Network provider. PrivateEndpoint *PrivateEndpointConnectionPropertiesPrivateEndpoint - // Describes the current state of an existing Azure Private Link service connection to the private endpoint. + // Describes the current state of an existing Private Link Service connection to the Azure Private Endpoint. PrivateLinkServiceConnectionState *PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState // The provisioning state of the private link service connection. Valid values are Updating, Deleting, Failed, Succeeded, - // Incomplete, or Canceled. + // or Incomplete 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 Azure -// Private Link service connection to the private endpoint. +// PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState - Describes the current state of an existing Private +// Link Service connection to the Azure Private Endpoint. type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState struct { // A description of any extra actions that may be required. ActionsRequired *string @@ -399,7 +202,7 @@ type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState struct Status *PrivateLinkServiceConnectionStatus } -// PrivateLinkResource - Describes a supported private link resource for the Azure AI Search service. +// PrivateLinkResource - Describes a supported private link resource for the 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 @@ -407,16 +210,15 @@ 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 AI Search service. + // READ-ONLY; Describes the properties of a supported private link resource for the 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 AI 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 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 @@ -427,7 +229,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 AI Search. + // READ-ONLY; The list of resources that are onboarded to private link service and that are supported by search. ShareablePrivateLinkResourceTypes []*ShareablePrivateLinkResourceType } @@ -437,14 +239,12 @@ type PrivateLinkResourcesResult struct { Value []*PrivateLinkResource } -// QueryKey - Describes an API key for a given Azure AI Search service that conveys read-only permissions on the docs collection -// of an index. +// QueryKey - Describes an API key for a given search service that has permissions for query operations only. type QueryKey struct { // READ-ONLY; The value of the query API key. Key *string - // 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. + // READ-ONLY; The name of the query API key; may be empty. Name *string } @@ -497,7 +297,7 @@ type SKU struct { Name *SKUName } -// Service - Describes an Azure AI Search service and its current state. +// Service - Describes a search service and its current state. type Service struct { // REQUIRED; The geo-location where the resource lives Location *string @@ -508,7 +308,7 @@ 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 + // The SKU of the search service, which determines billing rate and capacity limits. This property is required when creating // a new search service. SKU *SKU @@ -525,7 +325,7 @@ type Service struct { Type *string } -// ServiceListResult - Response containing a list of Azure AI Search services. +// ServiceListResult - Response containing a list of 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. @@ -545,11 +345,6 @@ 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 @@ -559,7 +354,7 @@ type ServiceProperties struct { // 'default'. HostingMode *HostingMode - // Network specific rules that determine how the Azure AI Search service may be reached. + // Network-specific rules that determine how the 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 @@ -576,27 +371,23 @@ 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 AI - // Search SKUs in certain locations. + // Sets options that control the availability of semantic search. This configuration is only possible for certain search SKUs + // in certain locations. SemanticSearch *SearchSemanticSearch - // 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. + // READ-ONLY; The list of private endpoint connections to the search service. PrivateEndpointConnections []*PrivateEndpointConnection // READ-ONLY; The state of the last provisioning operation performed on the search service. Provisioning is an intermediate // state that occurs while service capacity is being established. After capacity is set up, - // provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended + // provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended // polling interval is from 30 seconds to one minute) by using the Get // Search Service operation to see when an operation is completed. If you are using the free service, this value tends to - // come back as 'Succeeded' directly in the call to Create search service. This is + // come back as 'succeeded' directly in the call to Create search service. This is // 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 AI Search service. + // READ-ONLY; The list of shared private link resources managed by the search service. SharedPrivateLinkResources []*SharedPrivateLinkResource // READ-ONLY; The status of the search service. Possible values include: 'running': The search service is running and no provisioning @@ -605,19 +396,18 @@ 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. '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. + // 'error': The search service is in an error state. If your service is in the degraded, disabled, or error states, Microsoft + // 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 AI Search service. +// ServiceUpdate - The parameters used to update a search service. type ServiceUpdate struct { - // Details about the search service identity. A null value indicates that the search service has no identity assigned. + // The identity of the resource. Identity *Identity // The geographic location of the resource. This must be one of the supported and registered Azure geo regions (for example, @@ -628,7 +418,7 @@ 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 + // The SKU of the search service, which determines the billing rate and capacity limits. This property is required when creating // a new search service. SKU *SKU @@ -646,35 +436,35 @@ type ServiceUpdate struct { } // ShareablePrivateLinkResourceProperties - Describes the properties of a resource type that has been onboarded to private -// link service, supported by Azure AI Search. +// link service and that's supported by search. type ShareablePrivateLinkResourceProperties struct { - // READ-ONLY; The description of the resource type that has been onboarded to private link service, supported by Azure AI - // Search. + // READ-ONLY; The description of the resource type that has been onboarded to private link service and that's supported by + // search. Description *string - // READ-ONLY; The resource provider group id for the resource that has been onboarded to private link service, supported by - // Azure AI Search. + // READ-ONLY; The resource provider group id for the resource that has been onboarded to private link service and that's supported + // by search. GroupID *string - // READ-ONLY; The resource provider type for the resource that has been onboarded to private link service, supported by Azure - // AI Search. + // READ-ONLY; The resource provider type for the resource that has been onboarded to private link service and that's supported + // by search. Type *string } -// ShareablePrivateLinkResourceType - Describes an resource type that has been onboarded to private link service, supported -// by Azure AI Search. +// ShareablePrivateLinkResourceType - Describes a resource type that has been onboarded to private link service and that's +// supported by search. type ShareablePrivateLinkResourceType struct { - // READ-ONLY; The name of the resource type that has been onboarded to private link service, supported by Azure AI Search. + // READ-ONLY; The name of the resource type that has been onboarded to private link service and that's supported by search. Name *string - // READ-ONLY; Describes the properties of a resource type that has been onboarded to private link service, supported by Azure - // AI Search. + // READ-ONLY; Describes the properties of a resource type that has been onboarded to private link service and that's supported + // by search. Properties *ShareablePrivateLinkResourceProperties } -// SharedPrivateLinkResource - Describes a shared private link resource managed by the Azure AI Search service. +// SharedPrivateLinkResource - Describes a Shared Private Link Resource managed by the search service. type SharedPrivateLinkResource struct { - // Describes the properties of a shared private link resource managed by the Azure AI Search service. + // Describes the properties of a Shared Private Link Resource managed by the search service. Properties *SharedPrivateLinkResourceProperties // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -687,44 +477,35 @@ 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 AI Search service. +// SharedPrivateLinkResourceProperties - Describes the properties of an existing Shared Private Link Resource managed by the +// 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. Valid values are Updating, Deleting, Failed, Succeeded or Incomplete. ProvisioningState *SharedPrivateLinkResourceProvisioningState - // The message for requesting approval of the shared private link resource. + // The request 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 for which a shared private link is - // being 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 to which a shared private link is + // to be 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. 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 32cdd69b995d..eda9c9cef92e 100644 --- a/sdk/resourcemanager/search/armsearch/models_serde.go +++ b/sdk/resourcemanager/search/armsearch/models_serde.go @@ -1,6 +1,3 @@ -//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. @@ -234,7 +231,6 @@ 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) } @@ -256,9 +252,6 @@ 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) @@ -298,294 +291,9 @@ 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) } @@ -599,9 +307,6 @@ 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) @@ -613,127 +318,11 @@ 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) } @@ -749,49 +338,9 @@ 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) @@ -870,181 +419,6 @@ 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) @@ -1575,8 +949,6 @@ 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) @@ -1607,12 +979,6 @@ 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) @@ -1895,37 +1261,6 @@ 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 diff --git a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go deleted file mode 100644 index 2575eb352676..000000000000 --- a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go +++ /dev/null @@ -1,269 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. 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-06-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-06-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-06-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-06-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-06-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-06-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-06-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 deleted file mode 100644 index 82ca376b8bae..000000000000 --- a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-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 5cd88b29d96a..93d61193c9ab 100644 --- a/sdk/resourcemanager/search/armsearch/operations_client.go +++ b/sdk/resourcemanager/search/armsearch/operations_client.go @@ -1,6 +1,3 @@ -//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. @@ -39,7 +36,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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]{ @@ -66,14 +63,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Search/operations" 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-06-01-preview") + reqQP.Set("api-version", "2025-05-01") 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 deleted file mode 100644 index fa34a5be3a14..000000000000 --- a/sdk/resourcemanager/search/armsearch/operations_client_example_test.go +++ /dev/null @@ -1,644 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListOperations.json -func ExampleOperationsClient_NewListPager() { - 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.NewOperationsClient().NewListPager(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.OperationListResult = armsearch.OperationListResult{ - // Value: []*armsearch.Operation{ - // { - // Name: to.Ptr("Microsoft.Search/operations/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Lists all of the available operations of the Microsoft.Search provider."), - // Operation: to.Ptr("List all available operations"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Registers the subscription for the search resource provider and enables the creation of search services."), - // Operation: to.Ptr("Register the Search Resource Provider"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates or updates the search service."), - // Operation: to.Ptr("Set Search Service"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Reads the search service."), - // Operation: to.Ptr("Get Search Service"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes the search service."), - // Operation: to.Ptr("Delete Search Service"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Starts the search service."), - // Operation: to.Ptr("Start Search Service"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Stops the search service."), - // Operation: to.Ptr("Stop Search Service"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Reads the admin keys."), - // Operation: to.Ptr("Get Admin Key"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Regenerates the admin key."), - // Operation: to.Ptr("Regenerate Admin Key"), - // 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 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates the query key."), - // Operation: to.Ptr("Create Query Key"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes the query key."), - // Operation: to.Ptr("Delete Query Key"), - // 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"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Checks availability of the service name."), - // Operation: to.Ptr("Check Service Name Availability"), - // 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 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."), - // 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."), - // 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."), - // 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 (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."), - // 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."), - // 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."), - // 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 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 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 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."), - // 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."), - // 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."), - // 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."), - // 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 1de6e7a789df..d756d414edb5 100644 --- a/sdk/resourcemanager/search/armsearch/options.go +++ b/sdk/resourcemanager/search/armsearch/options.go @@ -1,6 +1,3 @@ -//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. @@ -24,25 +21,6 @@ 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 @@ -103,7 +81,7 @@ type SearchManagementRequestOptions struct { // ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. type ServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -143,14 +121,14 @@ type ServicesClientUpdateOptions struct { // SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreateOrUpdate // method. type SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete // method. type SharedPrivateLinkResourcesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } diff --git a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go index 78e857b7c8b1..dee76245e69a 100644 --- a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go +++ b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type PrivateEndpointConnectionsClient struct { // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { @@ -47,12 +44,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. -// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified -// resource group. +// - searchServiceName - The name of the search service associated with the specified resource group. +// - privateEndpointConnectionName - The name of the private endpoint connection to the 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 @@ -80,7 +77,7 @@ func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, reso } // deleteCreateRequest creates the Delete request. -func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *PrivateEndpointConnectionsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -103,7 +100,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -124,12 +121,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. -// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified -// resource group. +// - searchServiceName - The name of the search service associated with the specified resource group. +// - privateEndpointConnectionName - The name of the private endpoint connection to the 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 @@ -157,7 +154,7 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -180,7 +177,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -200,10 +197,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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 @@ -232,7 +229,7 @@ func (client *PrivateEndpointConnectionsClient) NewListByServicePager(resourceGr } // listByServiceCreateRequest creates the ListByService request. -func (client *PrivateEndpointConnectionsClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientListByServiceOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *PrivateEndpointConnectionsClientListByServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -251,7 +248,7 @@ func (client *PrivateEndpointConnectionsClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -269,15 +266,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. -// - privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified -// resource group. +// - searchServiceName - The name of the search service associated with the specified resource group. +// - privateEndpointConnectionName - The name of the private endpoint connection to the 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. @@ -306,7 +303,7 @@ func (client *PrivateEndpointConnectionsClient) Update(ctx context.Context, reso } // updateCreateRequest creates the Update request. -func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientUpdateOptions) (*policy.Request, error) { +func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, searchManagementRequestOptions *SearchManagementRequestOptions, _ *PrivateEndpointConnectionsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateEndpointConnections/{privateEndpointConnectionName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -329,7 +326,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go deleted file mode 100644 index b7d0aa970239..000000000000 --- a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/UpdatePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Update() { - 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.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."), - Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusRejected), - }, - }, - }, &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.PrivateEndpointConnection = armsearch.PrivateEndpointConnection{ - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr("Rejected for some reason."), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusRejected), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_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.NewPrivateEndpointConnectionsClient().Get(ctx, "rg1", "mysearchservice", "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546", &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.PrivateEndpointConnection = armsearch.PrivateEndpointConnection{ - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusApproved), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - 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.NewPrivateEndpointConnectionsClient().Delete(ctx, "rg1", "mysearchservice", "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546", &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.PrivateEndpointConnection = armsearch.PrivateEndpointConnection{ - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusDisconnected), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListPrivateEndpointConnectionsByService.json -func ExamplePrivateEndpointConnectionsClient_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.NewPrivateEndpointConnectionsClient().NewListByServicePager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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.PrivateEndpointConnectionListResult = armsearch.PrivateEndpointConnectionListResult{ - // Value: []*armsearch.PrivateEndpointConnection{ - // { - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusApproved), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go index e69d28c0316d..9d32d68daadc 100644 --- a/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go +++ b/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type PrivateLinkResourcesClient struct { // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { @@ -46,10 +43,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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 @@ -79,7 +76,7 @@ func (client *PrivateLinkResourcesClient) NewListSupportedPager(resourceGroupNam } // listSupportedCreateRequest creates the ListSupported request. -func (client *PrivateLinkResourcesClient) listSupportedCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateLinkResourcesClientListSupportedOptions) (*policy.Request, error) { +func (client *PrivateLinkResourcesClient) listSupportedCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *PrivateLinkResourcesClientListSupportedOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *PrivateLinkResourcesClient) listSupportedCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go b/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go deleted file mode 100644 index b9448355f126..000000000000 --- a/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListSupportedPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { - 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.NewPrivateLinkResourcesClient().NewListSupportedPager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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.PrivateLinkResourcesResult = armsearch.PrivateLinkResourcesResult{ - // Value: []*armsearch.PrivateLinkResource{ - // { - // Name: to.Ptr("searchService"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateLinkResources/searchService"), - // Properties: &armsearch.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("searchService"), - // RequiredMembers: []*string{ - // to.Ptr("searchService")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.search.windows.net")}, - // ShareablePrivateLinkResourceTypes: []*armsearch.ShareablePrivateLinkResourceType{ - // { - // Name: to.Ptr("blob"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Storage/storageAccounts"), - // 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"), - // }, - // }, - // { - // Name: to.Ptr("table"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Storage/storageAccounts"), - // 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"), - // }, - // }, - // { - // Name: to.Ptr("Sql"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // 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"), - // }, - // }, - // { - // Name: to.Ptr("plr"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Sql/servers"), - // 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"), - // }, - // }, - // { - // Name: to.Ptr("vault"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // 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"), - // }, - // }, - // { - // Name: to.Ptr("plr"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // Description: to.Ptr("Azure AI Search indexers can connect to MySQL databases for reading data from an indexer data source."), - // GroupID: to.Ptr("mysqlServer"), - // }, - // }, - // { - // Name: to.Ptr("site"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Web/sites"), - // 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 f8d2e9d01837..f0a1e3a1ade7 100644 --- a/sdk/resourcemanager/search/armsearch/querykeys_client.go +++ b/sdk/resourcemanager/search/armsearch/querykeys_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type QueryKeysClient struct { // NewQueryKeysClient creates a new instance of QueryKeysClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewQueryKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueryKeysClient, error) { @@ -47,10 +44,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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. @@ -78,7 +75,7 @@ func (client *QueryKeysClient) Create(ctx context.Context, resourceGroupName str } // createCreateRequest creates the Create request. -func (client *QueryKeysClient) createCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, name string, searchManagementRequestOptions *SearchManagementRequestOptions, options *QueryKeysClientCreateOptions) (*policy.Request, error) { +func (client *QueryKeysClient) createCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, name string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *QueryKeysClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/createQueryKey/{name}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -101,7 +98,7 @@ func (client *QueryKeysClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -123,10 +120,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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. @@ -153,7 +150,7 @@ func (client *QueryKeysClient) Delete(ctx context.Context, resourceGroupName str } // deleteCreateRequest creates the Delete request. -func (client *QueryKeysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, key string, searchManagementRequestOptions *SearchManagementRequestOptions, options *QueryKeysClientDeleteOptions) (*policy.Request, error) { +func (client *QueryKeysClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, key string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *QueryKeysClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/deleteQueryKey/{key}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -176,7 +173,7 @@ func (client *QueryKeysClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -185,12 +182,12 @@ func (client *QueryKeysClient) deleteCreateRequest(ctx context.Context, resource return req, nil } -// NewListBySearchServicePager - Returns the list of query API keys for the given Azure AI Search service. +// NewListBySearchServicePager - Returns the list of query API keys for the given search service. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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 @@ -219,7 +216,7 @@ func (client *QueryKeysClient) NewListBySearchServicePager(resourceGroupName str } // listBySearchServiceCreateRequest creates the ListBySearchService request. -func (client *QueryKeysClient) listBySearchServiceCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *QueryKeysClientListBySearchServiceOptions) (*policy.Request, error) { +func (client *QueryKeysClient) listBySearchServiceCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *QueryKeysClientListBySearchServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/listQueryKeys" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -238,7 +235,7 @@ func (client *QueryKeysClient) listBySearchServiceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go b/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go deleted file mode 100644 index 6cfed2ef61b4..000000000000 --- a/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateQueryKey.json -func ExampleQueryKeysClient_Create() { - 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.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) - } - // 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.QueryKey = armsearch.QueryKey{ - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListQueryKeysBySearchService.json -func ExampleQueryKeysClient_NewListBySearchServicePager() { - 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.NewQueryKeysClient().NewListBySearchServicePager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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.ListQueryKeysResult = armsearch.ListQueryKeysResult{ - // Value: []*armsearch.QueryKey{ - // { - // Name: to.Ptr("Query key for browser-based clients"), - // Key: to.Ptr(""), - // }, - // { - // Name: to.Ptr("Query key for mobile clients"), - // Key: to.Ptr(""), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchDeleteQueryKey.json -func ExampleQueryKeysClient_Delete() { - 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) - } - _, err = clientFactory.NewQueryKeysClient().Delete(ctx, "rg1", "mysearchservice", "", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/search/armsearch/responses.go b/sdk/resourcemanager/search/armsearch/responses.go index 6b49eac7fe19..8146155e355d 100644 --- a/sdk/resourcemanager/search/armsearch/responses.go +++ b/sdk/resourcemanager/search/armsearch/responses.go @@ -1,6 +1,3 @@ -//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. @@ -10,13 +7,13 @@ 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 AI Search service. + // Response containing the primary and secondary admin API keys for a given 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 AI Search service. + // Response containing the primary and secondary admin API keys for a given search service. AdminKeyResult } @@ -26,23 +23,6 @@ type ManagementClientUsageBySubscriptionSKUResponse struct { 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 @@ -52,25 +32,25 @@ type OperationsClientListResponse struct { // PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. type PrivateEndpointConnectionsClientDeleteResponse struct { - // Describes an existing private endpoint connection to the Azure AI Search service. + // Describes an existing private endpoint connection to the search service. PrivateEndpointConnection } // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { - // Describes an existing private endpoint connection to the Azure AI Search service. + // Describes an existing private endpoint connection to the 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 AI Search service. + // Describes an existing private endpoint connection to the search service. PrivateEndpointConnection } @@ -82,8 +62,7 @@ type PrivateLinkResourcesClientListSupportedResponse struct { // QueryKeysClientCreateResponse contains the response from method QueryKeysClient.Create. type QueryKeysClientCreateResponse struct { - // Describes an API key for a given Azure AI Search service that conveys read-only permissions on the docs collection of an - // index. + // Describes an API key for a given search service that has permissions for query operations only. QueryKey } @@ -94,7 +73,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 AI Search service. + // Response containing the query API keys for a given search service. ListQueryKeysResult } @@ -106,7 +85,7 @@ type ServicesClientCheckNameAvailabilityResponse struct { // ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { - // Describes an Azure AI Search service and its current state. + // Describes a search service and its current state. Service } @@ -117,31 +96,31 @@ type ServicesClientDeleteResponse struct { // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { - // Describes an Azure AI Search service and its current state. + // Describes a search service and its current state. Service } // ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager. type ServicesClientListByResourceGroupResponse struct { - // Response containing a list of Azure AI Search services. + // Response containing a list of search services. ServiceListResult } // ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager. type ServicesClientListBySubscriptionResponse struct { - // Response containing a list of Azure AI Search services. + // Response containing a list of search services. ServiceListResult } // ServicesClientUpdateResponse contains the response from method ServicesClient.Update. type ServicesClientUpdateResponse struct { - // Describes an Azure AI Search service and its current state. + // Describes a 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 AI Search service. + // Describes a Shared Private Link Resource managed by the search service. SharedPrivateLinkResource } @@ -152,13 +131,13 @@ type SharedPrivateLinkResourcesClientDeleteResponse struct { // SharedPrivateLinkResourcesClientGetResponse contains the response from method SharedPrivateLinkResourcesClient.Get. type SharedPrivateLinkResourcesClientGetResponse struct { - // Describes a shared private link resource managed by the Azure AI Search service. + // Describes a Shared Private Link Resource managed by the 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 } diff --git a/sdk/resourcemanager/search/armsearch/services_client.go b/sdk/resourcemanager/search/armsearch/services_client.go index 66e72d32a30c..cacd13488202 100644 --- a/sdk/resourcemanager/search/armsearch/services_client.go +++ b/sdk/resourcemanager/search/armsearch/services_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type ServicesClient struct { // NewServicesClient creates a new instance of ServicesClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error) { @@ -48,7 +45,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - checkNameAvailabilityInput - The resource name and type to check. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -77,7 +74,7 @@ func (client *ServicesClient) CheckNameAvailability(ctx context.Context, checkNa } // checkNameAvailabilityCreateRequest creates the CheckNameAvailability request. -func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientCheckNameAvailabilityOptions) (*policy.Request, error) { +func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ServicesClientCheckNameAvailabilityOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Search/checkNameAvailability" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -88,7 +85,7 @@ func (client *ServicesClient) checkNameAvailabilityCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -113,14 +110,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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 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 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 +144,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 2024-06-01-preview +// Generated from API version 2025-05-01 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" @@ -170,7 +167,7 @@ func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupN } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ServicesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -189,7 +186,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -204,10 +201,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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. @@ -233,7 +230,7 @@ func (client *ServicesClient) Delete(ctx context.Context, resourceGroupName stri } // deleteCreateRequest creates the Delete request. -func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientDeleteOptions) (*policy.Request, error) { +func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ServicesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -252,7 +249,7 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -264,10 +261,10 @@ func (client *ServicesClient) deleteCreateRequest(ctx context.Context, resourceG // 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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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. @@ -294,7 +291,7 @@ func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientGetOptions) (*policy.Request, error) { +func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ServicesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -313,7 +310,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -333,7 +330,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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 @@ -364,7 +361,7 @@ func (client *ServicesClient) NewListByResourceGroupPager(resourceGroupName stri } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ServicesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -379,7 +376,7 @@ func (client *ServicesClient) listByResourceGroupCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -399,7 +396,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Gets a list of all Search services in the given subscription. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-05-01 // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager @@ -428,7 +425,7 @@ func (client *ServicesClient) NewListBySubscriptionPager(searchManagementRequest } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Context, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Context, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ServicesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Search/searchServices" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -439,7 +436,7 @@ func (client *ServicesClient) listBySubscriptionCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -460,10 +457,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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 to update. +// - searchServiceName - The name of the 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. @@ -491,7 +488,7 @@ func (client *ServicesClient) Update(ctx context.Context, resourceGroupName stri } // updateCreateRequest creates the Update request. -func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, service ServiceUpdate, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientUpdateOptions) (*policy.Request, error) { +func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, service ServiceUpdate, searchManagementRequestOptions *SearchManagementRequestOptions, _ *ServicesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -510,7 +507,7 @@ func (client *ServicesClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/services_client_example_test.go b/sdk/resourcemanager/search/armsearch/services_client_example_test.go deleted file mode 100644 index b1e625c427a5..000000000000 --- a/sdk/resourcemanager/search/armsearch/services_client_example_test.go +++ /dev/null @@ -1,1902 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateService.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { - 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), - 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{ - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOptions() { - 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{ - AuthOptions: &armsearch.DataPlaneAuthOptions{ - AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), - }, - }, - 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{ - // AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - // 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(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisableLocalAuth() { - 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{ - DisableLocalAuth: to.Ptr(true), - 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{ - // 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(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { - 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), - PartitionCount: to.Ptr[int32](1), - PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), - 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{ - // }, - // 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.PublicNetworkAccessDisabled), - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { - 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{ - 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{ - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-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"), - // }, - // { - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCmkEnforcement() { - 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{ - EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), - }, - 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{ - // }, - // 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{ - // }, - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithIdentity() { - 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"), - }, - Identity: &armsearch.Identity{ - 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), - 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"), - // }, - // Identity: &armsearch.Identity{ - // 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{ - // }, - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticSearch() { - 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), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchFree), - }, - 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.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), - // SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchFree), - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateService.json -func ExampleServicesClient_Update_searchUpdateService() { - 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{ - 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{ - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceAuthOptions.json -func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { - 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{ - AuthOptions: &armsearch.DataPlaneAuthOptions{ - AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), - }, - }, - 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{ - // AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - // 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(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json -func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { - 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{ - DisableLocalAuth: to.Ptr(true), - 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{ - // 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(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json -func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEndpoints() { - 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{ - PartitionCount: to.Ptr[int32](1), - PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), - ReplicaCount: to.Ptr[int32](1), - }, - }, &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.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // 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(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json -func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPs() { - 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{ - 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{ - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-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"), - // }}, - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json -func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { - 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{ - Identity: &armsearch.Identity{ - Type: to.Ptr(armsearch.IdentityTypeNone), - }, - 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) - } - // 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{ - // }, - // 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{ - // }, - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json -func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { - 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{ - EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), - }, - 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{ - // }, - // 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{ - // }, - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json -func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { - 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{ - ReplicaCount: to.Ptr[int32](2), - SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard), - }, - 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{ - // }, - // 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), - // SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard), - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchGetService.json -func ExampleServicesClient_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.NewServicesClient().Get(ctx, "rg1", "mysearchservice", &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"), - // }, - // 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{ - // }, - // }, - // 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchDeleteService.json -func ExampleServicesClient_Delete() { - 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) - } - _, err = clientFactory.NewServicesClient().Delete(ctx, "rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListServicesByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - 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.NewServicesClient().NewListByResourceGroupPager("rg1", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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.ServiceListResult = armsearch.ServiceListResult{ - // Value: []*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.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.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("mysearchservice2"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice2"), - // Location: to.Ptr("eastus"), - // 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.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](1), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListServicesBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - 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.NewServicesClient().NewListBySubscriptionPager(&armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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.ServiceListResult = armsearch.ServiceListResult{ - // Value: []*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.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.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("mysearchservice2"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Search/searchServices/mysearchservice2"), - // Location: to.Ptr("eastus"), - // 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.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](1), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCheckNameAvailability.json -func ExampleServicesClient_CheckNameAvailability() { - 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().CheckNameAvailability(ctx, armsearch.CheckNameAvailabilityInput{ - Name: to.Ptr("mysearchservice"), - Type: to.Ptr("searchServices"), - }, &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.CheckNameAvailabilityOutput = armsearch.CheckNameAvailabilityOutput{ - // Message: to.Ptr(""), - // IsNameAvailable: to.Ptr(false), - // Reason: to.Ptr(armsearch.UnavailableNameReasonAlreadyExists), - // } -} diff --git a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go index 7af10bdf569d..eb7b2bc9faea 100644 --- a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go +++ b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type SharedPrivateLinkResourcesClient struct { // NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedPrivateLinkResourcesClient, error) { @@ -48,12 +45,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. -// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within -// the specified resource group. +// - searchServiceName - The name of the search service associated with the specified resource group. +// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the 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 +78,7 @@ func (client *SharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context. // given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-05-01 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" @@ -104,7 +101,7 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Conte } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, sharedPrivateLinkResource SharedPrivateLinkResource, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, sharedPrivateLinkResource SharedPrivateLinkResource, searchManagementRequestOptions *SearchManagementRequestOptions, _ *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -127,7 +124,7 @@ func (client *SharedPrivateLinkResourcesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -142,12 +139,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. -// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within -// the specified resource group. +// - searchServiceName - The name of the search service associated with the specified resource group. +// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the 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 +170,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 2024-06-01-preview +// Generated from API version 2025-05-01 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" @@ -196,7 +193,7 @@ func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Cont } // deleteCreateRequest creates the Delete request. -func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -219,7 +216,7 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -231,12 +228,12 @@ func (client *SharedPrivateLinkResourcesClient) deleteCreateRequest(ctx context. // 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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. -// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within -// the specified resource group. +// - searchServiceName - The name of the search service associated with the specified resource group. +// - sharedPrivateLinkResourceName - The name of the shared private link resource managed by the 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 @@ -264,7 +261,7 @@ func (client *SharedPrivateLinkResourcesClient) Get(ctx context.Context, resourc } // getCreateRequest creates the Get request. -func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientGetOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *SharedPrivateLinkResourcesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -287,7 +284,7 @@ func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -307,10 +304,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 2024-06-01-preview +// Generated from API version 2025-05-01 // - 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. +// - searchServiceName - The name of the 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 @@ -339,7 +336,7 @@ func (client *SharedPrivateLinkResourcesClient) NewListByServicePager(resourceGr } // listByServiceCreateRequest creates the ListByService request. -func (client *SharedPrivateLinkResourcesClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientListByServiceOptions) (*policy.Request, error) { +func (client *SharedPrivateLinkResourcesClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *SharedPrivateLinkResourcesClientListByServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/sharedPrivateLinkResources" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -358,7 +355,7 @@ func (client *SharedPrivateLinkResourcesClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go deleted file mode 100644 index b80e4998fc5d..000000000000 --- a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,151 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json -func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { - 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.NewSharedPrivateLinkResourcesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", "testResource", armsearch.SharedPrivateLinkResource{ - Properties: &armsearch.SharedPrivateLinkResourceProperties{ - GroupID: to.Ptr("blob"), - PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - RequestMessage: to.Ptr("please approve"), - }, - }, &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.SharedPrivateLinkResource = armsearch.SharedPrivateLinkResource{ - // Name: to.Ptr("testResource"), - // Type: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource"), - // Properties: &armsearch.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - // RequestMessage: to.Ptr("please approve"), - // Status: to.Ptr(armsearch.SharedPrivateLinkResourceStatusPending), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetSharedPrivateLinkResource.json -func ExampleSharedPrivateLinkResourcesClient_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.NewSharedPrivateLinkResourcesClient().Get(ctx, "rg1", "mysearchservice", "testResource", &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.SharedPrivateLinkResource = armsearch.SharedPrivateLinkResource{ - // Name: to.Ptr("testResource"), - // Type: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource"), - // Properties: &armsearch.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - // RequestMessage: to.Ptr("please approve"), - // Status: to.Ptr(armsearch.SharedPrivateLinkResourceStatusPending), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/DeleteSharedPrivateLinkResource.json -func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { - 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.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "rg1", "mysearchservice", "testResource", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListSharedPrivateLinkResourcesByService.json -func ExampleSharedPrivateLinkResourcesClient_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.NewSharedPrivateLinkResourcesClient().NewListByServicePager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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.SharedPrivateLinkResourceListResult = armsearch.SharedPrivateLinkResourceListResult{ - // Value: []*armsearch.SharedPrivateLinkResource{ - // { - // Name: to.Ptr("testResource"), - // Type: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource"), - // Properties: &armsearch.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - // RequestMessage: to.Ptr("please approve"), - // Status: to.Ptr(armsearch.SharedPrivateLinkResourceStatusPending), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/search/armsearch/usages_client.go b/sdk/resourcemanager/search/armsearch/usages_client.go index c0b6dff7d1ff..2d3ae9a253ca 100644 --- a/sdk/resourcemanager/search/armsearch/usages_client.go +++ b/sdk/resourcemanager/search/armsearch/usages_client.go @@ -1,6 +1,3 @@ -//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. @@ -29,7 +26,7 @@ type UsagesClient struct { // NewUsagesClient creates a new instance of UsagesClient 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. +// Manager API, command line tools, or the portal. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { @@ -44,9 +41,9 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o return client, nil } -// NewListBySubscriptionPager - Get a list of all Azure AI Search quota usages across the subscription. +// NewListBySubscriptionPager - Gets a list of all Search quota usages in the given subscription. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-05-01 // - location - The unique location name for a Microsoft Azure geographic region. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -76,7 +73,7 @@ func (client *UsagesClient) NewListBySubscriptionPager(location string, searchMa } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *UsagesClient) listBySubscriptionCreateRequest(ctx context.Context, location string, searchManagementRequestOptions *SearchManagementRequestOptions, options *UsagesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *UsagesClient) listBySubscriptionCreateRequest(ctx context.Context, location string, searchManagementRequestOptions *SearchManagementRequestOptions, _ *UsagesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages" if location == "" { return nil, errors.New("parameter location cannot be empty") @@ -91,7 +88,7 @@ func (client *UsagesClient) listBySubscriptionCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { diff --git a/sdk/resourcemanager/search/armsearch/usages_client_example_test.go b/sdk/resourcemanager/search/armsearch/usages_client_example_test.go deleted file mode 100644 index eb810b0385eb..000000000000 --- a/sdk/resourcemanager/search/armsearch/usages_client_example_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetQuotaUsagesList.json -func ExampleUsagesClient_NewListBySubscriptionPager() { - 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.NewUsagesClient().NewListBySubscriptionPager("westus", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, 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.QuotaUsagesListResult = armsearch.QuotaUsagesListResult{ - // Value: []*armsearch.QuotaUsageResult{ - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("F - Free"), - // Value: to.Ptr("free"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/free"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("B - Basic"), - // Value: to.Ptr("basic"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/basic"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("S - Standard"), - // Value: to.Ptr("standard"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/standard"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("S2 - Standard2"), - // Value: to.Ptr("standard2"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/standard2"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("S3 - Standard3"), - // Value: to.Ptr("standard3"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/standard3"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("L1 - Storage Optimized"), - // Value: to.Ptr("storageOptimizedL1"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/storageOptimizedL1"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("L2 - Storage Optimized"), - // Value: to.Ptr("storageOptimizedL2"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/storageOptimizedL2"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }}, - // } - } -}