armsearch

package module
v0.0.0-...-45adee8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2024 License: MIT Imports: 12 Imported by: 0

README

Azure Search Module for Go

The armsearch module provides operations for working with Azure Search.

Source code

Getting started

Prerequisites

  • an Azure subscription
  • Go 1.18 or above (You could download and install the latest version of Go from here. It will replace the existing Go on your machine. If you want to install multiple Go versions on the same machine, you could refer this doc.)

Install the package

This project uses Go modules for versioning and dependency management.

Install the Azure Search module:

go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch

Authorization

When creating a client, you will need to provide a credential for authenticating with Azure Search. The azidentity module provides facilities for various ways of authenticating with Azure including client/secret, certificate, managed identity, and more.

cred, err := azidentity.NewDefaultAzureCredential(nil)

For more information on authentication, please see the documentation for azidentity at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity.

Client Factory

Azure Search module consists of one or more clients. We provide a client factory which could be used to create any client in this module.

clientFactory, err := armsearch.NewClientFactory(<subscription ID>, cred, nil)

You can use ClientOptions in package github.com/Azure/azure-sdk-for-go/sdk/azcore/arm to set endpoint to connect with public and sovereign clouds as well as Azure Stack. For more information, please see the documentation for azcore at pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azcore.

options := arm.ClientOptions {
    ClientOptions: azcore.ClientOptions {
        Cloud: cloud.AzureChina,
    },
}
clientFactory, err := armsearch.NewClientFactory(<subscription ID>, cred, &options)

Clients

A client groups a set of related APIs, providing access to its functionality. Create one or more clients to access the APIs you require using client factory.

client := clientFactory.NewAdminKeysClient()

Fakes

The fake package contains types used for constructing in-memory fake servers used in unit tests. This allows writing tests to cover various success/error conditions without the need for connecting to a live service.

Please see https://github.com/Azure/azure-sdk-for-go/tree/main/sdk/samples/fakes for details and examples on how to use fakes.

Provide Feedback

If you encounter bugs or have suggestions, please open an issue and assign the Search label.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AADAuthFailureMode

type AADAuthFailureMode string

AADAuthFailureMode - Describes what response the data plane API of a search service would send for requests that failed authentication.

const (
	// AADAuthFailureModeHttp401WithBearerChallenge - Indicates that requests that failed authentication should be presented with
	// an HTTP status code of 401 (Unauthorized) and present a Bearer Challenge.
	AADAuthFailureModeHttp401WithBearerChallenge AADAuthFailureMode = "http401WithBearerChallenge"
	// AADAuthFailureModeHttp403 - Indicates that requests that failed authentication should be presented with an HTTP status
	// code of 403 (Forbidden).
	AADAuthFailureModeHttp403 AADAuthFailureMode = "http403"
)

func PossibleAADAuthFailureModeValues

func PossibleAADAuthFailureModeValues() []AADAuthFailureMode

PossibleAADAuthFailureModeValues returns the possible values for the AADAuthFailureMode const type.

type AdminKeyKind

type AdminKeyKind string
const (
	// AdminKeyKindPrimary - The primary API key for the search service.
	AdminKeyKindPrimary AdminKeyKind = "primary"
	// AdminKeyKindSecondary - The secondary API key for the search service.
	AdminKeyKindSecondary AdminKeyKind = "secondary"
)

func PossibleAdminKeyKindValues

func PossibleAdminKeyKindValues() []AdminKeyKind

PossibleAdminKeyKindValues returns the possible values for the AdminKeyKind const type.

type AdminKeyResult

type AdminKeyResult struct {
	// READ-ONLY; The primary admin API key of the search service.
	PrimaryKey *string

	// READ-ONLY; The secondary admin API key of the search service.
	SecondaryKey *string
}

AdminKeyResult - Response containing the primary and secondary admin API keys for a given Azure AI Search service.

func (AdminKeyResult) MarshalJSON

func (a AdminKeyResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type AdminKeyResult.

func (*AdminKeyResult) UnmarshalJSON

func (a *AdminKeyResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type AdminKeyResult.

type AdminKeysClient

type AdminKeysClient struct {
	// contains filtered or unexported fields
}

AdminKeysClient contains the methods for the AdminKeys group. Don't use this type directly, use NewAdminKeysClient() instead.

func NewAdminKeysClient

func NewAdminKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdminKeysClient, error)

NewAdminKeysClient creates a new instance of AdminKeysClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*AdminKeysClient) Get

func (client *AdminKeysClient) Get(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *AdminKeysClientGetOptions) (AdminKeysClientGetResponse, error)

Get - Gets the primary and secondary admin API keys for the specified Azure AI Search service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - AdminKeysClientGetOptions contains the optional parameters for the AdminKeysClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchGetAdminKeys.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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("<your primary admin API key>"),
	// 	SecondaryKey: to.Ptr("<your secondary admin API key>"),
	// }
}
Output:

func (*AdminKeysClient) Regenerate

func (client *AdminKeysClient) Regenerate(ctx context.Context, resourceGroupName string, searchServiceName string, keyKind AdminKeyKind, searchManagementRequestOptions *SearchManagementRequestOptions, options *AdminKeysClientRegenerateOptions) (AdminKeysClientRegenerateResponse, error)

Regenerate - Regenerates either the primary or secondary admin API key. You can only regenerate one key at a time. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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.
  • keyKind - Specifies which key to regenerate. Valid values include 'primary' and 'secondary'.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - AdminKeysClientRegenerateOptions contains the optional parameters for the AdminKeysClient.Regenerate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchRegenerateAdminKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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("<your primary admin API key>"),
	// 	SecondaryKey: to.Ptr("<your secondary admin API key>"),
	// }
}
Output:

type AdminKeysClientGetOptions

type AdminKeysClientGetOptions struct {
}

AdminKeysClientGetOptions contains the optional parameters for the AdminKeysClient.Get method.

type AdminKeysClientGetResponse

type AdminKeysClientGetResponse struct {
	// Response containing the primary and secondary admin API keys for a given Azure AI Search service.
	AdminKeyResult
}

AdminKeysClientGetResponse contains the response from method AdminKeysClient.Get.

type AdminKeysClientRegenerateOptions

type AdminKeysClientRegenerateOptions struct {
}

AdminKeysClientRegenerateOptions contains the optional parameters for the AdminKeysClient.Regenerate method.

type AdminKeysClientRegenerateResponse

type AdminKeysClientRegenerateResponse struct {
	// Response containing the primary and secondary admin API keys for a given Azure AI Search service.
	AdminKeyResult
}

AdminKeysClientRegenerateResponse contains the response from method AdminKeysClient.Regenerate.

type CheckNameAvailabilityInput

type CheckNameAvailabilityInput struct {
	// REQUIRED; The search service name to validate. Search service names must only contain lowercase letters, digits or dashes,
	// cannot use dash as the first two or last one characters, cannot contain consecutive
	// dashes, and must be between 2 and 60 characters in length.
	Name *string

	// CONSTANT; The type of the resource whose name is to be validated. This value must always be 'searchServices'.
	// Field has constant value "searchServices", any specified value is ignored.
	Type *string
}

CheckNameAvailabilityInput - Input of check name availability API.

func (CheckNameAvailabilityInput) MarshalJSON

func (c CheckNameAvailabilityInput) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityInput.

func (*CheckNameAvailabilityInput) UnmarshalJSON

func (c *CheckNameAvailabilityInput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityInput.

type CheckNameAvailabilityOutput

type CheckNameAvailabilityOutput struct {
	// READ-ONLY; A value indicating whether the name is available.
	IsNameAvailable *bool

	// READ-ONLY; A message that explains why the name is invalid and provides resource naming requirements. Available only if
	// 'Invalid' is returned in the 'reason' property.
	Message *string

	// READ-ONLY; The reason why the name is not available. 'Invalid' indicates the name provided does not match the naming requirements
	// (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates that
	// the name is already in use and is therefore unavailable.
	Reason *UnavailableNameReason
}

CheckNameAvailabilityOutput - Output of check name availability API.

func (CheckNameAvailabilityOutput) MarshalJSON

func (c CheckNameAvailabilityOutput) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityOutput.

func (*CheckNameAvailabilityOutput) UnmarshalJSON

func (c *CheckNameAvailabilityOutput) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityOutput.

type ClientFactory

type ClientFactory struct {
	// contains filtered or unexported fields
}

ClientFactory is a client factory used to create any client in this module. Don't use this type directly, use NewClientFactory instead.

func NewClientFactory

func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error)

NewClientFactory creates a new instance of ClientFactory with the specified values. The parameter values will be propagated to any client created from this factory.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ClientFactory) NewAdminKeysClient

func (c *ClientFactory) NewAdminKeysClient() *AdminKeysClient

NewAdminKeysClient creates a new instance of AdminKeysClient.

func (*ClientFactory) NewManagementClient

func (c *ClientFactory) NewManagementClient() *ManagementClient

NewManagementClient creates a new instance of ManagementClient.

func (*ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient

func (c *ClientFactory) NewNetworkSecurityPerimeterConfigurationsClient() *NetworkSecurityPerimeterConfigurationsClient

NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient.

func (*ClientFactory) NewOperationsClient

func (c *ClientFactory) NewOperationsClient() *OperationsClient

NewOperationsClient creates a new instance of OperationsClient.

func (*ClientFactory) NewPrivateEndpointConnectionsClient

func (c *ClientFactory) NewPrivateEndpointConnectionsClient() *PrivateEndpointConnectionsClient

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient.

func (*ClientFactory) NewPrivateLinkResourcesClient

func (c *ClientFactory) NewPrivateLinkResourcesClient() *PrivateLinkResourcesClient

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient.

func (*ClientFactory) NewQueryKeysClient

func (c *ClientFactory) NewQueryKeysClient() *QueryKeysClient

NewQueryKeysClient creates a new instance of QueryKeysClient.

func (*ClientFactory) NewServicesClient

func (c *ClientFactory) NewServicesClient() *ServicesClient

NewServicesClient creates a new instance of ServicesClient.

func (*ClientFactory) NewSharedPrivateLinkResourcesClient

func (c *ClientFactory) NewSharedPrivateLinkResourcesClient() *SharedPrivateLinkResourcesClient

NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient.

func (*ClientFactory) NewUsagesClient

func (c *ClientFactory) NewUsagesClient() *UsagesClient

NewUsagesClient creates a new instance of UsagesClient.

type DataPlaneAADOrAPIKeyAuthOption

type DataPlaneAADOrAPIKeyAuthOption struct {
	// Describes what response the data plane API of a search service would send for requests that failed authentication.
	AADAuthFailureMode *AADAuthFailureMode
}

DataPlaneAADOrAPIKeyAuthOption - Indicates that either the API key or an access token from a Microsoft Entra ID tenant can be used for authentication.

func (DataPlaneAADOrAPIKeyAuthOption) MarshalJSON

func (d DataPlaneAADOrAPIKeyAuthOption) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DataPlaneAADOrAPIKeyAuthOption.

func (*DataPlaneAADOrAPIKeyAuthOption) UnmarshalJSON

func (d *DataPlaneAADOrAPIKeyAuthOption) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DataPlaneAADOrAPIKeyAuthOption.

type DataPlaneAuthOptions

type DataPlaneAuthOptions struct {
	// Indicates that either the API key or an access token from a Microsoft Entra ID tenant can be used for authentication.
	AADOrAPIKey *DataPlaneAADOrAPIKeyAuthOption

	// Indicates that only the API key can be used for authentication.
	APIKeyOnly any
}

DataPlaneAuthOptions - Defines the options for how the search service authenticates a data plane request. This cannot be set if 'disableLocalAuth' is set to true.

func (DataPlaneAuthOptions) MarshalJSON

func (d DataPlaneAuthOptions) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type DataPlaneAuthOptions.

func (*DataPlaneAuthOptions) UnmarshalJSON

func (d *DataPlaneAuthOptions) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type DataPlaneAuthOptions.

type EncryptionWithCmk

type EncryptionWithCmk struct {
	// Describes how a search service should enforce compliance if it finds objects that aren't encrypted with the customer-managed
	// key.
	Enforcement *SearchEncryptionWithCmk

	// READ-ONLY; Returns the status of search service compliance with respect to non-CMK-encrypted objects. If a service has
	// more than one unencrypted object, and enforcement is enabled, the service is marked as
	// noncompliant.
	EncryptionComplianceStatus *SearchEncryptionComplianceStatus
}

EncryptionWithCmk - Describes a policy that determines how resources within the search service are to be encrypted with customer managed keys.

func (EncryptionWithCmk) MarshalJSON

func (e EncryptionWithCmk) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type EncryptionWithCmk.

func (*EncryptionWithCmk) UnmarshalJSON

func (e *EncryptionWithCmk) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionWithCmk.

type HostingMode

type HostingMode string

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 'default'.

const (
	// HostingModeDefault - The limit on number of indexes is determined by the default limits for the SKU.
	HostingModeDefault HostingMode = "default"
	// HostingModeHighDensity - Only application for standard3 SKU, where the search service can have up to 1000 indexes.
	HostingModeHighDensity HostingMode = "highDensity"
)

func PossibleHostingModeValues

func PossibleHostingModeValues() []HostingMode

PossibleHostingModeValues returns the possible values for the HostingMode const type.

type IPRule

type IPRule struct {
	// Value corresponding to a single IPv4 address (eg., 123.1.2.3) or an IP range in CIDR format (eg., 123.1.2.3/24) to be allowed.
	Value *string
}

IPRule - The IP restriction rule of the Azure AI Search service.

func (IPRule) MarshalJSON

func (i IPRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type IPRule.

func (*IPRule) UnmarshalJSON

func (i *IPRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type IPRule.

type Identity

type Identity struct {
	// REQUIRED; The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an identity
	// created by the system and a set of user assigned identities. The type 'None' will remove
	// all identities from the service.
	Type *IdentityType

	// The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource
	// IDs in the form:
	// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
	UserAssignedIdentities map[string]*UserAssignedManagedIdentity

	// READ-ONLY; The principal ID of the system-assigned identity of the search service.
	PrincipalID *string

	// READ-ONLY; The tenant ID of the system-assigned identity of the search service.
	TenantID *string
}

Identity - Details about the search service identity. A null value indicates that the search service has no identity assigned.

func (Identity) MarshalJSON

func (i Identity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Identity.

func (*Identity) UnmarshalJSON

func (i *Identity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Identity.

type IdentityType

type IdentityType string

IdentityType - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an identity created by the system and a set of user assigned identities. The type 'None' will remove all identities from the service.

const (
	// IdentityTypeNone - Indicates that any identity associated with the search service needs to be removed.
	IdentityTypeNone IdentityType = "None"
	// IdentityTypeSystemAssigned - Indicates that system-assigned identity for the search service will be enabled.
	IdentityTypeSystemAssigned IdentityType = "SystemAssigned"
	// IdentityTypeSystemAssignedUserAssigned - Indicates that system-assigned identity for the search service will be enabled
	// along with the assignment of one or more user assigned identities.
	IdentityTypeSystemAssignedUserAssigned IdentityType = "SystemAssigned, UserAssigned"
	// IdentityTypeUserAssigned - Indicates that one or more user assigned identities will be assigned to the search service.
	IdentityTypeUserAssigned IdentityType = "UserAssigned"
)

func PossibleIdentityTypeValues

func PossibleIdentityTypeValues() []IdentityType

PossibleIdentityTypeValues returns the possible values for the IdentityType const type.

type ListQueryKeysResult

type ListQueryKeysResult struct {
	// READ-ONLY; Request URL that can be used to query next page of query keys. Returned when the total number of requested query
	// keys exceed maximum page size.
	NextLink *string

	// READ-ONLY; The query keys for the Azure AI Search service.
	Value []*QueryKey
}

ListQueryKeysResult - Response containing the query API keys for a given Azure AI Search service.

func (ListQueryKeysResult) MarshalJSON

func (l ListQueryKeysResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ListQueryKeysResult.

func (*ListQueryKeysResult) UnmarshalJSON

func (l *ListQueryKeysResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ListQueryKeysResult.

type ManagementClient

type ManagementClient struct {
	// contains filtered or unexported fields
}

ManagementClient contains the methods for the SearchManagementClient group. Don't use this type directly, use NewManagementClient() instead.

func NewManagementClient

func NewManagementClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagementClient, error)

NewManagementClient creates a new instance of ManagementClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ManagementClient) UsageBySubscriptionSKU

func (client *ManagementClient) UsageBySubscriptionSKU(ctx context.Context, location string, skuName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ManagementClientUsageBySubscriptionSKUOptions) (ManagementClientUsageBySubscriptionSKUResponse, error)

UsageBySubscriptionSKU - Gets the quota usage for a search sku in the given subscription. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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 method.
  • options - ManagementClientUsageBySubscriptionSKUOptions contains the optional parameters for the ManagementClient.UsageBySubscriptionSKU method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetQuotaUsage.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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"),
	// }
}
Output:

type ManagementClientUsageBySubscriptionSKUOptions

type ManagementClientUsageBySubscriptionSKUOptions struct {
}

ManagementClientUsageBySubscriptionSKUOptions contains the optional parameters for the ManagementClient.UsageBySubscriptionSKU method.

type ManagementClientUsageBySubscriptionSKUResponse

type ManagementClientUsageBySubscriptionSKUResponse struct {
	// Describes the quota usage for a particular SKU.
	QuotaUsageResult
}

ManagementClientUsageBySubscriptionSKUResponse contains the response from method ManagementClient.UsageBySubscriptionSKU.

type NSPConfigAccessRule

type NSPConfigAccessRule struct {
	Name *string

	// The properties for the access rules in a network security perimeter configuration.
	Properties *NSPConfigAccessRuleProperties
}

NSPConfigAccessRule - An access rule for a network security perimeter configuration.

func (NSPConfigAccessRule) MarshalJSON

func (n NSPConfigAccessRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPConfigAccessRule.

func (*NSPConfigAccessRule) UnmarshalJSON

func (n *NSPConfigAccessRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAccessRule.

type NSPConfigAccessRuleProperties

type NSPConfigAccessRuleProperties struct {
	AddressPrefixes           []*string
	Direction                 *string
	FullyQualifiedDomainNames []*string
	NetworkSecurityPerimeters []*NSPConfigNetworkSecurityPerimeterRule
	Subscriptions             []*string
}

NSPConfigAccessRuleProperties - The properties for the access rules in a network security perimeter configuration.

func (NSPConfigAccessRuleProperties) MarshalJSON

func (n NSPConfigAccessRuleProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPConfigAccessRuleProperties.

func (*NSPConfigAccessRuleProperties) UnmarshalJSON

func (n *NSPConfigAccessRuleProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAccessRuleProperties.

type NSPConfigAssociation

type NSPConfigAssociation struct {
	AccessMode *string
	Name       *string
}

NSPConfigAssociation - The resource association for the network security perimeter.

func (NSPConfigAssociation) MarshalJSON

func (n NSPConfigAssociation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPConfigAssociation.

func (*NSPConfigAssociation) UnmarshalJSON

func (n *NSPConfigAssociation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigAssociation.

type NSPConfigNetworkSecurityPerimeterRule

type NSPConfigNetworkSecurityPerimeterRule struct {
	ID            *string
	Location      *string
	PerimeterGUID *string
}

NSPConfigNetworkSecurityPerimeterRule - The network security perimeter properties present in a configuration rule.

func (NSPConfigNetworkSecurityPerimeterRule) MarshalJSON

func (n NSPConfigNetworkSecurityPerimeterRule) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPConfigNetworkSecurityPerimeterRule.

func (*NSPConfigNetworkSecurityPerimeterRule) UnmarshalJSON

func (n *NSPConfigNetworkSecurityPerimeterRule) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigNetworkSecurityPerimeterRule.

type NSPConfigPerimeter

type NSPConfigPerimeter struct {
	ID            *string
	Location      *string
	PerimeterGUID *string
}

NSPConfigPerimeter - The perimeter for a network security perimeter configuration.

func (NSPConfigPerimeter) MarshalJSON

func (n NSPConfigPerimeter) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPConfigPerimeter.

func (*NSPConfigPerimeter) UnmarshalJSON

func (n *NSPConfigPerimeter) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigPerimeter.

type NSPConfigProfile

type NSPConfigProfile struct {
	AccessRules        []*NSPConfigAccessRule
	AccessRulesVersion *string
	Name               *string
}

NSPConfigProfile - The profile for a network security perimeter configuration.

func (NSPConfigProfile) MarshalJSON

func (n NSPConfigProfile) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPConfigProfile.

func (*NSPConfigProfile) UnmarshalJSON

func (n *NSPConfigProfile) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPConfigProfile.

type NSPProvisioningIssue

type NSPProvisioningIssue struct {
	Name *string

	// The properties to describe any issues with provisioning network security perimeters to a search service.
	Properties *NSPProvisioningIssueProperties
}

NSPProvisioningIssue - An object to describe any issues with provisioning network security perimeters to a search service.

func (NSPProvisioningIssue) MarshalJSON

func (n NSPProvisioningIssue) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPProvisioningIssue.

func (*NSPProvisioningIssue) UnmarshalJSON

func (n *NSPProvisioningIssue) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPProvisioningIssue.

type NSPProvisioningIssueProperties

type NSPProvisioningIssueProperties struct {
	Description          *string
	IssueType            *string
	Severity             *string
	SuggestedAccessRules []*string
	SuggestedResourceIDs []*string
}

NSPProvisioningIssueProperties - The properties to describe any issues with provisioning network security perimeters to a search service.

func (NSPProvisioningIssueProperties) MarshalJSON

func (n NSPProvisioningIssueProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NSPProvisioningIssueProperties.

func (*NSPProvisioningIssueProperties) UnmarshalJSON

func (n *NSPProvisioningIssueProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NSPProvisioningIssueProperties.

type NetworkRuleSet

type NetworkRuleSet struct {
	// Possible origins of inbound traffic that can bypass the rules defined in the 'ipRules' section.
	Bypass *SearchBypass

	// A list of IP restriction rules that defines the inbound network(s) with allowing access to the search service endpoint.
	// At the meantime, all other public IP networks are blocked by the firewall. These
	// restriction rules are applied only when the 'publicNetworkAccess' of the search service is 'enabled'; otherwise, traffic
	// over public interface is not allowed even with any public IP rules, and private
	// endpoint connections would be the exclusive access method.
	IPRules []*IPRule
}

NetworkRuleSet - Network specific rules that determine how the Azure AI Search service may be reached.

func (NetworkRuleSet) MarshalJSON

func (n NetworkRuleSet) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkRuleSet.

func (*NetworkRuleSet) UnmarshalJSON

func (n *NetworkRuleSet) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkRuleSet.

type NetworkSecurityPerimeterConfiguration

type NetworkSecurityPerimeterConfiguration struct {
	// Resource properties.
	Properties *NetworkSecurityPerimeterConfigurationProperties

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

NetworkSecurityPerimeterConfiguration - Network security perimeter configuration for a server.

func (NetworkSecurityPerimeterConfiguration) MarshalJSON

func (n NetworkSecurityPerimeterConfiguration) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfiguration.

func (*NetworkSecurityPerimeterConfiguration) UnmarshalJSON

func (n *NetworkSecurityPerimeterConfiguration) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfiguration.

type NetworkSecurityPerimeterConfigurationListResult

type NetworkSecurityPerimeterConfigurationListResult struct {
	// READ-ONLY; Link to retrieve next page of results.
	NextLink *string

	// READ-ONLY; Array of results.
	Value []*NetworkSecurityPerimeterConfiguration
}

NetworkSecurityPerimeterConfigurationListResult - A list of network security perimeter configurations for a server.

func (NetworkSecurityPerimeterConfigurationListResult) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationListResult.

func (*NetworkSecurityPerimeterConfigurationListResult) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationListResult.

type NetworkSecurityPerimeterConfigurationProperties

type NetworkSecurityPerimeterConfigurationProperties struct {
	// The perimeter for a network security perimeter configuration.
	NetworkSecurityPerimeter *NSPConfigPerimeter

	// The profile for a network security perimeter configuration.
	Profile            *NSPConfigProfile
	ProvisioningIssues []*NSPProvisioningIssue

	// The resource association for the network security perimeter.
	ResourceAssociation *NSPConfigAssociation

	// READ-ONLY
	ProvisioningState *string
}

NetworkSecurityPerimeterConfigurationProperties - The properties of a network security perimeter configuration.

func (NetworkSecurityPerimeterConfigurationProperties) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type NetworkSecurityPerimeterConfigurationProperties.

func (*NetworkSecurityPerimeterConfigurationProperties) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type NetworkSecurityPerimeterConfigurationProperties.

type NetworkSecurityPerimeterConfigurationsClient

type NetworkSecurityPerimeterConfigurationsClient struct {
	// contains filtered or unexported fields
}

NetworkSecurityPerimeterConfigurationsClient contains the methods for the NetworkSecurityPerimeterConfigurations group. Don't use this type directly, use NewNetworkSecurityPerimeterConfigurationsClient() instead.

func NewNetworkSecurityPerimeterConfigurationsClient

func NewNetworkSecurityPerimeterConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkSecurityPerimeterConfigurationsClient, error)

NewNetworkSecurityPerimeterConfigurationsClient creates a new instance of NetworkSecurityPerimeterConfigurationsClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*NetworkSecurityPerimeterConfigurationsClient) BeginReconcile

BeginReconcile - Reconcile network security perimeter configuration for the Azure AI Search resource provider. This triggers a manual resync with network security perimeter configurations by ensuring the search service carries the latest configuration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • nspConfigName - The network security configuration name.
  • options - NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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)
	}
}
Output:

func (*NetworkSecurityPerimeterConfigurationsClient) Get

Get - Gets a network security perimeter configuration. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • nspConfigName - The network security configuration name.
  • options - NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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"),
	// 			},
	// 		},
	// 	}
}
Output:

func (*NetworkSecurityPerimeterConfigurationsClient) NewListByServicePager

NewListByServicePager - Gets a list of network security perimeter configurations for a search service.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • options - NetworkSecurityPerimeterConfigurationsClientListByServiceOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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"),
		// 					},
		// 				},
		// 		}},
		// 	}
	}
}
Output:

type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions

type NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

NetworkSecurityPerimeterConfigurationsClientBeginReconcileOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.BeginReconcile method.

type NetworkSecurityPerimeterConfigurationsClientGetOptions

type NetworkSecurityPerimeterConfigurationsClientGetOptions struct {
}

NetworkSecurityPerimeterConfigurationsClientGetOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.Get method.

type NetworkSecurityPerimeterConfigurationsClientGetResponse

type NetworkSecurityPerimeterConfigurationsClientGetResponse struct {
	// Network security perimeter configuration for a server.
	NetworkSecurityPerimeterConfiguration
}

NetworkSecurityPerimeterConfigurationsClientGetResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.Get.

type NetworkSecurityPerimeterConfigurationsClientListByServiceOptions

type NetworkSecurityPerimeterConfigurationsClientListByServiceOptions struct {
}

NetworkSecurityPerimeterConfigurationsClientListByServiceOptions contains the optional parameters for the NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager method.

type NetworkSecurityPerimeterConfigurationsClientListByServiceResponse

type NetworkSecurityPerimeterConfigurationsClientListByServiceResponse struct {
	// A list of network security perimeter configurations for a server.
	NetworkSecurityPerimeterConfigurationListResult
}

NetworkSecurityPerimeterConfigurationsClientListByServiceResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.NewListByServicePager.

type NetworkSecurityPerimeterConfigurationsClientReconcileResponse

type NetworkSecurityPerimeterConfigurationsClientReconcileResponse struct {
}

NetworkSecurityPerimeterConfigurationsClientReconcileResponse contains the response from method NetworkSecurityPerimeterConfigurationsClient.BeginReconcile.

type Operation

type Operation struct {
	// READ-ONLY; The object that describes the operation.
	Display *OperationDisplay

	// READ-ONLY; Describes if the specified operation is a data plane API operation. Operations where this value is not true
	// are supported directly by the resource provider.
	IsDataAction *bool

	// READ-ONLY; The name of the operation. This name is of the form {provider}/{resource}/{operation}.
	Name *string

	// READ-ONLY; Describes which originating entities are allowed to invoke this operation.
	Origin *string

	// READ-ONLY; Describes additional properties for this operation.
	Properties *OperationProperties
}

Operation - Describes a REST API operation.

func (Operation) MarshalJSON

func (o Operation) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Operation.

func (*Operation) UnmarshalJSON

func (o *Operation) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Operation.

type OperationAvailability

type OperationAvailability struct {
	// READ-ONLY; The blob duration for the dimension.
	BlobDuration *string

	// READ-ONLY; The time grain for the dimension.
	TimeGrain *string
}

OperationAvailability - Describes a particular availability for the metric specification.

func (OperationAvailability) MarshalJSON

func (o OperationAvailability) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationAvailability.

func (*OperationAvailability) UnmarshalJSON

func (o *OperationAvailability) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationAvailability.

type OperationDisplay

type OperationDisplay struct {
	// READ-ONLY; The friendly name of the operation.
	Description *string

	// READ-ONLY; The operation type: read, write, delete, listKeys/action, etc.
	Operation *string

	// READ-ONLY; The friendly name of the resource provider.
	Provider *string

	// READ-ONLY; The resource type on which the operation is performed.
	Resource *string
}

OperationDisplay - The object that describes the operation.

func (OperationDisplay) MarshalJSON

func (o OperationDisplay) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationDisplay.

func (*OperationDisplay) UnmarshalJSON

func (o *OperationDisplay) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay.

type OperationListResult

type OperationListResult struct {
	// READ-ONLY; The URL to get the next set of operation list results, if any.
	NextLink *string

	// READ-ONLY; The list of operations by Azure AI Search, some supported by the resource provider and others by data plane
	// APIs.
	Value []*Operation
}

OperationListResult - The result of the request to list REST API operations. It contains a list of operations and a URL to get the next set of results.

func (OperationListResult) MarshalJSON

func (o OperationListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationListResult.

func (*OperationListResult) UnmarshalJSON

func (o *OperationListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult.

type OperationLogsSpecification

type OperationLogsSpecification struct {
	// READ-ONLY; The blob duration for the log specification.
	BlobDuration *string

	// READ-ONLY; The display name of the log specification.
	DisplayName *string

	// READ-ONLY; The name of the log specification.
	Name *string
}

OperationLogsSpecification - Specifications of one type of log for this operation.

func (OperationLogsSpecification) MarshalJSON

func (o OperationLogsSpecification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationLogsSpecification.

func (*OperationLogsSpecification) UnmarshalJSON

func (o *OperationLogsSpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationLogsSpecification.

type OperationMetricDimension

type OperationMetricDimension struct {
	// READ-ONLY; The display name of the dimension.
	DisplayName *string

	// READ-ONLY; The name of the dimension.
	Name *string
}

OperationMetricDimension - Describes a particular dimension for the metric specification.

func (OperationMetricDimension) MarshalJSON

func (o OperationMetricDimension) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationMetricDimension.

func (*OperationMetricDimension) UnmarshalJSON

func (o *OperationMetricDimension) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricDimension.

type OperationMetricsSpecification

type OperationMetricsSpecification struct {
	// READ-ONLY; The type of aggregation for the metric specification.
	AggregationType *string

	// READ-ONLY; Availabilities for the metric specification.
	Availabilities []*OperationAvailability

	// READ-ONLY; Dimensions for the metric specification.
	Dimensions []*OperationMetricDimension

	// READ-ONLY; The display description of the metric specification.
	DisplayDescription *string

	// READ-ONLY; The display name of the metric specification.
	DisplayName *string

	// READ-ONLY; The name of the metric specification.
	Name *string

	// READ-ONLY; The unit for the metric specification.
	Unit *string
}

OperationMetricsSpecification - Specifications of one type of metric for this operation.

func (OperationMetricsSpecification) MarshalJSON

func (o OperationMetricsSpecification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationMetricsSpecification.

func (*OperationMetricsSpecification) UnmarshalJSON

func (o *OperationMetricsSpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationMetricsSpecification.

type OperationProperties

type OperationProperties struct {
	// READ-ONLY; Specifications of the service for this operation.
	ServiceSpecification *OperationServiceSpecification
}

OperationProperties - Describes additional properties for this operation.

func (OperationProperties) MarshalJSON

func (o OperationProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationProperties.

func (*OperationProperties) UnmarshalJSON

func (o *OperationProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationProperties.

type OperationServiceSpecification

type OperationServiceSpecification struct {
	// READ-ONLY; Specifications of logs for this operation.
	LogSpecifications []*OperationLogsSpecification

	// READ-ONLY; Specifications of metrics for this operation.
	MetricSpecifications []*OperationMetricsSpecification
}

OperationServiceSpecification - Specifications of the service for this operation.

func (OperationServiceSpecification) MarshalJSON

func (o OperationServiceSpecification) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type OperationServiceSpecification.

func (*OperationServiceSpecification) UnmarshalJSON

func (o *OperationServiceSpecification) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type OperationServiceSpecification.

type OperationsClient

type OperationsClient struct {
	// contains filtered or unexported fields
}

OperationsClient contains the methods for the Operations group. Don't use this type directly, use NewOperationsClient() instead.

func NewOperationsClient

func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error)

NewOperationsClient creates a new instance of OperationsClient with the specified values.

  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*OperationsClient) NewListPager

NewListPager - Lists all of the available REST API operations of the Microsoft.Search provider.

Generated from API version 2024-06-01-preview

  • options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListOperations.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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"),
		// 	}},
		// }
	}
}
Output:

type OperationsClientListOptions

type OperationsClientListOptions struct {
}

OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method.

type OperationsClientListResponse

type OperationsClientListResponse struct {
	// The result of the request to list REST API operations. It contains a list of operations and a URL to get the next set of
	// results.
	OperationListResult
}

OperationsClientListResponse contains the response from method OperationsClient.NewListPager.

type PrivateEndpointConnection

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}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

PrivateEndpointConnection - Describes an existing private endpoint connection to the Azure AI Search service.

func (PrivateEndpointConnection) MarshalJSON

func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection.

func (*PrivateEndpointConnection) UnmarshalJSON

func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection.

type PrivateEndpointConnectionListResult

type PrivateEndpointConnectionListResult struct {
	// READ-ONLY; Request URL that can be used to query next page of private endpoint connections. Returned when the total number
	// of requested private endpoint connections exceed maximum page size.
	NextLink *string

	// READ-ONLY; The list of private endpoint connections.
	Value []*PrivateEndpointConnection
}

PrivateEndpointConnectionListResult - Response containing a list of private endpoint connections.

func (PrivateEndpointConnectionListResult) MarshalJSON

func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult.

func (*PrivateEndpointConnectionListResult) UnmarshalJSON

func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult.

type PrivateEndpointConnectionProperties

type PrivateEndpointConnectionProperties struct {
	// The group ID of the Azure resource for which the private link service is for.
	GroupID *string

	// The private endpoint resource from Microsoft.Network provider.
	PrivateEndpoint *PrivateEndpointConnectionPropertiesPrivateEndpoint

	// Describes the current state of an existing Azure Private Link service connection to the private endpoint.
	PrivateLinkServiceConnectionState *PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState

	// The provisioning state of the private link service connection. Valid values are Updating, Deleting, Failed, Succeeded,
	// Incomplete, or Canceled.
	ProvisioningState *PrivateLinkServiceConnectionProvisioningState
}

PrivateEndpointConnectionProperties - Describes the properties of an existing private endpoint connection to the search service.

func (PrivateEndpointConnectionProperties) MarshalJSON

func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties.

func (*PrivateEndpointConnectionProperties) UnmarshalJSON

func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties.

type PrivateEndpointConnectionPropertiesPrivateEndpoint

type PrivateEndpointConnectionPropertiesPrivateEndpoint struct {
	// The resource ID of the private endpoint resource from Microsoft.Network provider.
	ID *string
}

PrivateEndpointConnectionPropertiesPrivateEndpoint - The private endpoint resource from Microsoft.Network provider.

func (PrivateEndpointConnectionPropertiesPrivateEndpoint) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionPropertiesPrivateEndpoint.

func (*PrivateEndpointConnectionPropertiesPrivateEndpoint) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionPropertiesPrivateEndpoint.

type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState

type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState struct {
	// A description of any extra actions that may be required.
	ActionsRequired *string

	// The description for the private link service connection state.
	Description *string

	// Status of the the private link service connection. Valid values are Pending, Approved, Rejected, or Disconnected.
	Status *PrivateLinkServiceConnectionStatus
}

PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState - Describes the current state of an existing Azure Private Link service connection to the private endpoint.

func (PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState) MarshalJSON

MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.

func (*PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState) UnmarshalJSON

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionPropertiesPrivateLinkServiceConnectionState.

type PrivateEndpointConnectionsClient

type PrivateEndpointConnectionsClient struct {
	// contains filtered or unexported fields
}

PrivateEndpointConnectionsClient contains the methods for the PrivateEndpointConnections group. Don't use this type directly, use NewPrivateEndpointConnectionsClient() instead.

func NewPrivateEndpointConnectionsClient

func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error)

NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PrivateEndpointConnectionsClient) Delete

func (client *PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientDeleteOptions) (PrivateEndpointConnectionsClientDeleteResponse, error)

Delete - Disconnects the private endpoint connection and deletes it from the search service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/DeletePrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 		},
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) Get

func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error)

Get - Gets the details of the private endpoint connection to the search service in the given resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetPrivateEndpointConnection.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 		},
	// 	},
	// }
}
Output:

func (*PrivateEndpointConnectionsClient) NewListByServicePager

func (client *PrivateEndpointConnectionsClient) NewListByServicePager(resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientListByServiceOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByServiceResponse]

NewListByServicePager - Gets a list of all private endpoint connections in the given service.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - PrivateEndpointConnectionsClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListPrivateEndpointConnectionsByService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
		// 				},
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*PrivateEndpointConnectionsClient) Update

func (client *PrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, searchServiceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateEndpointConnectionsClientUpdateOptions) (PrivateEndpointConnectionsClientUpdateResponse, error)

Update - Updates a private endpoint connection to the search service in the given resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • privateEndpointConnectionName - The name of the private endpoint connection to the Azure AI Search service with the specified resource group.
  • privateEndpointConnection - The definition of the private endpoint connection to update.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - PrivateEndpointConnectionsClientUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Update method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/UpdatePrivateEndpointConnection.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 		},
	// 	},
	// }
}
Output:

type PrivateEndpointConnectionsClientDeleteOptions

type PrivateEndpointConnectionsClientDeleteOptions struct {
}

PrivateEndpointConnectionsClientDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Delete method.

type PrivateEndpointConnectionsClientDeleteResponse

type PrivateEndpointConnectionsClientDeleteResponse struct {
	// Describes an existing private endpoint connection to the Azure AI Search service.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete.

type PrivateEndpointConnectionsClientGetOptions

type PrivateEndpointConnectionsClientGetOptions struct {
}

PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get method.

type PrivateEndpointConnectionsClientGetResponse

type PrivateEndpointConnectionsClientGetResponse struct {
	// Describes an existing private endpoint connection to the Azure AI Search service.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get.

type PrivateEndpointConnectionsClientListByServiceOptions

type PrivateEndpointConnectionsClientListByServiceOptions struct {
}

PrivateEndpointConnectionsClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServicePager method.

type PrivateEndpointConnectionsClientListByServiceResponse

type PrivateEndpointConnectionsClientListByServiceResponse struct {
	// Response containing a list of private endpoint connections.
	PrivateEndpointConnectionListResult
}

PrivateEndpointConnectionsClientListByServiceResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServicePager.

type PrivateEndpointConnectionsClientUpdateOptions

type PrivateEndpointConnectionsClientUpdateOptions struct {
}

PrivateEndpointConnectionsClientUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Update method.

type PrivateEndpointConnectionsClientUpdateResponse

type PrivateEndpointConnectionsClientUpdateResponse struct {
	// Describes an existing private endpoint connection to the Azure AI Search service.
	PrivateEndpointConnection
}

PrivateEndpointConnectionsClientUpdateResponse contains the response from method PrivateEndpointConnectionsClient.Update.

type PrivateLinkResource

type PrivateLinkResource struct {
	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; Describes the properties of a supported private link resource for the Azure AI Search service.
	Properties *PrivateLinkResourceProperties

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

PrivateLinkResource - Describes a supported private link resource for the Azure AI Search service.

func (PrivateLinkResource) MarshalJSON

func (p PrivateLinkResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource.

func (*PrivateLinkResource) UnmarshalJSON

func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource.

type PrivateLinkResourceProperties

type PrivateLinkResourceProperties struct {
	// READ-ONLY; The group ID of the private link resource.
	GroupID *string

	// READ-ONLY; The list of required members of the private link resource.
	RequiredMembers []*string

	// READ-ONLY; The list of required DNS zone names of the private link resource.
	RequiredZoneNames []*string

	// READ-ONLY; The list of resources that are onboarded to private link service, that are supported by Azure AI Search.
	ShareablePrivateLinkResourceTypes []*ShareablePrivateLinkResourceType
}

PrivateLinkResourceProperties - Describes the properties of a supported private link resource for the Azure AI Search service. For a given API version, this represents the 'supported' groupIds when creating a shared private link resource.

func (PrivateLinkResourceProperties) MarshalJSON

func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties.

func (*PrivateLinkResourceProperties) UnmarshalJSON

func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties.

type PrivateLinkResourcesClient

type PrivateLinkResourcesClient struct {
	// contains filtered or unexported fields
}

PrivateLinkResourcesClient contains the methods for the PrivateLinkResources group. Don't use this type directly, use NewPrivateLinkResourcesClient() instead.

func NewPrivateLinkResourcesClient

func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error)

NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*PrivateLinkResourcesClient) NewListSupportedPager

func (client *PrivateLinkResourcesClient) NewListSupportedPager(resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *PrivateLinkResourcesClientListSupportedOptions) *runtime.Pager[PrivateLinkResourcesClientListSupportedResponse]

NewListSupportedPager - Gets a list of all supported private link resource types for the given service.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - PrivateLinkResourcesClientListSupportedOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListSupportedPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListSupportedPrivateLinkResources.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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"),
		// 								},
		// 						}},
		// 					},
		// 			}},
		// 		}
	}
}
Output:

type PrivateLinkResourcesClientListSupportedOptions

type PrivateLinkResourcesClientListSupportedOptions struct {
}

PrivateLinkResourcesClientListSupportedOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListSupportedPager method.

type PrivateLinkResourcesClientListSupportedResponse

type PrivateLinkResourcesClientListSupportedResponse struct {
	// Response containing a list of supported Private Link Resources.
	PrivateLinkResourcesResult
}

PrivateLinkResourcesClientListSupportedResponse contains the response from method PrivateLinkResourcesClient.NewListSupportedPager.

type PrivateLinkResourcesResult

type PrivateLinkResourcesResult struct {
	// READ-ONLY; The list of supported Private Link Resources.
	Value []*PrivateLinkResource
}

PrivateLinkResourcesResult - Response containing a list of supported Private Link Resources.

func (PrivateLinkResourcesResult) MarshalJSON

func (p PrivateLinkResourcesResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourcesResult.

func (*PrivateLinkResourcesResult) UnmarshalJSON

func (p *PrivateLinkResourcesResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourcesResult.

type PrivateLinkServiceConnectionProvisioningState

type PrivateLinkServiceConnectionProvisioningState string

PrivateLinkServiceConnectionProvisioningState - The provisioning state of the private link service connection. Valid values are Updating, Deleting, Failed, Succeeded, Incomplete, or Canceled.

const (
	// PrivateLinkServiceConnectionProvisioningStateCanceled - Provisioning request for the private link service connection resource
	// has been canceled.
	PrivateLinkServiceConnectionProvisioningStateCanceled PrivateLinkServiceConnectionProvisioningState = "Canceled"
	// PrivateLinkServiceConnectionProvisioningStateDeleting - The private link service connection is in the process of being
	// deleted.
	PrivateLinkServiceConnectionProvisioningStateDeleting PrivateLinkServiceConnectionProvisioningState = "Deleting"
	// PrivateLinkServiceConnectionProvisioningStateFailed - The private link service connection has failed to be provisioned
	// or deleted.
	PrivateLinkServiceConnectionProvisioningStateFailed PrivateLinkServiceConnectionProvisioningState = "Failed"
	// PrivateLinkServiceConnectionProvisioningStateIncomplete - Provisioning request for the private link service connection
	// resource has been accepted but the process of creation has not commenced yet.
	PrivateLinkServiceConnectionProvisioningStateIncomplete PrivateLinkServiceConnectionProvisioningState = "Incomplete"
	// PrivateLinkServiceConnectionProvisioningStateSucceeded - The private link service connection has finished provisioning
	// and is ready for approval.
	PrivateLinkServiceConnectionProvisioningStateSucceeded PrivateLinkServiceConnectionProvisioningState = "Succeeded"
	// PrivateLinkServiceConnectionProvisioningStateUpdating - The private link service connection is in the process of being
	// created along with other resources for it to be fully functional.
	PrivateLinkServiceConnectionProvisioningStateUpdating PrivateLinkServiceConnectionProvisioningState = "Updating"
)

func PossiblePrivateLinkServiceConnectionProvisioningStateValues

func PossiblePrivateLinkServiceConnectionProvisioningStateValues() []PrivateLinkServiceConnectionProvisioningState

PossiblePrivateLinkServiceConnectionProvisioningStateValues returns the possible values for the PrivateLinkServiceConnectionProvisioningState const type.

type PrivateLinkServiceConnectionStatus

type PrivateLinkServiceConnectionStatus string

PrivateLinkServiceConnectionStatus - Status of the the private link service connection. Valid values are Pending, Approved, Rejected, or Disconnected.

const (
	// PrivateLinkServiceConnectionStatusApproved - The private endpoint connection is approved and is ready for use.
	PrivateLinkServiceConnectionStatusApproved PrivateLinkServiceConnectionStatus = "Approved"
	// PrivateLinkServiceConnectionStatusDisconnected - The private endpoint connection has been removed from the service.
	PrivateLinkServiceConnectionStatusDisconnected PrivateLinkServiceConnectionStatus = "Disconnected"
	// PrivateLinkServiceConnectionStatusPending - The private endpoint connection has been created and is pending approval.
	PrivateLinkServiceConnectionStatusPending PrivateLinkServiceConnectionStatus = "Pending"
	// PrivateLinkServiceConnectionStatusRejected - The private endpoint connection has been rejected and cannot be used.
	PrivateLinkServiceConnectionStatusRejected PrivateLinkServiceConnectionStatus = "Rejected"
)

func PossiblePrivateLinkServiceConnectionStatusValues

func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus

PossiblePrivateLinkServiceConnectionStatusValues returns the possible values for the PrivateLinkServiceConnectionStatus const type.

type ProvisioningState

type ProvisioningState string

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 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 because the free service uses capacity that is already set up.

const (
	// ProvisioningStateFailed - The last provisioning operation has failed.
	ProvisioningStateFailed ProvisioningState = "Failed"
	// ProvisioningStateProvisioning - The search service is being provisioned or scaled up or down.
	ProvisioningStateProvisioning ProvisioningState = "Provisioning"
	// ProvisioningStateSucceeded - The last provisioning operation has completed successfully.
	ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)

func PossibleProvisioningStateValues

func PossibleProvisioningStateValues() []ProvisioningState

PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type.

type PublicNetworkAccess

type PublicNetworkAccess string

PublicNetworkAccess - This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method.

const (
	// PublicNetworkAccessDisabled - The search service is not accessible from traffic originating from the public internet. Access
	// is only permitted over approved private endpoint connections.
	PublicNetworkAccessDisabled PublicNetworkAccess = "disabled"
	// PublicNetworkAccessEnabled - The search service is accessible from traffic originating from the public internet.
	PublicNetworkAccessEnabled PublicNetworkAccess = "enabled"
)

func PossiblePublicNetworkAccessValues

func PossiblePublicNetworkAccessValues() []PublicNetworkAccess

PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type.

type QueryKey

type QueryKey struct {
	// READ-ONLY; The value of the query API key.
	Key *string

	// READ-ONLY; The name of the query API key. Query names are optional, but assigning a name can help you remember how it's
	// used.
	Name *string
}

QueryKey - Describes an API key for a given Azure AI Search service that conveys read-only permissions on the docs collection of an index.

func (QueryKey) MarshalJSON

func (q QueryKey) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QueryKey.

func (*QueryKey) UnmarshalJSON

func (q *QueryKey) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QueryKey.

type QueryKeysClient

type QueryKeysClient struct {
	// contains filtered or unexported fields
}

QueryKeysClient contains the methods for the QueryKeys group. Don't use this type directly, use NewQueryKeysClient() instead.

func NewQueryKeysClient

func NewQueryKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QueryKeysClient, error)

NewQueryKeysClient creates a new instance of QueryKeysClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*QueryKeysClient) Create

func (client *QueryKeysClient) Create(ctx context.Context, resourceGroupName string, searchServiceName string, name string, searchManagementRequestOptions *SearchManagementRequestOptions, options *QueryKeysClientCreateOptions) (QueryKeysClientCreateResponse, error)

Create - Generates a new query key for the specified search service. You can create up to 50 query keys per service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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.
  • name - The name of the new query API key.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - QueryKeysClientCreateOptions contains the optional parameters for the QueryKeysClient.Create method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateQueryKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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("<a query API key>"),
	// }
}
Output:

func (*QueryKeysClient) Delete

func (client *QueryKeysClient) Delete(ctx context.Context, resourceGroupName string, searchServiceName string, key string, searchManagementRequestOptions *SearchManagementRequestOptions, options *QueryKeysClientDeleteOptions) (QueryKeysClientDeleteResponse, error)

Delete - Deletes the specified query key. Unlike admin keys, query keys are not regenerated. The process for regenerating a query key is to delete and then recreate it. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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.
  • key - The query key to be deleted. Query keys are identified by value, not by name.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - QueryKeysClientDeleteOptions contains the optional parameters for the QueryKeysClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchDeleteQueryKey.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", cred, nil)
	if err != nil {
		log.Fatalf("failed to create client: %v", err)
	}
	_, err = clientFactory.NewQueryKeysClient().Delete(ctx, "rg1", "mysearchservice", "<a query API key>", &armsearch.SearchManagementRequestOptions{ClientRequestID: nil}, nil)
	if err != nil {
		log.Fatalf("failed to finish the request: %v", err)
	}
}
Output:

func (*QueryKeysClient) NewListBySearchServicePager

func (client *QueryKeysClient) NewListBySearchServicePager(resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *QueryKeysClientListBySearchServiceOptions) *runtime.Pager[QueryKeysClientListBySearchServiceResponse]

NewListBySearchServicePager - Returns the list of query API keys for the given Azure AI Search service.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - QueryKeysClientListBySearchServiceOptions contains the optional parameters for the QueryKeysClient.NewListBySearchServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListQueryKeysBySearchService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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("<a query API key>"),
		// 		},
		// 		{
		// 			Name: to.Ptr("Query key for mobile clients"),
		// 			Key: to.Ptr("<another query API key>"),
		// 	}},
		// }
	}
}
Output:

type QueryKeysClientCreateOptions

type QueryKeysClientCreateOptions struct {
}

QueryKeysClientCreateOptions contains the optional parameters for the QueryKeysClient.Create method.

type QueryKeysClientCreateResponse

type QueryKeysClientCreateResponse struct {
	// Describes an API key for a given Azure AI Search service that conveys read-only permissions on the docs collection of an
	// index.
	QueryKey
}

QueryKeysClientCreateResponse contains the response from method QueryKeysClient.Create.

type QueryKeysClientDeleteOptions

type QueryKeysClientDeleteOptions struct {
}

QueryKeysClientDeleteOptions contains the optional parameters for the QueryKeysClient.Delete method.

type QueryKeysClientDeleteResponse

type QueryKeysClientDeleteResponse struct {
}

QueryKeysClientDeleteResponse contains the response from method QueryKeysClient.Delete.

type QueryKeysClientListBySearchServiceOptions

type QueryKeysClientListBySearchServiceOptions struct {
}

QueryKeysClientListBySearchServiceOptions contains the optional parameters for the QueryKeysClient.NewListBySearchServicePager method.

type QueryKeysClientListBySearchServiceResponse

type QueryKeysClientListBySearchServiceResponse struct {
	// Response containing the query API keys for a given Azure AI Search service.
	ListQueryKeysResult
}

QueryKeysClientListBySearchServiceResponse contains the response from method QueryKeysClient.NewListBySearchServicePager.

type QuotaUsageResult

type QuotaUsageResult struct {
	// The currently used up value for the particular search SKU.
	CurrentValue *int32

	// The resource ID of the quota usage SKU endpoint for Microsoft.Search provider.
	ID *string

	// The quota limit for the particular search SKU.
	Limit *int32

	// The unit of measurement for the search SKU.
	Unit *string

	// READ-ONLY; The name of the SKU supported by Azure AI Search.
	Name *QuotaUsageResultName
}

QuotaUsageResult - Describes the quota usage for a particular SKU.

func (QuotaUsageResult) MarshalJSON

func (q QuotaUsageResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaUsageResult.

func (*QuotaUsageResult) UnmarshalJSON

func (q *QuotaUsageResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsageResult.

type QuotaUsageResultName

type QuotaUsageResultName struct {
	// The localized string value for the SKU name.
	LocalizedValue *string

	// The SKU name supported by Azure AI Search.
	Value *string
}

QuotaUsageResultName - The name of the SKU supported by Azure AI Search.

func (QuotaUsageResultName) MarshalJSON

func (q QuotaUsageResultName) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaUsageResultName.

func (*QuotaUsageResultName) UnmarshalJSON

func (q *QuotaUsageResultName) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsageResultName.

type QuotaUsagesListResult

type QuotaUsagesListResult struct {
	// READ-ONLY; Request URL that can be used to query next page of quota usages. Returned when the total number of requested
	// quota usages exceed maximum page size.
	NextLink *string

	// READ-ONLY; The quota usages for the SKUs supported by Azure AI Search.
	Value []*QuotaUsageResult
}

QuotaUsagesListResult - Response containing the quota usage information for all the supported SKUs of Azure AI Search.

func (QuotaUsagesListResult) MarshalJSON

func (q QuotaUsagesListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type QuotaUsagesListResult.

func (*QuotaUsagesListResult) UnmarshalJSON

func (q *QuotaUsagesListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type QuotaUsagesListResult.

type SKU

type SKU struct {
	// The SKU of the search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas.
	// 'standard': Dedicated service with up to 12 partitions and 12 replicas.
	// 'standard2': Similar to standard, but with more capacity per search unit. 'standard3': The largest Standard offering with
	// up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes
	// if you also set the hostingMode property to 'highDensity'). 'storageoptimizedl1': Supports 1TB per partition, up to 12
	// partitions. 'storageoptimizedl2': Supports 2TB per partition, up to 12
	// partitions.'
	Name *SKUName
}

SKU - Defines the SKU of a search service, which determines billing rate and capacity limits.

func (SKU) MarshalJSON

func (s SKU) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SKU.

func (*SKU) UnmarshalJSON

func (s *SKU) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SKU.

type SKUName

type SKUName string

SKUName - The SKU of the search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas. 'standard': Dedicated service with up to 12 partitions and 12 replicas. 'standard2': Similar to standard, but with more capacity per search unit. 'standard3': The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes if you also set the hostingMode property to 'highDensity'). 'storageoptimizedl1': Supports 1TB per partition, up to 12 partitions. 'storageoptimizedl2': Supports 2TB per partition, up to 12 partitions.'

const (
	// SKUNameBasic - Billable tier for a dedicated service having up to 3 replicas.
	SKUNameBasic SKUName = "basic"
	// SKUNameFree - Free tier, with no SLA guarantees and a subset of the features offered on billable tiers.
	SKUNameFree SKUName = "free"
	// SKUNameStandard - Billable tier for a dedicated service having up to 12 partitions and 12 replicas.
	SKUNameStandard SKUName = "standard"
	// SKUNameStandard2 - Similar to 'standard', but with more capacity per search unit.
	SKUNameStandard2 SKUName = "standard2"
	// SKUNameStandard3 - The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more
	// indexes if you also set the hostingMode property to 'highDensity').
	SKUNameStandard3 SKUName = "standard3"
	// SKUNameStorageOptimizedL1 - Billable tier for a dedicated service that supports 1TB per partition, up to 12 partitions.
	SKUNameStorageOptimizedL1 SKUName = "storage_optimized_l1"
	// SKUNameStorageOptimizedL2 - Billable tier for a dedicated service that supports 2TB per partition, up to 12 partitions.
	SKUNameStorageOptimizedL2 SKUName = "storage_optimized_l2"
)

func PossibleSKUNameValues

func PossibleSKUNameValues() []SKUName

PossibleSKUNameValues returns the possible values for the SKUName const type.

type SearchBypass

type SearchBypass string

SearchBypass - Possible origins of inbound traffic that can bypass the rules defined in the 'ipRules' section.

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"
)

func PossibleSearchBypassValues

func PossibleSearchBypassValues() []SearchBypass

PossibleSearchBypassValues returns the possible values for the SearchBypass const type.

type SearchDisabledDataExfiltrationOption

type SearchDisabledDataExfiltrationOption string

SearchDisabledDataExfiltrationOption - A specific data exfiltration scenario that is disabled for the service.

const (
	// SearchDisabledDataExfiltrationOptionAll - Indicates that all data exfiltration scenarios are disabled.
	SearchDisabledDataExfiltrationOptionAll SearchDisabledDataExfiltrationOption = "All"
)

func PossibleSearchDisabledDataExfiltrationOptionValues

func PossibleSearchDisabledDataExfiltrationOptionValues() []SearchDisabledDataExfiltrationOption

PossibleSearchDisabledDataExfiltrationOptionValues returns the possible values for the SearchDisabledDataExfiltrationOption const type.

type SearchEncryptionComplianceStatus

type SearchEncryptionComplianceStatus string

SearchEncryptionComplianceStatus - Returns the status of search service compliance with respect to non-CMK-encrypted objects. If a service has more than one unencrypted object, and enforcement is enabled, the service is marked as noncompliant.

const (
	// SearchEncryptionComplianceStatusCompliant - Indicates that the search service is compliant, either because the number of
	// non-CMK-encrypted objects is zero or enforcement is disabled.
	SearchEncryptionComplianceStatusCompliant SearchEncryptionComplianceStatus = "Compliant"
	// SearchEncryptionComplianceStatusNonCompliant - Indicates that the search service has more than one non-CMK-encrypted objects.
	SearchEncryptionComplianceStatusNonCompliant SearchEncryptionComplianceStatus = "NonCompliant"
)

func PossibleSearchEncryptionComplianceStatusValues

func PossibleSearchEncryptionComplianceStatusValues() []SearchEncryptionComplianceStatus

PossibleSearchEncryptionComplianceStatusValues returns the possible values for the SearchEncryptionComplianceStatus const type.

type SearchEncryptionWithCmk

type SearchEncryptionWithCmk string

SearchEncryptionWithCmk - Describes how a search service should enforce compliance if it finds objects that aren't encrypted with the customer-managed key.

const (
	// SearchEncryptionWithCmkDisabled - No enforcement of customer-managed key encryption will be made. Only the built-in service-managed
	// encryption is used.
	SearchEncryptionWithCmkDisabled SearchEncryptionWithCmk = "Disabled"
	// SearchEncryptionWithCmkEnabled - Search service will be marked as non-compliant if one or more objects aren't encrypted
	// with a customer-managed key.
	SearchEncryptionWithCmkEnabled SearchEncryptionWithCmk = "Enabled"
	// SearchEncryptionWithCmkUnspecified - Enforcement policy is not explicitly specified, with the behavior being the same as
	// if it were set to 'Disabled'.
	SearchEncryptionWithCmkUnspecified SearchEncryptionWithCmk = "Unspecified"
)

func PossibleSearchEncryptionWithCmkValues

func PossibleSearchEncryptionWithCmkValues() []SearchEncryptionWithCmk

PossibleSearchEncryptionWithCmkValues returns the possible values for the SearchEncryptionWithCmk const type.

type SearchManagementRequestOptions

type SearchManagementRequestOptions struct {
	// A client-generated GUID value that identifies this request. If specified, this will be included in response information
	// as a way to track the request.
	ClientRequestID *string
}

SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.

type SearchSemanticSearch

type SearchSemanticSearch string

SearchSemanticSearch - Sets options that control the availability of semantic search. This configuration is only possible for certain Azure AI Search SKUs in certain locations.

const (
	// SearchSemanticSearchDisabled - Indicates that semantic reranker is disabled for the search service. This is the default.
	SearchSemanticSearchDisabled SearchSemanticSearch = "disabled"
	// SearchSemanticSearchFree - Enables semantic reranker on a search service and indicates that it is to be used within the
	// limits of the free plan. The free plan would cap the volume of semantic ranking requests and is offered at no extra charge.
	// This is the default for newly provisioned search services.
	SearchSemanticSearchFree SearchSemanticSearch = "free"
	// SearchSemanticSearchStandard - Enables semantic reranker on a search service as a billable feature, with higher throughput
	// and volume of semantically reranked queries.
	SearchSemanticSearchStandard SearchSemanticSearch = "standard"
)

func PossibleSearchSemanticSearchValues

func PossibleSearchSemanticSearchValues() []SearchSemanticSearch

PossibleSearchSemanticSearchValues returns the possible values for the SearchSemanticSearch const type.

type SearchServiceStatus

type SearchServiceStatus string

SearchServiceStatus - The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If your service is in the degraded, disabled, or error states, it means the Azure AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned.

const (
	// SearchServiceStatusDegraded - The search service is degraded because underlying search units are not healthy.
	SearchServiceStatusDegraded SearchServiceStatus = "degraded"
	// SearchServiceStatusDeleting - The search service is being deleted.
	SearchServiceStatusDeleting SearchServiceStatus = "deleting"
	// SearchServiceStatusDisabled - The search service is disabled and all API requests will be rejected.
	SearchServiceStatusDisabled SearchServiceStatus = "disabled"
	// SearchServiceStatusError - The search service is in error state, indicating either a failure to provision or to be deleted.
	SearchServiceStatusError SearchServiceStatus = "error"
	// SearchServiceStatusProvisioning - The search service is being provisioned or scaled up or down.
	SearchServiceStatusProvisioning SearchServiceStatus = "provisioning"
	// SearchServiceStatusRunning - The search service is running and no provisioning operations are underway.
	SearchServiceStatusRunning SearchServiceStatus = "running"
	// SearchServiceStatusStopped - The search service is in a subscription that's disabled.
	SearchServiceStatusStopped SearchServiceStatus = "stopped"
)

func PossibleSearchServiceStatusValues

func PossibleSearchServiceStatusValues() []SearchServiceStatus

PossibleSearchServiceStatusValues returns the possible values for the SearchServiceStatus const type.

type Service

type Service struct {
	// REQUIRED; The geo-location where the resource lives
	Location *string

	// The identity of the resource.
	Identity *Identity

	// Properties of the search service.
	Properties *ServiceProperties

	// The SKU of the search service, which determines price tier and capacity limits. This property is required when creating
	// a new search service.
	SKU *SKU

	// Resource tags.
	Tags map[string]*string

	// READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

Service - Describes an Azure AI Search service and its current state.

func (Service) MarshalJSON

func (s Service) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type Service.

func (*Service) UnmarshalJSON

func (s *Service) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type Service.

type ServiceListResult

type ServiceListResult struct {
	// READ-ONLY; Request URL that can be used to query next page of search services. Returned when the total number of requested
	// search services exceed maximum page size.
	NextLink *string

	// READ-ONLY; The list of search services.
	Value []*Service
}

ServiceListResult - Response containing a list of Azure AI Search services.

func (ServiceListResult) MarshalJSON

func (s ServiceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceListResult.

func (*ServiceListResult) UnmarshalJSON

func (s *ServiceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceListResult.

type ServiceProperties

type ServiceProperties struct {
	// Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth'
	// is set to true.
	AuthOptions *DataPlaneAuthOptions

	// When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot
	// be set to true if 'dataPlaneAuthOptions' are defined.
	DisableLocalAuth *bool

	// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported
	// value is 'All' to disable all possible data export scenarios with more fine
	// grained controls planned for the future.
	DisabledDataExfiltrationOptions []*SearchDisabledDataExfiltrationOption

	// Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service.
	EncryptionWithCmk *EncryptionWithCmk

	// 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
	// 'default'.
	HostingMode *HostingMode

	// Network specific rules that determine how the Azure AI Search service may be reached.
	NetworkRuleSet *NetworkRuleSet

	// The number of partitions in the search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are
	// only valid for standard SKUs. For 'standard3' services with hostingMode set to
	// 'highDensity', the allowed values are between 1 and 3.
	PartitionCount *int32

	// This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled',
	// traffic over public interface is not allowed, and private endpoint
	// connections would be the exclusive access method.
	PublicNetworkAccess *PublicNetworkAccess

	// The number of replicas in the search service. If specified, it must be a value between 1 and 12 inclusive for standard
	// SKUs or between 1 and 3 inclusive for basic SKU.
	ReplicaCount *int32

	// Sets options that control the availability of semantic search. This configuration is only possible for certain Azure AI
	// Search SKUs in certain locations.
	SemanticSearch *SearchSemanticSearch

	// READ-ONLY; A system generated property representing the service's etag that can be for optimistic concurrency control during
	// updates.
	ETag *string

	// READ-ONLY; The list of private endpoint connections to the Azure AI Search service.
	PrivateEndpointConnections []*PrivateEndpointConnection

	// READ-ONLY; The state of the last provisioning operation performed on the search service. Provisioning is an intermediate
	// state that occurs while service capacity is being established. After capacity is set up,
	// provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended
	// 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
	// because the free service uses capacity that is already set up.
	ProvisioningState *ProvisioningState

	// READ-ONLY; The list of shared private link resources managed by the Azure AI Search service.
	SharedPrivateLinkResources []*SharedPrivateLinkResource

	// READ-ONLY; The status of the search service. Possible values include: 'running': The search service is running and no provisioning
	// operations are underway. 'provisioning': The search service is being provisioned
	// or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This
	// can occur when the underlying search units are not healthy. The search service
	// is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service
	// is disabled. In this state, the service will reject all API requests.
	// 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If
	// your service is in the degraded, disabled, or error states, it means the Azure
	// AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable
	// based on the number of search units provisioned.
	Status *SearchServiceStatus

	// READ-ONLY; The details of the search service status.
	StatusDetails *string
}

ServiceProperties - Properties of the search service.

func (ServiceProperties) MarshalJSON

func (s ServiceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceProperties.

func (*ServiceProperties) UnmarshalJSON

func (s *ServiceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties.

type ServiceUpdate

type ServiceUpdate struct {
	// Details about the search service identity. A null value indicates that the search service has no identity assigned.
	Identity *Identity

	// The geographic location of the resource. This must be one of the supported and registered Azure geo regions (for example,
	// West US, East US, Southeast Asia, and so forth). This property is required
	// when creating a new resource.
	Location *string

	// Properties of the search service.
	Properties *ServiceProperties

	// The SKU of the search service, which determines price tier and capacity limits. This property is required when creating
	// a new search service.
	SKU *SKU

	// 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}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

ServiceUpdate - The parameters used to update an Azure AI Search service.

func (ServiceUpdate) MarshalJSON

func (s ServiceUpdate) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ServiceUpdate.

func (*ServiceUpdate) UnmarshalJSON

func (s *ServiceUpdate) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdate.

type ServicesClient

type ServicesClient struct {
	// contains filtered or unexported fields
}

ServicesClient contains the methods for the Services group. Don't use this type directly, use NewServicesClient() instead.

func NewServicesClient

func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error)

NewServicesClient creates a new instance of ServicesClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*ServicesClient) BeginCreateOrUpdate

func (client *ServicesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, searchServiceName string, service Service, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServicesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). You cannot change the service name after the service is created.
  • service - The definition of the search service to create or update.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method.
Example (SearchCreateOrUpdateService)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateService.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateServiceAuthOptions)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateServiceDisableLocalAuth)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateServiceWithCmkEnforcement)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateServiceWithDataExfiltration)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 		},
	// 	}
}
Output:

Example (SearchCreateOrUpdateServiceWithIdentity)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchCreateOrUpdateWithSemanticSearch)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

func (*ServicesClient) CheckNameAvailability

func (client *ServicesClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientCheckNameAvailabilityOptions) (ServicesClientCheckNameAvailabilityResponse, error)

CheckNameAvailability - Checks whether or not the given search service name is available for use. Search service names must be globally unique since they are part of the service URI (https://.search.windows.net). If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • checkNameAvailabilityInput - The resource name and type to check.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchCheckNameAvailability.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// }
}
Output:

func (*ServicesClient) Delete

func (client *ServicesClient) Delete(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientDeleteOptions) (ServicesClientDeleteResponse, error)

Delete - Deletes a search service in the given resource group, along with its associated resources. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchDeleteService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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)
	}
}
Output:

func (*ServicesClient) Get

func (client *ServicesClient) Get(ctx context.Context, resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientGetOptions) (ServicesClientGetResponse, error)

Get - Gets the search service with the given name in the given resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchGetService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

func (*ServicesClient) NewListByResourceGroupPager

func (client *ServicesClient) NewListByResourceGroupPager(resourceGroupName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientListByResourceGroupOptions) *runtime.Pager[ServicesClientListByResourceGroupResponse]

NewListByResourceGroupPager - Gets a list of all Search services in the given resource group.

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 method.
  • options - ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListServicesByResourceGroup.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ServicesClient) NewListBySubscriptionPager

func (client *ServicesClient) NewListBySubscriptionPager(searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientListBySubscriptionOptions) *runtime.Pager[ServicesClientListBySubscriptionResponse]

NewListBySubscriptionPager - Gets a list of all Search services in the given subscription.

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 method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchListServicesBySubscription.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
		// 			},
		// 	}},
		// }
	}
}
Output:

func (*ServicesClient) Update

func (client *ServicesClient) Update(ctx context.Context, resourceGroupName string, searchServiceName string, service ServiceUpdate, searchManagementRequestOptions *SearchManagementRequestOptions, options *ServicesClientUpdateOptions) (ServicesClientUpdateResponse, error)

Update - Updates an existing search service in the given resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • 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.
  • service - The definition of the search service to update.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.
Example (SearchUpdateService)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateService.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceAuthOptions)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceAuthOptions.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceDisableLocalAuth)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceToAllowAccessFromPrivateEndpoints)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceToAllowAccessFromPublicCustomIPs)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceToRemoveIdentity)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceWithCmkEnforcement)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

Example (SearchUpdateServiceWithDataExfiltration)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 		},
	// 	}
}
Output:

Example (SearchUpdateServiceWithSemanticSearch)

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

type ServicesClientBeginCreateOrUpdateOptions

type ServicesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

ServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServicesClient.BeginCreateOrUpdate method.

type ServicesClientCheckNameAvailabilityOptions

type ServicesClientCheckNameAvailabilityOptions struct {
}

ServicesClientCheckNameAvailabilityOptions contains the optional parameters for the ServicesClient.CheckNameAvailability method.

type ServicesClientCheckNameAvailabilityResponse

type ServicesClientCheckNameAvailabilityResponse struct {
	// Output of check name availability API.
	CheckNameAvailabilityOutput
}

ServicesClientCheckNameAvailabilityResponse contains the response from method ServicesClient.CheckNameAvailability.

type ServicesClientCreateOrUpdateResponse

type ServicesClientCreateOrUpdateResponse struct {
	// Describes an Azure AI Search service and its current state.
	Service
}

ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.BeginCreateOrUpdate.

type ServicesClientDeleteOptions

type ServicesClientDeleteOptions struct {
}

ServicesClientDeleteOptions contains the optional parameters for the ServicesClient.Delete method.

type ServicesClientDeleteResponse

type ServicesClientDeleteResponse struct {
}

ServicesClientDeleteResponse contains the response from method ServicesClient.Delete.

type ServicesClientGetOptions

type ServicesClientGetOptions struct {
}

ServicesClientGetOptions contains the optional parameters for the ServicesClient.Get method.

type ServicesClientGetResponse

type ServicesClientGetResponse struct {
	// Describes an Azure AI Search service and its current state.
	Service
}

ServicesClientGetResponse contains the response from method ServicesClient.Get.

type ServicesClientListByResourceGroupOptions

type ServicesClientListByResourceGroupOptions struct {
}

ServicesClientListByResourceGroupOptions contains the optional parameters for the ServicesClient.NewListByResourceGroupPager method.

type ServicesClientListByResourceGroupResponse

type ServicesClientListByResourceGroupResponse struct {
	// Response containing a list of Azure AI Search services.
	ServiceListResult
}

ServicesClientListByResourceGroupResponse contains the response from method ServicesClient.NewListByResourceGroupPager.

type ServicesClientListBySubscriptionOptions

type ServicesClientListBySubscriptionOptions struct {
}

ServicesClientListBySubscriptionOptions contains the optional parameters for the ServicesClient.NewListBySubscriptionPager method.

type ServicesClientListBySubscriptionResponse

type ServicesClientListBySubscriptionResponse struct {
	// Response containing a list of Azure AI Search services.
	ServiceListResult
}

ServicesClientListBySubscriptionResponse contains the response from method ServicesClient.NewListBySubscriptionPager.

type ServicesClientUpdateOptions

type ServicesClientUpdateOptions struct {
}

ServicesClientUpdateOptions contains the optional parameters for the ServicesClient.Update method.

type ServicesClientUpdateResponse

type ServicesClientUpdateResponse struct {
	// Describes an Azure AI Search service and its current state.
	Service
}

ServicesClientUpdateResponse contains the response from method ServicesClient.Update.

type ShareablePrivateLinkResourceProperties

type ShareablePrivateLinkResourceProperties struct {
	// READ-ONLY; The description of the resource type that has been onboarded to private link service, supported by Azure AI
	// Search.
	Description *string

	// READ-ONLY; The resource provider group id for the resource that has been onboarded to private link service, supported by
	// Azure AI Search.
	GroupID *string

	// READ-ONLY; The resource provider type for the resource that has been onboarded to private link service, supported by Azure
	// AI Search.
	Type *string
}

ShareablePrivateLinkResourceProperties - Describes the properties of a resource type that has been onboarded to private link service, supported by Azure AI Search.

func (ShareablePrivateLinkResourceProperties) MarshalJSON

func (s ShareablePrivateLinkResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ShareablePrivateLinkResourceProperties.

func (*ShareablePrivateLinkResourceProperties) UnmarshalJSON

func (s *ShareablePrivateLinkResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ShareablePrivateLinkResourceProperties.

type ShareablePrivateLinkResourceType

type ShareablePrivateLinkResourceType struct {
	// READ-ONLY; The name of the resource type that has been onboarded to private link service, supported by Azure AI Search.
	Name *string

	// READ-ONLY; Describes the properties of a resource type that has been onboarded to private link service, supported by Azure
	// AI Search.
	Properties *ShareablePrivateLinkResourceProperties
}

ShareablePrivateLinkResourceType - Describes an resource type that has been onboarded to private link service, supported by Azure AI Search.

func (ShareablePrivateLinkResourceType) MarshalJSON

func (s ShareablePrivateLinkResourceType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type ShareablePrivateLinkResourceType.

func (*ShareablePrivateLinkResourceType) UnmarshalJSON

func (s *ShareablePrivateLinkResourceType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type ShareablePrivateLinkResourceType.

type SharedPrivateLinkResource

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}
	ID *string

	// READ-ONLY; The name of the resource
	Name *string

	// READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
	Type *string
}

SharedPrivateLinkResource - Describes a shared private link resource managed by the Azure AI Search service.

func (SharedPrivateLinkResource) MarshalJSON

func (s SharedPrivateLinkResource) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResource.

func (*SharedPrivateLinkResource) UnmarshalJSON

func (s *SharedPrivateLinkResource) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResource.

type SharedPrivateLinkResourceListResult

type SharedPrivateLinkResourceListResult struct {
	// The URL to get the next set of shared private link resources, if there are any.
	NextLink *string

	// READ-ONLY; The list of shared private link resources.
	Value []*SharedPrivateLinkResource
}

SharedPrivateLinkResourceListResult - Response containing a list of shared private link resources.

func (SharedPrivateLinkResourceListResult) MarshalJSON

func (s SharedPrivateLinkResourceListResult) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResourceListResult.

func (*SharedPrivateLinkResourceListResult) UnmarshalJSON

func (s *SharedPrivateLinkResourceListResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResourceListResult.

type SharedPrivateLinkResourceProperties

type SharedPrivateLinkResourceProperties struct {
	// The group ID from the provider of resource the shared private link resource is for.
	GroupID *string

	// The resource ID of the resource the shared private link resource is for.
	PrivateLinkResourceID *string

	// The provisioning state of the shared private link resource. Valid values are Updating, Deleting, Failed, Succeeded or Incomplete.
	ProvisioningState *SharedPrivateLinkResourceProvisioningState

	// The message for requesting approval of the shared private link resource.
	RequestMessage *string

	// Optional. Can be used to specify the Azure Resource Manager location of the resource for which a shared private link is
	// being created. This is only required for those resources whose DNS configuration
	// are regional (such as Azure Kubernetes Service).
	ResourceRegion *string

	// Status of the shared private link resource. Valid values are Pending, Approved, Rejected or Disconnected.
	Status *SharedPrivateLinkResourceStatus
}

SharedPrivateLinkResourceProperties - Describes the properties of an existing shared private link resource managed by the Azure AI Search service.

func (SharedPrivateLinkResourceProperties) MarshalJSON

func (s SharedPrivateLinkResourceProperties) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type SharedPrivateLinkResourceProperties.

func (*SharedPrivateLinkResourceProperties) UnmarshalJSON

func (s *SharedPrivateLinkResourceProperties) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type SharedPrivateLinkResourceProperties.

type SharedPrivateLinkResourceProvisioningState

type SharedPrivateLinkResourceProvisioningState string

SharedPrivateLinkResourceProvisioningState - The provisioning state of the shared private link resource. Valid values are Updating, Deleting, Failed, Succeeded or Incomplete.

const (
	// SharedPrivateLinkResourceProvisioningStateDeleting - The shared private link resource is in the process of being deleted.
	SharedPrivateLinkResourceProvisioningStateDeleting SharedPrivateLinkResourceProvisioningState = "Deleting"
	// SharedPrivateLinkResourceProvisioningStateFailed - The shared private link resource has failed to be provisioned or deleted.
	SharedPrivateLinkResourceProvisioningStateFailed SharedPrivateLinkResourceProvisioningState = "Failed"
	// SharedPrivateLinkResourceProvisioningStateIncomplete - Provisioning request for the shared private link resource has been
	// accepted but the process of creation has not commenced yet.
	SharedPrivateLinkResourceProvisioningStateIncomplete SharedPrivateLinkResourceProvisioningState = "Incomplete"
	// SharedPrivateLinkResourceProvisioningStateSucceeded - The shared private link resource has finished provisioning and is
	// ready for approval.
	SharedPrivateLinkResourceProvisioningStateSucceeded SharedPrivateLinkResourceProvisioningState = "Succeeded"
	// SharedPrivateLinkResourceProvisioningStateUpdating - The shared private link resource is in the process of being created
	// along with other resources for it to be fully functional.
	SharedPrivateLinkResourceProvisioningStateUpdating SharedPrivateLinkResourceProvisioningState = "Updating"
)

func PossibleSharedPrivateLinkResourceProvisioningStateValues

func PossibleSharedPrivateLinkResourceProvisioningStateValues() []SharedPrivateLinkResourceProvisioningState

PossibleSharedPrivateLinkResourceProvisioningStateValues returns the possible values for the SharedPrivateLinkResourceProvisioningState const type.

type SharedPrivateLinkResourceStatus

type SharedPrivateLinkResourceStatus string

SharedPrivateLinkResourceStatus - Status of the shared private link resource. Valid values are Pending, Approved, Rejected or Disconnected.

const (
	// SharedPrivateLinkResourceStatusApproved - The shared private link resource is approved and is ready for use.
	SharedPrivateLinkResourceStatusApproved SharedPrivateLinkResourceStatus = "Approved"
	// SharedPrivateLinkResourceStatusDisconnected - The shared private link resource has been removed from the service.
	SharedPrivateLinkResourceStatusDisconnected SharedPrivateLinkResourceStatus = "Disconnected"
	// SharedPrivateLinkResourceStatusPending - The shared private link resource has been created and is pending approval.
	SharedPrivateLinkResourceStatusPending SharedPrivateLinkResourceStatus = "Pending"
	// SharedPrivateLinkResourceStatusRejected - The shared private link resource has been rejected and cannot be used.
	SharedPrivateLinkResourceStatusRejected SharedPrivateLinkResourceStatus = "Rejected"
)

func PossibleSharedPrivateLinkResourceStatusValues

func PossibleSharedPrivateLinkResourceStatusValues() []SharedPrivateLinkResourceStatus

PossibleSharedPrivateLinkResourceStatusValues returns the possible values for the SharedPrivateLinkResourceStatus const type.

type SharedPrivateLinkResourcesClient

type SharedPrivateLinkResourcesClient struct {
	// contains filtered or unexported fields
}

SharedPrivateLinkResourcesClient contains the methods for the SharedPrivateLinkResources group. Don't use this type directly, use NewSharedPrivateLinkResourcesClient() instead.

func NewSharedPrivateLinkResourcesClient

func NewSharedPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SharedPrivateLinkResourcesClient, error)

NewSharedPrivateLinkResourcesClient creates a new instance of SharedPrivateLinkResourcesClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*SharedPrivateLinkResourcesClient) BeginCreateOrUpdate

func (client *SharedPrivateLinkResourcesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, sharedPrivateLinkResource SharedPrivateLinkResource, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions) (*runtime.Poller[SharedPrivateLinkResourcesClientCreateOrUpdateResponse], error)

BeginCreateOrUpdate - Initiates the creation or update of a shared private link resource managed by the search service in the given resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within the specified resource group.
  • sharedPrivateLinkResource - The definition of the shared private link resource to create or update.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreateOrUpdate method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json

package main

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"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

func (*SharedPrivateLinkResourcesClient) BeginDelete

func (client *SharedPrivateLinkResourcesClient) BeginDelete(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientBeginDeleteOptions) (*runtime.Poller[SharedPrivateLinkResourcesClientDeleteResponse], error)

BeginDelete - Initiates the deletion of the shared private link resource from the search service. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/DeleteSharedPrivateLinkResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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)
	}
}
Output:

func (*SharedPrivateLinkResourcesClient) Get

func (client *SharedPrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, searchServiceName string, sharedPrivateLinkResourceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientGetOptions) (SharedPrivateLinkResourcesClientGetResponse, error)

Get - Gets the details of the shared private link resource managed by the search service in the given resource group. If the operation fails it returns an *azcore.ResponseError type.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • sharedPrivateLinkResourceName - The name of the shared private link resource managed by the Azure AI Search service within the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetSharedPrivateLinkResource.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
	// 	},
	// }
}
Output:

func (*SharedPrivateLinkResourcesClient) NewListByServicePager

func (client *SharedPrivateLinkResourcesClient) NewListByServicePager(resourceGroupName string, searchServiceName string, searchManagementRequestOptions *SearchManagementRequestOptions, options *SharedPrivateLinkResourcesClientListByServiceOptions) *runtime.Pager[SharedPrivateLinkResourcesClientListByServiceResponse]

NewListByServicePager - Gets a list of all shared private link resources managed by the given service.

Generated from API version 2024-06-01-preview

  • resourceGroupName - The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • searchServiceName - The name of the Azure AI Search service associated with the specified resource group.
  • SearchManagementRequestOptions - SearchManagementRequestOptions contains a group of parameters for the AdminKeysClient.Get method.
  • options - SharedPrivateLinkResourcesClientListByServiceOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.NewListByServicePager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/ListSharedPrivateLinkResourcesByService.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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),
		// 			},
		// 	}},
		// }
	}
}
Output:

type SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions

type SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SharedPrivateLinkResourcesClientBeginCreateOrUpdateOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginCreateOrUpdate method.

type SharedPrivateLinkResourcesClientBeginDeleteOptions

type SharedPrivateLinkResourcesClientBeginDeleteOptions struct {
	// Resumes the LRO from the provided token.
	ResumeToken string
}

SharedPrivateLinkResourcesClientBeginDeleteOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.BeginDelete method.

type SharedPrivateLinkResourcesClientCreateOrUpdateResponse

type SharedPrivateLinkResourcesClientCreateOrUpdateResponse struct {
	// Describes a shared private link resource managed by the Azure AI Search service.
	SharedPrivateLinkResource
}

SharedPrivateLinkResourcesClientCreateOrUpdateResponse contains the response from method SharedPrivateLinkResourcesClient.BeginCreateOrUpdate.

type SharedPrivateLinkResourcesClientDeleteResponse

type SharedPrivateLinkResourcesClientDeleteResponse struct {
}

SharedPrivateLinkResourcesClientDeleteResponse contains the response from method SharedPrivateLinkResourcesClient.BeginDelete.

type SharedPrivateLinkResourcesClientGetOptions

type SharedPrivateLinkResourcesClientGetOptions struct {
}

SharedPrivateLinkResourcesClientGetOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.Get method.

type SharedPrivateLinkResourcesClientGetResponse

type SharedPrivateLinkResourcesClientGetResponse struct {
	// Describes a shared private link resource managed by the Azure AI Search service.
	SharedPrivateLinkResource
}

SharedPrivateLinkResourcesClientGetResponse contains the response from method SharedPrivateLinkResourcesClient.Get.

type SharedPrivateLinkResourcesClientListByServiceOptions

type SharedPrivateLinkResourcesClientListByServiceOptions struct {
}

SharedPrivateLinkResourcesClientListByServiceOptions contains the optional parameters for the SharedPrivateLinkResourcesClient.NewListByServicePager method.

type SharedPrivateLinkResourcesClientListByServiceResponse

type SharedPrivateLinkResourcesClientListByServiceResponse struct {
	// Response containing a list of shared private link resources.
	SharedPrivateLinkResourceListResult
}

SharedPrivateLinkResourcesClientListByServiceResponse contains the response from method SharedPrivateLinkResourcesClient.NewListByServicePager.

type UnavailableNameReason

type UnavailableNameReason string

UnavailableNameReason - The reason why the name is not available. 'Invalid' indicates the name provided does not match the naming requirements (incorrect length, unsupported characters, etc.). 'AlreadyExists' indicates that the name is already in use and is therefore unavailable.

const (
	// UnavailableNameReasonAlreadyExists - The search service name is already assigned to a different search service.
	UnavailableNameReasonAlreadyExists UnavailableNameReason = "AlreadyExists"
	// UnavailableNameReasonInvalid - The search service name doesn't match naming requirements.
	UnavailableNameReasonInvalid UnavailableNameReason = "Invalid"
)

func PossibleUnavailableNameReasonValues

func PossibleUnavailableNameReasonValues() []UnavailableNameReason

PossibleUnavailableNameReasonValues returns the possible values for the UnavailableNameReason const type.

type UsagesClient

type UsagesClient struct {
	// contains filtered or unexported fields
}

UsagesClient contains the methods for the Usages group. Don't use this type directly, use NewUsagesClient() instead.

func NewUsagesClient

func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error)

NewUsagesClient creates a new instance of UsagesClient with the specified values.

  • subscriptionID - The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal.
  • credential - used to authorize requests. Usually a credential from azidentity.
  • options - pass nil to accept the default values.

func (*UsagesClient) NewListBySubscriptionPager

func (client *UsagesClient) NewListBySubscriptionPager(location string, searchManagementRequestOptions *SearchManagementRequestOptions, options *UsagesClientListBySubscriptionOptions) *runtime.Pager[UsagesClientListBySubscriptionResponse]

NewListBySubscriptionPager - Get a list of all Azure AI Search quota usages across the subscription.

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.
  • options - UsagesClientListBySubscriptionOptions contains the optional parameters for the UsagesClient.NewListBySubscriptionPager method.
Example

Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/f6f50c6388fd5836fa142384641b8353a99874ef/specification/search/resource-manager/Microsoft.Search/preview/2024-06-01-preview/examples/GetQuotaUsagesList.json

package main

import (
	"context"
	"log"

	"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
	"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/search/armsearch"
)

func main() {
	cred, err := azidentity.NewDefaultAzureCredential(nil)
	if err != nil {
		log.Fatalf("failed to obtain a credential: %v", err)
	}
	ctx := context.Background()
	clientFactory, err := armsearch.NewClientFactory("<subscription-id>", 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"),
		// 	}},
		// }
	}
}
Output:

type UsagesClientListBySubscriptionOptions

type UsagesClientListBySubscriptionOptions struct {
}

UsagesClientListBySubscriptionOptions contains the optional parameters for the UsagesClient.NewListBySubscriptionPager method.

type UsagesClientListBySubscriptionResponse

type UsagesClientListBySubscriptionResponse struct {
	// Response containing the quota usage information for all the supported SKUs of Azure AI Search.
	QuotaUsagesListResult
}

UsagesClientListBySubscriptionResponse contains the response from method UsagesClient.NewListBySubscriptionPager.

type UserAssignedManagedIdentity

type UserAssignedManagedIdentity struct {
	// READ-ONLY; The client ID of user assigned identity.
	ClientID *string

	// READ-ONLY; The principal ID of user assigned identity.
	PrincipalID *string
}

UserAssignedManagedIdentity - The details of the user assigned managed identity assigned to the search service.

func (UserAssignedManagedIdentity) MarshalJSON

func (u UserAssignedManagedIdentity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface for type UserAssignedManagedIdentity.

func (*UserAssignedManagedIdentity) UnmarshalJSON

func (u *UserAssignedManagedIdentity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaller interface for type UserAssignedManagedIdentity.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL