diff --git a/sdk/resourcemanager/search/armsearch/CHANGELOG.md b/sdk/resourcemanager/search/armsearch/CHANGELOG.md index 32a10eecbe55..ccfe59fc6bb4 100644 --- a/sdk/resourcemanager/search/armsearch/CHANGELOG.md +++ b/sdk/resourcemanager/search/armsearch/CHANGELOG.md @@ -1,5 +1,25 @@ # Release History +## 1.4.0-beta.2 (2024-05-17) +### Breaking Changes + +- Type of `Identity.UserAssignedIdentities` has been changed from `map[string]*UserAssignedManagedIdentity` to `map[string]*UserAssignedIdentity` +- Struct `UserAssignedManagedIdentity` has been removed + +### Features Added + +- New value `SearchBypassAzureServices` added to enum type `SearchBypass` +- New enum type `CreatedByType` with values `CreatedByTypeApplication`, `CreatedByTypeKey`, `CreatedByTypeManagedIdentity`, `CreatedByTypeUser` +- New struct `SystemData` +- New struct `UserAssignedIdentity` +- New field `SystemData` in struct `NetworkSecurityPerimeterConfiguration` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `SystemData` in struct `Service` +- New field `SystemData` in struct `ServiceUpdate` +- New field `SystemData` in struct `SharedPrivateLinkResource` + + ## 1.4.0-beta.1 (2024-03-22) ### Features Added diff --git a/sdk/resourcemanager/search/armsearch/adminkeys_client.go b/sdk/resourcemanager/search/armsearch/adminkeys_client.go index f2d2b9c866ea..bd6cc2f2dc89 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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index 7a0be192ebac..000000000000 --- a/sdk/resourcemanager/search/armsearch/adminkeys_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetAdminKeys.json -func ExampleAdminKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminKeysClient().Get(ctx, "rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdminKeyResult = armsearch.AdminKeyResult{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchRegenerateAdminKey.json -func ExampleAdminKeysClient_Regenerate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdminKeysClient().Regenerate(ctx, "rg1", "mysearchservice", armsearch.AdminKeyKindPrimary, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdminKeyResult = armsearch.AdminKeyResult{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), - // } -} diff --git a/sdk/resourcemanager/search/armsearch/autorest.md b/sdk/resourcemanager/search/armsearch/autorest.md index c968d1fd474f..bd3b06436901 100644 --- a/sdk/resourcemanager/search/armsearch/autorest.md +++ b/sdk/resourcemanager/search/armsearch/autorest.md @@ -5,9 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/search/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/search/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.4.0-beta.1 -tag: package-preview-2024-03 +module-version: 1.4.0-beta.2 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/search/armsearch/constants.go b/sdk/resourcemanager/search/armsearch/constants.go index 802ce1f598bf..0fc539d5a345 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.1" + moduleVersion = "v1.4.0-beta.2" ) // AADAuthFailureMode - Describes what response the data plane API of a search service would send for requests that failed @@ -51,6 +51,26 @@ func PossibleAdminKeyKindValues() []AdminKeyKind { } } +// 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, + } +} + // 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 @@ -163,20 +183,20 @@ func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConn // ProvisioningState - The state of the last provisioning operation performed on the search service. Provisioning is an intermediate // state that occurs while service capacity is being established. After capacity is set up, -// provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended +// provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended // polling interval is from 30 seconds to one minute) by using the Get // Search Service operation to see when an operation is completed. If you are using the free service, this value tends to -// come back as 'succeeded' directly in the call to Create search service. This is +// come back as 'Succeeded' directly in the call to Create search service. This is // because the free service uses capacity that is already set up. type ProvisioningState string const ( // ProvisioningStateFailed - The last provisioning operation has failed. - ProvisioningStateFailed ProvisioningState = "failed" + ProvisioningStateFailed ProvisioningState = "Failed" // ProvisioningStateProvisioning - The search service is being provisioned or scaled up or down. - ProvisioningStateProvisioning ProvisioningState = "provisioning" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" // ProvisioningStateSucceeded - The last provisioning operation has completed successfully. - ProvisioningStateSucceeded ProvisioningState = "succeeded" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. @@ -256,6 +276,9 @@ const ( // SearchBypassAzurePortal - Indicates that requests originating from the Azure portal can bypass the rules defined in the // 'ipRules' section. SearchBypassAzurePortal SearchBypass = "AzurePortal" + // SearchBypassAzureServices - Indicates that requests originating from Azure trusted services can bypass the rules defined + // in the 'ipRules' section. + SearchBypassAzureServices SearchBypass = "AzureServices" // SearchBypassNone - Indicates that no origin can bypass the rules defined in the 'ipRules' section. This is the default. SearchBypassNone SearchBypass = "None" ) @@ -264,6 +287,7 @@ const ( func PossibleSearchBypassValues() []SearchBypass { return []SearchBypass{ SearchBypassAzurePortal, + SearchBypassAzureServices, SearchBypassNone, } } 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/go.mod b/sdk/resourcemanager/search/armsearch/go.mod index 383bc7a66173..49409d74f530 100644 --- a/sdk/resourcemanager/search/armsearch/go.mod +++ b/sdk/resourcemanager/search/armsearch/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.11.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 github.com/Azure/azure-sdk-for-go/sdk/internal v1.7.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 @@ -12,6 +11,7 @@ require ( ) require ( + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.2 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect diff --git a/sdk/resourcemanager/search/armsearch/management_client.go b/sdk/resourcemanager/search/armsearch/management_client.go index 6654a36c6ec9..7dd8a16e41cf 100644 --- a/sdk/resourcemanager/search/armsearch/management_client.go +++ b/sdk/resourcemanager/search/armsearch/management_client.go @@ -47,7 +47,7 @@ func NewManagementClient(subscriptionID string, credential azcore.TokenCredentia // UsageBySubscriptionSKU - Gets the quota usage for a search sku in the given subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index 92ea71dfc3c7..000000000000 --- a/sdk/resourcemanager/search/armsearch/management_client_example_test.go +++ /dev/null @@ -1,48 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsage.json -func ExampleManagementClient_UsageBySubscriptionSKU() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewManagementClient().UsageBySubscriptionSKU(ctx, "westus", "free", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.QuotaUsageResult = armsearch.QuotaUsageResult{ - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("F - Free"), - // Value: to.Ptr("free"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/{skuName}"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // } -} diff --git a/sdk/resourcemanager/search/armsearch/models.go b/sdk/resourcemanager/search/armsearch/models.go index 6cdaf457d10e..dfbeb74fd9cc 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. @@ -90,7 +92,7 @@ type Identity struct { // The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource // IDs in the form: // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - UserAssignedIdentities map[string]*UserAssignedManagedIdentity + UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The principal ID of the system-assigned identity of the search service. PrincipalID *string @@ -189,12 +191,15 @@ type NetworkSecurityPerimeterConfiguration struct { // Resource properties. Properties *NetworkSecurityPerimeterConfigurationProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // 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 } @@ -343,12 +348,15 @@ type PrivateEndpointConnection struct { // Describes the properties of an existing private endpoint connection to the Azure AI Search service. Properties *PrivateEndpointConnectionProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // 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 } @@ -401,7 +409,7 @@ type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState struct // PrivateLinkResource - Describes a supported private link resource for the Azure AI Search service. type PrivateLinkResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource @@ -410,6 +418,9 @@ type PrivateLinkResource struct { // READ-ONLY; Describes the properties of a supported private link resource for the Azure AI Search service. Properties *PrivateLinkResourceProperties + // 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 } @@ -515,12 +526,15 @@ type Service struct { // Resource tags. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // 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 } @@ -589,10 +603,10 @@ type ServiceProperties struct { // READ-ONLY; The state of the last provisioning operation performed on the search service. Provisioning is an intermediate // state that occurs while service capacity is being established. After capacity is set up, - // provisioningState changes to either 'succeeded' or 'failed'. Client applications can poll provisioning status (the recommended + // provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended // polling interval is from 30 seconds to one minute) by using the Get // Search Service operation to see when an operation is completed. If you are using the free service, this value tends to - // come back as 'succeeded' directly in the call to Create search service. This is + // come back as 'Succeeded' directly in the call to Create search service. This is // because the free service uses capacity that is already set up. ProvisioningState *ProvisioningState @@ -635,12 +649,15 @@ type ServiceUpdate struct { // Tags to help categorize the resource in the Azure portal. Tags map[string]*string - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // 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 } @@ -677,12 +694,15 @@ type SharedPrivateLinkResource struct { // Describes the properties of a shared private link resource managed by the Azure AI Search service. Properties *SharedPrivateLinkResourceProperties - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // 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,11 +740,32 @@ type SharedPrivateLinkResourceProperties struct { Status *SharedPrivateLinkResourceStatus } -// UserAssignedManagedIdentity - The details of the user assigned managed identity assigned to the search service. -type UserAssignedManagedIdentity struct { - // READ-ONLY; The client ID of user assigned identity. +// 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 +} + +// UserAssignedIdentity - User assigned identity properties +type UserAssignedIdentity struct { + // READ-ONLY; The client ID of the assigned identity. ClientID *string - // READ-ONLY; The principal ID of user assigned identity. + // READ-ONLY; The principal ID of the assigned identity. PrincipalID *string } diff --git a/sdk/resourcemanager/search/armsearch/models_serde.go b/sdk/resourcemanager/search/armsearch/models_serde.go index 32cdd69b995d..35b7d3284572 100644 --- a/sdk/resourcemanager/search/armsearch/models_serde.go +++ b/sdk/resourcemanager/search/armsearch/models_serde.go @@ -619,6 +619,7 @@ func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error) { populate(objectMap, "id", n.ID) populate(objectMap, "name", n.Name) populate(objectMap, "properties", n.Properties) + populate(objectMap, "systemData", n.SystemData) populate(objectMap, "type", n.Type) return json.Marshal(objectMap) } @@ -641,6 +642,9 @@ func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error case "properties": err = unpopulate(val, "Properties", &n.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &n.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &n.Type) delete(rawMsg, key) @@ -1051,6 +1055,7 @@ func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1073,6 +1078,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -1222,6 +1230,7 @@ func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1244,6 +1253,9 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -1493,6 +1505,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 +1538,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) @@ -1666,6 +1682,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 +1715,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) @@ -1784,6 +1804,7 @@ func (s SharedPrivateLinkResource) MarshalJSON() ([]byte, error) { populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } @@ -1806,6 +1827,9 @@ func (s *SharedPrivateLinkResource) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &s.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) @@ -1895,16 +1919,63 @@ func (s *SharedPrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type UserAssignedManagedIdentity. -func (u UserAssignedManagedIdentity) MarshalJSON() ([]byte, error) { +// 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 UserAssignedIdentity. +func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "clientId", u.ClientID) populate(objectMap, "principalId", u.PrincipalID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedManagedIdentity. -func (u *UserAssignedManagedIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedIdentity. +func (u *UserAssignedIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", u, err) diff --git a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client.go index da048df81155..2575eb352676 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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -100,7 +100,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -166,7 +166,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) listByServiceCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview +// Generated from API version 2024-06-01-preview func (client *NetworkSecurityPerimeterConfigurationsClient) reconcile(ctx context.Context, resourceGroupName string, searchServiceName string, nspConfigName string, options *NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions) (*http.Response, error) { var err error const operationName = "NetworkSecurityPerimeterConfigurationsClient.BeginReconcile" @@ -262,7 +262,7 @@ func (client *NetworkSecurityPerimeterConfigurationsClient) reconcileCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go b/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go deleted file mode 100644 index aee2ff198987..000000000000 --- a/sdk/resourcemanager/search/armsearch/networksecurityperimeterconfigurations_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json -func ExampleNetworkSecurityPerimeterConfigurationsClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().NewListByServicePager("rg1", "mysearchservice", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.NetworkSecurityPerimeterConfigurationListResult = armsearch.NetworkSecurityPerimeterConfigurationListResult{ - // Value: []*armsearch.NetworkSecurityPerimeterConfiguration{ - // { - // Name: to.Ptr("00000001-2222-3333-4444-111144444444.assoc1"), - // Type: to.Ptr("Microsoft.Search/searchServices/networkSecurityPerimeterConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/networkSecurityPerimeterConfigurations/00000001-2222-3333-4444-111144444444.assoc1"), - // Properties: &armsearch.NetworkSecurityPerimeterConfigurationProperties{ - // NetworkSecurityPerimeter: &armsearch.NSPConfigPerimeter{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"), - // Location: to.Ptr("westus"), - // }, - // Profile: &armsearch.NSPConfigProfile{ - // Name: to.Ptr("profile1"), - // AccessRules: []*armsearch.NSPConfigAccessRule{ - // { - // Name: to.Ptr("rule1"), - // Properties: &armsearch.NSPConfigAccessRuleProperties{ - // AddressPrefixes: []*string{ - // to.Ptr("148.0.0.0/8"), - // to.Ptr("152.4.6.0/24")}, - // Direction: to.Ptr("Inbound"), - // }, - // }}, - // AccessRulesVersion: to.Ptr("0"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ResourceAssociation: &armsearch.NSPConfigAssociation{ - // Name: to.Ptr("assoc1"), - // AccessMode: to.Ptr("Enforced"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json -func ExampleNetworkSecurityPerimeterConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().Get(ctx, "rg1", "mysearchservice", "00000001-2222-3333-4444-111144444444.assoc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.NetworkSecurityPerimeterConfiguration = armsearch.NetworkSecurityPerimeterConfiguration{ - // Name: to.Ptr("00000001-2222-3333-4444-111144444444.assoc1"), - // Type: to.Ptr("Microsoft.Search/searchServices/networkSecurityPerimeterConfigurations"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/networkSecurityPerimeterConfigurations/00000001-2222-3333-4444-111144444444.assoc1"), - // Properties: &armsearch.NetworkSecurityPerimeterConfigurationProperties{ - // NetworkSecurityPerimeter: &armsearch.NSPConfigPerimeter{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/networkRG/providers/Microsoft.Network/networkSecurityPerimeters/perimeter1"), - // Location: to.Ptr("westus"), - // }, - // Profile: &armsearch.NSPConfigProfile{ - // Name: to.Ptr("profile1"), - // AccessRules: []*armsearch.NSPConfigAccessRule{ - // { - // Name: to.Ptr("rule1"), - // Properties: &armsearch.NSPConfigAccessRuleProperties{ - // AddressPrefixes: []*string{ - // to.Ptr("148.0.0.0/8"), - // to.Ptr("152.4.6.0/24")}, - // Direction: to.Ptr("Inbound"), - // }, - // }}, - // AccessRulesVersion: to.Ptr("0"), - // }, - // ProvisioningState: to.Ptr("Succeeded"), - // ResourceAssociation: &armsearch.NSPConfigAssociation{ - // Name: to.Ptr("assoc1"), - // AccessMode: to.Ptr("Enforced"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json -func ExampleNetworkSecurityPerimeterConfigurationsClient_BeginReconcile() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewNetworkSecurityPerimeterConfigurationsClient().BeginReconcile(ctx, "rg1", "mysearchservice", "00000001-2222-3333-4444-111144444444.assoc1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/search/armsearch/operations_client.go b/sdk/resourcemanager/search/armsearch/operations_client.go index 8c07c3da3834..5cd88b29d96a 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-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/search/armsearch/operations_client_example_test.go b/sdk/resourcemanager/search/armsearch/operations_client_example_test.go deleted file mode 100644 index e03f9da21072..000000000000 --- a/sdk/resourcemanager/search/armsearch/operations_client_example_test.go +++ /dev/null @@ -1,644 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armsearch.OperationListResult{ - // Value: []*armsearch.Operation{ - // { - // Name: to.Ptr("Microsoft.Search/operations/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Lists all of the available operations of the Microsoft.Search provider."), - // Operation: to.Ptr("List all available operations"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/register/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Registers the subscription for the search resource provider and enables the creation of search services."), - // Operation: to.Ptr("Register the Search Resource Provider"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates or updates the search service."), - // Operation: to.Ptr("Set Search Service"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Reads the search service."), - // Operation: to.Ptr("Get Search Service"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes the search service."), - // Operation: to.Ptr("Delete Search Service"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/start/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Starts the search service."), - // Operation: to.Ptr("Start Search Service"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/stop/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Stops the search service."), - // Operation: to.Ptr("Stop Search Service"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/listAdminKeys/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Reads the admin keys."), - // Operation: to.Ptr("Get Admin Key"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/regenerateAdminKey/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Regenerates the admin key."), - // Operation: to.Ptr("Regenerate Admin Key"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/listQueryKeys/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of query API keys for the given Azure AI Search service."), - // Operation: to.Ptr("Get Query Keys"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("API Keys"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/createQueryKey/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates the query key."), - // Operation: to.Ptr("Create Query Key"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Search Services"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/deleteQueryKey/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes the query key."), - // Operation: to.Ptr("Delete Query Key"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("API Keys"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/checkNameAvailability/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Checks availability of the service name."), - // Operation: to.Ptr("Check Service Name Availability"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Service Name Availability"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/diagnosticSettings/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Gets the diganostic setting for the resource."), - // Operation: to.Ptr("Get Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Diagnostic Settings"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/diagnosticSettings/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates or updates the diganostic setting for the resource."), - // Operation: to.Ptr("Set Diagnostic Setting"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Diagnostic Settings"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/metricDefinitions/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Gets the available metrics for the search service."), - // Operation: to.Ptr("Read search service metric definitions"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("The metric definitions for the search service"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: &armsearch.OperationProperties{ - // ServiceSpecification: &armsearch.OperationServiceSpecification{ - // MetricSpecifications: []*armsearch.OperationMetricsSpecification{ - // { - // Name: to.Ptr("SearchLatency"), - // AggregationType: to.Ptr("Average"), - // Availabilities: []*armsearch.OperationAvailability{ - // { - // BlobDuration: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT1M"), - // }}, - // DisplayDescription: to.Ptr("Average search latency for the search service"), - // DisplayName: to.Ptr("Search Latency"), - // Unit: to.Ptr("Seconds"), - // }, - // { - // Name: to.Ptr("SearchQueriesPerSecond"), - // AggregationType: to.Ptr("Average"), - // Availabilities: []*armsearch.OperationAvailability{ - // { - // BlobDuration: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT1M"), - // }}, - // DisplayDescription: to.Ptr("Search queries per second for the search service."), - // DisplayName: to.Ptr("Search queries per second"), - // Unit: to.Ptr("CountPerSecond"), - // }, - // { - // Name: to.Ptr("ThrottledSearchQueriesPercentage"), - // AggregationType: to.Ptr("Average"), - // Availabilities: []*armsearch.OperationAvailability{ - // { - // BlobDuration: to.Ptr("PT1H"), - // TimeGrain: to.Ptr("PT1M"), - // }}, - // DisplayDescription: to.Ptr("Percentage of search queries that were throttled for the search service."), - // DisplayName: to.Ptr("Throttled search queries percentage"), - // Unit: to.Ptr("Percent"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/logDefinitions/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Gets the available logs for the search service."), - // Operation: to.Ptr("Read search service log definitions"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("The log definition for the search service"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("system"), - // Properties: &armsearch.OperationProperties{ - // ServiceSpecification: &armsearch.OperationServiceSpecification{ - // LogSpecifications: []*armsearch.OperationLogsSpecification{ - // { - // Name: to.Ptr("OperationLogs"), - // BlobDuration: to.Ptr("PT1H"), - // DisplayName: to.Ptr("Operation Logs"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/validate/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Validates a private endpoint connection create call from NRP (Microsoft.Network Resource Provider) side."), - // Operation: to.Ptr("Validate Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates a private endpoint connection proxy with the specified parameters or updates the properties or tags for the specified private endpoint connection proxy."), - // Operation: to.Ptr("Create Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of private endpoint connection proxies or gets the properties for the specified private endpoint connection proxy."), - // Operation: to.Ptr("Get Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnectionProxies/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes an existing private endpoint connection proxy."), - // Operation: to.Ptr("Delete Private Endpoint Connection Proxy"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Private Endpoint Connection Proxy"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates a private endpoint connection with the specified parameters or updates the properties or tags for the specified private endpoint connections."), - // Operation: to.Ptr("Create Private Endpoint Connection"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Private Endpoint Connection"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of private endpoint connections or gets the properties for the specified private endpoint connection."), - // Operation: to.Ptr("Get Private Endpoint Connection"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Private Endpoint Connection"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes an existing private endpoint connection."), - // Operation: to.Ptr("Delete Private Endpoint Connection"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Private Endpoint Connection"), - // }, - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Creates a new shared private link resource with the specified parameters or updates the properties for the specified shared private link resource."), - // Operation: to.Ptr("Create Shared Private Link Resource"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Shared Private Link Resource"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Returns the list of shared private link resources or gets the properties for the specified shared private link resource."), - // Operation: to.Ptr("Get Shared Private Link Resource"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Shared Private Link Resource"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Deletes an existing shared private link resource."), - // Operation: to.Ptr("Delete Shared Private Link Resource"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Shared Private Link Resource"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources/operationStatuses/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Get the details of a long running shared private link resource operation."), - // Operation: to.Ptr("Get Operation Status"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Shared Private Link Resource"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexes/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Return an index or its statistics, return a list of indexes or their statistics, or test the lexical analysis components of an index."), - // Operation: to.Ptr("Read Index"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Indexes"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexes/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Create an index or modify its properties."), - // Operation: to.Ptr("Create or Update Index"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Indexes"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexes/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Delete an index."), - // Operation: to.Ptr("Delete Index"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Indexes"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/synonymMaps/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Return a synonym map or a list of synonym maps."), - // Operation: to.Ptr("Read Synonym Map"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Synonym Maps"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/synonymMaps/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Create a synonym map or modify its properties."), - // Operation: to.Ptr("Create or Update Synonym Map"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Synonym Maps"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/synonymMaps/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Delete a synonym map."), - // Operation: to.Ptr("Delete Synonym Map"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Synonym Maps"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/dataSources/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Return a data source or a list of data sources."), - // Operation: to.Ptr("Read Data Source"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Data Sources"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/dataSources/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Create a data source or modify its properties."), - // Operation: to.Ptr("Create or Update Data Source"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Data Sources"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/dataSources/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Delete a data source."), - // Operation: to.Ptr("Delete Data Source"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Data Sources"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/skillsets/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Return a skillset or a list of skillsets."), - // Operation: to.Ptr("Read Skillset"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Skillsets"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/skillsets/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Create a skillset or modify its properties."), - // Operation: to.Ptr("Create or Update Skillset"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Skillsets"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/skillsets/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Delete a skillset."), - // Operation: to.Ptr("Delete Skillset"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Skillsets"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexers/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Return an indexer or its status, or return a list of indexers or their statuses."), - // Operation: to.Ptr("Read Indexer"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Indexers"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexers/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Create an indexer, modify its properties, or manage its execution."), - // Operation: to.Ptr("Create or Manage Indexer"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Indexers"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexers/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Delete an indexer."), - // Operation: to.Ptr("Delete Indexer"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Indexers"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Return a debug session or a list of debug sessions."), - // Operation: to.Ptr("Read Debug Session"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Debug Sessions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Create a debug session or modify its properties."), - // Operation: to.Ptr("Create or Update Debug Session"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Debug Sessions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Delete a debug session."), - // Operation: to.Ptr("Delete Debug Session"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Debug Sessions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/debugSessions/execute/action"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Use a debug session, get execution data, or evaluate expressions on it."), - // Operation: to.Ptr("Execute Debug Session"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Debug Sessions"), - // }, - // IsDataAction: to.Ptr(false), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexes/documents/read"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Read documents or suggested query terms from an index."), - // Operation: to.Ptr("Read Documents"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Documents"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexes/documents/write"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Upload documents to an index or modify existing documents."), - // Operation: to.Ptr("Write Documents"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Documents"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // }, - // { - // Name: to.Ptr("Microsoft.Search/searchServices/indexes/documents/delete"), - // Display: &armsearch.OperationDisplay{ - // Description: to.Ptr("Delete documents from an index."), - // Operation: to.Ptr("Delete Documents"), - // Provider: to.Ptr("Microsoft Search"), - // Resource: to.Ptr("Documents"), - // }, - // IsDataAction: to.Ptr(true), - // Origin: to.Ptr("user,system"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go b/sdk/resourcemanager/search/armsearch/privateendpointconnections_client.go index f0a68c27efd8..78e857b7c8b1 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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -103,7 +103,7 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -180,7 +180,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -251,7 +251,7 @@ func (client *PrivateEndpointConnectionsClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -329,7 +329,7 @@ func (client *PrivateEndpointConnectionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index 80dcb67a4911..000000000000 --- a/sdk/resourcemanager/search/armsearch/privateendpointconnections_client_example_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/UpdatePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Update(ctx, "rg1", "mysearchservice", "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546", armsearch.PrivateEndpointConnection{ - Properties: &armsearch.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - Description: to.Ptr("Rejected for some reason."), - Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusRejected), - }, - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armsearch.PrivateEndpointConnection{ - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr("Rejected for some reason."), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusRejected), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Get(ctx, "rg1", "mysearchservice", "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armsearch.PrivateEndpointConnection{ - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusApproved), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionsClient().Delete(ctx, "rg1", "mysearchservice", "testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armsearch.PrivateEndpointConnection{ - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusDisconnected), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListPrivateEndpointConnectionsByService.json -func ExamplePrivateEndpointConnectionsClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListByServicePager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armsearch.PrivateEndpointConnectionListResult{ - // Value: []*armsearch.PrivateEndpointConnection{ - // { - // Name: to.Ptr("testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateEndpointConnections/testEndpoint.50bf4fbe-d7c1-4b48-a642-4f5892642546"), - // Properties: &armsearch.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armsearch.PrivateEndpointConnectionPropertiesPrivateEndpoint{ - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/testEndpoint"), - // }, - // PrivateLinkServiceConnectionState: &armsearch.PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState{ - // Description: to.Ptr(""), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armsearch.PrivateLinkServiceConnectionStatusApproved), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/privatelinkresources_client.go index 0a6b65b8fd6c..e69d28c0316d 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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -98,7 +98,7 @@ func (client *PrivateLinkResourcesClient) listSupportedCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index 9864e62c7c6c..000000000000 --- a/sdk/resourcemanager/search/armsearch/privatelinkresources_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSupportedPrivateLinkResources.json -func ExamplePrivateLinkResourcesClient_NewListSupportedPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewPrivateLinkResourcesClient().NewListSupportedPager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourcesResult = armsearch.PrivateLinkResourcesResult{ - // Value: []*armsearch.PrivateLinkResource{ - // { - // Name: to.Ptr("searchService"), - // Type: to.Ptr("Microsoft.Search/searchServices/privateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/privateLinkResources/searchService"), - // Properties: &armsearch.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("searchService"), - // RequiredMembers: []*string{ - // to.Ptr("searchService")}, - // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.search.windows.net")}, - // ShareablePrivateLinkResourceTypes: []*armsearch.ShareablePrivateLinkResourceType{ - // { - // Name: to.Ptr("blob"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Storage/storageAccounts"), - // Description: to.Ptr("Azure AI Search indexers can connect to blobs in Azure Storage for reading data from an indexer data source, for writing intermediate results of indexer execution or for storing any knowledge store projections."), - // GroupID: to.Ptr("blob"), - // }, - // }, - // { - // Name: to.Ptr("table"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Storage/storageAccounts"), - // Description: to.Ptr("Azure AI Search indexers can connect to tables in Azure Storage for reading data from an indexer data source, for writing intermediate results of indexer execution or for storing any knowledge store projections."), - // GroupID: to.Ptr("table"), - // }, - // }, - // { - // Name: to.Ptr("Sql"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.DocumentDB/databaseAccounts"), - // Description: to.Ptr("Azure AI Search indexers can connect to Azure Cosmos DB API for NoSQL for reading data from an indexer data source."), - // GroupID: to.Ptr("Sql"), - // }, - // }, - // { - // Name: to.Ptr("plr"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Sql/servers"), - // Description: to.Ptr("Azure AI Search indexers can connect to Azure SQL database on a server for reading data from an indexer data source."), - // GroupID: to.Ptr("sqlServer"), - // }, - // }, - // { - // Name: to.Ptr("vault"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.KeyVault/vaults"), - // Description: to.Ptr("Azure AI Search can access keys in Azure Key Vault to encrypt sensitive data in a search index and synonym map data."), - // GroupID: to.Ptr("vault"), - // }, - // }, - // { - // Name: to.Ptr("plr"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.DBforMySQL/servers"), - // Description: to.Ptr("Azure AI Search indexers can connect to MySQL databases for reading data from an indexer data source."), - // GroupID: to.Ptr("mysqlServer"), - // }, - // }, - // { - // Name: to.Ptr("site"), - // Properties: &armsearch.ShareablePrivateLinkResourceProperties{ - // Type: to.Ptr("Microsoft.Web/sites"), - // Description: to.Ptr("For custom skills that connect to an app service, you can specify sites as the group ID."), - // GroupID: to.Ptr("sites"), - // }, - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/search/armsearch/querykeys_client.go b/sdk/resourcemanager/search/armsearch/querykeys_client.go index a85dd39e6c17..f8d2e9d01837 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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -238,7 +238,7 @@ func (client *QueryKeysClient) listBySearchServiceCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index d2270f0ba429..000000000000 --- a/sdk/resourcemanager/search/armsearch/querykeys_client_example_test.go +++ /dev/null @@ -1,95 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateQueryKey.json -func ExampleQueryKeysClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewQueryKeysClient().Create(ctx, "rg1", "mysearchservice", "An API key granting read-only access to the documents collection of an index.", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.QueryKey = armsearch.QueryKey{ - // Name: to.Ptr("An API key granting read-only access to the documents collection of an index."), - // Key: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListQueryKeysBySearchService.json -func ExampleQueryKeysClient_NewListBySearchServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewQueryKeysClient().NewListBySearchServicePager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ListQueryKeysResult = armsearch.ListQueryKeysResult{ - // Value: []*armsearch.QueryKey{ - // { - // Name: to.Ptr("Query key for browser-based clients"), - // Key: to.Ptr(""), - // }, - // { - // Name: to.Ptr("Query key for mobile clients"), - // Key: to.Ptr(""), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteQueryKey.json -func ExampleQueryKeysClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewQueryKeysClient().Delete(ctx, "rg1", "mysearchservice", "", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/search/armsearch/services_client.go b/sdk/resourcemanager/search/armsearch/services_client.go index 6edd0ad3eed4..66e72d32a30c 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-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service 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-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - 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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service 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-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index 075ed1facba5..000000000000 --- a/sdk/resourcemanager/search/armsearch/services_client_example_test.go +++ /dev/null @@ -1,1902 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateService.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceAuthOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - AuthOptions: &armsearch.DataPlaneAuthOptions{ - AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), - }, - }, - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - // AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), - // }, - // }, - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceDisableLocalAuth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - DisableLocalAuth: to.Ptr(true), - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // DisableLocalAuth: to.Ptr(true), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), - ReplicaCount: to.Ptr[int32](3), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - HostingMode: to.Ptr(armsearch.HostingModeDefault), - NetworkRuleSet: &armsearch.NetworkRuleSet{ - IPRules: []*armsearch.IPRule{ - { - Value: to.Ptr("123.4.5.6"), - }, - { - Value: to.Ptr("123.4.6.0/18"), - }}, - }, - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](1), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // IPRules: []*armsearch.IPRule{ - // { - // Value: to.Ptr("123.4.5.6"), - // }, - // { - // Value: to.Ptr("123.4.6.0/18"), - // }}, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](1), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - HostingMode: to.Ptr(armsearch.HostingModeDefault), - NetworkRuleSet: &armsearch.NetworkRuleSet{ - Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), - IPRules: []*armsearch.IPRule{ - { - Value: to.Ptr("123.4.5.6"), - }, - { - Value: to.Ptr("123.4.6.0/18"), - }}, - }, - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](1), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), - // IPRules: []*armsearch.IPRule{ - // { - // Value: to.Ptr("123.4.5.6"), - // }, - // { - // Value: to.Ptr("123.4.6.0/18"), - // }}, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](1), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithCmkEnforcement() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), - }, - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithDataExfiltration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateServiceWithIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Identity: &armsearch.Identity{ - Type: to.Ptr(armsearch.IdentityTypeSystemAssignedUserAssigned), - UserAssignedIdentities: map[string]*armsearch.UserAssignedManagedIdentity{ - "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": {}, - }, - }, - Properties: &armsearch.ServiceProperties{ - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Identity: &armsearch.Identity{ - // Type: to.Ptr(armsearch.IdentityTypeSystemAssignedUserAssigned), - // PrincipalID: to.Ptr("9d1e1f18-2122-4988-a11c-878782e40a5c"), - // TenantID: to.Ptr("f686d426-8d16-42db-81b7-ab578e110ccd"), - // UserAssignedIdentities: map[string]*armsearch.UserAssignedManagedIdentity{ - // "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/rg1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/user-mi": &armsearch.UserAssignedManagedIdentity{ - // ClientID: to.Ptr("cd1dcac8-82dd-45b5-9aed-76795d529f6b"), - // PrincipalID: to.Ptr("24e07a75-1286-41e5-a15d-ded85ec3acd7"), - // }, - // }, - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json -func ExampleServicesClient_BeginCreateOrUpdate_searchCreateOrUpdateWithSemanticSearch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServicesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", armsearch.Service{ - Location: to.Ptr("westus"), - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - }, - Properties: &armsearch.ServiceProperties{ - HostingMode: to.Ptr(armsearch.HostingModeDefault), - PartitionCount: to.Ptr[int32](1), - ReplicaCount: to.Ptr[int32](3), - SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchFree), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchFree), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateService.json -func ExampleServicesClient_Update_searchUpdateService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - ReplicaCount: to.Ptr[int32](2), - }, - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - "new-tag": to.Ptr("Adding a new tag"), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](2), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceAuthOptions.json -func ExampleServicesClient_Update_searchUpdateServiceAuthOptions() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - AuthOptions: &armsearch.DataPlaneAuthOptions{ - AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), - }, - }, - ReplicaCount: to.Ptr[int32](2), - }, - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - "new-tag": to.Ptr("Adding a new tag"), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // AADOrAPIKey: &armsearch.DataPlaneAADOrAPIKeyAuthOption{ - // AADAuthFailureMode: to.Ptr(armsearch.AADAuthFailureModeHttp401WithBearerChallenge), - // }, - // }, - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](2), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json -func ExampleServicesClient_Update_searchUpdateServiceDisableLocalAuth() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - DisableLocalAuth: to.Ptr(true), - ReplicaCount: to.Ptr[int32](2), - }, - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - "new-tag": to.Ptr("Adding a new tag"), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // DisableLocalAuth: to.Ptr(true), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](2), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json -func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPrivateEndpoints() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - PartitionCount: to.Ptr[int32](1), - PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), - ReplicaCount: to.Ptr[int32](1), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessDisabled), - // ReplicaCount: to.Ptr[int32](1), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameBasic), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json -func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - NetworkRuleSet: &armsearch.NetworkRuleSet{ - IPRules: []*armsearch.IPRule{ - { - Value: to.Ptr("123.4.5.6"), - }, - { - Value: to.Ptr("123.4.6.0/18"), - }}, - }, - PartitionCount: to.Ptr[int32](1), - PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - ReplicaCount: to.Ptr[int32](3), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // IPRules: []*armsearch.IPRule{ - // { - // Value: to.Ptr("10.2.3.4"), - // }}, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json -func ExampleServicesClient_Update_searchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - NetworkRuleSet: &armsearch.NetworkRuleSet{ - Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), - IPRules: []*armsearch.IPRule{ - { - Value: to.Ptr("123.4.5.6"), - }, - { - Value: to.Ptr("123.4.6.0/18"), - }}, - }, - PartitionCount: to.Ptr[int32](1), - PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - ReplicaCount: to.Ptr[int32](3), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassAzurePortal), - // IPRules: []*armsearch.IPRule{ - // { - // Value: to.Ptr("10.2.3.4"), - // }}, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json -func ExampleServicesClient_Update_searchUpdateServiceToRemoveIdentity() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Identity: &armsearch.Identity{ - Type: to.Ptr(armsearch.IdentityTypeNone), - }, - SKU: &armsearch.SKU{ - Name: to.Ptr(armsearch.SKUNameStandard), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json -func ExampleServicesClient_Update_searchUpdateServiceWithCmkEnforcement() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), - }, - ReplicaCount: to.Ptr[int32](2), - }, - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - "new-tag": to.Ptr("Adding a new tag"), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkEnabled), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](2), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json -func ExampleServicesClient_Update_searchUpdateServiceWithDataExfiltration() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, - ReplicaCount: to.Ptr[int32](2), - }, - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - "new-tag": to.Ptr("Adding a new tag"), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // to.Ptr(armsearch.SearchDisabledDataExfiltrationOptionAll)}, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](2), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json -func ExampleServicesClient_Update_searchUpdateServiceWithSemanticSearch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Update(ctx, "rg1", "mysearchservice", armsearch.ServiceUpdate{ - Properties: &armsearch.ServiceProperties{ - ReplicaCount: to.Ptr[int32](2), - SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard), - }, - Tags: map[string]*string{ - "app-name": to.Ptr("My e-commerce app"), - "new-tag": to.Ptr("Adding a new tag"), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // "new-tag": to.Ptr("Adding a new tag"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](2), - // SemanticSearch: to.Ptr(armsearch.SearchSemanticSearchStandard), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusProvisioning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchGetService.json -func ExampleServicesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().Get(ctx, "rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Service = armsearch.Service{ - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchDeleteService.json -func ExampleServicesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServicesClient().Delete(ctx, "rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesByResourceGroup.json -func ExampleServicesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListByResourceGroupPager("rg1", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceListResult = armsearch.ServiceListResult{ - // Value: []*armsearch.Service{ - // { - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("mysearchservice2"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](1), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchListServicesBySubscription.json -func ExampleServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServicesClient().NewListBySubscriptionPager(&armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServiceListResult = armsearch.ServiceListResult{ - // Value: []*armsearch.Service{ - // { - // Name: to.Ptr("mysearchservice"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice"), - // Location: to.Ptr("westus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](3), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameStandard), - // }, - // }, - // { - // Name: to.Ptr("mysearchservice2"), - // Type: to.Ptr("Microsoft.Search/searchServices"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Search/searchServices/mysearchservice2"), - // Location: to.Ptr("eastus"), - // Tags: map[string]*string{ - // "app-name": to.Ptr("My e-commerce app"), - // }, - // Properties: &armsearch.ServiceProperties{ - // AuthOptions: &armsearch.DataPlaneAuthOptions{ - // APIKeyOnly: map[string]any{ - // }, - // }, - // DisableLocalAuth: to.Ptr(false), - // DisabledDataExfiltrationOptions: []*armsearch.SearchDisabledDataExfiltrationOption{ - // }, - // EncryptionWithCmk: &armsearch.EncryptionWithCmk{ - // EncryptionComplianceStatus: to.Ptr(armsearch.SearchEncryptionComplianceStatusCompliant), - // Enforcement: to.Ptr(armsearch.SearchEncryptionWithCmkUnspecified), - // }, - // HostingMode: to.Ptr(armsearch.HostingModeDefault), - // NetworkRuleSet: &armsearch.NetworkRuleSet{ - // Bypass: to.Ptr(armsearch.SearchBypassNone), - // IPRules: []*armsearch.IPRule{ - // }, - // }, - // PartitionCount: to.Ptr[int32](1), - // PrivateEndpointConnections: []*armsearch.PrivateEndpointConnection{ - // }, - // ProvisioningState: to.Ptr(armsearch.ProvisioningStateSucceeded), - // PublicNetworkAccess: to.Ptr(armsearch.PublicNetworkAccessEnabled), - // ReplicaCount: to.Ptr[int32](1), - // SharedPrivateLinkResources: []*armsearch.SharedPrivateLinkResource{ - // }, - // Status: to.Ptr(armsearch.SearchServiceStatusRunning), - // StatusDetails: to.Ptr(""), - // }, - // SKU: &armsearch.SKU{ - // Name: to.Ptr(armsearch.SKUNameBasic), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/SearchCheckNameAvailability.json -func ExampleServicesClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServicesClient().CheckNameAvailability(ctx, armsearch.CheckNameAvailabilityInput{ - Name: to.Ptr("mysearchservice"), - Type: to.Ptr("searchServices"), - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CheckNameAvailabilityOutput = armsearch.CheckNameAvailabilityOutput{ - // Message: to.Ptr(""), - // IsNameAvailable: to.Ptr(false), - // Reason: to.Ptr(armsearch.UnavailableNameReasonAlreadyExists), - // } -} diff --git a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go b/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client.go index a5ede4001dcc..7af10bdf569d 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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -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-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -287,7 +287,7 @@ func (client *SharedPrivateLinkResourcesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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-03-01-preview +// Generated from API version 2024-06-01-preview // - resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the // Azure Resource Manager API or the portal. // - searchServiceName - The name of the Azure AI Search service associated with the specified resource group. @@ -358,7 +358,7 @@ func (client *SharedPrivateLinkResourcesClient) listByServiceCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index b85a8a04d630..000000000000 --- a/sdk/resourcemanager/search/armsearch/sharedprivatelinkresources_client_example_test.go +++ /dev/null @@ -1,151 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json -func ExampleSharedPrivateLinkResourcesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginCreateOrUpdate(ctx, "rg1", "mysearchservice", "testResource", armsearch.SharedPrivateLinkResource{ - Properties: &armsearch.SharedPrivateLinkResourceProperties{ - GroupID: to.Ptr("blob"), - PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - RequestMessage: to.Ptr("please approve"), - }, - }, &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedPrivateLinkResource = armsearch.SharedPrivateLinkResource{ - // Name: to.Ptr("testResource"), - // Type: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource"), - // Properties: &armsearch.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - // RequestMessage: to.Ptr("please approve"), - // Status: to.Ptr(armsearch.SharedPrivateLinkResourceStatusPending), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetSharedPrivateLinkResource.json -func ExampleSharedPrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSharedPrivateLinkResourcesClient().Get(ctx, "rg1", "mysearchservice", "testResource", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SharedPrivateLinkResource = armsearch.SharedPrivateLinkResource{ - // Name: to.Ptr("testResource"), - // Type: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource"), - // Properties: &armsearch.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - // RequestMessage: to.Ptr("please approve"), - // Status: to.Ptr(armsearch.SharedPrivateLinkResourceStatusPending), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/DeleteSharedPrivateLinkResource.json -func ExampleSharedPrivateLinkResourcesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSharedPrivateLinkResourcesClient().BeginDelete(ctx, "rg1", "mysearchservice", "testResource", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/ListSharedPrivateLinkResourcesByService.json -func ExampleSharedPrivateLinkResourcesClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSharedPrivateLinkResourcesClient().NewListByServicePager("rg1", "mysearchservice", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SharedPrivateLinkResourceListResult = armsearch.SharedPrivateLinkResourceListResult{ - // Value: []*armsearch.SharedPrivateLinkResource{ - // { - // Name: to.Ptr("testResource"), - // Type: to.Ptr("Microsoft.Search/searchServices/sharedPrivateLinkResources"), - // ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Search/searchServices/mysearchservice/sharedPrivateLinkResources/testResource"), - // Properties: &armsearch.SharedPrivateLinkResourceProperties{ - // GroupID: to.Ptr("blob"), - // PrivateLinkResourceID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/storageAccountName"), - // RequestMessage: to.Ptr("please approve"), - // Status: to.Ptr(armsearch.SharedPrivateLinkResourceStatusPending), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/search/armsearch/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 96ee986676a6..c0b6dff7d1ff 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-03-01-preview +// Generated from API version 2024-06-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-03-01-preview") + reqQP.Set("api-version", "2024-06-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 deleted file mode 100644 index 1d6347e1813c..000000000000 --- a/sdk/resourcemanager/search/armsearch/usages_client_example_test.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsearch_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/cf5ad1932d00c7d15497705ad6b71171d3d68b1e/specification/search/resource-manager/Microsoft.Search/preview/2024-03-01-preview/examples/GetQuotaUsagesList.json -func ExampleUsagesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsearch.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewUsagesClient().NewListBySubscriptionPager("westus", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.QuotaUsagesListResult = armsearch.QuotaUsagesListResult{ - // Value: []*armsearch.QuotaUsageResult{ - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("F - Free"), - // Value: to.Ptr("free"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/free"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("B - Basic"), - // Value: to.Ptr("basic"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/basic"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("S - Standard"), - // Value: to.Ptr("standard"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/standard"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("S2 - Standard2"), - // Value: to.Ptr("standard2"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/standard2"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("S3 - Standard3"), - // Value: to.Ptr("standard3"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/standard3"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("L1 - Storage Optimized"), - // Value: to.Ptr("storageOptimizedL1"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/storageOptimizedL1"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }, - // { - // Name: &armsearch.QuotaUsageResultName{ - // LocalizedValue: to.Ptr("L2 - Storage Optimized"), - // Value: to.Ptr("storageOptimizedL2"), - // }, - // CurrentValue: to.Ptr[int32](8), - // ID: to.Ptr("/subscriptions/{subscriptionId}/providers/Microsoft.Search/locations/{location}/usages/storageOptimizedL2"), - // Limit: to.Ptr[int32](16), - // Unit: to.Ptr("Count"), - // }}, - // } - } -}