From ec8d25b4b2f47d243b97844064333c7d1e1cab1b Mon Sep 17 00:00:00 2001 From: ReleaseHelper Date: Sat, 1 Feb 2025 01:08:28 +0000 Subject: [PATCH] [Release] sdk/resourcemanager/search/armsearch/1.4.0-beta.3 generation from spec commit: b43042075540b8d67cce7d3d9f70b9b9f5a359da --- .../search/armsearch/CHANGELOG.md | 23 + .../search/armsearch/adminkeys_client.go | 8 +- .../adminkeys_client_example_test.go | 4 +- .../search/armsearch/autorest.md | 8 +- .../search/armsearch/client_factory.go | 15 + .../search/armsearch/constants.go | 80 +++- .../search/armsearch/fake/offerings_server.go | 92 ++++ .../search/armsearch/fake/server_factory.go | 10 + .../search/armsearch/fake/service_server.go | 115 +++++ .../search/armsearch/fake/time_rfc3339.go | 110 +++++ .../search/armsearch/management_client.go | 6 +- .../management_client_example_test.go | 2 +- .../search/armsearch/models.go | 99 +++++ .../search/armsearch/models_serde.go | 246 +++++++++++ ...ksecurityperimeterconfigurations_client.go | 14 +- ...meterconfigurations_client_example_test.go | 6 +- .../search/armsearch/offerings_client.go | 89 ++++ .../offerings_client_example_test.go | 124 ++++++ .../search/armsearch/operations_client.go | 4 +- .../operations_client_example_test.go | 2 +- .../search/armsearch/options.go | 11 + .../privateendpointconnections_client.go | 16 +- ...endpointconnections_client_example_test.go | 8 +- .../armsearch/privatelinkresources_client.go | 4 +- ...rivatelinkresources_client_example_test.go | 2 +- .../search/armsearch/querykeys_client.go | 12 +- .../querykeys_client_example_test.go | 6 +- .../search/armsearch/responses.go | 12 + .../search/armsearch/service_client.go | 122 ++++++ .../armsearch/service_client_example_test.go | 94 ++++ .../search/armsearch/services_client.go | 30 +- .../armsearch/services_client_example_test.go | 412 ++++++++++++++++-- .../sharedprivatelinkresources_client.go | 20 +- ...rivatelinkresources_client_example_test.go | 8 +- .../search/armsearch/time_rfc3339.go | 110 +++++ .../search/armsearch/usages_client.go | 4 +- .../armsearch/usages_client_example_test.go | 2 +- 37 files changed, 1821 insertions(+), 109 deletions(-) create mode 100644 sdk/resourcemanager/search/armsearch/fake/offerings_server.go create mode 100644 sdk/resourcemanager/search/armsearch/fake/service_server.go create mode 100644 sdk/resourcemanager/search/armsearch/fake/time_rfc3339.go create mode 100644 sdk/resourcemanager/search/armsearch/offerings_client.go create mode 100644 sdk/resourcemanager/search/armsearch/offerings_client_example_test.go create mode 100644 sdk/resourcemanager/search/armsearch/service_client.go create mode 100644 sdk/resourcemanager/search/armsearch/service_client_example_test.go create mode 100644 sdk/resourcemanager/search/armsearch/time_rfc3339.go diff --git a/sdk/resourcemanager/search/armsearch/CHANGELOG.md b/sdk/resourcemanager/search/armsearch/CHANGELOG.md index 5fa150e010f0..035b237bd03e 100644 --- a/sdk/resourcemanager/search/armsearch/CHANGELOG.md +++ b/sdk/resourcemanager/search/armsearch/CHANGELOG.md @@ -1,5 +1,28 @@ # Release History +## 1.4.0-beta.3 (2025-02-28) +### Features Added + +- New enum type `ComputeType` with values `ComputeTypeConfidential`, `ComputeTypeDefault` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New enum type `FeatureName` with values `FeatureNameAvailabilityZones`, `FeatureNameDocumentIntelligence`, `FeatureNameGrok`, `FeatureNameImageVectorization`, `FeatureNameMegaStore`, `FeatureNameQueryRewrite`, `FeatureNameS3`, `FeatureNameSemanticSearch`, `FeatureNameStorageOptimized` +- New function `*ClientFactory.NewOfferingsClient() *OfferingsClient` +- New function `*ClientFactory.NewServiceClient() *ServiceClient` +- New function `NewOfferingsClient(azcore.TokenCredential, *arm.ClientOptions) (*OfferingsClient, error)` +- New function `*OfferingsClient.NewListPager(*OfferingsClientListOptions) *runtime.Pager[OfferingsClientListResponse]` +- New function `NewServiceClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServiceClient, error)` +- New function `*ServiceClient.BeginUpgrade(context.Context, string, string, *ServiceClientBeginUpgradeOptions) (*runtime.Poller[ServiceClientUpgradeResponse], error)` +- New struct `FeatureOffering` +- New struct `OfferingsByRegion` +- New struct `OfferingsListResult` +- New struct `SKUOffering` +- New struct `SKUOfferingLimits` +- New struct `SystemData` +- New field `SystemData` in struct `Service` +- New field `ComputeType`, `Endpoint`, `ServiceUpgradeDate`, `UpgradeAvailable` in struct `ServiceProperties` +- New field `SystemData` in struct `ServiceUpdate` + + ## 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..5e23a0f649b6 100644 --- a/sdk/resourcemanager/search/armsearch/adminkeys_client.go +++ b/sdk/resourcemanager/search/armsearch/adminkeys_client.go @@ -47,7 +47,7 @@ func NewAdminKeysClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets the primary and secondary admin API keys for the specified Azure AI Search service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-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. @@ -96,7 +96,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -117,7 +117,7 @@ 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-02-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. @@ -171,7 +171,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-02-01-preview") 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 index 6af57bcfa226..93f039a6115b 100644 --- a/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchGetAdminKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchGetAdminKeys.json func ExampleAdminKeysClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleAdminKeysClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchRegenerateAdminKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchRegenerateAdminKey.json func ExampleAdminKeysClient_Regenerate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/autorest.md b/sdk/resourcemanager/search/armsearch/autorest.md index 9b9e1f3ef894..25ced3efcb52 100644 --- a/sdk/resourcemanager/search/armsearch/autorest.md +++ b/sdk/resourcemanager/search/armsearch/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/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.4.0-beta.3 +tag: package-preview-2025-02-01 ``` \ 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..4faf2f06920f 100644 --- a/sdk/resourcemanager/search/armsearch/client_factory.go +++ b/sdk/resourcemanager/search/armsearch/client_factory.go @@ -61,6 +61,13 @@ func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *Netwo } } +// NewOfferingsClient creates a new instance of OfferingsClient. +func (c *ClientFactory) NewOfferingsClient() *OfferingsClient { + return &OfferingsClient{ + internal: c.internal, + } +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { return &OperationsClient{ @@ -92,6 +99,14 @@ func (c *ClientFactory) NewQueryKeysClient() *QueryKeysClient { } } +// NewServiceClient creates a new instance of ServiceClient. +func (c *ClientFactory) NewServiceClient() *ServiceClient { + return &ServiceClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewServicesClient creates a new instance of ServicesClient. func (c *ClientFactory) NewServicesClient() *ServicesClient { return &ServicesClient{ diff --git a/sdk/resourcemanager/search/armsearch/constants.go b/sdk/resourcemanager/search/armsearch/constants.go index e857f438ad33..55cf153ac27d 100644 --- a/sdk/resourcemanager/search/armsearch/constants.go +++ b/sdk/resourcemanager/search/armsearch/constants.go @@ -10,7 +10,7 @@ package armsearch const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" - moduleVersion = "v1.4.0-beta.2" + moduleVersion = "v1.4.0-beta.3" ) // AADAuthFailureMode - Describes what response the data plane API of a search service would send for requests that failed @@ -51,6 +51,84 @@ func PossibleAdminKeyKindValues() []AdminKeyKind { } } +// ComputeType - Configure this property to support the search service using either the default compute or Azure Confidential +// Compute. +type ComputeType string + +const ( + // ComputeTypeConfidential - Create the service with Azure Confidential Compute. + ComputeTypeConfidential ComputeType = "confidential" + // ComputeTypeDefault - Create the service with the default compute. + ComputeTypeDefault ComputeType = "default" +) + +// PossibleComputeTypeValues returns the possible values for the ComputeType const type. +func PossibleComputeTypeValues() []ComputeType { + return []ComputeType{ + ComputeTypeConfidential, + ComputeTypeDefault, + } +} + +// CreatedByType - The type of identity that created the resource. +type CreatedByType string + +const ( + CreatedByTypeApplication CreatedByType = "Application" + CreatedByTypeKey CreatedByType = "Key" + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{ + CreatedByTypeApplication, + CreatedByTypeKey, + CreatedByTypeManagedIdentity, + CreatedByTypeUser, + } +} + +// FeatureName - The name of the feature offered in this region. +type FeatureName string + +const ( + // FeatureNameAvailabilityZones - Supports Availability Zones feature. + FeatureNameAvailabilityZones FeatureName = "AvailabilityZones" + // FeatureNameDocumentIntelligence - Supports Document Intelligence feature. + FeatureNameDocumentIntelligence FeatureName = "DocumentIntelligence" + // FeatureNameGrok - Supports Grok feature. + FeatureNameGrok FeatureName = "Grok" + // FeatureNameImageVectorization - Supports Image Vectorization feature. + FeatureNameImageVectorization FeatureName = "ImageVectorization" + // FeatureNameMegaStore - Supports Mega Store feature. + FeatureNameMegaStore FeatureName = "MegaStore" + // FeatureNameQueryRewrite - Supports Query Rewrite feature. + FeatureNameQueryRewrite FeatureName = "QueryRewrite" + // FeatureNameS3 - Supports S3 feature. + FeatureNameS3 FeatureName = "S3" + // FeatureNameSemanticSearch - Supports Semantic Search feature. + FeatureNameSemanticSearch FeatureName = "SemanticSearch" + // FeatureNameStorageOptimized - Supports Storage Optimized feature. + FeatureNameStorageOptimized FeatureName = "StorageOptimized" +) + +// PossibleFeatureNameValues returns the possible values for the FeatureName const type. +func PossibleFeatureNameValues() []FeatureName { + return []FeatureName{ + FeatureNameAvailabilityZones, + FeatureNameDocumentIntelligence, + FeatureNameGrok, + FeatureNameImageVectorization, + FeatureNameMegaStore, + FeatureNameQueryRewrite, + FeatureNameS3, + FeatureNameSemanticSearch, + FeatureNameStorageOptimized, + } +} + // HostingMode - Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions // that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any // other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be diff --git a/sdk/resourcemanager/search/armsearch/fake/offerings_server.go b/sdk/resourcemanager/search/armsearch/fake/offerings_server.go new file mode 100644 index 000000000000..b56f025b6ffe --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/fake/offerings_server.go @@ -0,0 +1,92 @@ +//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 ( + "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/resourcemanager/search/armsearch" + "net/http" +) + +// OfferingsServer is a fake server for instances of the armsearch.OfferingsClient type. +type OfferingsServer struct { + // NewListPager is the fake for method OfferingsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(options *armsearch.OfferingsClientListOptions) (resp azfake.PagerResponder[armsearch.OfferingsClientListResponse]) +} + +// NewOfferingsServerTransport creates a new instance of OfferingsServerTransport with the provided implementation. +// The returned OfferingsServerTransport instance is connected to an instance of armsearch.OfferingsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewOfferingsServerTransport(srv *OfferingsServer) *OfferingsServerTransport { + return &OfferingsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armsearch.OfferingsClientListResponse]](), + } +} + +// OfferingsServerTransport connects instances of armsearch.OfferingsClient to instances of OfferingsServer. +// Don't use this type directly, use NewOfferingsServerTransport instead. +type OfferingsServerTransport struct { + srv *OfferingsServer + newListPager *tracker[azfake.PagerResponder[armsearch.OfferingsClientListResponse]] +} + +// Do implements the policy.Transporter interface for OfferingsServerTransport. +func (o *OfferingsServerTransport) 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 "OfferingsClient.NewListPager": + resp, err = o.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (o *OfferingsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if o.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := o.newListPager.get(req) + if newListPager == nil { + resp := o.srv.NewListPager(nil) + newListPager = &resp + o.newListPager.add(req, newListPager) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/search/armsearch/fake/server_factory.go b/sdk/resourcemanager/search/armsearch/fake/server_factory.go index 29a400fc0941..2b1ec84381e0 100644 --- a/sdk/resourcemanager/search/armsearch/fake/server_factory.go +++ b/sdk/resourcemanager/search/armsearch/fake/server_factory.go @@ -22,10 +22,12 @@ type ServerFactory struct { AdminKeysServer AdminKeysServer ManagementServer ManagementServer NetworkSecurityPerimeterConfigurationsServer NetworkSecurityPerimeterConfigurationsServer + OfferingsServer OfferingsServer OperationsServer OperationsServer PrivateEndpointConnectionsServer PrivateEndpointConnectionsServer PrivateLinkResourcesServer PrivateLinkResourcesServer QueryKeysServer QueryKeysServer + ServiceServer ServiceServer ServicesServer ServicesServer SharedPrivateLinkResourcesServer SharedPrivateLinkResourcesServer UsagesServer UsagesServer @@ -48,10 +50,12 @@ type ServerFactoryTransport struct { trAdminKeysServer *AdminKeysServerTransport trManagementServer *ManagementServerTransport trNetworkSecurityPerimeterConfigurationsServer *NetworkSecurityPerimeterConfigurationsServerTransport + trOfferingsServer *OfferingsServerTransport trOperationsServer *OperationsServerTransport trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport trPrivateLinkResourcesServer *PrivateLinkResourcesServerTransport trQueryKeysServer *QueryKeysServerTransport + trServiceServer *ServiceServerTransport trServicesServer *ServicesServerTransport trSharedPrivateLinkResourcesServer *SharedPrivateLinkResourcesServerTransport trUsagesServer *UsagesServerTransport @@ -81,6 +85,9 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewNetworkSecurityPerimeterConfigurationsServerTransport(&s.srv.NetworkSecurityPerimeterConfigurationsServer) }) resp, err = s.trNetworkSecurityPerimeterConfigurationsServer.Do(req) + case "OfferingsClient": + initServer(s, &s.trOfferingsServer, func() *OfferingsServerTransport { return NewOfferingsServerTransport(&s.srv.OfferingsServer) }) + resp, err = s.trOfferingsServer.Do(req) case "OperationsClient": initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) @@ -97,6 +104,9 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { case "QueryKeysClient": initServer(s, &s.trQueryKeysServer, func() *QueryKeysServerTransport { return NewQueryKeysServerTransport(&s.srv.QueryKeysServer) }) resp, err = s.trQueryKeysServer.Do(req) + case "ServiceClient": + initServer(s, &s.trServiceServer, func() *ServiceServerTransport { return NewServiceServerTransport(&s.srv.ServiceServer) }) + resp, err = s.trServiceServer.Do(req) case "ServicesClient": initServer(s, &s.trServicesServer, func() *ServicesServerTransport { return NewServicesServerTransport(&s.srv.ServicesServer) }) resp, err = s.trServicesServer.Do(req) diff --git a/sdk/resourcemanager/search/armsearch/fake/service_server.go b/sdk/resourcemanager/search/armsearch/fake/service_server.go new file mode 100644 index 000000000000..3d912ca99d5d --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/fake/service_server.go @@ -0,0 +1,115 @@ +//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/resourcemanager/search/armsearch" + "net/http" + "net/url" + "regexp" +) + +// ServiceServer is a fake server for instances of the armsearch.ServiceClient type. +type ServiceServer struct { + // BeginUpgrade is the fake for method ServiceClient.BeginUpgrade + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginUpgrade func(ctx context.Context, resourceGroupName string, searchServiceName string, options *armsearch.ServiceClientBeginUpgradeOptions) (resp azfake.PollerResponder[armsearch.ServiceClientUpgradeResponse], errResp azfake.ErrorResponder) +} + +// NewServiceServerTransport creates a new instance of ServiceServerTransport with the provided implementation. +// The returned ServiceServerTransport instance is connected to an instance of armsearch.ServiceClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewServiceServerTransport(srv *ServiceServer) *ServiceServerTransport { + return &ServiceServerTransport{ + srv: srv, + beginUpgrade: newTracker[azfake.PollerResponder[armsearch.ServiceClientUpgradeResponse]](), + } +} + +// ServiceServerTransport connects instances of armsearch.ServiceClient to instances of ServiceServer. +// Don't use this type directly, use NewServiceServerTransport instead. +type ServiceServerTransport struct { + srv *ServiceServer + beginUpgrade *tracker[azfake.PollerResponder[armsearch.ServiceClientUpgradeResponse]] +} + +// Do implements the policy.Transporter interface for ServiceServerTransport. +func (s *ServiceServerTransport) 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 "ServiceClient.BeginUpgrade": + resp, err = s.dispatchBeginUpgrade(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (s *ServiceServerTransport) dispatchBeginUpgrade(req *http.Request) (*http.Response, error) { + if s.srv.BeginUpgrade == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginUpgrade not implemented")} + } + beginUpgrade := s.beginUpgrade.get(req) + if beginUpgrade == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Search/searchServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/upgrade` + 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 + } + respr, errRespr := s.srv.BeginUpgrade(req.Context(), resourceGroupNameParam, searchServiceNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginUpgrade = &respr + s.beginUpgrade.add(req, beginUpgrade) + } + + resp, err := server.PollerResponderNext(beginUpgrade, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginUpgrade.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginUpgrade) { + s.beginUpgrade.remove(req) + } + + return resp, nil +} diff --git a/sdk/resourcemanager/search/armsearch/fake/time_rfc3339.go b/sdk/resourcemanager/search/armsearch/fake/time_rfc3339.go new file mode 100644 index 000000000000..81f308b0d343 --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/fake/time_rfc3339.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/search/armsearch/management_client.go b/sdk/resourcemanager/search/armsearch/management_client.go index 7dd8a16e41cf..ae172972379f 100644 --- a/sdk/resourcemanager/search/armsearch/management_client.go +++ b/sdk/resourcemanager/search/armsearch/management_client.go @@ -44,10 +44,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-02-01-preview // - 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 @@ -96,7 +96,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-02-01-preview") 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 index e4d632d6dc49..f99d86c4cab4 100644 --- a/sdk/resourcemanager/search/armsearch/management_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/management_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetQuotaUsage.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetQuotaUsage.json func ExampleManagementClient_UsageBySubscriptionSKU() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/models.go b/sdk/resourcemanager/search/armsearch/models.go index a6e161fcc370..d9a211502648 100644 --- a/sdk/resourcemanager/search/armsearch/models.go +++ b/sdk/resourcemanager/search/armsearch/models.go @@ -8,6 +8,8 @@ package armsearch +import "time" + // AdminKeyResult - Response containing the primary and secondary admin API keys for a given Azure AI Search service. type AdminKeyResult struct { // READ-ONLY; The primary admin API key of the search service. @@ -74,6 +76,11 @@ type EncryptionWithCmk struct { EncryptionComplianceStatus *SearchEncryptionComplianceStatus } +type FeatureOffering struct { + // The name of the feature offered in this region. + Name *FeatureName +} + // IPRule - The IP restriction rule of the Azure AI Search service. type IPRule struct { // Value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be allowed. @@ -224,6 +231,26 @@ type NetworkSecurityPerimeterConfigurationProperties struct { ProvisioningState *string } +type OfferingsByRegion struct { + // The list of features offered in this region. + Features []*FeatureOffering + + // The name of the region. + RegionName *string + + // The list of SKUs offered in this region. + SKUs []*SKUOffering +} + +// OfferingsListResult - The response containing a list of features and SKUs offered in various regions. +type OfferingsListResult struct { + // The list of regions with their respective features and SKUs offered. + Value []*OfferingsByRegion + + // READ-ONLY; The URL to get the next set of offerings, if any. + NextLink *string +} + // Operation - Describes a REST API operation. type Operation struct { // READ-ONLY; The object that describes the operation. @@ -497,6 +524,38 @@ type SKU struct { Name *SKUName } +type SKUOffering struct { + // The limits associated with this SKU offered in this region. + Limits *SKUOfferingLimits + + // Defines the SKU of a search service, which determines billing rate and capacity limits. + SKU *SKU +} + +// SKUOfferingLimits - The limits associated with this SKU offered in this region. +type SKUOfferingLimits struct { + // The maximum number of indexers available for this SKU. + Indexers *int32 + + // The maximum number of indexes available for this SKU. + Indexes *int32 + + // The maximum storage size in Gigabytes available for this SKU per partition. + PartitionStorageInGigabytes *int32 + + // The maximum vector storage size in Gigabytes available for this SKU per partition. + PartitionVectorStorageInGigabytes *int32 + + // The maximum number of partitions available for this SKU. + Partitions *int32 + + // The maximum number of replicas available for this SKU. + Replicas *int32 + + // The maximum number of search units available for this SKU. + SearchUnits *int32 +} + // Service - Describes an Azure AI Search service and its current state. type Service struct { // REQUIRED; The geo-location where the resource lives @@ -521,6 +580,9 @@ type Service struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata of the search service containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -541,6 +603,9 @@ type ServiceProperties struct { // is set to true. AuthOptions *DataPlaneAuthOptions + // Configure this property to support the search service using either the default compute or Azure Confidential Compute. + ComputeType *ComputeType + // When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot // be set to true if 'dataPlaneAuthOptions' are defined. DisableLocalAuth *bool @@ -553,6 +618,9 @@ type ServiceProperties struct { // Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. EncryptionWithCmk *EncryptionWithCmk + // The endpoint of the Azure AI Search service. + Endpoint *string + // Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up // to 1000 indexes, which is much higher than the maximum indexes allowed for any // other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be @@ -596,6 +664,10 @@ type ServiceProperties struct { // because the free service uses capacity that is already set up. ProvisioningState *ProvisioningState + // READ-ONLY; The date and time the search service was last upgraded. This field will be null until the service gets upgraded + // for the first time. + ServiceUpgradeDate *time.Time + // READ-ONLY; The list of shared private link resources managed by the Azure AI Search service. SharedPrivateLinkResources []*SharedPrivateLinkResource @@ -613,6 +685,9 @@ type ServiceProperties struct { // READ-ONLY; The details of the search service status. StatusDetails *string + + // READ-ONLY; Indicates whether or not the search service has an upgrade available. + UpgradeAvailable *bool } // ServiceUpdate - The parameters used to update an Azure AI Search service. @@ -641,6 +716,9 @@ type ServiceUpdate struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -720,6 +798,27 @@ type SharedPrivateLinkResourceProperties struct { Status *SharedPrivateLinkResourceStatus } +// SystemData - Metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // The timestamp of resource creation (UTC). + CreatedAt *time.Time + + // The identity that created the resource. + CreatedBy *string + + // The type of identity that created the resource. + CreatedByType *CreatedByType + + // The timestamp of resource last modification (UTC) + LastModifiedAt *time.Time + + // The identity that last modified the resource. + LastModifiedBy *string + + // The type of identity that last modified the resource. + LastModifiedByType *CreatedByType +} + // 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. diff --git a/sdk/resourcemanager/search/armsearch/models_serde.go b/sdk/resourcemanager/search/armsearch/models_serde.go index 32cdd69b995d..6cf6b221e220 100644 --- a/sdk/resourcemanager/search/armsearch/models_serde.go +++ b/sdk/resourcemanager/search/armsearch/models_serde.go @@ -201,6 +201,33 @@ func (e *EncryptionWithCmk) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FeatureOffering. +func (f FeatureOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", f.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureOffering. +func (f *FeatureOffering) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type IPRule. func (i IPRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -726,6 +753,72 @@ func (n *NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON(data []b return nil } +// MarshalJSON implements the json.Marshaller interface for type OfferingsByRegion. +func (o OfferingsByRegion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "features", o.Features) + populate(objectMap, "regionName", o.RegionName) + populate(objectMap, "skus", o.SKUs) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfferingsByRegion. +func (o *OfferingsByRegion) 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 "features": + err = unpopulate(val, "Features", &o.Features) + delete(rawMsg, key) + case "regionName": + err = unpopulate(val, "RegionName", &o.RegionName) + delete(rawMsg, key) + case "skus": + err = unpopulate(val, "SKUs", &o.SKUs) + 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 OfferingsListResult. +func (o OfferingsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OfferingsListResult. +func (o *OfferingsListResult) 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 "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + 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 Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1484,6 +1577,88 @@ func (s *SKU) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SKUOffering. +func (s SKUOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limits", s.Limits) + populate(objectMap, "sku", s.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUOffering. +func (s *SKUOffering) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "limits": + err = unpopulate(val, "Limits", &s.Limits) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUOfferingLimits. +func (s SKUOfferingLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "indexers", s.Indexers) + populate(objectMap, "indexes", s.Indexes) + populate(objectMap, "partitionStorageInGigabytes", s.PartitionStorageInGigabytes) + populate(objectMap, "partitionVectorStorageInGigabytes", s.PartitionVectorStorageInGigabytes) + populate(objectMap, "partitions", s.Partitions) + populate(objectMap, "replicas", s.Replicas) + populate(objectMap, "searchUnits", s.SearchUnits) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUOfferingLimits. +func (s *SKUOfferingLimits) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "indexers": + err = unpopulate(val, "Indexers", &s.Indexers) + delete(rawMsg, key) + case "indexes": + err = unpopulate(val, "Indexes", &s.Indexes) + delete(rawMsg, key) + case "partitionStorageInGigabytes": + err = unpopulate(val, "PartitionStorageInGigabytes", &s.PartitionStorageInGigabytes) + delete(rawMsg, key) + case "partitionVectorStorageInGigabytes": + err = unpopulate(val, "PartitionVectorStorageInGigabytes", &s.PartitionVectorStorageInGigabytes) + delete(rawMsg, key) + case "partitions": + err = unpopulate(val, "Partitions", &s.Partitions) + delete(rawMsg, key) + case "replicas": + err = unpopulate(val, "Replicas", &s.Replicas) + delete(rawMsg, key) + case "searchUnits": + err = unpopulate(val, "SearchUnits", &s.SearchUnits) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Service. func (s Service) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1493,6 +1668,7 @@ func (s Service) MarshalJSON() ([]byte, error) { populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) @@ -1525,6 +1701,9 @@ func (s *Service) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &s.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) @@ -1574,10 +1753,12 @@ func (s *ServiceListResult) UnmarshalJSON(data []byte) error { func (s ServiceProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "authOptions", s.AuthOptions) + populate(objectMap, "computeType", s.ComputeType) populate(objectMap, "disableLocalAuth", s.DisableLocalAuth) populate(objectMap, "disabledDataExfiltrationOptions", s.DisabledDataExfiltrationOptions) populate(objectMap, "eTag", s.ETag) populate(objectMap, "encryptionWithCmk", s.EncryptionWithCmk) + populate(objectMap, "endpoint", s.Endpoint) populate(objectMap, "hostingMode", s.HostingMode) populate(objectMap, "networkRuleSet", s.NetworkRuleSet) populate(objectMap, "partitionCount", s.PartitionCount) @@ -1586,9 +1767,11 @@ func (s ServiceProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) populate(objectMap, "replicaCount", s.ReplicaCount) populate(objectMap, "semanticSearch", s.SemanticSearch) + populateDateTimeRFC3339(objectMap, "serviceUpgradeDate", s.ServiceUpgradeDate) populate(objectMap, "sharedPrivateLinkResources", s.SharedPrivateLinkResources) populate(objectMap, "status", s.Status) populate(objectMap, "statusDetails", s.StatusDetails) + populate(objectMap, "upgradeAvailable", s.UpgradeAvailable) return json.Marshal(objectMap) } @@ -1604,6 +1787,9 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "authOptions": err = unpopulate(val, "AuthOptions", &s.AuthOptions) delete(rawMsg, key) + case "computeType": + err = unpopulate(val, "ComputeType", &s.ComputeType) + delete(rawMsg, key) case "disableLocalAuth": err = unpopulate(val, "DisableLocalAuth", &s.DisableLocalAuth) delete(rawMsg, key) @@ -1616,6 +1802,9 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "encryptionWithCmk": err = unpopulate(val, "EncryptionWithCmk", &s.EncryptionWithCmk) delete(rawMsg, key) + case "endpoint": + err = unpopulate(val, "Endpoint", &s.Endpoint) + delete(rawMsg, key) case "hostingMode": err = unpopulate(val, "HostingMode", &s.HostingMode) delete(rawMsg, key) @@ -1640,6 +1829,9 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "semanticSearch": err = unpopulate(val, "SemanticSearch", &s.SemanticSearch) delete(rawMsg, key) + case "serviceUpgradeDate": + err = unpopulateDateTimeRFC3339(val, "ServiceUpgradeDate", &s.ServiceUpgradeDate) + delete(rawMsg, key) case "sharedPrivateLinkResources": err = unpopulate(val, "SharedPrivateLinkResources", &s.SharedPrivateLinkResources) delete(rawMsg, key) @@ -1649,6 +1841,9 @@ func (s *ServiceProperties) UnmarshalJSON(data []byte) error { case "statusDetails": err = unpopulate(val, "StatusDetails", &s.StatusDetails) delete(rawMsg, key) + case "upgradeAvailable": + err = unpopulate(val, "UpgradeAvailable", &s.UpgradeAvailable) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -1666,6 +1861,7 @@ func (s ServiceUpdate) MarshalJSON() ([]byte, error) { populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "tags", s.Tags) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) @@ -1698,6 +1894,9 @@ func (s *ServiceUpdate) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &s.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &s.Tags) delete(rawMsg, key) @@ -1895,6 +2094,53 @@ func (s *SharedPrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type UserAssignedManagedIdentity. func (u UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go index 2575eb352676..04dd17594746 100644 --- a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go +++ b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go @@ -47,7 +47,7 @@ func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, cred // 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 +// Generated from API version 2025-02-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. @@ -100,7 +100,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,7 +117,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getHandleResponse(re // NewListByServicePager - Gets a list of network security perimeter configurations for a search service. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-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. @@ -166,7 +166,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listByServiceCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,7 +186,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listByServiceHandleR // service carries the latest configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-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. @@ -216,7 +216,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) BeginReconcile(ctx c // service carries the latest configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-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" @@ -262,7 +262,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-02-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 index 82ca376b8bae..b7c08713abd0 100644 --- a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json func ExampleNetworkSecurityPerimeterConfigurationsClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -75,7 +75,7 @@ func ExampleNetworkSecurityPerimeterConfigurationsClient_NewListByServicePager() } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json func ExampleNetworkSecurityPerimeterConfigurationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -125,7 +125,7 @@ func ExampleNetworkSecurityPerimeterConfigurationsClient_Get() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginReconcile() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/offerings_client.go b/sdk/resourcemanager/search/armsearch/offerings_client.go new file mode 100644 index 000000000000..acf8461784a1 --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/offerings_client.go @@ -0,0 +1,89 @@ +//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" + "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" +) + +// OfferingsClient contains the methods for the Offerings group. +// Don't use this type directly, use NewOfferingsClient() instead. +type OfferingsClient struct { + internal *arm.Client +} + +// NewOfferingsClient creates a new instance of OfferingsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewOfferingsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OfferingsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OfferingsClient{ + internal: cl, + } + return client, nil +} + +// NewListPager - Lists all of the features and SKUs offered by the Azure AI Search service in each region. +// +// Generated from API version 2025-02-01-preview +// - options - OfferingsClientListOptions contains the optional parameters for the OfferingsClient.NewListPager method. +func (client *OfferingsClient) NewListPager(options *OfferingsClientListOptions) *runtime.Pager[OfferingsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[OfferingsClientListResponse]{ + More: func(page OfferingsClientListResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *OfferingsClientListResponse) (OfferingsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "OfferingsClient.NewListPager") + req, err := client.listCreateRequest(ctx, options) + if err != nil { + return OfferingsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OfferingsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OfferingsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *OfferingsClient) listCreateRequest(ctx context.Context, options *OfferingsClientListOptions) (*policy.Request, error) { + urlPath := "/providers/Microsoft.Search/offerings" + 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", "2025-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OfferingsClient) listHandleResponse(resp *http.Response) (OfferingsClientListResponse, error) { + result := OfferingsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OfferingsListResult); err != nil { + return OfferingsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/search/armsearch/offerings_client_example_test.go b/sdk/resourcemanager/search/armsearch/offerings_client_example_test.go new file mode 100644 index 000000000000..483c5e7c2da0 --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/offerings_client_example_test.go @@ -0,0 +1,124 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// 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/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListOfferings.json +func ExampleOfferingsClient_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.NewOfferingsClient().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.OfferingsListResult = armsearch.OfferingsListResult{ + // Value: []*armsearch.OfferingsByRegion{ + // { + // Features: []*armsearch.FeatureOffering{ + // { + // Name: to.Ptr(armsearch.FeatureName("SemanticRanker")), + // }, + // { + // Name: to.Ptr(armsearch.FeatureName("QueryRewriting")), + // }}, + // RegionName: to.Ptr("East US"), + // SKUs: []*armsearch.SKUOffering{ + // { + // Limits: &armsearch.SKUOfferingLimits{ + // Indexers: to.Ptr[int32](50), + // Indexes: to.Ptr[int32](50), + // PartitionStorageInGigabytes: to.Ptr[int32](160), + // PartitionVectorStorageInGigabytes: to.Ptr[int32](35), + // Partitions: to.Ptr[int32](12), + // Replicas: to.Ptr[int32](12), + // SearchUnits: to.Ptr[int32](36), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard), + // }, + // }, + // { + // Limits: &armsearch.SKUOfferingLimits{ + // Indexers: to.Ptr[int32](200), + // Indexes: to.Ptr[int32](200), + // PartitionStorageInGigabytes: to.Ptr[int32](512), + // PartitionVectorStorageInGigabytes: to.Ptr[int32](150), + // Partitions: to.Ptr[int32](12), + // Replicas: to.Ptr[int32](12), + // SearchUnits: to.Ptr[int32](36), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard2), + // }, + // }}, + // }, + // { + // Features: []*armsearch.FeatureOffering{ + // { + // Name: to.Ptr(armsearch.FeatureNameGrok), + // }, + // { + // Name: to.Ptr(armsearch.FeatureNameImageVectorization), + // }}, + // RegionName: to.Ptr("West Europe"), + // SKUs: []*armsearch.SKUOffering{ + // { + // Limits: &armsearch.SKUOfferingLimits{ + // Indexers: to.Ptr[int32](50), + // Indexes: to.Ptr[int32](50), + // PartitionStorageInGigabytes: to.Ptr[int32](160), + // PartitionVectorStorageInGigabytes: to.Ptr[int32](35), + // Partitions: to.Ptr[int32](12), + // Replicas: to.Ptr[int32](12), + // SearchUnits: to.Ptr[int32](36), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard), + // }, + // }, + // { + // Limits: &armsearch.SKUOfferingLimits{ + // Indexers: to.Ptr[int32](200), + // Indexes: to.Ptr[int32](200), + // PartitionStorageInGigabytes: to.Ptr[int32](512), + // PartitionVectorStorageInGigabytes: to.Ptr[int32](150), + // Partitions: to.Ptr[int32](12), + // Replicas: to.Ptr[int32](12), + // SearchUnits: to.Ptr[int32](36), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard2), + // }, + // }}, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/search/armsearch/operations_client.go b/sdk/resourcemanager/search/armsearch/operations_client.go index 5cd88b29d96a..eac48977191e 100644 --- a/sdk/resourcemanager/search/armsearch/operations_client.go +++ b/sdk/resourcemanager/search/armsearch/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.Search provider. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -73,7 +73,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-06-01-preview") + reqQP.Set("api-version", "2025-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/search/armsearch/operations_client_example_test.go b/sdk/resourcemanager/search/armsearch/operations_client_example_test.go index fa34a5be3a14..35cc8dacbece 100644 --- a/sdk/resourcemanager/search/armsearch/operations_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/operations_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListOperations.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/options.go b/sdk/resourcemanager/search/armsearch/options.go index 1de6e7a789df..0cc3577658bb 100644 --- a/sdk/resourcemanager/search/armsearch/options.go +++ b/sdk/resourcemanager/search/armsearch/options.go @@ -43,6 +43,11 @@ type NetworkSecurityPerimeterConfigurationsClientListByServiceOptions struct { // placeholder for future optional parameters } +// OfferingsClientListOptions contains the optional parameters for the OfferingsClient.NewListPager method. +type OfferingsClientListOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -101,6 +106,12 @@ type SearchManagementRequestOptions struct { ClientRequestID *string } +// ServiceClientBeginUpgradeOptions contains the optional parameters for the ServiceClient.BeginUpgrade method. +type ServiceClientBeginUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method. type ServicesClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. diff --git a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go index 78e857b7c8b1..dbba8a36c7f1 100644 --- a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go +++ b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go @@ -47,7 +47,7 @@ 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-02-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. @@ -103,7 +103,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -124,7 +124,7 @@ 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-02-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. @@ -180,7 +180,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -200,7 +200,7 @@ 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-02-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. @@ -251,7 +251,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -272,7 +272,7 @@ func (client *PrivateEndpointConnectionsClient) listByServiceHandleResponse(resp // 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-02-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. @@ -329,7 +329,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-02-01-preview") 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 index b7d0aa970239..af798d1ceeeb 100644 --- a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/UpdatePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/UpdatePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -60,7 +60,7 @@ func ExamplePrivateEndpointConnectionsClient_Update() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -95,7 +95,7 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/DeletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/DeletePrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -130,7 +130,7 @@ func ExamplePrivateEndpointConnectionsClient_Delete() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListPrivateEndpointConnectionsByService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/ListPrivateEndpointConnectionsByService.json func ExamplePrivateEndpointConnectionsClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go index e69d28c0316d..62b1fe4904a1 100644 --- a/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go +++ b/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go @@ -46,7 +46,7 @@ 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-02-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. @@ -98,7 +98,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-02-01-preview") 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 index b9448355f126..8ddde16b8629 100644 --- a/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListSupportedPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/ListSupportedPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/querykeys_client.go b/sdk/resourcemanager/search/armsearch/querykeys_client.go index f8d2e9d01837..fbd1854d4e96 100644 --- a/sdk/resourcemanager/search/armsearch/querykeys_client.go +++ b/sdk/resourcemanager/search/armsearch/querykeys_client.go @@ -47,7 +47,7 @@ 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-02-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. @@ -101,7 +101,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -123,7 +123,7 @@ 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-02-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. @@ -176,7 +176,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -187,7 +187,7 @@ func (client *QueryKeysClient) deleteCreateRequest(ctx context.Context, resource // NewListBySearchServicePager - Returns the list of query API keys for the given Azure AI Search service. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-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. @@ -238,7 +238,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-02-01-preview") 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 index 6cfed2ef61b4..90d4a3d013e4 100644 --- a/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateQueryKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateQueryKey.json func ExampleQueryKeysClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -41,7 +41,7 @@ func ExampleQueryKeysClient_Create() { // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListQueryKeysBySearchService.json func ExampleQueryKeysClient_NewListBySearchServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -77,7 +77,7 @@ func ExampleQueryKeysClient_NewListBySearchServicePager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchDeleteQueryKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchDeleteQueryKey.json func ExampleQueryKeysClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/responses.go b/sdk/resourcemanager/search/armsearch/responses.go index 6b49eac7fe19..027dee5fab99 100644 --- a/sdk/resourcemanager/search/armsearch/responses.go +++ b/sdk/resourcemanager/search/armsearch/responses.go @@ -43,6 +43,12 @@ type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct { // placeholder for future response values } +// OfferingsClientListResponse contains the response from method OfferingsClient.NewListPager. +type OfferingsClientListResponse struct { + // The response containing a list of features and SKUs offered in various regions. + OfferingsListResult +} + // 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 @@ -98,6 +104,12 @@ type QueryKeysClientListBySearchServiceResponse struct { ListQueryKeysResult } +// ServiceClientUpgradeResponse contains the response from method ServiceClient.BeginUpgrade. +type ServiceClientUpgradeResponse struct { + // Describes an Azure AI Search service and its current state. + Service +} + // ServicesClientCheckNameAvailabilityResponse contains the response from method ServicesClient.CheckNameAvailability. type ServicesClientCheckNameAvailabilityResponse struct { // Output of check name availability API. diff --git a/sdk/resourcemanager/search/armsearch/service_client.go b/sdk/resourcemanager/search/armsearch/service_client.go new file mode 100644 index 000000000000..f98107671b0c --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/service_client.go @@ -0,0 +1,122 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. 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" +) + +// ServiceClient contains the methods for the Service group. +// Don't use this type directly, use NewServiceClient() instead. +type ServiceClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServiceClient creates a new instance of ServiceClient 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 NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServiceClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginUpgrade - Upgrades the Azure AI Search service to the latest version available. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-02-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 - ServiceClientBeginUpgradeOptions contains the optional parameters for the ServiceClient.BeginUpgrade method. +func (client *ServiceClient) BeginUpgrade(ctx context.Context, resourceGroupName string, searchServiceName string, options *ServiceClientBeginUpgradeOptions) (*runtime.Poller[ServiceClientUpgradeResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.upgrade(ctx, resourceGroupName, searchServiceName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServiceClientUpgradeResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[ServiceClientUpgradeResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Upgrade - Upgrades the Azure AI Search service to the latest version available. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-02-01-preview +func (client *ServiceClient) upgrade(ctx context.Context, resourceGroupName string, searchServiceName string, options *ServiceClientBeginUpgradeOptions) (*http.Response, error) { + var err error + const operationName = "ServiceClient.BeginUpgrade" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.upgradeCreateRequest(ctx, resourceGroupName, searchServiceName, 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.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// upgradeCreateRequest creates the Upgrade request. +func (client *ServiceClient) upgradeCreateRequest(ctx context.Context, resourceGroupName string, searchServiceName string, options *ServiceClientBeginUpgradeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/upgrade" + 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.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-02-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/service_client_example_test.go b/sdk/resourcemanager/search/armsearch/service_client_example_test.go new file mode 100644 index 000000000000..9f05320c407d --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/service_client_example_test.go @@ -0,0 +1,94 @@ +//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/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/UpgradeSearchServiceToLatestVersion.json +func ExampleServiceClient_BeginUpgrade() { + 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.NewServiceClient().BeginUpgrade(ctx, "rg1", "mysearchservice", 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"), + // "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](1), + // ServiceUpgradeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-01T00:00:00.000Z"); return t}()), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, + // Status: to.Ptr(armsearch.SearchServiceStatusRunning), + // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard), + // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, + // } +} diff --git a/sdk/resourcemanager/search/armsearch/services_client.go b/sdk/resourcemanager/search/armsearch/services_client.go index 66e72d32a30c..82772409d01c 100644 --- a/sdk/resourcemanager/search/armsearch/services_client.go +++ b/sdk/resourcemanager/search/armsearch/services_client.go @@ -48,7 +48,7 @@ func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, // must be globally unique since they are part of the service URI (https://.search.windows.net). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview // - checkNameAvailabilityInput - The resource name and type to check. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -88,7 +88,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -113,7 +113,7 @@ 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-02-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 to create or update. Search service names must only contain @@ -147,7 +147,7 @@ func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceG // all properties will be updated with the given values. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview func (client *ServicesClient) createOrUpdate(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "ServicesClient.BeginCreateOrUpdate" @@ -189,7 +189,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -204,7 +204,7 @@ 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-02-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. @@ -252,7 +252,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -264,7 +264,7 @@ 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-02-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. @@ -313,7 +313,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -333,7 +333,7 @@ func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesCl // NewListByResourceGroupPager - Gets a list of all Search services in the given resource group. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get @@ -379,7 +379,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -399,7 +399,7 @@ func (client *ServicesClient) listByResourceGroupHandleResponse(resp *http.Respo // NewListBySubscriptionPager - Gets a list of all Search services in the given subscription. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. // - options - ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager @@ -439,7 +439,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -460,7 +460,7 @@ 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-02-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 to update. @@ -510,7 +510,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-02-01-preview") 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 index b1e625c427a5..1ff1d3768b93 100644 --- a/sdk/resourcemanager/search/armsearch/services_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/services_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateService.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -35,6 +35,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), HostingMode: to.Ptr(armsearch.HostingModeDefault), PartitionCount: to.Ptr[int32](1), ReplicaCount: to.Ptr[int32](3), @@ -66,6 +67,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -73,6 +75,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -89,14 +92,20 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOptions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -118,6 +127,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOp AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), }, }, + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), HostingMode: to.Ptr(armsearch.HostingModeDefault), PartitionCount: to.Ptr[int32](1), ReplicaCount: to.Ptr[int32](3), @@ -150,12 +160,14 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOp // AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -172,14 +184,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOp // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(true), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisableLocalAuth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -196,6 +217,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisabl "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), DisableLocalAuth: to.Ptr(true), HostingMode: to.Ptr(armsearch.HostingModeDefault), PartitionCount: to.Ptr[int32](1), @@ -224,6 +246,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisabl // "app-name": to.Ptr("My e-commerce app"), // }, // Properties: &armsearch.ServiceProperties{ + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(true), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -231,6 +254,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisabl // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -247,14 +271,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisabl // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -271,6 +304,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), HostingMode: to.Ptr(armsearch.HostingModeDefault), PartitionCount: to.Ptr[int32](1), PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), @@ -303,6 +337,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -310,6 +345,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -326,14 +362,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -350,6 +395,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), HostingMode: to.Ptr(armsearch.HostingModeDefault), NetworkRuleSet: &armsearch.NetworkRuleSet{ IPRules: []*armsearch.IPRule{ @@ -390,6 +436,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -397,6 +444,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // IPRules: []*armsearch.IPRule{ @@ -417,14 +465,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -441,6 +498,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), HostingMode: to.Ptr(armsearch.HostingModeDefault), NetworkRuleSet: &armsearch.NetworkRuleSet{ Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), @@ -482,6 +540,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -489,6 +548,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), @@ -510,14 +570,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllo // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCmkEnforcement() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -534,6 +603,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCm "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), EncryptionWithCmk: &armsearch.EncryptionWithCmk{ Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), }, @@ -568,6 +638,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCm // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -575,6 +646,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCm // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -591,14 +663,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCm // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDataExfiltration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -615,6 +696,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDa "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, HostingMode: to.Ptr(armsearch.HostingModeDefault), @@ -648,6 +730,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDa // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, @@ -655,6 +738,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDa // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -671,14 +755,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDa // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -701,6 +794,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId }, }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), HostingMode: to.Ptr(armsearch.HostingModeDefault), PartitionCount: to.Ptr[int32](1), ReplicaCount: to.Ptr[int32](3), @@ -743,6 +837,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -750,6 +845,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -766,14 +862,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithId // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticSearch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -790,6 +895,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticS "app-name": to.Ptr("My e-commerce app"), }, Properties: &armsearch.ServiceProperties{ + ComputeType: to.Ptr(armsearch.ComputeTypeDefault), HostingMode: to.Ptr(armsearch.HostingModeDefault), PartitionCount: to.Ptr[int32](1), ReplicaCount: to.Ptr[int32](3), @@ -822,6 +928,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticS // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -829,6 +936,7 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticS // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -846,14 +954,23 @@ func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticS // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateService.json func ExampleServicesClient_Update_searchUpdateService() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -893,6 +1010,7 @@ func ExampleServicesClient_Update_searchUpdateService() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -900,6 +1018,7 @@ func ExampleServicesClient_Update_searchUpdateService() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -916,14 +1035,23 @@ func ExampleServicesClient_Update_searchUpdateService() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceAuthOptions.json func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -969,12 +1097,14 @@ func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { // AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -991,14 +1121,23 @@ func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1035,6 +1174,7 @@ func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { // "new-tag": to.Ptr("Adding a new tag"), // }, // Properties: &armsearch.ServiceProperties{ + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(true), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1042,6 +1182,7 @@ func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1058,14 +1199,23 @@ func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEndpoints() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1103,6 +1253,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEnd // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1110,6 +1261,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEnd // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1126,14 +1278,23 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEnd // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameBasic), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPs() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1180,6 +1341,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1187,6 +1349,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // IPRules: []*armsearch.IPRule{ @@ -1204,14 +1367,23 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1259,6 +1431,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1266,6 +1439,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), @@ -1284,14 +1458,23 @@ func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCust // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1328,6 +1511,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1335,6 +1519,7 @@ func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1351,14 +1536,23 @@ func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1401,6 +1595,7 @@ func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1408,6 +1603,7 @@ func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1424,14 +1620,23 @@ func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1473,6 +1678,7 @@ func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, @@ -1480,6 +1686,7 @@ func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1496,14 +1703,23 @@ func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1544,6 +1760,7 @@ func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1551,6 +1768,7 @@ func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1568,14 +1786,102 @@ func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithSku.json +func ExampleServicesClient_Update_searchUpdateServiceWithSku() { + 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{ + SKU: &armsearch.SKU{ + Name: to.Ptr(armsearch.SKUNameStandard2), + }, + 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](1), + // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ + // }, + // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), + // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), + // }, + // SKU: &armsearch.SKU{ + // Name: to.Ptr(armsearch.SKUNameStandard2), + // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchGetService.json func ExampleServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1606,6 +1912,7 @@ func ExampleServicesClient_Get() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1613,6 +1920,7 @@ func ExampleServicesClient_Get() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1625,18 +1933,28 @@ func ExampleServicesClient_Get() { // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), // ReplicaCount: to.Ptr[int32](3), + // ServiceUpgradeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2025-02-01T00:00:00.000Z"); return t}()), // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchDeleteService.json func ExampleServicesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1653,7 +1971,7 @@ func ExampleServicesClient_Delete() { } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListServicesByResourceGroup.json func ExampleServicesClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1690,6 +2008,7 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1697,6 +2016,7 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1713,10 +2033,19 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // }, // { // Name: to.Ptr("mysearchservice2"), @@ -1731,6 +2060,7 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1738,6 +2068,7 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1754,16 +2085,25 @@ func ExampleServicesClient_NewListByResourceGroupPager() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameBasic), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // }}, // } } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListServicesBySubscription.json func ExampleServicesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -1800,6 +2140,7 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1807,6 +2148,7 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1823,10 +2165,19 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameStandard), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // }, // { // Name: to.Ptr("mysearchservice2"), @@ -1841,6 +2192,7 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // APIKeyOnly: map[string]any{ // }, // }, + // ComputeType: to.Ptr(armsearch.ComputeTypeDefault), // DisableLocalAuth: to.Ptr(false), // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ // }, @@ -1848,6 +2200,7 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), // }, + // Endpoint: to.Ptr("https://mysearchservice.search.windows.net/"), // HostingMode: to.Ptr(armsearch.HostingModeDefault), // NetworkRuleSet: &armsearch.NetworkRuleSet{ // Bypass: to.Ptr(armsearch.SearchBypassNone), @@ -1864,16 +2217,25 @@ func ExampleServicesClient_NewListBySubscriptionPager() { // }, // Status: to.Ptr(armsearch.SearchServiceStatusRunning), // StatusDetails: to.Ptr(""), + // UpgradeAvailable: to.Ptr(false), // }, // SKU: &armsearch.SKU{ // Name: to.Ptr(armsearch.SKUNameBasic), // }, + // SystemData: &armsearch.SystemData{ + // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-01-01T00:00:00.000Z"); return t}()), + // CreatedBy: to.Ptr("My e-commerce app"), + // CreatedByType: to.Ptr(armsearch.CreatedByTypeApplication), + // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-11-01T00:00:00.000Z"); return t}()), + // LastModifiedBy: to.Ptr("fakeuser@contoso.com"), + // LastModifiedByType: to.Ptr(armsearch.CreatedByTypeUser), + // }, // }}, // } } } -// 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 +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCheckNameAvailability.json func ExampleServicesClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go index 7af10bdf569d..cee2dd5946db 100644 --- a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go +++ b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go @@ -48,7 +48,7 @@ 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-02-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. @@ -81,7 +81,7 @@ func (client *SharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context. // given resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview func (client *SharedPrivateLinkResourcesClient) createOrUpdate(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, sharedPrivateLinkResource SharedPrivateLinkResource, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginCreateOrUpdate" @@ -127,7 +127,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -142,7 +142,7 @@ 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-02-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. @@ -173,7 +173,7 @@ func (client *SharedPrivateLinkResourcesClient) BeginDelete(ctx context.Context, // Delete - Initiates the deletion of the shared private link resource from the search service. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview func (client *SharedPrivateLinkResourcesClient) deleteOperation(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "SharedPrivateLinkResourcesClient.BeginDelete" @@ -219,7 +219,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -231,7 +231,7 @@ 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-02-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. @@ -287,7 +287,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-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if searchManagementRequestOptions != nil && searchManagementRequestOptions.ClientRequestID != nil { @@ -307,7 +307,7 @@ 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-02-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. @@ -358,7 +358,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-02-01-preview") 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 index b80e4998fc5d..680002a0d39d 100644 --- a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go @@ -18,7 +18,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -59,7 +59,7 @@ func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetSharedPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetSharedPrivateLinkResource.json func ExampleSharedPrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -90,7 +90,7 @@ func ExampleSharedPrivateLinkResourcesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/DeleteSharedPrivateLinkResource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/DeleteSharedPrivateLinkResource.json func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -111,7 +111,7 @@ func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListSharedPrivateLinkResourcesByService.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/ListSharedPrivateLinkResourcesByService.json func ExampleSharedPrivateLinkResourcesClient_NewListByServicePager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/search/armsearch/time_rfc3339.go b/sdk/resourcemanager/search/armsearch/time_rfc3339.go new file mode 100644 index 000000000000..4152c6c035a9 --- /dev/null +++ b/sdk/resourcemanager/search/armsearch/time_rfc3339.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsearch + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" + "regexp" + "strings" + "time" +) + +// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. +var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) + +const ( + utcDateTime = "2006-01-02T15:04:05.999999999" + utcDateTimeJSON = `"` + utcDateTime + `"` + utcDateTimeNoT = "2006-01-02 15:04:05.999999999" + utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` + dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` + dateTimeJSON = `"` + time.RFC3339Nano + `"` + dateTimeJSONNoT = `"` + dateTimeNoT + `"` +) + +type dateTimeRFC3339 time.Time + +func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalJSON() +} + +func (t dateTimeRFC3339) MarshalText() ([]byte, error) { + tt := time.Time(t) + return tt.MarshalText() +} + +func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = dateTimeJSON + } else if tzOffset { + layout = dateTimeJSONNoT + } else if hasT { + layout = utcDateTimeJSON + } else { + layout = utcDateTimeJSONNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + tzOffset := tzOffsetRegex.Match(data) + hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") + var layout string + if tzOffset && hasT { + layout = time.RFC3339Nano + } else if tzOffset { + layout = dateTimeNoT + } else if hasT { + layout = utcDateTime + } else { + layout = utcDateTimeNoT + } + return t.Parse(layout, string(data)) +} + +func (t *dateTimeRFC3339) Parse(layout, value string) error { + p, err := time.Parse(layout, strings.ToUpper(value)) + *t = dateTimeRFC3339(p) + return err +} + +func (t dateTimeRFC3339) String() string { + return time.Time(t).Format(time.RFC3339Nano) +} + +func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + return + } else if reflect.ValueOf(t).IsNil() { + return + } + m[k] = (*dateTimeRFC3339)(t) +} + +func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux dateTimeRFC3339 + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/search/armsearch/usages_client.go b/sdk/resourcemanager/search/armsearch/usages_client.go index c0b6dff7d1ff..af4fec91a19b 100644 --- a/sdk/resourcemanager/search/armsearch/usages_client.go +++ b/sdk/resourcemanager/search/armsearch/usages_client.go @@ -46,7 +46,7 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o // NewListBySubscriptionPager - Get a list of all Azure AI Search quota usages across the subscription. // -// Generated from API version 2024-06-01-preview +// Generated from API version 2025-02-01-preview // - location - The unique location name for a Microsoft Azure geographic region. // - SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get // method. @@ -91,7 +91,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-02-01-preview") 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 index eb810b0385eb..67097fd5464f 100644 --- a/sdk/resourcemanager/search/armsearch/usages_client_example_test.go +++ b/sdk/resourcemanager/search/armsearch/usages_client_example_test.go @@ -17,7 +17,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetQuotaUsagesList.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b43042075540b8d67cce7d3d9f70b9b9f5a359da/specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetQuotaUsagesList.json func ExampleUsagesClient_NewListBySubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {